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

Feature request: Allow API keys to be set using environment variables #504

Open
MillironX opened this issue Mar 9, 2023 · 1 comment
Open

Comments

@MillironX
Copy link

It would be great to be able to use environment variables for the Youtube and Vimeo API keys. This would allow users (including myself) to commit the config.toml file into version control without exposing any secrets.

Proposition

API keys for Youtube and Vimeo can be set using either the [tokens] table in config.toml or can be set using the environment variables PODSYNC_TOKENS_YOUTUBE and PODSYNC_TOKENS_VIMEO. Multiple tokens are separated by commas in the environment variables. This means that running

docker run \
    -p 8080:8080 \
    -e PODSYNC_TOKENS_YOUTUBE=abc123 \
    -e PODSYNC_TOKENS_VIMEO=def456,ghi789 \
    -v $(pwd)/data:/app/data/ \
    -v $(pwd)/config.toml:/app/config.toml \
    mxpv/podsync:latest

would be equivalent to having

[tokens]
youtube = "abc123"
vimeo = [
    "def456",
    "ghi789"
]

in config.toml.

In the case of both environment variables being set and tokens present in config.toml, the environment variable tokens would override any tokens present in config.toml.

@PylotLight
Copy link

My current workaround for this is just replacing the value in github action with sed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants