Skip to content

Add AdGuard Home install script - #91

Open
Sportarr wants to merge 1 commit into
eshtek:stagingfrom
Sportarr:add-adguard-home
Open

Sportarr wants to merge 1 commit into
eshtek:stagingfrom
Sportarr:add-adguard-home

Conversation

@Sportarr

Copy link
Copy Markdown
Contributor

What it does

AdGuard Home blocks ads and trackers for the whole network by answering its DNS. This script wraps the TrueNAS community app adguard-home.

How it installs

There are no install questions. A v6 hook named "Set up AdGuard Home" runs after install and asks for an admin username and password. It then completes AdGuard's first-run setup through /control/install/configure:

  • The web interface stays on 0.0.0.0:30004, the address the template passes with --web-addr. Left alone, the wizard suggests port 80, which the TrueNAS web interface holds, and then needs the restart that the TrueNAS app notes mention. The hook avoids both.
  • DNS binds to the server's LAN address (ctx.host) on port 53. Other addresses on port 53 belong to the TrueNAS virtualization service (incusbr0) and to your remote access (hexos0), and app.ip_choices offers only 0.0.0.0 and ::. For the same reason the app uses the host network and does not publish dns_port.
  • Running the hook again from the card skips setup when it is already done. After a restart the setup endpoint returns 404, and the hook treats that as done too.

Config and work are on ApplicationsPerformance at adguard-home/config and adguard-home/work, snapshotted before updates. The container runs as root. Limits are 2 CPUs and 1024 MB.

Testing

  • bun _lib/validate.ts passes with 0 errors and 0 warnings. The hook passes tsc --noEmit in strict mode against _lib/hook_context.ts.
  • I installed it on my HexOS server (TrueNAS 25.10, HexOS 2026.10.16), with the hook inline through Custom Install's request and its inputs answered through the hook inputs endpoint. Setup finished with no restart. The admin signed in and a wrong password was refused. DNS listened only on 192.168.1.65:53, protection was on, and doubleclick.net resolved to 0.0.0.0.
  • I ran the hook again after restarting the app. It skipped setup and succeeded.

Known limits

  • DNS stays on the LAN address the server had during setup. If that address changes, running setup again from the card fixes it, or the user can change the DNS address in AdGuard.

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