Skip to content

Make the path of the configuration file configurable - #49

Merged
satishweb merged 1 commit into
masterfrom
feature/doh-config-file
Oct 21, 2026
Merged

satishweb merged 1 commit into
masterfrom
feature/doh-config-file

Conversation

@satishweb

Copy link
Copy Markdown
Owner

The path of the configuration file was hardcoded, so a custom configuration had to be mounted on /server/doh-server.conf, which is the path the generated configuration uses as well.

The path can now be set with the DOH_CONFIG_FILE environment variable. A custom configuration can live in a directory of its own and is not replaced by the generated one:

docker run -itd --name doh-server \
    -p 8053:8053 \
    -v ./doh-server.conf:/server-custom/doh-server.conf:ro \
    -e DOH_CONFIG_FILE=/server-custom/doh-server.conf \
    satishweb/doh-server

The file is generated from the bundled template when it does not exist, so the variable works without a custom configuration as well. The argument of the server is adjusted to the path, an argument that was given on the command line always wins.

The path of the configuration file was hardcoded, so a custom
configuration had to be mounted on /server/doh-server.conf, which is the
path the generated configuration uses as well.

The path can now be set with the DOH_CONFIG_FILE environment variable. A
custom configuration can live in a directory of its own and is not replaced
by the generated one:

    -v ./doh-server.conf:/server-custom/doh-server.conf:ro
    -e DOH_CONFIG_FILE=/server-custom/doh-server.conf

The file is generated from the bundled template when it does not exist, so
the variable works without a custom configuration as well. The argument of
the server is adjusted to the path, an argument that was given on the
command line always wins.
@satishweb
satishweb merged commit 3f90467 into master Oct 21, 2026
4 checks passed
@satishweb
satishweb deleted the feature/doh-config-file branch October 21, 2026 04:17
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.

1 participant