{"id":13549047,"url":"https://github.com/bakito/adguardhome-sync","last_synced_at":"2025-05-15T03:08:02.071Z","repository":{"id":37982513,"uuid":"352191746","full_name":"bakito/adguardhome-sync","owner":"bakito","description":"🛡️ Synchronize AdGuard Home config to replicas","archived":false,"fork":false,"pushed_at":"2025-05-05T05:26:23.000Z","size":1202,"stargazers_count":1133,"open_issues_count":4,"forks_count":40,"subscribers_count":13,"default_branch":"main","last_synced_at":"2025-05-05T06:31:39.911Z","etag":null,"topics":["adguardhome","replication","sync"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bakito.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":["bakito"]}},"created_at":"2021-03-27T22:32:10.000Z","updated_at":"2025-05-05T05:26:27.000Z","dependencies_parsed_at":"2023-11-20T07:58:48.604Z","dependency_job_id":"1ff57e06-7c45-4660-9b68-f7686bcfd32a","html_url":"https://github.com/bakito/adguardhome-sync","commit_stats":null,"previous_names":[],"tags_count":62,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakito%2Fadguardhome-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakito%2Fadguardhome-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakito%2Fadguardhome-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bakito%2Fadguardhome-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bakito","download_url":"https://codeload.github.com/bakito/adguardhome-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254264769,"owners_count":22041794,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adguardhome","replication","sync"],"created_at":"2024-08-01T12:01:17.653Z","updated_at":"2025-05-15T03:07:57.058Z","avatar_url":"https://github.com/bakito.png","language":"Go","funding_links":["https://github.com/sponsors/bakito"],"categories":["Go","others"],"sub_categories":[],"readme":"[![Go](https://github.com/bakito/adguardhome-sync/actions/workflows/go.yml/badge.svg)](https://github.com/bakito/adguardhome-sync/actions/workflows/go.yml)\n[![e2e tests](https://github.com/bakito/adguardhome-sync/actions/workflows/e2e.yaml/badge.svg)](https://github.com/bakito/adguardhome-sync/actions/workflows/e2e.yaml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/bakito/adguardhome-sync)](https://goreportcard.com/report/github.com/bakito/adguardhome-sync)\n[![Coverage Status](https://coveralls.io/repos/github/bakito/adguardhome-sync/badge.svg?branch=main\u0026service=github)](https://coveralls.io/github/bakito/adguardhome-sync?branch=main)\n\n# AdGuardHome sync\n\nSynchronize [AdGuardHome](https://github.com/AdguardTeam/AdGuardHome) config to replica instances.\n\n## FAQ \u0026 Deprecations\n\nPlease check the wiki\nfor [FAQ](https://github.com/bakito/adguardhome-sync/wiki/FAQ)\nand [Deprecations](https://github.com/bakito/adguardhome-sync/wiki/Deprecations).\n\n## Current sync features\n\n- General Settings\n- Filters\n- Rewrites\n- Services\n- Clients\n- DNS Config\n- DHCP Config\n- Theme\n\nBy default, all features are enabled. Single features can be disabled in the config.\n\n### Setup of initial instances\n\nNew AdGuardHome replica instances can be automatically installed if enabled via the config autoSetup. During automatic\ninstallation, the admin interface will be listening on port 3000 in runtime.\n\nTo skip automatic setup\n\n## Install\n\nGet from [releases](https://github.com/bakito/adguardhome-sync/releases) or install from source\n\n```bash\ngo install github.com/bakito/adguardhome-sync@latest\n```\n\n## Prerequisites\n\nBoth the origin instance must be initially setup via the AdguardHome installation wizard.\n\n## Username / Password vs. Cookie\n\nSome instances of AdGuard Home do not support basic authentication. For instance, many routers with built-in Adguard\nHome support do not. If this is the case, a valid cookie may be provided instead. If the router protects the AdGuard\ninstance behind its own authentication, the cookie from an authenticated request may allow the sync to succeed.\n\n- This has been tested successfully against GL.Inet routers with AdGuard Home.\n- Note: due to the short validity of cookies, this approach is likely only suitable for one-time syncs\n\n## Run Linux/Mac\n\n```bash\n\nexport LOG_LEVEL=info\nexport ORIGIN_URL=https://192.168.1.2:3000\nexport ORIGIN_USERNAME=username\nexport ORIGIN_PASSWORD=password\n# export ORIGIN_COOKIE=Origin-Cookie-Name=CCCOOOKKKIIIEEE\nexport REPLICA1_URL=http://192.168.1.3\nexport REPLICA1_USERNAME=username\nexport REPLICA1_PASSWORD=password\n# export REPLICA_COOKIE=Replica-Cookie-Name=CCCOOOKKKIIIEEE\n\n# run once\nadguardhome-sync run\n\n# run as daemon\nadguardhome-sync run --cron \"0 */2 * * *\"\n```\n\n### Run as Linux Service via Systemd\n\n\u003e Verified on Ubuntu Linux 24.04\n\nAssume you have downloaded the the `adguardhome-sync` binary to `/opt/adguardhome-sync`.\n\nCreate systemd service file `/opt/adguardhome-sync/adguardhome-sync.service`:\n\n```\n[Unit]\nDescription = AdGuardHome Sync\nAfter = network.target\n\n[Service]\nExecStart = /opt/adguardhome-sync/adguardhome-sync --config /opt/adguardhome-sync/adguardhome-sync.yaml run\n\n[Install]\nWantedBy = multi-user.target\n\n```\n\nCreate a configuration file `/opt/adguardhome-sync/adguardhome-sync.yaml`, please follow [Config file](#config-file-1)\nsection below for details.\n\nInstall and enable service:\n\n```bash\nsudo cp /opt/adguardhome-sync/adguardhome-sync.service /etc/systemd/system/\n\nsudo systemctl enable adguardhome-sync.service\n\nsudo systemctl start adguardhome-sync.service\n\n```\n\nThen you can check the status:\n\n```bash\nsudo systemctl status adguardhome-sync.service\n\n```\n\nIf web UI has been enabled in configuration (default port is 8080), can also check the status via\n`http://\u003cserver-IP\u003e:8080`\n\n## Run Windows\n\n```bash\n@ECHO OFF\n@TITLE AdGuardHome-Sync\n\nREM set LOG_LEVEL=debug\nset LOG_LEVEL=info\nREM set LOG_LEVEL=warn\nREM set LOG_LEVEL=error\n\nset ORIGIN_URL=http://192.168.1.2:3000\nset ORIGIN_USERNAME=username\nset ORIGIN_PASSWORD=password\n# set ORIGIN_COOKIE=Origin-Cookie-Name=CCCOOOKKKIIIEEE\n\nset REPLICA1_URL=http://192.168.2.2:3000\nset REPLICA1_USERNAME=username\nset REPLICA1_PASSWORD=password\n# set REPLICA1_COOKIE=Replica-Cookie-Name=CCCOOOKKKIIIEEE\n\nset FEATURES_DHCP_SERVER_CONFIG=false\nset FEATURES_DHCP_STATIC_LEASES=false\n\n# run once\nadguardhome-sync run\n\n# run as daemon\nadguardhome-sync run --cron \"0 */2 * * *\"\n```\n\n## docker cli\n\n```bash\ndocker run -d \\\n  --name=adguardhome-sync \\\n  -p 8080:8080 \\\n  -v /path/to/appdata/config/adguardhome-sync.yaml:/config/adguardhome-sync.yaml \\\n  --restart unless-stopped \\\n  ghcr.io/bakito/adguardhome-sync:latest\n```\n\n## docker compose\n\n### config file\n\n```yaml\n---\nversion: \"2.1\"\nservices:\n  adguardhome-sync:\n    image: ghcr.io/bakito/adguardhome-sync\n    container_name: adguardhome-sync\n    command: run --config /config/adguardhome-sync.yaml\n    volumes:\n      - /path/to/appdata/config/adguardhome-sync.yaml:/config/adguardhome-sync.yaml\n    ports:\n      - 8080:8080\n    restart: unless-stopped\n```\n\n## Config via environment variables\n\nFor Replicas replace `#` with the index number for the replica. E.g: `REPLICA#_URL` -\u003e `REPLICA1_URL`\n\n| Name                                 | Type   | Description                                               |\n|:-------------------------------------|--------|:----------------------------------------------------------|\n| ORIGIN_URL (string)                  | string | URL of adguardhome instance                               |\n| ORIGIN_WEB_URL (string)              | string | Web URL of adguardhome instance                           |\n| ORIGIN_API_PATH (string)             | string | API Path                                                  |\n| ORIGIN_USERNAME (string)             | string | Adguardhome username                                      |\n| ORIGIN_PASSWORD (string)             | string | Adguardhome password                                      |\n| ORIGIN_COOKIE (string)               | string | Adguardhome cookie                                        |\n| ORIGIN_INSECURE_SKIP_VERIFY (bool)   | bool   | Skip TLS verification                                     |\n| ORIGIN_AUTO_SETUP (bool)             | bool   | Automatically setup the instance if it is not initialized |\n| ORIGIN_INTERFACE_NAME (string)       | string | Network interface name                                    |\n| ORIGIN_DHCP_SERVER_ENABLED (bool)    | bool   | Enable DHCP server                                        |\n| REPLICA#_URL (string)                | string | URL of adguardhome instance                               |\n| REPLICA#_WEB_URL (string)            | string | Web URL of adguardhome instance                           |\n| REPLICA#_API_PATH (string)           | string | API Path                                                  |\n| REPLICA#_USERNAME (string)           | string | Adguardhome username                                      |\n| REPLICA#_PASSWORD (string)           | string | Adguardhome password                                      |\n| REPLICA#_COOKIE (string)             | string | Adguardhome cookie                                        |\n| REPLICA#_INSECURE_SKIP_VERIFY (bool) | bool   | Skip TLS verification                                     |\n| REPLICA#_AUTO_SETUP (bool)           | bool   | Automatically setup the instance if it is not initialized |\n| REPLICA#_INTERFACE_NAME (string)     | string | Network interface name                                    |\n| REPLICA#_DHCP_SERVER_ENABLED (bool)  | bool   | Enable DHCP server                                        |\n| CRON (string)                        | string | Cron expression for the sync interval                     |\n| RUN_ON_START (bool)                  | bool   | Run the sung on startup                                   |\n| PRINT_CONFIG_ONLY (bool)             | bool   | Print current config only and stop the application        |\n| CONTINUE_ON_ERROR (bool)             | bool   | Continue sync on errors                                   |\n| API_PORT (int)                       | int    | API port                                                  |\n| API_USERNAME (string)                | string | API username                                              |\n| API_PASSWORD (string)                | string | API password                                              |\n| API_DARK_MODE (bool)                 | bool   | API dark mode                                             |\n| API_METRICS_ENABLED (bool)           | bool   | Enable metrics                                            |\n| API_METRICS_SCRAPE_INTERVAL (int64)  | int64  | Interval for metrics scraping                             |\n| API_METRICS_QUERY_LOG_LIMIT (int)    | int    | Metrics log query limit                                   |\n| API_TLS_CERT_DIR (string)            | string | API TLS certificate directory                             |\n| API_TLS_CERT_NAME (string)           | string | API TLS certificate file name                             |\n| API_TLS_KEY_NAME (string)            | string | API TLS key file name                                     |\n| FEATURES_DNS_ACCESS_LISTS (bool)     | bool   | Sync DNS access lists                                     |\n| FEATURES_DNS_SERVER_CONFIG (bool)    | bool   | Sync DNS server config                                    |\n| FEATURES_DNS_REWRITES (bool)         | bool   | Sync DNS rewrites                                         |\n| FEATURES_DHCP_SERVER_CONFIG (bool)   | bool   | Sync DHCP server config                                   |\n| FEATURES_DHCP_STATIC_LEASES (bool)   | bool   | Sync DHCP static leases                                   |\n| FEATURES_GENERAL_SETTINGS (bool)     | bool   | Sync general settings                                     |\n| FEATURES_QUERY_LOG_CONFIG (bool)     | bool   | Sync query log config                                     |\n| FEATURES_STATS_CONFIG (bool)         | bool   | Sync stats config                                         |\n| FEATURES_CLIENT_SETTINGS (bool)      | bool   | Sync client settings                                      |\n| FEATURES_SERVICES (bool)             | bool   | Sync services                                             |\n| FEATURES_FILTERS (bool)              | bool   | Sync filters                                              |\n| FEATURES_THEME (bool)                | bool   | Sync the weg UI theme                                     |\n\n### Unraid\n\n⚠️ Disclaimer: Tere exists an unraid tepmlate for this application. This template is not managed by this project.\nAlso, as unraid is not known to me, I can not give any support on unraind templates.\n\nNote when running the Docker container in Unraid please remove unneeded env variables if don't needed.\nIf replica2 isn't used this can cause sync errors.\n\n### Config file\n\nlocation: $HOME/.adguardhome-sync.yaml\n\n```yaml\n# cron expression to run in daemon mode. (default; \"\" = runs only once)\ncron: \"0 */2 * * *\"\n\n# runs the synchronisation on startup\nrunOnStart: true\n\n# If enabled, the synchronisation task will not fail on single errors, but will log the errors and continue\ncontinueOnError: false\n\norigin:\n  # url of the origin instance\n  url: https://192.168.1.2:3000\n  # apiPath: define an api path if other than \"/control\"\n  # insecureSkipVerify: true # disable tls check\n  username: username\n  password: password\n  # cookie: Origin-Cookie-Name=CCCOOOKKKIIIEEE\n\n# replicas instances\nreplicas:\n  # url of the replica instance\n  - url: http://192.168.1.3\n    username: username\n    password: password\n    # cookie: Replica1-Cookie-Name=CCCOOOKKKIIIEEE\n  - url: http://192.168.1.4\n    username: username\n    password: password\n    # cookie: Replica2-Cookie-Name=CCCOOOKKKIIIEEE\n    # autoSetup: true # if true, AdGuardHome is automatically initialized.\n    # webURL: \"https://some-other.url\" # used in the web interface (default: \u003creplica-url\u003e\n\n# Configure the sync API server, disabled if api port is 0\napi:\n  # Port, default 8080\n  port: 8080\n  # if username and password are defined, basic auth is applied to the sync API\n  username: username\n  password: password\n  # enable api dark mode\n  darkMode: true\n\n  # enable metrics on path '/metrics' (api port must be != 0)\n  # metrics:\n  #   enabled: true\n  #   scrapeInterval: 30s \n  #   queryLogLimit: 10000\n\n  # enable tls for the api server\n  # tls:\n  #   # the directory of the provided tls certs\n  #   certDir: /path/to/certs\n  #   # the name of the cert file (default: tls.crt)\n  #   certName: foo.crt\n  #   # the name of the key file (default: tls.key)\n  #   keyName: bar.key\n\n# Configure sync features; by default all features are enabled.\nfeatures:\n  generalSettings: true\n  queryLogConfig: true\n  statsConfig: true\n  clientSettings: true\n  services: true\n  filters: true\n  dhcp:\n    serverConfig: true\n    staticLeases: true\n  dns:\n    serverConfig: true\n    accessLists: true\n    rewrites: true\n```\n\n## Log Level\n\nThe log level can be set with the environment variable: `LOG_LEVEL`\n\nThe following log levels are supported (default: info)\n\n- debug\n- info\n- warn\n- error\n\n## Log Format\n\nDefault log format is `console`.\nIt can be changed to `json` by setting the environment variable: `LOG_FORMAT=json`.\n\n## Video Tutorials\n\n- [Como replicar la configuración de tu servidor DNS Adguard automáticamente - Tu servidor Part #12](https://www.youtube.com/watch?v=1LPeu_JG064) (\n  Spanish) by [Jonatan Castro](https://github.com/jcastro)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakito%2Fadguardhome-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbakito%2Fadguardhome-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbakito%2Fadguardhome-sync/lists"}