Skip to content
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

Default DNS Upstream #1608

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ services:
# Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
TZ: 'Europe/London'
# Set a password to access the web interface. Not setting one will result in a random password being assigned
FTLCONF_webserver_api_password: 'correct horse battery staple'
# Configure DNS upstream servers, e.g:
FTLCONF_dns_upstreams: '8.8.8.8;8.8.4.4'
FTLCONF_webserver_api_password: 'correct horse battery staple'
# Volumes store your data between container upgrades
volumes:
# For persisting Pi-hole's databases and common configuration file
Expand Down
4 changes: 1 addition & 3 deletions examples/docker-compose-caddy-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@ services:
# Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
TZ: 'Europe/London'
# Set a password to access the web interface. Not setting one will result in a random password being assigned
FTLCONF_webserver_api_password: 'correct horse battery staple'
# Configure DNS upstream servers, e.g:
FTLCONF_dns_upstreams: '8.8.8.8;8.8.4.4'
FTLCONF_webserver_api_password: 'correct horse battery staple'
# Volumes store your data between container upgrades
volumes:
# For persisting Pi-hole's databases and common configuration file
Expand Down
11 changes: 4 additions & 7 deletions src/bash_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,10 @@ ensure_basic_configuration() {
chown pihole:pihole /macvendor.db
fi

# If getFTLConfigValue "dns.upstreams" returns [], exit the container. We need upstream servers to function!
if [[ $(getFTLConfigValue "dns.upstreams") == "[]" ]]; then
echo ""
echo " [X] No DNS upstream servers are set!"
echo " [i] Recommended: Set the upstream DNS servers in the environment variable FTLCONF_dns_upstreams"
echo ""
exit 1
# If getFTLConfigValue "dns.upstreams" returns [], default to Google's DNS server
if [[ $(getFTLConfigValue "dns.upstreams") == "[]" ]]; then
echo " [i] No DNS upstream set in environment or config file, defaulting to Google DNS"
setFTLConfigValue "dns.upstreams" "[\"8.8.8.8\", \"8.8.4.4\"]"
fi

setup_web_password
Expand Down
4 changes: 2 additions & 2 deletions test/tests/test_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def test_pihole_gid_env_var(docker):


# Wait 5 seconds for startup, then kill the start.sh script
# Finally, tail the FTL log to see if it has been shut down cleanly
# Finally, grep the FTL log to see if it has been shut down cleanly
def test_pihole_ftl_clean_shutdown(docker):
func = docker.run(
"""
sleep 5
killall --signal 15 start.sh
sleep 5
tail -f /var/log/pihole-FTL.log
grep 'jmpret\|terminated' /var/log/pihole/FTL.log
yubiuser marked this conversation as resolved.
Show resolved Hide resolved
"""
)
assert "INFO: Shutting down... // exit code 0 // jmpret 0" in func.stdout
Expand Down