zhaofengli / attic

Multi-tenant Nix Binary Cache
https://docs.attic.rs
Other
1.04k stars 79 forks source link

Allow setting config file path by environment variable #87

Open Alxandr opened 1 year ago

Alxandr commented 1 year ago

As far as I can see, given a configuration file in a custom location, I can either specify it on the command line, or make sure it's not in a custom location. This is a bit annoying when trying to run attic in a container where the config comes from a k8s configmap, so it would be good if the path could be specified as an environment variable.

cole-h commented 1 year ago

Your other option is to specify the entire config itself (base64'd) as an environment variable:

https://github.com/zhaofengli/attic/blob/e9918bc6be268da6fa97af6ced15193d8a0421c0/server/src/config.rs#L27

If you set ATTIC_SERVER_CONFIG_BASE64="$(cat your-config.toml | base64 -w0)", that should work.

srd424 commented 6 months ago

This would be nice for running atticadm separately from atticd to create tokens etc - I've got atticd running in docker, and a separate admin environment on my main machine.