regindexer: create two sets of indexes

Flatpak-1.6 expects metadata to be stored in Docker-compatible labels
rather than OCI annotations. We build Flatpaks for Fedora with both
labels and annotations for compatibility with older and newer Flatpaks,
but we also need to have two sets of indexes:

 - One that is served in response to a query for labels, and skips
   including Flatpak annotations in the response (to reduce size)
 - One that is served in response to a query for annotation, and skips
   including Flatpak labels in the response.

This commit requires regindexer-1.6. See:

 https://pagure.io/fedora-infrastructure/issue/8579

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
This commit is contained in:
Owen W. Taylor 2020-01-22 15:44:17 -05:00 committed by Pierre-Yves Chibon
parent 080f5206bf
commit 08a3454a43
2 changed files with 54 additions and 0 deletions

View file

@ -25,17 +25,33 @@ RewriteCond "&%{QUERY_STRING}" &tag=testing
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
RewriteRule "^/index/static$" /index/flatpak-testing-%1.json [L,PT]
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-labels.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
RewriteRule "^/index/static$" /index/flatpak-%1.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &label(%3A|:)org.flatpak.ref(%3A|:)exists=1
RewriteCond "&%{QUERY_STRING}" &architecture=([^&]+)
RewriteRule "^/index/static$" /index/flatpak-%1-labels.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.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-labels.json [L,PT]
RewriteCond "&%{QUERY_STRING}" &annotation(%3A|:)org.flatpak.ref(%3A|:)exists=1
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]
DocumentRoot /srv/web/registry-index/
<Directory /srv/web/registry-index>

View file

@ -7,6 +7,15 @@ indexes:
registry_public: /
tags: ['latest']
required_annotations: ['org.flatpak.ref']
skip_flatpak_labels: True
extract_icons: True
flatpak_labels:
output: /var/lib/regindexer/index/flatpak-labels.json
registry: https://registry{{ env_suffix }}.fedoraproject.org
registry_public: /
tags: ['latest']
required_labels: ['org.flatpak.ref']
skip_flatpak_annotations: True
extract_icons: True
flatpak_testing:
output: /var/lib/regindexer/index/flatpak-testing.json
@ -14,6 +23,15 @@ indexes:
registry_public: /
tags: ['testing']
required_annotations: ['org.flatpak.ref']
skip_flatpak_labels: True
extract_icons: True
flatpak_testing_labels:
output: /var/lib/regindexer/index/flatpak-testing-labels.json
registry: https://registry{{ env_suffix }}.fedoraproject.org
registry_public: /
tags: ['testing']
required_labels: ['org.flatpak.ref']
skip_flatpak_annotations: True
extract_icons: True
flatpak_amd64:
output: /var/lib/regindexer/index/flatpak-amd64.json
@ -22,6 +40,16 @@ indexes:
tags: ['latest']
required_annotations: ['org.flatpak.ref']
architectures: ['amd64']
skip_flatpak_labels: True
extract_icons: True
flatpak_amd64_labels:
output: /var/lib/regindexer/index/flatpak-amd64-labels.json
registry: https://registry{{ env_suffix }}.fedoraproject.org
registry_public: /
tags: ['latest']
required_labels: ['org.flatpak.ref']
architectures: ['amd64']
skip_flatpak_annotations: True
extract_icons: True
flatpak_testing_amd64:
output: /var/lib/regindexer/index/flatpak-testing-amd64.json
@ -30,6 +58,16 @@ indexes:
tags: ['testing']
required_annotations: ['org.flatpak.ref']
architectures: ['amd64']
skip_flatpak_labels: True
extract_icons: True
flatpak_testing_amd64_labels:
output: /var/lib/regindexer/index/flatpak-testing-amd64-labels.json
registry: https://registry{{ env_suffix }}.fedoraproject.org
registry_public: /
tags: ['testing']
required_labels: ['org.flatpak.ref']
architectures: ['amd64']
skip_flatpak_annotations: True
extract_icons: True
daemon:
topic_prefix: org.fedoraproject