# To get adguard to work, follow these steps:

# 1. Ensure port 853 is open on your firewall. (Oracle users: add an ingress rule for port 853 on your security list)
# 2. You should be able to now start this container and complete the setup
# 3. After setting it up, change the value of ADGUARD_PORT below to 80
ADGUARD_PORT=3000
# 4. You now need to edit the configuration file to enable TLS. First, set the permissions to allow writing:
#    sudo chown ${PGID}:${PUID} /opt/docker/apps/adguard/config/AdGuardHome.yaml
# 5. Open the file and make the following changes:
#    - Set `tls.enabled` to true
#    - Set `tls.server_name` to your domain name - adguard.${DOMAIN} (e.g. adguard.example.com)
#    - Set `tls.allow_unencrypted_doh` to true
#    - Add 172.16.0.0/12 to the `dns.trusted_proxies` list
#    Save the file.
# 6. Now, recreate the container with `docker compose up -d adguard` (in /opt/docker)

# Limitations:

# Plain DNS (port 53) is not enabled by default. It is recommended that you use DNS over TLS (DoT) or DNS over HTTPS (DoH) instead.
# If you want to enable plain DNS, uncomment the ports section in the compose file and ensure that port 53 is open on your firewall.
# Depending on your system, you may also need to stop/remove any existing DNS services on the host such as systemd-resolved.
# Remember that this means all services on the host also use Adguard and if it goes down/is not running, DNS resolution will fail for all apps. 
#
# Since all DNS requests are routed through Traefik, all client IPs will appear as the IP of the Traefik container, rather than the actual client IPs.
# You may try resolving this using `dns.trusted_proxies` in the AdGuard configuration file.