Skip to content

Support configuration using environment variables - #107

Open
htomer wants to merge 3 commits into
K0p1-Git:mainfrom
htomer:feature/env-config-support
Open

Support configuration using environment variables#107
htomer wants to merge 3 commits into
K0p1-Git:mainfrom
htomer:feature/env-config-support

Conversation

@htomer

@htomer htomer commented Jul 18, 2026

Copy link
Copy Markdown

Summary

This PR adds support for configuring DDNS updater script using environment variables while preserving the existing configuration workflow.

Changes

  • Add environment variable overrides for configuration values.
  • Keep existing in-script configuration fully functional.
  • Add validation for required configuration values.
  • Document the supported environment variables in the README.

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.

@htomer
htomer force-pushed the feature/env-config-support branch from c19293d to c6ccebf Compare July 18, 2026 11:57
Comment thread cloudflare-template.sh
sitename="${SITENAME:-$sitename}"
slackchannel="${SLACK_CHANNEL:-$slackchannel}"
slackuri="${SLACK_URI:-$slackuri}"
discorduri="${DISCORD_URI:-$discorduri}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually expect command-line arguments or configuration provided directly by the user to win over environment variables. Is this precedence intentional?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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

Successfully merging this pull request may close these issues.

2 participants