Skip to content

Commit

Permalink
Add allowlist at container runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewKostka committed Oct 15, 2024
1 parent dce9c97 commit b5f1938
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1,239 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,4 @@ LABEL org.opencontainers.image.source="https://github.com/wbstack/queryservice"
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

# TODO this should probably just be added at runtime as configuration....
COPY ./allowlist.txt /wdqs/allowlist.txt

CMD /wdqs/runBlazegraph.sh
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# queryservice
# Query Service
> ℹ️ Issues for this repository are tracked on [Phabricator](https://phabricator.wikimedia.org/project/board/5563/) - ([Click here to open a new one](https://phabricator.wikimedia.org/maniphest/task/edit/form/1/?tags=wikibase_cloud
))

## Allowlist
The allowlist determines to which queryservices federated queries can be made.
This list should contain at least the services that are allowed on the wikidata
queryservice and any Wikibase Cloud hosted Wikibases

To update the list to include new Wikibase Cloud wikis one can run the following:
```lang=bash
kubectl exec -it deployment/api-app-backend -- php artisan tinker --execute '\App\Wiki::all()->pluck("domain")->each(function ($i, $k) { echo "https://".$i."/query/sparql".PHP_EOL; })' > allowlist.txt
cat allowlist-static.txt >> allowlist.txt
The allowlist determines which query services can be used for federated queries. This list is provided at runtime by mounting a newline-delimited text file of endpoints to `/wdqs/allowlist.txt`. It should include all instances hosted by Wikibase Cloud.

Example for `allowlist.txt`:
```
https://query.wikidata.org/bigdata/namespace/dcatap/sparql
https://query.wikidata.org/bigdata/namespace/wdq/sparql
https://query.wikidata.org/sparql
```
91 changes: 0 additions & 91 deletions allowlist-static.txt

This file was deleted.

Loading

0 comments on commit b5f1938

Please sign in to comment.