From 32a3c0c43f8d93d350a7a012867978e436f63a56 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Tue, 2 Mar 2021 17:00:06 -0500 Subject: [PATCH] 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 --- .../reversepassproxy.registry-generic.conf | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf index e41bdcf7e6..c0a456c7ef 100644 --- a/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf +++ b/roles/httpd/reverseproxy/templates/reversepassproxy.registry-generic.conf @@ -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 %} Options +FollowSymLinks @@ -106,3 +143,14 @@ Alias "/app-icons/" "/srv/web/registry-index/icons/" Options +Indexes Require all granted + +{% if env == "staging" %} + + ExpiresActive on + ExpiresDefault "access plus 1 year" + + AllowOverride None + Options +Indexes + Require all granted + +{% endif %}