Add possibility to use environment variables#6
Add possibility to use environment variables#6junpet wants to merge 1 commit intomrchainman:masterfrom
Conversation
You can use environment variables instead of storing passwords in config.py as plaintext. Note that settings.py is still needed, because this file reads the environment variables. Changes in settings.py: - Only the domain has to be specified for the URLs. Previously you used 'https://example.com/ocs/v2.php/apps/notifications/api/v2/notifications' now you only specify 'https://example.com'. This is valid for both Nextcloud and Gotify URL as well. Some minimal adjustments in push_msg.py: - Remove unused json import - Use single quote globally - Remove unnecessary whitespace character - Break some long lines
|
Hi @junpet EDIT: |
|
Hi @mrchainman! Sorry for late answer. I used VSCode on Windows with Python 3 dev container. It looks like this container uses export NEXTCLOUD_URL="https://cloud.mydomain.com"I think you can use special characters in the password. IIRC you need to escape BTW, I've created a |
|
@junpet alright, i will retest it and report back. |
|
@junpet Sorry, still didn't geht around testing, have a lot going on right now... Would you be interested in maintaining this project? |
|
@mrchainman Unfortunately I have not much time either, so it wouldn't be much difference if I would maintain this project. Just keep it. Don't worry about merging this. You'll do it if you have time. :) Have a nice day. :) |
You can use environment variables instead of storing passwords in
config.py as plaintext. Note that settings.py is still needed, because
this file reads the environment variables.
Changes in settings.py:
'https://example.com/ocs/v2.php/apps/notifications/api/v2/notifications'
now you only specify 'https://example.com'. This is valid for both
Nextcloud and Gotify URL as well.
Some minimal adjustments in push_msg.py: