-
Notifications
You must be signed in to change notification settings - Fork 69
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 setting Redis authpassword via docker env variables #306
Comments
Thanks for the request. Regards, |
Feature is now available in v8.0.0-beta.1. example:
Would be nice if someone cloud test this and give some feedback. Regards, |
@systemofapwne Any feedback until I move this to a stable state? Regards, |
Give me some time up to the weekend. I am currently busy with many side-projects but I intend to add an additional dockerized secondary ioBroker system this weekend. |
I just successfully tested the changes. Setting a password via ENVs works for states and objects. Thank you so much! |
Some more feedback: Using
Same is true for objectsdb. This is a rare situation TBH but could lead to strange situations, where unsetting a pasword is required. Here is a nice suggestion on how to implement an "is set/is unset" check to also respect the empty string: https://stackoverflow.com/a/13864829 |
I also had this in mind, but as the database connection stays "untouched" when you do not configure its environment variables I would prefer to do this to the authentication as well. If no env is set, nothing will be touched. If I would delete the password this might break it the same way but in other rare situations. The only way I can imagine is to check on an specific value like "none" as trigger to delete the password. Regards, |
In new beta release it is now possible to empty the password with value "none". If ENV is not set, the value will stay untouched. Please test. Regards, |
Description
It would be nice to be able to set an auth-password for redis backends via an env-variable in docker.
Right now, iobroker supports authentication against redis out of the box:
Adding a knob to set a password for both, states and objects, via an env-var set in a docker-compose config would be nice.
E.g.
IOB_OBJECTSDB_AUTH="somepassword"
IOB_STATESDB_AUTH="somepassword"
If these env-vars are not set, the iobroker.json file should not be touched/modified. This will not interfere with setups, where the password already has been set manually.
If these env-vars are set, the file should be modified. (even when it is the empty string "")
The reason why I ask for this is, that I already set a password in there manually. But a recent upgrade of this docker container and/or the js-controller however reset that config such, that "auth_pass" was empty. Therefore, my container stopped working with a generic "There was a problem detecting the admin instance of your iobroker"-error, while actually the redis connection could not be established due to incorrect credentials. This took me an hour to figure out.
Enforcing a password via an env-var via docker(-compose) would do the trick and is way more cleaner IMHO. That should be rather easy to implement, since your iorboker_startup.sh script already does some "jq"-magic on that config file.
The text was updated successfully, but these errors were encountered: