reversepassproxy.registry-generic.conf: Set up for flatpak-indexer for staging

Add changes required for flatpak-indexer, conditionalized for staging:

 * Reverse which of "index with labels" or "index with annotations" is the
   default (make labels the default, since annotations are only used by
   old versions of Flatpak)
 * Add the deltas/ directory which holds deltas between Flatpak versions.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
This commit is contained in:
Owen W. Taylor 2021-03-02 17:00:06 -05:00 committed by kevin
parent df15370222
commit 32a3c0c43f

View file

@ -32,6 +32,7 @@ RewriteRule ^/v2/(.*)$ http://oci-registry01:5000/v2/$1 [P,L]
{% endif %}
RewriteRule ^/v2/(.*)$ http://localhost:10048/v2/$1 [P,L]
{% if env == "production" %}
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &tag=testing
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
@ -63,6 +64,39 @@ RewriteRule "^/index/static$" /index/flatpak.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteRule "^/index/static$" /index/flatpak-labels.json [L,PT]
{% elif env == "staging" %}
RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &tag=testing
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
RewriteRule "^/index/static$" /index/flatpak-testing-%1.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &tag=testing
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
RewriteRule "^/index/static$" /index/flatpak-testing-%1-annotations.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
RewriteRule "^/index/static$" /index/flatpak-%1.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
RewriteRule "^/index/static$" /index/flatpak-%1-annotations.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &tag=testing
RewriteRule "^/index/static$" /index/flatpak-testing.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &tag=testing
RewriteRule "^/index/static$" /index/flatpak-testing-annotations.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteRule "^/index/static$" /index/flatpak.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteRule "^/index/static$" /index/flatpak-annotations.json [L,PT]
{% endif %}
DocumentRoot /srv/web/registry-index/
@ -87,6 +121,9 @@ SSLOptions +FakeBasicAuth
Alias "/index/" "/srv/web/registry-index/index/"
Alias "/app-icons/" "/srv/web/registry-index/icons/"
{% if env == "staging" %}
Alias "/deltas/" "/srv/web/registry-index/deltas/"
{% endif %}
<Directory “/srv/web/registry-index/index/">
Options +FollowSymLinks
@ -106,3 +143,14 @@ Alias "/app-icons/" "/srv/web/registry-index/icons/"
Options +Indexes
Require all granted
</Directory>
{% if env == "staging" %}
<Directory "/srv/web/registry-index/deltas/">
ExpiresActive on
ExpiresDefault "access plus 1 year"
AllowOverride None
Options +Indexes
Require all granted
</Directory>
{% endif %}