-
-
Notifications
You must be signed in to change notification settings - Fork 299
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
feat: add environment variable for API key #831
Conversation
For what use cases do you need this? |
The main advantage of this setup is for people who use tools like: https://github.com/buildarr/buildarr-jellyseerr. Buildarr is a configuration management tool for the Jellyseerr and the -arr stack, and it can completely initialize Jellyseerr automatically, if provided with the API key. This makes it possible to generate that key externally, and then provide it to both Jellyseerr and a configuration management tool like Buildarr. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please rebase your PR on develop and add information about this setting in the documentation?
I removed the change to the translation, pulled the latest changes from develop, and added documentation about the API key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you've done won't work if the API_KEY environment variable is changed after the 1st restart of Jellyseerr, unless you click on "regenerate" after setting it.
It seems odd to have to regenerate a key you've just defined manually, so you should add a check each time you start Jellyseerr to check whether there's an API_KEY environment variable, and if so change the main settings with this key.
Alright, I went ahead and added a check when the settings load, if the environment variable is set it will read that and use that at startup. I made sure to pull in the latest changes on develop. Documentation is still updated as well. Anything else I should adjust or any changes to be made? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🎉 This PR is included in version 2.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
* Added the ability to set the API key with the env var API_KEY * Adding debug statements * Updating * feat: adding env var for API key * feat: update * fix(settings/index.ts): remove a print statement that logs the API key to the console * Update en.json * docs: added documentation about API_KEY environment variable * feat: add a check to ensure API key always uses env var if provided * feat: always check the API_KEY env var at startup * chore: add back the gitkeeps under ./config, accidentally deleted in prev commit * chore: revert change made to docker-compose that was accidentally committed
* Added the ability to set the API key with the env var API_KEY * Adding debug statements * Updating * feat: adding env var for API key * feat: update * fix(settings/index.ts): remove a print statement that logs the API key to the console * Update en.json * docs: added documentation about API_KEY environment variable * feat: add a check to ensure API key always uses env var if provided * feat: always check the API_KEY env var at startup * chore: add back the gitkeeps under ./config, accidentally deleted in prev commit * chore: revert change made to docker-compose that was accidentally committed
Description
Adds an environment variable, API_KEY, that can be used to set the API key. If the environment variable is not set, the previous method is used.
Screenshot (if UI-related)
To-Dos
yarn build
yarn i18n:extract
Issues Fixed or Closed
This doesn't fix any filed issues, the need for this came up from my own projects.