Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add allowlist at container runtime #149

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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