Support configuration using environment variables - #107
Conversation
c19293d to
c6ccebf
Compare
| sitename="${SITENAME:-$sitename}" | ||
| slackchannel="${SLACK_CHANNEL:-$slackchannel}" | ||
| slackuri="${SLACK_URI:-$slackuri}" | ||
| discorduri="${DISCORD_URI:-$discorduri}" |
There was a problem hiding this comment.
I usually expect command-line arguments or configuration provided directly by the user to win over environment variables. Is this precedence intentional?
There was a problem hiding this comment.
Thanks for the review. Yes, this is intentional.
The main goal of this change is to allow using the script without modifying it, especially for automated environments where configuration is provided externally.
For this reason, environment variables currently take precedence over the values defined in the script. The script values act as defaults and preserve the existing behavior for users who still configure the script directly.
That said, I'm open to changing the precedence if you prefer explicitly configured script values to have higher priority.
There was a problem hiding this comment.
That would be my preference. Also I recognize I'm not the owner of this repository just a user. So I will defer to their judgement.
Summary
This PR adds support for configuring DDNS updater script using environment variables while preserving the existing configuration workflow.
Changes
Backwards compatibility
Existing users are unaffected and can continue configuring the scripts by editing the configuration section.
Environment variables provide an additional configuration method for automated environments.