This service serves files, retrievable via their share:// URI.
Add the service to your docker-compose.yml
services:
fileshare:
image: redpencil/file-share-sync:0.1.0
volumes:
- ./data/files:/shareBy default the service only grants access to files as configured in mu-authorization. I.e. if the user has access to the share-URI in the triplestore, he can download the file.
To enable access for 'super consumers', enable the following environment variable on the service:
services:
fileshare:
image: redpencil/file-share-sync:0.1.0
environment:
ALLOW_MU_AUTH_SUDO: "true"
ALLOW_SUPER_CONSUMER: "true"
volumes:
- ./data/files:/shareIf the mu-session-id (session URI) of the request is linked to the http://services.lblod.info/diff-consumer/account account in the http://mu.semte.ch/graphs/diff-producer/login graph, the requester will be granted access to the files.
The allowed accounts can be configured via the ALLOWED_ACCOUNTS environment variable.
See the login endpoints of for example lblod/delta-producer-publication-graph-maintainer or kanselarij-vlaanderen/delta-producer-json-diff-file-publisher to link an account to the mu-session-id.
The following environment variables can be configured on the service:
ALLOW_SUPER_CONSUMER: flag to enable file access for superconsumers. Otherwise file access will only be granted as configured in mu-authorization (default:false). Superconsumers have their session linked to one of theALLOWED_ACCOUNTS.ALLOWED_ACCOUNTS: Comma-separated list of allowed accounts to be considered superconsumer. Only relevant ifALLOW_SUPER_CONSUMERis enabled. E.g.http://foo,http://bar(default:http://services.lblod.info/diff-consumer/account)SHARE_FOLDER: path to the folder with the files to serve (default:/share/)
Download the content of the file.
Query paramaters
uri(required): share URI of the file (e.g./download?uri=share://foo.pdf)name(optional): name for the downloaded file (e.g./download?name=report.pdf)
Response
Returns 200 OK on success.
Returns 400 Bad Request if uri query param is missing or requester doesn't have access to the file.
Returns 404 Not Found if file with the given URI cannot be found on disk.