bakito / adguardhome-sync Goto Github PK
View Code? Open in Web Editor NEW🛡️ Synchronize AdGuard Home config to replicas
License: Apache License 2.0
🛡️ Synchronize AdGuard Home config to replicas
License: Apache License 2.0
I am getting the following error.
But if you do open the url u can see its signed by a valid certificate
ERROR sync sync/sync.go:99 Error getting origin status {"from": "adguard.ownlab.in", "error": "Get \"https://adguard.ownlab.in/control/status\": x509: certificate signed by unknown authority"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:99
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/go/src/app/pkg/sync/sync.go:61
My Docker Compose File
version: "3.2"
services:
adguardhome-sync:
image: quay.io/bakito/adguardhome-sync
container_name: adguardhome-sync
command: run
environment:
- ORIGIN_URL=https://adguard.ownlab.in
- ORIGIN_USERNAME=SECRET
- ORIGIN_PASSWORD=SECRET
- REPLICA_URL=https://adguard-backup.ownlab.in
- REPLICA_USERNAME=SECRET
- REPLICA_PASSWORD=SECRET
- CRON=*/10 * * * * # run every 10 minutes
- RUNONSTART=true
ports:
- 8080:8080
restart: unless-stopped
Describe the bug
I managed to get two of the same DNS rewrite entries in my source AGH container.
The sync to the two replica's however now have a list of hundreds of these enties: Sync keeps adding extra rewrite entries to the replica's!
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect to have the replica's also contain two of the entries, ie exactly as the source does.
Screenshots
If applicable, add log files or json responses from AdGuardHome to help explain your problem.
2021-06-05T02:30:01.533Z INFO client client/client.go:170 Add rewrite entry {"host": "192.168.2.189", "domain": "poseidon.srv.athome", "answer": "192.168.2.226"}
2021-06-05T02:30:02.043Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T02:30:02.043Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T02:30:02.537Z INFO client client/client.go:170 Add rewrite entry {"host": "192.168.2.188", "domain": "poseidon.srv.athome", "answer": "192.168.2.226"}
2021-06-05T02:30:03.035Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T02:40:00.957Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T02:40:01.471Z INFO client client/client.go:170 Add rewrite entry {"host": "192.168.2.189", "domain": "poseidon.srv.athome", "answer": "192.168.2.226"}
2021-06-05T02:40:01.963Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T02:40:01.963Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T02:40:02.469Z INFO client client/client.go:170 Add rewrite entry {"host": "192.168.2.188", "domain": "poseidon.srv.athome", "answer": "192.168.2.226"}
2021-06-05T02:40:02.955Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T02:50:01.030Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T02:50:01.554Z INFO client client/client.go:170 Add rewrite entry {"host": "192.168.2.189", "domain": "poseidon.srv.athome", "answer": "192.168.2.226"}
After removing the TWO entries in the source, everything is syncing normally again:
2021-06-05T16:20:01.439Z INFO client client/client.go:181 Delete rewrite entry {"host": "192.168.2.189", "domain": "poseidon.srv.athome", "answer": "192.168.2.226"}
2021-06-05T16:20:01.927Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T16:20:01.928Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T16:20:02.436Z INFO client client/client.go:181 Delete rewrite entry {"host": "192.168.2.188", "domain": "poseidon.srv.athome", "answer": "192.168.2.226"}
2021-06-05T16:20:02.931Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T16:30:01.006Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T16:30:01.922Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T16:30:01.922Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T16:30:02.866Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T16:40:00.932Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T16:40:01.868Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.189"}
2021-06-05T16:40:01.868Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.2.190", "to": "192.168.2.188"}
2021-06-05T16:40:02.826Z INFO sync sync/sync.go:241 Sync done {"from": "192.168.2.190", "to": "192.168.2.188"}
Additional context
Add any other context about the problem here.
Describe the bug
Starting from v0.107.14 there is a breaking change that makes adguardhome-sync fail:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
API requests should specify their content-type as application/json to allow for syncing
Log Files
N/A
Additional context
N/A
I've migrated from AlmaLinux to Debian 11 and AdGuardHome sync works with the exception that if configured to setup a cron task, it will hang up indefinitely.
Snippet from my .adguardhome-sync.yaml file
# cron expression to run in daemon mode. (default; "" = runs only once) cron: "*/10 * * * *"
Then upon running the command to run adguard home it'll hang
~/work/bin/adguardhome-sync run
Once it gets to this line it'll hang indefinately;
2022-08-11T23:12:19.211-0700 INFO sync sync/sync.go:50 Setup cronjob {"cron": "*/10 * * * *"}
Go was installed using the process on this page,
https://www.digitalocean.com/community/tutorials/how-to-install-go-on-debian-10
Is perhaps the path throwing things off?
I've commented the cron line out of the config file and manually setup a crontab for the time being but would like to figure out what the root issue is.
Describe the bug
I am running the main AdGuardHome in a Pi4 using the eth0
network interface and my replica should be using ens18
, but when it tries to sync DHCP configuration it fails because it can't bind to that network interface (it doesn't exist).
To Reproduce
Steps to reproduce the behavior:
v0.107.5
v0.4.3
# cron expression to run in daemon mode. (default; "" = runs only once)
cron: "* * * * *"
origin:
# url of the origin instance
url: http://192.168.0.201:3001
# apiPath: define an api path if other than "/control"
# insecureSkipVerify: true # disable tls check
username: admin
password: <redacted>
# replica instance (optional, if only one)
replica:
# url of the replica instance
url: http://192.168.0.200:3001
username: admin
password: <redacted>
# Configure the sync API server, disabled if api port is 0
api:
# Port, default 8080
port: 8080
# if username and password are defined, basic auth is applied to the sync API
username: username
password: password
2022-03-17T15:48:03.322Z DEBUG client client/client.go:156 got response {"host": "192.168.0.200:3001", "method": "POST", "path": "/dhcp/set_config", "username": "MiguelNdeCarvalho", "status": 400, "body": "enabling dhcp: starting dhcp server: dhcpv4: finding interface eth0 by name: route ip+net: no such network interface\n"}
Expected behavior
Option to set the interface of the replica via a environment variable or via the config file like:
replica:
interface_name: ens18
Log Files
2022-03-17T15:50:00.995Z DEBUG client client/client.go:126 do get {"host": "192.168.0.201:3001", "method": "GET", "path": "/stats_info", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.101Z DEBUG client client/client.go:138 got response {"host": "192.168.0.201:3001", "method": "GET", "path": "/stats_info", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"interval\":30}"}
2022-03-17T15:50:01.102Z DEBUG client client/client.go:126 do get {"host": "192.168.0.201:3001", "method": "GET", "path": "/access/list", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.210Z DEBUG client client/client.go:138 got response {"host": "192.168.0.201:3001", "method": "GET", "path": "/access/list", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"allowed_clients\":[],\"disallowed_clients\":[],\"blocked_hosts\":[\"version.bind\",\"id.server\",\"hostname.bind\"]}\n"}
2022-03-17T15:50:01.210Z DEBUG client client/client.go:126 do get {"host": "192.168.0.201:3001", "method": "GET", "path": "/dns_info", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.317Z DEBUG client client/client.go:138 got response {"host": "192.168.0.201:3001", "method": "GET", "path": "/dns_info", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"upstream_dns\":[\"https://dns.cloudflare.com/dns-query\"],\"upstream_dns_file\":\"\",\"bootstrap_dns\":[\"9.9.9.10\",\"149.112.112.10\",\"2620:fe::10\",\"2620:fe::fe:10\"],\"protection_enabled\":true,\"ratelimit\":50,\"blocking_mode\":\"default\",\"blocking_ipv4\":\"\",\"blocking_ipv6\":\"\",\"edns_cs_enabled\":false,\"dnssec_enabled\":false,\"disable_ipv6\":false,\"upstream_mode\":\"\",\"cache_size\":4194304,\"cache_ttl_min\":0,\"cache_ttl_max\":0,\"cache_optimistic\":false,\"resolve_clients\":true,\"use_private_ptr_resolvers\":true,\"local_ptr_upstreams\":[],\"default_local_ptr_upstreams\":[\"1.1.1.1\",\"1.0.0.1\"]}\n"}
2022-03-17T15:50:01.317Z DEBUG client client/client.go:126 do get {"host": "192.168.0.201:3001", "method": "GET", "path": "/dhcp/status", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.428Z DEBUG client client/client.go:138 got response {"host": "192.168.0.201:3001", "method": "GET", "path": "/dhcp/status", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"interface_name\":\"eth0\",\"v4\":{\"gateway_ip\":\"192.168.0.1\",\"subnet_mask\":\"255.255.255.0\",\"range_start\":\"192.168.0.4\",\"range_end\":\"192.168.0.254\",\"lease_duration\":86400},\"v6\":{\"range_start\":\"\",\"lease_duration\":86400},\"leases\":[{\"mac\":\"42:a7:74:3a:c6:d3\",\"expires\":\"2022-03-18T15:40:18Z\",\"hostname\":\"iphone\",\"ip\":\"192.168.0.4\"},{\"mac\":\"3c:bd:3e:39:4f:21\",\"expires\":\"2022-03-18T15:39:09Z\",\"hostname\":\"192-168-0-5\",\"ip\":\"192.168.0.5\"},{\"mac\":\"7c:d6:61:f2:d6:30\",\"expires\":\"2022-03-18T14:44:18Z\",\"hostname\":\"192-168-0-6\",\"ip\":\"192.168.0.6\"},{\"mac\":\"a0:29:19:e5:9b:f9\",\"expires\":\"2022-03-18T11:44:00Z\",\"hostname\":\"mike-laptop-angulo\",\"ip\":\"192.168.0.7\"},{\"mac\":\"b8:c6:aa:f5:b7:39\",\"expires\":\"2022-03-18T15:46:52Z\",\"hostname\":\"192-168-0-8\",\"ip\":\"192.168.0.8\"},{\"mac\":\"68:07:0a:23:2d:1f\",\"expires\":\"2022-03-18T04:34:31Z\",\"hostname\":\"192-168-0-10\",\"ip\":\"192.168.0.10\"},{\"mac\":\"30:9c:23:df:41:98\",\"expires\":\"2022-03-17T21:36:33Z\",\"hostname\":\"mike-desktop\",\"ip\":\"192.168.0.12\"},{\"mac\":\"d4:54:8b:0a:df:c0\",\"expires\":\"2022-03-18T03:17:19Z\",\"hostname\":\"\",\"ip\":\"192.168.0.13\"},{\"mac\":\"98:f6:21:cc:2c:dd\",\"expires\":\"2022-03-18T15:01:36Z\",\"hostname\":\"poco-f2-pro\",\"ip\":\"192.168.0.14\"},{\"mac\":\"48:e1:e9:16:57:4e\",\"expires\":\"2022-03-18T11:17:28Z\",\"hostname\":\"meross-smart-plug\",\"ip\":\"192.168.0.15\"},{\"mac\":\"84:a9:3e:b9:ce:2b\",\"expires\":\"2022-03-17T21:56:12Z\",\"hostname\":\"hpb9ce2b\",\"ip\":\"192.168.0.16\"},{\"mac\":\"54:b8:0a:06:c8:dc\",\"expires\":\"2022-03-18T11:44:15Z\",\"hostname\":\"dlinkap\",\"ip\":\"192.168.0.17\"},{\"mac\":\"4c:f2:02:3a:67:15\",\"expires\":\"2022-03-18T15:41:00Z\",\"hostname\":\"192-168-0-18\",\"ip\":\"192.168.0.18\"},{\"mac\":\"e8:b1:fc:e8:d6:d6\",\"expires\":\"2022-03-18T12:37:18Z\",\"hostname\":\"desktop-6eecu9t\",\"ip\":\"192.168.0.19\"}],\"static_leases\":[{\"mac\":\"5c:b1:3e:f1:ac:fb\",\"hostname\":\"vodafone-box-tv\",\"ip\":\"192.168.0.3\"}],\"enabled\":true}\n"}
2022-03-17T15:50:01.428Z INFO sync sync/sync.go:189 Start sync {"from": "192.168.0.201:3001", "to": "192.168.0.200:3001"}
2022-03-17T15:50:01.428Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "status", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.557Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "status", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"dns_addresses\":[\"192.168.0.200\"],\"dns_port\":53,\"http_port\":3001,\"protection_enabled\":true,\"dhcp_available\":true,\"running\":true,\"version\":\"v0.107.5\",\"language\":\"\"}\n"}
2022-03-17T15:50:01.557Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/parental/status", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.683Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/parental/status", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"enabled\":false}\n"}
2022-03-17T15:50:01.683Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/safesearch/status", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.810Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/safesearch/status", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"enabled\":false}\n"}
2022-03-17T15:50:01.811Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/safebrowsing/status", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:01.938Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/safebrowsing/status", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"enabled\":false}\n"}
2022-03-17T15:50:01.938Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/querylog_info", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.066Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/querylog_info", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"enabled\":true,\"interval\":30,\"anonymize_client_ip\":false}"}
2022-03-17T15:50:02.066Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/stats_info", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.192Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/stats_info", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"interval\":30}"}
2022-03-17T15:50:02.192Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/rewrite/list", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.318Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/rewrite/list", "username": "MiguelNdeCarvalho", "status": 200, "body": "[{\"domain\":\"*.mike-server.ovh\",\"answer\":\"192.168.0.200\"}]\n"}
2022-03-17T15:50:02.319Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/filtering/status", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.446Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/filtering/status", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"enabled\":true,\"interval\":168,\"filters\":[{\"id\":1,\"enabled\":true,\"url\":\"https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt\",\"name\":\"AdGuard DNS filter\",\"rules_count\":45771,\"last_updated\":\"2022-03-14T23:51:03Z\"},{\"id\":1647296016,\"enabled\":true,\"url\":\"https://abp.oisd.nl/basic/\",\"name\":\"OISD Blocklist Basic\",\"rules_count\":61021,\"last_updated\":\"2022-03-14T23:51:03Z\"},{\"id\":1647296017,\"enabled\":true,\"url\":\"https://raw.githubusercontent.com/Perflyst/PiHoleBlocklist/master/SmartTV-AGH.txt\",\"name\":\"Perflyst and Dandelion Sprout's Smart-TV Blocklist\",\"rules_count\":154,\"last_updated\":\"2022-03-14T23:51:04Z\"},{\"id\":1647296018,\"enabled\":true,\"url\":\"https://raw.githubusercontent.com/durablenapkin/scamblocklist/master/adguard.txt\",\"name\":\"Scam Blocklist by DurableNapkin\",\"rules_count\":414,\"last_updated\":\"2022-03-14T23:51:04Z\"},{\"id\":1647296019,\"enabled\":true,\"url\":\"https://raw.githubusercontent.com/mitchellkrogza/The-Big-List-of-Hacked-Malware-Web-Sites/master/hosts\",\"name\":\"The Big List of Hacked Malware Web Sites\",\"rules_count\":13822,\"last_updated\":\"2022-03-14T23:51:04Z\"},{\"id\":1647296020,\"enabled\":true,\"url\":\"https://curben.gitlab.io/malware-filter/urlhaus-filter-agh-online.txt\",\"name\":\"Online Malicious URL Blocklist\",\"rules_count\":6358,\"last_updated\":\"2022-03-14T23:51:04Z\"},{\"id\":1647296021,\"enabled\":true,\"url\":\"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareAdGuardHome.txt\",\"name\":\"Dandelion Sprout's Anti-Malware List\",\"rules_count\":6758,\"last_updated\":\"2022-03-14T23:51:04Z\"},{\"id\":1647296022,\"enabled\":true,\"url\":\"https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt\",\"name\":\"WindowsSpyBlocker - Hosts spy rules\",\"rules_count\":378,\"last_updated\":\"2022-03-14T23:51:04Z\"},{\"id\":1647296023,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/abuse-ags.txt\",\"name\":\"blocklistproject-abuse\",\"rules_count\":435310,\"last_updated\":\"2022-03-14T23:51:05Z\"},{\"id\":1647296024,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/ads-ags.txt\",\"name\":\"blocklistproject-ads\",\"rules_count\":154701,\"last_updated\":\"2022-03-14T23:51:05Z\"},{\"id\":1647296025,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/crypto-ags.txt\",\"name\":\"blocklistproject-crypto\",\"rules_count\":23813,\"last_updated\":\"2022-03-14T23:51:05Z\"},{\"id\":1647296026,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/drugs-ags.txt\",\"name\":\"blocklistproject-drugs\",\"rules_count\":26588,\"last_updated\":\"2022-03-14T23:51:05Z\"},{\"id\":1647296027,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/fraud-ags.txt\",\"name\":\"blocklistproject-fraud\",\"rules_count\":196102,\"last_updated\":\"2022-03-14T23:51:05Z\"},{\"id\":1647296028,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/gambling-ags.txt\",\"name\":\"blocklistproject-gambling\",\"rules_count\":2479,\"last_updated\":\"2022-03-14T23:51:05Z\"},{\"id\":1647296029,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/malware-ags.txt\",\"name\":\"blocklistproject-malware\",\"rules_count\":435417,\"last_updated\":\"2022-03-14T23:51:06Z\"},{\"id\":1647296030,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/phishing-ags.txt\",\"name\":\"blocklistproject-phishing\",\"rules_count\":190269,\"last_updated\":\"2022-03-14T23:51:06Z\"},{\"id\":1647296031,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/ransomware-ags.txt\",\"name\":\"blocklistproject-ransomware\",\"rules_count\":1904,\"last_updated\":\"2022-03-14T23:51:06Z\"},{\"id\":1647296032,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/scam-ags.txt\",\"name\":\"blocklistproject-scam\",\"rules_count\":1268,\"last_updated\":\"2022-03-14T23:51:06Z\"},{\"id\":1647296033,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/tiktok-ags.txt\",\"name\":\"blocklistproject-tiktok\",\"rules_count\":3698,\"last_updated\":\"2022-03-14T23:51:06Z\"},{\"id\":1647296034,\"enabled\":true,\"url\":\"https://blocklistproject.github.io/Lists/adguard/tracking-ags.txt\",\"name\":\"blocklistproject-tracking\",\"rules_count\":15063,\"last_updated\":\"2022-03-14T23:51:06Z\"}],\"whitelist_filters\":null,\"user_rules\":[\"@@||txxx.ahcdn.com^$important\",\"@@||hdzog.ahcdn.com^$important\",\"\"]}"}
2022-03-17T15:50:02.447Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/blocked_services/list", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.573Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/blocked_services/list", "username": "MiguelNdeCarvalho", "status": 200, "body": "[]\n"}
2022-03-17T15:50:02.573Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/clients", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.699Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/clients", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"clients\":[{\"name\":\"Vodafone-Box-TV\",\"blocked_services\":null,\"ids\":[\"5c:b1:3e:f1:ac:fb\"],\"tags\":[\"device_tv\"],\"upstreams\":[\"192.168.0.1\"],\"filtering_enabled\":false,\"parental_enabled\":false,\"safebrowsing_enabled\":false,\"safesearch_enabled\":false,\"use_global_blocked_services\":true,\"use_global_settings\":false}],\"auto_clients\":[{\"whois_info\":{},\"name\":\"ip6-allrouters\",\"source\":\"etc/hosts\",\"ip\":\"ff02::2\"},{\"whois_info\":{},\"name\":\"localhost\",\"source\":\"etc/hosts\",\"ip\":\"127.0.0.1\"},{\"whois_info\":{},\"name\":\"loki\",\"source\":\"etc/hosts\",\"ip\":\"127.0.1.1\"},{\"whois_info\":{},\"name\":\"localhost\",\"source\":\"etc/hosts\",\"ip\":\"::1\"},{\"whois_info\":{},\"name\":\"ip6-allnodes\",\"source\":\"etc/hosts\",\"ip\":\"ff02::1\"}],\"supported_tags\":[\"device_audio\",\"device_camera\",\"device_gameconsole\",\"device_laptop\",\"device_nas\",\"device_other\",\"device_pc\",\"device_phone\",\"device_printer\",\"device_securityalarm\",\"device_tablet\",\"device_tv\",\"os_android\",\"os_ios\",\"os_linux\",\"os_macos\",\"os_other\",\"os_windows\",\"user_admin\",\"user_child\",\"user_regular\"]}\n"}
2022-03-17T15:50:02.699Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/access/list", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.825Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/access/list", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"allowed_clients\":[],\"disallowed_clients\":[],\"blocked_hosts\":[\"version.bind\",\"id.server\",\"hostname.bind\"]}\n"}
2022-03-17T15:50:02.825Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/dns_info", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:02.954Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/dns_info", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"upstream_dns\":[\"https://dns.cloudflare.com/dns-query\"],\"upstream_dns_file\":\"\",\"bootstrap_dns\":[\"149.112.112.10\",\"2620:fe::10\",\"2620:fe::fe:10\",\"9.9.9.10\"],\"protection_enabled\":true,\"ratelimit\":50,\"blocking_mode\":\"default\",\"blocking_ipv4\":\"\",\"blocking_ipv6\":\"\",\"edns_cs_enabled\":false,\"dnssec_enabled\":false,\"disable_ipv6\":false,\"upstream_mode\":\"\",\"cache_size\":4194304,\"cache_ttl_min\":0,\"cache_ttl_max\":0,\"cache_optimistic\":false,\"resolve_clients\":true,\"use_private_ptr_resolvers\":true,\"local_ptr_upstreams\":[],\"default_local_ptr_upstreams\":[\"8.8.8.8\",\"8.8.4.4\"]}\n"}
2022-03-17T15:50:02.955Z DEBUG client client/client.go:126 do get {"host": "192.168.0.200:3001", "method": "GET", "path": "/dhcp/status", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:03.083Z DEBUG client client/client.go:138 got response {"host": "192.168.0.200:3001", "method": "GET", "path": "/dhcp/status", "username": "MiguelNdeCarvalho", "status": 200, "body": "{\"interface_name\":\"eth0\",\"v4\":{\"gateway_ip\":\"192.168.0.1\",\"subnet_mask\":\"255.255.255.0\",\"range_start\":\"192.168.0.4\",\"range_end\":\"192.168.0.254\",\"lease_duration\":86400},\"v6\":{\"range_start\":\"\",\"lease_duration\":86400},\"leases\":[],\"static_leases\":[],\"enabled\":true}\n"}
2022-03-17T15:50:03.083Z INFO client client/client.go:438 Set dhcp server config {"host": "192.168.0.200:3001"}
2022-03-17T15:50:03.084Z DEBUG client client/client.go:150 do post {"host": "192.168.0.200:3001", "method": "POST", "path": "/dhcp/set_config", "username": "MiguelNdeCarvalho"}
2022-03-17T15:50:03.281Z DEBUG client client/client.go:156 got response {"host": "192.168.0.200:3001", "method": "POST", "path": "/dhcp/set_config", "username": "MiguelNdeCarvalho", "status": 400, "body": "enabling dhcp: starting dhcp server: dhcpv4: finding interface eth0 by name: route ip+net: no such network interface\n"}
2022-03-17T15:50:03.282Z ERROR sync sync/sync.go:246 Error syncing dns {"from": "192.168.0.201:3001", "to": "192.168.0.200:3001", "error": "400 Bad Request"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:246
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:177
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:44
github.com/robfig/cron/v3.FuncJob.Run
/home/bakito/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
/home/bakito/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
Description of problem:
aguardhome-sync does not sync dhcp settings and static leases although other settings are copied successfully
No error messages obvious in error log - sync of dhcp parameters does not seem to be attempted.
After sync, the dhcp in the replica is disabled and the dhcp interface is deselected even if dhcp in the origin is enabled.
Steps to reproduce the behavior:
config.txt
adguard_sync_logs.txt
Thanks for your help.
Describe the bug
Install instructions go get ....
are deprecated for go 1.17+. Instead go install github.com/bakito/adguardhome-sync@latest
can be used.
To Reproduce
Steps to reproduce the behavior:
go version
=> go version go1.17.6 linux/amd64
go get -u github.com/bakito/adguardhome-sync
go: downloading ...
...
go get: installing executables with 'go get' in module mode is deprecated.
Use 'go install pkg@version' instead.
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
Expected behavior
Adguardhome-sync is installed
Log Files
provided in steps above
Additional context
provided above
Thanks for the utility!!!
Describe the bug
Using special characters in your AGH password results in the sync tool to get a 403 forbidden error.
To Reproduce
Expected behavior
To connect properly to the instance and start syncing with every password regardless of characters included.
Describe the bug
I am running AdGuard home on Windows Server 2019. Adguard Home does not support the DHCP module on windows servers and returns a 501 unimplemented
for API requests about DHCP. Even with DHCP.ServerConfig
& DHCP.StaticLeases
disabled, Adguardhome-sync
attempts to pull the DHCP config, which fails. Once the requests fails, it appears that adguardhome-sync
exits without performing any sync
To Reproduce
Steps to reproduce the behavior:
0.4.10
v0.107.2
Defaults, except i have disabled all features from sync except for filters (trying to get at least one thing working first)
Error getting dhcp server config {"from": "10.15.10.10", "error": "501 Not Implemented({\"message\":\"dhcp is unsupported on windows\"}\n)"}
Expected behavior
When a sync feature is disabled, Adguardhome-sync should not attempt to pull the data and continue to sync only enabled features
OR
have a feature flag that is essentially hosted_by_windows
that specifically excludes the DHCP config request.
Log Files
root@adguardsync-adguardhome-sync-7896745c67-bjt58:/app/adguardhome-sync# ./adguardhome-sync run --config ./config.yaml
2022-12-25T14:42:53.314Z INFO root cmd/root.go:118 Using config file:./config.yaml
2022-12-25T14:42:53.316Z INFO sync sync/sync.go:29 AdGuardHome sync {"version": "0.4.10", "build": "2022-11-18T17:51:16Z"}
2022-12-25T14:42:53.316Z INFO sync types/features.go:70 Disabled features {"features": ["DHCP.ServerConfig", "DHCP.StaticLeases", "DNS.AccessLists", "DNS.ServerConfig", "DNS.Rewrites", "GeneralSettings", "QueryLogConfig", "StatsConfig", "ClientSettings", "Services"]}
2022-12-25T14:42:53.316Z INFO sync sync/sync.go:55 Setup cronjob {"cron": "*/1 * * * *", "next-execution": "2022-12-25T14:43:00.000Z"}
2022-12-25T14:42:53.316Z INFO sync sync/http.go:52 Starting API server {"port": 8081}
2022-12-25T14:42:53.316Z INFO sync sync/sync.go:65 Running sync on startup
2022-12-25T14:42:53.370Z INFO sync sync/sync.go:113 Connected to origin {"from": "10.15.10.10", "version": "v0.107.21"}
2022-12-25T14:42:53.989Z ERROR sync sync/sync.go:178 Error getting dhcp server config {"from": "10.15.10.10", "error": "501 Not Implemented({\"message\":\"dhcp is unsupported on windows\"}\n)"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:178
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:66
Additional context
I do not have a lot of experience with go, but I think wrapping each request in the sync function
of sync.go
with a feature check would eliminate this? https://github.com/bakito/adguardhome-sync/blob/main/pkg/sync/sync.go#L176 but I am not sure if it would cause issues with null values in the SyncTo
function?
The executable keeps getting deleted:
Trojan:Win32/Sabsik.EN.A!ml
Trojan:Win32/Trickbot!ml
Trojan:Win32/Wacatac.H!ml
What to do?
Is it a false positive? As it constant changes....
Describe the bug
running 'adguardhome-sync run' gives me the error "http: server gave HTTP response to HTTPS client"
To Reproduce
Steps to reproduce the behavior:
Expected behavior
that the sync would work?
Log Files
$ adguardhome-sync run
INFO sync sync/sync.go:29 AdGuardHome sync {"version": "devel", "build": "N/A"}
INFO sync sync/http.go:52 Starting API server {"port": 8080}
INFO sync sync/sync.go:65 Running sync on startup
DEBUG client client/client.go:139 do get {"host": "10.0.0.50:3000", "method": "GET", "path": "status", "username": "admin"}
2023-01-29T02:26:56.756-0600
DEBUG client client/client.go:148 error in do get {"host": "10.0.0.50:3000", "method": "GET", "path": "status", "username": "admin", "status": 0, "body": "", "error": "Get "https://10.0.0.50:3000/control/status\": http: server gave HTTP response to HTTPS client"}
ERROR sync sync/sync.go:104 Error getting origin status {"from": "10.0.0.50:3000", "error": ": Get "https://10.0.0.50:3000/control/status\": http: server gave HTTP response to HTTPS client"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/root/go/pkg/mod/github.com/bakito/[email protected]/pkg/sync/sync.go:104
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/root/go/pkg/mod/github.com/bakito/[email protected]/pkg/sync/sync.go:66
Additional context
Add any other context about the problem here.
Sorry, this is somehow unspecific - a little bit brain storming. I am working on a HA k8s setup. I have implemented some active/standby leader election mechanism, so that there can run more than one instance of this in a kubernetes cluster, but only one will receive traffic. If one pod fails, there will be a failover to another one (new leder elected) within a very short time period.
I would like to use this sync, to keep the instances in sync.
The elected leader is allways available under the service ip / internal service dns record, in addition each pod is allways available via its pod ip / internal pod dns record.
There should be a regular sync from the elected leader, to the passive pods.
Is your feature request related to a problem? Please describe.
I would like to have some magic, that can lookup the sync targets via the kubernetes api
Describe the solution you'd like
I would like to have something like:
before syncing:
apiVersion: coordination.k8s.io/v1
kind: Lease
metadata:
creationTimestamp: "2022-12-11T22:52:03Z"
name: adguard-leader-election
namespace: adguard
resourceVersion: "3741631"
uid: 8590256a-b50a-4c9e-9d82-f30158c5b299
spec:
acquireTime: "2022-12-12T19:59:45.402214Z"
holderIdentity: adguard-1
leaseDurationSeconds: 60
leaseTransitions: 5
renewTime: "2022-12-12T20:31:15.799654Z"
=> we now adguard-1 is leader
2. get all pods of statefulset
adguard-0
adguard-1
adguard-2
=> so we know that sync targets are adguard-0 and adguard-2 and sync source is adguard-1
Describe alternatives you've considered
Maybe some init container, that is rewriting the config every time and only let this container run once and let the schedule trigger via k8s jobs...
As already said, this is more a brainstorming and I would like to see what you can imagine in your sync tool :-)
Describe the bug
When I start the docker container, it does not connect and produces a 403 Error.
To Reproduce
Steps to reproduce the behavior:
What version of AdGuardHome sync used?
v0.4.3
What version of AdGuardHome us used?
v0.108.0-b.9
How does the configuration look?
`cron: "*/1 * * * *"
origin:
url: http://192.168.0.140:9970
insecureSkipVerify: true
username: username
password: password
replica:
url: http://192.168.0.141:9970
insecureSkipVerify: true
username: username
password: password
api:
port: 9080
username: username
password: password`
Error getting origin status {"from": "192.168.0.140:9970", "error": "403 Forbidden"}
Expected behavior
Log Files
`-------------------------------------
_ ()
| | ___ _ __
| | / | | | /
| | _ \ | | | () |
|| |/ || __/
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 50-config: executing...
[cont-init.d] 50-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
2022-06-12T12:56:10.665+0200 INFO root cmd/root.go:114 Using config file:/config/adguardhome-sync.yaml
2022-06-12T12:56:10.668+0200 INFO sync sync/sync.go:30 AdGuardHome sync {"version": "0.4.3", "build": "2022-02-14T17:40:34Z"}
2022-06-12T12:56:10.669+0200 INFO sync sync/sync.go:50 Setup cronjob {"cron": "*/1 * * * *"}
2022-06-12T12:56:10.669+0200 INFO sync sync/http.go:54 Starting API server {"port": 9080}
2022-06-12T12:56:10.669+0200 INFO sync sync/sync.go:60 Running sync on startup
2022-06-12T12:56:10.670+0200 DEBUG client client/client.go:126 do get {"host": "192.168.0.140:9970", "method": "GET", "path": "status"}
2022-06-12T12:56:10.673+0200 DEBUG client client/client.go:138 got response {"host": "192.168.0.140:9970", "method": "GET", "path": "status", "status": 403, "body": "Forbidden"}
2022-06-12T12:56:10.673+0200 ERROR sync sync/sync.go:99 Error getting origin status {"from": "192.168.0.140:9970", "error": "403 Forbidden"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:99
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:61
`
Is your feature request related to a problem? Please describe.
I have 2 servers with adguardhome-sync copying settings between, and have noticed some errors in how I think replication of DHCP settings should take place. My 2 servers have different network settings (different NIC names / VLANS)
It appears that adgaurdhome-sync is attempting to sync all DHCP settings. I think it would be preferable to sync just some
Describe the solution you'd like
With 2 DHCP Servers on the same subnet standard practice would be to configure each with a seperate non-overlapping range of addresses within the same CIDR range. This is to prevent IP address conflicts caused by the 2 servers handing the same address to 2 different clients.
Suggestion would be not to sync the DHCP range setting.
Also with difference between servers possible in terms of network name etc, suggesting would be to also not sync this setting.
The setting that I think would be good to sync, but doesn't seem to be in my setup is the DHCP Static Reservations - the benefit here is that both servers should have the same static reservations to server these clients correctly
Describe alternatives you've considered
No alternatives that I can think of
Additional context
Add any other context or screenshots about the feature request here.
Finally found time to run this and the features as well as the documentation was great and easy to follow!
I would like to show my appreciation with a small token of gratitude.
Could you consider setting up GitHub Sponsor on this repo or one of the other donation platforms?
Describe the bug
Filters are synced from the primary to secondary instance successfully. The "enabled" status is not, in my case I have 2 disabled blocklists that were synced over to the second instance however on the second instance they were enabled.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The filter lists get synced over as well as the status of those lists (enabled/disabled)
Log Files
N/A
Additional context
N/A
Describe the bug
If the username or password has double quotes in the compose definition, syncing fails as if the wrong username/password is specified for the replica
To Reproduce
Steps to reproduce the behavior:
Using version 0.2 of sync with AGH 105.2
environment:
- REPLICA_USERNAME="username"
- REPLICA_PASSWORD="password"
The errormessage is a 404, invalid username/password.
Expected behavior
Syncing works, independent of single/double quotes used for username/password
If I remove the quotes, syncing works as expected.
Screenshots
If applicable, add log files or json responses from AdGuardHome to help explain your problem.
Additional context
Add any other context about the problem here.
I tweaked a few settings on my primary and notice on the secondary DNS server running the same version after the sync was done the following settings are not changed:
root@dns02:~# diff /etc/adguard/config.yaml config.yaml
50c50
< all_servers: true SECONDARY
---
> all_servers: false PRIMARY
65c65
< cache_optimistic: true SECONDARY
---
> cache_optimistic: false PRIMARY
root@dns02:~#
From the SYNC config file:
# Configure sync features; by default all features are enabled.
features:
generalSettings: true
queryLogConfig: true
statsConfig: true
clientSettings: true
services: true
filters: true
dhcp:
serverConfig: false
staticLeases: true
dns:
serverConfig: true
accessLists: true
rewrites: true
Running the latest version from Docker.
Describe the bug
When running the docker to sync my adguard to an off site version it constantly throws bad request 400 error.
To Reproduce
Steps to reproduce the behavior:
cron: "*/10 * * * *"
origin:
url: https://ablock.sojab0on.nl
username: michel
password: xxxxxxxxx
replica:
url: http://172.17.0.8:81
username: michel
password: xxxxxxxxxx
#replicas:
api:
port: 8080
username: michel
password: xxxxxxxxxx
Expected behavior
the sync should run normally so the off site has the same settings as the onsite.
Log Files
If applicable, add log files or json responses from AdGuardHome to help explain your problem.
022-06-20T09:21:50.098-0400 INFO root cmd/root.go:114 Using config file:/config/adguardhome-sync.yaml
2022-06-20T09:21:50.102-0400 INFO sync sync/sync.go:30 AdGuardHome sync {"version": "0.4.3", "build": "2022-02-14T17:40:34Z"}
2022-06-20T09:21:50.103-0400 INFO sync sync/sync.go:50 Setup cronjob {"cron": "*/10 * * * *"}
2022-06-20T09:21:50.103-0400 INFO sync sync/http.go:54 Starting API server {"port": 8080}
2022-06-20T09:21:50.104-0400 INFO sync sync/sync.go:60 Running sync on startup
2022-06-20T09:21:51.402-0400 INFO sync sync/sync.go:189 Start sync {"from": "ablock.sojab0on.nl", "to": "172.17.0.8:81"}
2022-06-20T09:21:51.547-0400 INFO client client/client.go:230 Toggle parental {"host": "172.17.0.8:81", "enable": true}
2022-06-20T09:21:51.696-0400 INFO client client/client.go:230 Toggle safesearch {"host": "172.17.0.8:81", "enable": true}
2022-06-20T09:21:52.132-0400 INFO client client/client.go:248 Add filter {"host": "172.17.0.8:81", "url": "https://curben.gitlab.io/malware-filter/urlhaus-filter-agh-online.txt", "whitelist": false, "enabled": true}
2022-06-20T09:21:52.999-0400 ERROR sync sync/sync.go:225 Error syncing filters {"from": "ablock.sojab0on.nl", "to": "172.17.0.8:81", "error": "400 Bad Request"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:225
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:177
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:61
Direct API page log copy
Additional context
Add any other context about the problem here.
can you please have a look at the error below
2021-04-05T12:57:01.816+0200 ERROR sync sync/sync.go:104 Error getting origin filters {"from": "192.168.1.101:81", "error": "parsing time \"\"\"\" as \"\"2006-01-02T15:04:05Z07:00\"\": cannot parse \"\"\" as \"2006\""} github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync /root/go/pkg/mod/github.com/bakito/[email protected]/pkg/sync/sync.go:104 github.com/bakito/adguardhome-sync/pkg/sync.Sync.func1 /root/go/pkg/mod/github.com/bakito/[email protected]/pkg/sync/sync.go:24 github.com/robfig/cron/v3.FuncJob.Run /root/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136 github.com/robfig/cron/v3.(*Cron).startJob.func1 /root/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
Is your feature request related to a problem? Please describe.
When using auto initialise of an instance it should be possible to set the port of the UI as you can currently do in the normal setup wizard.
Describe the solution you'd like
A few things are possible:
In all 3 of the cases, if auto initialise is true and the adguard instance has not been initialised then the inital configuration and setup should take place at port 3000. I realise this will likely require some sort of probe to happen to figure out what port should be used for initial configuration.
Describe alternatives you've considered
Running the install manually and then not using the auto initialise feature.
Is your feature request related to a problem? Please describe.
Debugging e.g. network issues is a pain, when the docker image has no option to use some kind of terminal.
Describe the solution you'd like
It would be nice to have an image tag with an alpine extension. The new version would still use the normal scratch base image but the alpine tag would build on top of alpine.
Describe alternatives you've considered
Creating my own image but I want to share this feature.
Additional context
Hi,
I try to set up new installs of AGH on seperated hardware (PIs)
My main is a 3B+, AGH in docker, with 100-ish lists in the filter. That's also where I have AGH-sync installed in docker.
My secondary is a pi zero W, first with AGH in docher and it breaks once.
Then I installed AGH with apt directly and it broke again.
when I say brocken, everything is actually frozen, and I can ssh into the pi anymore.
At this moment, i have the logs below in AGH-sync and AGH-sync is displayed as running but the logs are frozen too.
Can you help please?
To Reproduce
Steps to reproduce the behavior:
n"}
2021-05-22T12:40:37.721Z INFO client client/client.go:228 Add filter {"host": "192.168.1.178", "url": "https://v.firebog.net/hosts/static/w3kbl.txt", "whitelist": false, "enabled": true}
2021-05-22T12:40:37.721Z DEBUG client client/client.go:133 do post {"host": "192.168.1.178", "method": "POST", "path": "/filtering/add_url", "username": "Nicolas"}
2021-05-22T12:40:39.362Z DEBUG client client/client.go:138 got response {"host": "192.168.1.178", "method": "POST", "path": "/filtering/add_url", "username": "Nicolas", "status": 200, "body": "OK 909 rules\n"}
2021-05-22T12:40:39.362Z INFO client client/client.go:228 Add filter {"host": "192.168.1.178", "url": "http://sysctl.org/cameleon/hosts", "whitelist": false, "enabled": true}
2021-05-22T12:40:39.362Z DEBUG client client/client.go:133 do post {"host": "192.168.1.178", "method": "POST", "path": "/filtering/add_url", "username": "Nicolas"}
2021-05-22T12:40:40.886Z DEBUG client client/client.go:138 got response {"host": "192.168.1.178", "method": "POST", "path": "/filtering/add_url", "username": "Nicolas", "status": 400, "body": "Couldn't fetch filter from url http://sysctl.org/cameleon/hosts: Get \"http://sysctl.org/cameleon/hosts\": couldn't do a GET request to 'https://dns10.quad9.net:443/dns-query', cause: Get \"https://dns10.quad9.net:443/dns-query?dns=Zw0BAAABAAAAAAAABnN5c2N0bANvcmcAAAEAAQ\": read tcp 192.168.1.178:40118->9.9.9.10:443: read: connection reset by peer\n"}
2021-05-22T12:40:40.887Z ERROR sync sync/sync.go:190 Error syncing filters {"from": "192.168.1.45", "to": "192.168.1.178", "error": "400 Bad Request"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:190
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:146
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/go/src/app/pkg/sync/sync.go:42
github.com/robfig/cron/v3.FuncJob.Run
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add log files or json responses from AdGuardHome to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
At least from AdGuard version 0.107.2 on the storage duration for logs can be set to 6hrs (0.25 days). If 6hrs are selected - even if logging is disabled at all - the sync fails with the following error:
ERROR sync sync/sync.go:143 Error getting query log config {"from": "x.x.x.x:xxxx", "error": "json: cannot unmarshal number 0.25 into Go struct field QueryLogConfig.interval of type int"}
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Support the new setting, change the used data format from int to float.
Log Files
see above
Additional context
none
Describe the bug
It appears that the version returned by the AdGuardHome API does not follow the usual pattern of v0.107.21
but returns 0.107.21
instead. As a result, the IsNewerThan
function result is inconsistant.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Log Files
2022-12-27T15:47:16.329+0100 INFO root cmd/root.go:118 Using config file:/config/adguardhome-sync.yaml
2022-12-27T15:47:16.329+0100 INFO sync sync/sync.go:29 AdGuardHome sync {"version": "0.4.10", "build": "2022-11-18T17:51:16Z"}
2022-12-27T15:47:16.329+0100 INFO sync sync/sync.go:55 Setup cronjob {"cron": "*/10 * * * *", "next-execution": "2022-12-27T15:50:00.000+0100"}
2022-12-27T15:47:16.330+0100 INFO sync sync/http.go:52 Starting API server {"port": 8080}
2022-12-27T15:47:16.330+0100 INFO sync sync/sync.go:65 Running sync on startup
2022-12-27T15:47:16.386+0100 INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.1.1", "version": "v0.107.21"}
2022-12-27T15:47:17.026+0100 INFO sync sync/sync.go:196 Start sync {"from": "192.168.1.1", "to": "192.168.1.2"}
2022-12-27T15:47:17.033+0100 INFO sync sync/sync.go:204 Connected to replica {"from": "192.168.1.1", "to": "192.168.1.2", "version": "0.107.21"}
2022-12-27T15:47:17.033+0100 ERROR sync sync/sync.go:207 Replica AdGuard Home version must be >= v0.107.0 {"from": "192.168.1.1", "to": "192.168.1.2", "error": null, "version": "0.107.21"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:207
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:66
Additional context
I initially tried to sync from an AdGuardHome instance in a FreeBDS jail (0.107.15
) to an AdGuardHome instance on an Ubuntu server (v0.107.21
).
I thought that those two version were incompatible, so I moved my primary DNS to the Ubuntu instance, and upgraded the FreeBDS one. When I tried to sync them again (both 0.107.21), I got the same error message.
http://192.168.1.1/control/status returns:
{"version":"v0.107.21","language":"","dns_addresses":["192.168.1.1","100.110.42.41"],"dns_port":53,"http_port":80,"protection_enabled":true,"dhcp_available":true,"running":true}
http://192.168.1.2/control/status returns:
{"version":"0.107.21","language":"","dns_addresses":["::1","fe80::1%lo0","127.0.0.1","192.168.1.2"],"dns_port":53,"http_port":80,"protection_enabled":true,"dhcp_available":true,"running":true}
Is your feature request related to a problem? Please describe.
No
Describe the solution you'd like
When the docker container starts, initiate the sync function.
Describe alternatives you've considered
I had to reduce the sync frequency if I was making changes.
Additional context
I ideally would want to keep the sync for 60 mins. If my server starts before the 60 mins cron job, I lose 1 sync. This would also help with testing changes.
Describe the bug
Sync fails. Used to work fine.
2022-09-07T06:30:10.394Z ERROR sync sync/sync.go:240 Error syncing clients {"from": "10.10.10.2:8081", "to": "10.10.10.5:8081", "error": "400 Bad Request"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:240
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:179
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/go/src/app/pkg/sync/sync.go:44
github.com/robfig/cron/v3.FuncJob.Run
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
To Reproduce
Steps to reproduce the behavior:
I'm getting bellow error. Could you please help to work around? Thank you.
2021-06-12T19:21:53.750Z INFO sync sync/http.go:65 Starting API server {"version": "v0.3.0-rc1", "port": 8080},
2021-06-12T19:22:55.636Z INFO root cmd/root.go:102 Using config file:/config/adguardhome-sync.yaml,
2021-06-12T19:22:55.638Z INFO sync sync/sync.go:48 Setup cronjob {"version": "v0.3.0-rc1", "cron": "*/10 * * * *"},
2021-06-12T19:22:55.639Z INFO sync sync/sync.go:56 Run on startup {"version": "v0.3.0-rc1"},
2021-06-12T19:22:56.520Z INFO sync sync/sync.go:181 Start sync {"from": "192.168.20.197:80", "to": "192.168.20.73:80"},
2021-06-12T19:22:59.573Z ERROR sync sync/sync.go:185 Error getting replica status {"from": "192.168.20.197:80", "to": "192.168.20.73:80", "error": "Get "http://192.168.20.73:80/control/status\": dial tcp 192.168.20.73:80: connect: no route to host"},
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo,
/go/src/app/pkg/sync/sync.go:185,
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync,
/go/src/app/pkg/sync/sync.go:168,
github.com/bakito/adguardhome-sync/pkg/sync.Sync,
/go/src/app/pkg/sync/sync.go:57,
github.com/bakito/adguardhome-sync/cmd.glob..func1,
/go/src/app/cmd/run.go:23,
github.com/spf13/cobra.(*Command).execute,
/go/pkg/mod/github.com/spf13/[email protected]/command.go:852,
github.com/spf13/cobra.(*Command).ExecuteC,
/go/pkg/mod/github.com/spf13/[email protected]/command.go:960,
github.com/spf13/cobra.(*Command).Execute,
/go/pkg/mod/github.com/spf13/[email protected]/command.go:897,
github.com/bakito/adguardhome-sync/cmd.Execute,
/go/src/app/cmd/root.go:60,�,
n,
/go/src/app/main.go:6,�
runtime.main,
/usr/local/go/src/runtime/proc.go:225,
2021-06-12T19:22:59.573Z INFO sync sync/http.go:65 Starting API server {"version": "v0.3.0-rc1", "port": 80},
Hi,
Is it possible to sync all DHCP settings, but do not enable the DHCP server on the REPLICA?
Currently it syncs all settings now, which is good, but it also enables the DHCP server on the REPLICA, which is not good, as it is not wise to have more then 1 running DHCP server on your LAN. (if they don't know from each other)
Thx, T
Describe the bug
400 Bad Request error syncing filters.
To Reproduce
Steps to reproduce the behavior:
# cron expression to run in daemon mode. (default; "" = runs only once)
cron: ""
# runs the synchronisation on startup
runOnStart: true
origin:
# url of the origin instance
url: http://172.16.0.2:81
# replica instance (optional, if only one)
replica:
# url of the replica instance
url: http://172.16.0.3
username: usr
password: psw
2021-06-02T19:29:43.627Z INFO sync sync/http.go:65 Starting API server {"version": "v0.3.0-rc1", "port": 8080}
2021-06-02T19:40:10.843Z INFO root cmd/root.go:102 Using config file:/config/adguardhome-sync.yaml
2021-06-02T19:40:10.844Z INFO sync sync/sync.go:56 Run on startup {"version": "v0.3.0-rc1"}
2021-06-02T19:40:10.933Z INFO sync sync/sync.go:181 Start sync {"from": "172.16.0.2:81", "to": "172.16.0.3"}
2021-06-02T19:40:11.436Z INFO client client/client.go:239 Add filter {"host": "172.16.0.3", "url": "https://hosts-file.net/ad_servers.txt", "whitelist": false, "enabled": false}
2021-06-02T19:40:11.969Z ERROR sync sync/sync.go:212 Error syncing filters {"from": "172.16.0.2:81", "to": "172.16.0.3", "error": "400 Bad Request"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:212
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:168
github.com/bakito/adguardhome-sync/pkg/sync.Sync
/go/src/app/pkg/sync/sync.go:57
github.com/bakito/adguardhome-sync/cmd.glob..func1
/go/src/app/cmd/run.go:23
github.com/spf13/cobra.(*Command).execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:852
github.com/spf13/cobra.(*Command).ExecuteC
/go/pkg/mod/github.com/spf13/[email protected]/command.go:960
github.com/spf13/cobra.(*Command).Execute
/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
github.com/bakito/adguardhome-sync/cmd.Execute
/go/src/app/cmd/root.go:60
�
n
/go/src/app/main.go:6
�
runtime.main
/usr/local/go/src/runtime/proc.go:225
2021-06-02T19:40:11.969Z INFO sync sync/http.go:65 Starting API server {"version": "v0.3.0-rc1", "port": 8080}
Could you add a feature to your project that disables all instances for a set period of time and then re-enables them?
That would be a really useful feature.
主adguard的上游DNS服务器配置如下:
119.29.29.29
168.95.192.1
192.168.10.10
我不想同步192.168.10.10,这个DNS仅限master可以访问到,其它adguard实例是无法访问192.16.10.10的。期待后续可以做个排除规则。
Describe the bug
A clear and concise description of what the bug is.
I am running an instance of adguard home on a raspberry pi and trying to sync that instance to 2 other replicas. All versions are set to the latest release. When I first ran the sync, I got errors relating to redirects - I found the answer to that in issue #59 . Once I added that env variable, I now am faced with an issue where it looks like it fails to detect the version to initialize the sync...after it detects the version
To Reproduce
Steps to reproduce the behavior:
Docker - Latest
v0.107.8
2022-08-03T03:40:05.953-0700 INFO sync sync/sync.go:191 Start sync {"from": "x.x.x.x", "to": "x.x.x.x"} 2022-08-03T03:40:05.964-0700 INFO sync sync/sync.go:199 Connected to replica {"from": "x.x.x.x", "to": "x.x.x.x", "version": "v0.107.8"} 2022-08-03T03:40:05.964-0700 ERROR sync sync/sync.go:202 Replica AdGuard Home version must be >= v0.107.0 {"from": "x.x.x.x", "to": "x.x.x.x", "error": null, "version": ""} github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo /home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:202 github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync /home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:179 github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2 /home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:44 github.com/robfig/cron/v3.FuncJob.Run /home/bakito/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136 github.com/robfig/cron/v3.(*Cron).startJob.func1 /home/bakito/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
Expected behavior
A clear and concise description of what you expected to happen.
To sync as expected as I am running the latest for Adguard-home and Adguardhome-sync docker containers with minimal configurations
Describe the bug
I have a two servers in docker behind traefik. Found via google search your amazing product.
Now trying to use - and faced with problem - I can't sync my two servers.
Most interesting thing - i tried to change the order of syncing - I had the same error
To Reproduce
Steps to reproduce the behavior:
runOnStart: true
origin:
# url of the origin instance
url: https://adguard-cat.my.org
# apiPath: define an api path if other than "/control"
# insecureSkipVerify: true # disable tls check
username: admin
password: *
# replica instance (optional, if only one)
replica:
# url of the replica instance
url: http://adguard-two.my.org
username: admin
password: *
# replicas instances (optional, if more than one)
replicas:
# Configure the sync API server, disabled if api port is 0
api:
# Port, default 8080
port: 8080
# if username and password are defined, basic auth is applied to the sync API.
#username:.
#password:.
features:
generalSettings: false
queryLogConfig: false
statsConfig: false
clientSettings: false
services: false
filters: false
dhcp:
serverConfig: false
staticLeases: false
dns:
serverConfig: true
accessLists: false
rewrites: false
Error getting replica status {"from": "adguard-two.my.org", "to": "adguard-one.my.org", "error": "Get \"https://adguard-one.catshome.name/control/status\": auto redirect is disabled"}
Error getting replica status {"from": "adguard-two.catshome.name", "to": "adguard-cat.catshome.name", "error": "Get \"https://adguard-cat.catshome.name/control/status\": auto redirect is disabled"}
curl
trace - no any 301 code at all - see in the curl-to-cat.log and curl-to-two.log.wget
(not posted here)Expected behavior
Replication is working
Log Files
from-two-to-cat.log
from-cat-to-two.log
Additional context
P.S. DNS names is changed, but it doesn't matter - it's official DNS and Let's Encrypt certs.
as all my apps are running as Docker apps,. would be great if you can create a Docker app
i've got new instances and cant make it work. Im getting an error when sync:
ive got two server:
1: BareMetal - adguard primary(origin)
2: CasaOS where docker is installed. (replica)
both srv are in different Vlans but connection is wokring between those vlans.
ERROR:
2022-12-04T17:37:02.157Z INFO root cmd/root.go:118 Using config file:/config/adguardhome-sync.yaml
2022-12-04T17:37:02.158Z INFO sync sync/sync.go:29 AdGuardHome sync {"version": "v0.4.10", "build": "2022-11-18T17:51:40Z"}
2022-12-04T17:37:02.158Z INFO sync types/features.go:70 Disabled features {"features": ["DHCP.ServerConfig", "DHCP.StaticLeases"]}
2022-12-04T17:37:02.158Z INFO sync sync/sync.go:55 Setup cronjob {"cron": "*/1 * * * *", "next-execution": "2022-12-04T17:38:00.000Z"}
2022-12-04T17:37:02.158Z INFO sync sync/http.go:52 Starting API server {"port": 443}
2022-12-04T17:37:02.159Z INFO sync sync/sync.go:65 Running sync on startup
2022-12-04T17:37:02.305Z INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.3.250:443", "version": "v0.107.19"}
2022-12-04T17:37:03.844Z INFO sync sync/sync.go:196 Start sync {"from": "192.168.3.250:443", "to": "10.192.168.254:3000"}
2022-12-04T17:37:33.863Z ERROR sync sync/sync.go:200 Error getting replica status {"from": "192.168.3.250:443", "to": "10.192.168.254:3000", "error": ": Get "http://10.192.168.254:3000/control/status\": dial tcp 10.192.168.254:3000: i/o timeout"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:200
github.com/bakito/adguardhome-sync/pkg/sync.(worker).sync
/go/src/app/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/go/src/app/pkg/sync/sync.go:66
2022-12-04T17:37:59.332Z INFO root cmd/root.go:118 Using config file:/config/adguardhome-sync.yaml
2022-12-04T17:37:59.333Z INFO sync sync/sync.go:29 AdGuardHome sync {"version": "v0.4.10", "build": "2022-11-18T17:51:40Z"}
2022-12-04T17:37:59.333Z INFO sync types/features.go:70 Disabled features {"features": ["DHCP.ServerConfig", "DHCP.StaticLeases"]}
2022-12-04T17:37:59.333Z INFO sync sync/sync.go:55 Setup cronjob {"cron": "/1 * * * *", "next-execution": "2022-12-04T17:38:00.000Z"}
2022-12-04T17:37:59.333Z INFO sync sync/http.go:52 Starting API server {"port": 3000}
2022-12-04T17:37:59.333Z INFO sync sync/sync.go:65 Running sync on startup
2022-12-04T17:37:59.480Z INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.3.250:443", "version": "v0.107.19"}
2022-12-04T17:38:00.001Z INFO sync sync/sync.go:87 Sync already running
2022-12-04T17:38:01.001Z INFO sync sync/sync.go:196 Start sync {"from": "192.168.3.250:443", "to": "10.192.168.254:3000"}
2022-12-04T17:38:31.003Z ERROR sync sync/sync.go:200 Error getting replica status {"from": "192.168.3.250:443", "to": "10.192.168.254:3000", "error": ": Get "http://10.192.168.254:3000/control/status\": dial tcp 10.192.168.254:3000: i/o timeout"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:200
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/go/src/app/pkg/sync/sync.go:66
2022-12-04T17:39:00.195Z INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.3.250:443", "version": "v0.107.19"}
2022-12-04T17:39:01.698Z INFO sync sync/sync.go:196 Start sync {"from": "192.168.3.250:443", "to": "10.192.168.254:3000"}
2022-12-04T17:39:31.699Z ERROR sync sync/sync.go:200 Error getting replica status {"from": "192.168.3.250:443", "to": "10.192.168.254:3000", "error": ": Get "http://10.192.168.254:3000/control/status\": dial tcp 10.192.168.254:3000: i/o timeout"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:200
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/go/src/app/pkg/sync/sync.go:49
github.com/robfig/cron/v3.FuncJob.Run
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
2022-12-04T17:40:00.161Z INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.3.250:443", "version": "v0.107.19"}
2022-12-04T17:40:01.650Z INFO sync sync/sync.go:196 Start sync {"from": "192.168.3.250:443", "to": "10.192.168.254:3000"}
2022-12-04T17:40:31.657Z ERROR sync sync/sync.go:200 Error getting replica status {"from": "192.168.3.250:443", "to": "10.192.168.254:3000", "error": ": Get "http://10.192.168.254:3000/control/status\": dial tcp 10.192.168.254:3000: i/o timeout"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:200
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/go/src/app/pkg/sync/sync.go:49
github.com/robfig/cron/v3.FuncJob.Run
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
2022-12-04T17:41:00.182Z INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.3.250:443", "version": "v0.107.19"}
2022-12-04T17:41:01.697Z INFO sync sync/sync.go:196 Start sync {"from": "192.168.3.250:443", "to": "10.192.168.254:3000"}
2022-12-04T17:41:31.699Z ERROR sync sync/sync.go:200 Error getting replica status {"from": "192.168.3.250:443", "to": "10.192.168.254:3000", "error": ": Get "http://10.192.168.254:3000/control/status\": dial tcp 10.192.168.254:3000: i/o timeout"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:200
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/go/src/app/pkg/sync/sync.go:49
github.com/robfig/cron/v3.FuncJob.Run
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
2022-12-04T17:42:00.176Z INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.3.250:443", "version": "v0.107.19"}
2022-12-04T17:42:01.675Z INFO sync sync/sync.go:196 Start sync {"from": "192.168.3.250:443", "to": "10.192.168.254:3000"}
2022-12-04T17:42:31.676Z ERROR sync sync/sync.go:200 Error getting replica status {"from": "192.168.3.250:443", "to": "10.192.168.254:3000", "error": ": Get "http://10.192.168.254:3000/control/status\": dial tcp 10.192.168.254:3000: i/o timeout"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/go/src/app/pkg/sync/sync.go:200
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/go/src/app/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2
/go/src/app/pkg/sync/sync.go:49
github.com/robfig/cron/v3.FuncJob.Run
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136
github.com/robfig/cron/v3.(*Cron).startJob.func1
/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
2022-12-04T17:43:00.184Z INFO sync sync/sync.go:113 Connected to origin {"from": "192.168.3.250:443", "version": "v0.107.19"}
2022-12-04T17:43:01.679Z INFO sync sync/sync.go:196 Start sync {"from": "192.168.3.250:443", "to": "10.192.168.254:3000"}
Is your feature request related to a problem? Please describe.
I would like to have full replica's of several AGH instances.
The current replication does not yet replicate the DNS Settings (Settings->DNS) and DHCP settings for instance. This means I still have to manually configure multiple AGH instances and manually keep them in sync.
Describe the solution you'd like
Either a full replica, or selectable replication settings. I have no idea if it would be a problem for some people if a replica is a full replica of the origin instance.
Describe alternatives you've considered
Manual sync is not an option regarding DHCP settings. Error prone...
Additional context
None.
Describe the bug
Using the linuxserver version and getting this error when I start up my instances I have one instance at 254 and another at 250 I am going from main 254 to 250 and updated the port on the second instance to 3000
. Both instances are install on bare metal raspberry pi's(3b+ and zero).
[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 50-config: executing...
[cont-init.d] 50-config: exited 0.
[cont-init.d] 90-custom-folders: executing...
[cont-init.d] 90-custom-folders: exited 0.
[cont-init.d] 99-custom-files: executing...
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
While parsing config: yaml: line 15: did not find expected key
To Reproduce
Steps to reproduce the behavior:
# cron expression to run in daemon mode. (default; "" = runs only once)
cron: "*/10 * * * *"
origin:
# url of the origin instance
url: http://10.0.2.254:3000
# apiPath: define an api path if other than "/control"
# insecureSkipVerify: true # disable tls check
username: redacted
password: redacted
# replica instance (optional, if only one)
replica:
# url of the replica instance
url: http://10.0.2.250:3000
username: redacted
password: redacted
# replicas instances (optional, if more than one)
replicas:
# url of the replica instance
#- url: http://192.168.1.3
# username: username
# password: password
#- url: http://192.168.1.4
# username: username
# password: password
# Configure the sync API server, disabled if api port is 0
api:
# Port, default 8080
port: 8080
# if username and password are defined, basic auth is applied to the sync API
username: redacted
password: redacted
While parsing config: yaml: line 15: did not find expected key
Expected behavior
A clear and concise description of what you expected to happen.
A smooth sync between two adguard instances without any errors.
Screenshots
If applicable, add log files or json responses from AdGuardHome to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
400 Bad Request when syncing filters
To Reproduce
Steps to reproduce the behavior:
# cron expression to run in daemon mode. (default; "" = runs only once)
cron: "*/10 * * * *"
# runs the synchronisation on startup
runOnStart: true
origin:
# url of the origin instance
url: https://10.0.20.8
# apiPath: define an api path if other than "/control"
# insecureSkipVerify: true # disable tls check
username: [REDACTED]
password: [REDACTED]
# replica instance (optional, if only one)
replica:
# url of the replica instance
url: https://10.0.20.9
username: [REDACTED]
password: [REDACTED]
# replicas instances (optional, if more than one)
#replicas:
# url of the replica instance
# - url: http://192.168.1.3
# username: username
# password: password
# - url: http://192.168.1.4
# username: username
# password: password
# autoSetup: true # if true, AdGuardHome is automatically initialized.
# Configure the sync API server, disabled if api port is 0
api:
# Port, default 8080
port: 8080
# if username and password are defined, basic auth is applied to the sync API
# username: username
# password: password
# Configure sync features; by default all features are enabled.
features:
generalSettings: true
queryLogConfig: true
statsConfig: true
clientSettings: true
services: true
filters: true
dhcp:
serverConfig: true
staticLeases: true
dns:
serverConfig: true
accessLists: true
rewrites: true
ERROR sync sync/sync.go:236 Error syncing filters {"from": "10.0.20.8", "to": "10.0.20.9", "error": "400 Bad Request"}
Expected behavior
This is the initial sync, I would expect the sync to complete successfully.
Log Files
2022-09-12T04:45:47.360Z INFO root cmd/root.go:118 Using config file:/opt/adguardhome-sync/adguardhome-sync.yaml
2022-09-12T04:45:47.363Z INFO sync sync/sync.go:31 AdGuardHome sync {"version": "0.4.6", "build": "2022-09-07T20:13:05Z"}
2022-09-12T04:45:47.364Z INFO sync sync/sync.go:57 Setup cronjob {"cron": "*/10 * * * *", "next-execution": "2022-09-12T04:50:00.000Z"}
2022-09-12T04:45:47.364Z INFO sync sync/http.go:52 Starting API server {"port": 8080}
2022-09-12T04:45:47.365Z INFO sync sync/sync.go:67 Running sync on startup
2022-09-12T04:45:47.471Z INFO sync sync/sync.go:115 Connected to origin {"from": "10.0.20.8", "version": "v0.107.12"}
2022-09-12T04:45:47.554Z INFO sync sync/sync.go:198 Start sync {"from": "10.0.20.8", "to": "10.0.20.9"}
2022-09-12T04:45:47.574Z INFO sync sync/sync.go:206 Connected to replica {"from": "10.0.20.8", "to": "10.0.20.9", "version": "v0.107.12"}
2022-09-12T04:45:47.616Z INFO client client/client.go:248 Add filter {"host": "10.0.20.9", "url": "https://github.com/AdAway/adaway.github.io/blob/master/hosts.txt", "whitelist": false, "enabled": true}
2022-09-12T04:45:48.296Z ERROR sync sync/sync.go:236 Error syncing filters {"from": "10.0.20.8", "to": "10.0.20.9", "error": "400 Bad Request"}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:236
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:186
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:68
Additional context:
TLS is configured for both instances and the servers (as well as client machines) trust the local CA certificate. Configuration was tested with insecureSkipVerify: true
but the result is the same
There is a hard coded "\" character in the URL generator for the origin status.
The Following configuration is unable to connect to an adguard instance:
origin:
# url of the origin instance
url: http://192.168.0.3:3000
apiPath: /control
# insecureSkipVerify: true # disable tls check
username: <user>
password: <password>
the result of all attempts puts the following:
{"from": "192.168.0.3:3000", "error": ": Get \"http://192.168.0.3:3000/control/status\": dial tcp 192.168.0.3:3000: connect: no route to host"}
As you can see, there is a "\" character being added to the URL path. I have verified that AdGuard does NOT support this URL and fails.
there should be no trailing slashes on the URL and the "/control/status" IS the correct URL.
Describe the bug
When I set up AdGuard Home in 2 separate Docker environments and then configured AdGuardHome-Sync on the primary instance, it synched as expected. Now, a couple of days later, it fails with a 404 error even though both AdGuard Home instances are online, and have not been changed.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would expect synching to work as it did initially..
Screenshots
If applicable, add log files or json responses from AdGuardHome to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
AdGuardHome replica version used in Home Assistant is not detected by AdGuardHomeSync
To Reproduce
Steps to reproduce the behavior:
# cron expression to run in daemon mode. (default; "" = runs only once)
cron: "*/10 * * * *"
# runs the synchronisation on startup
runOnStart: true
origin:
# url of the origin instance
url: http://192.168.2.X:3000
# apiPath: define an api path if other than "/control"
username: ***
password: ***
# replica instance (optional, if only one)
replica:
# url of the replica instance
url: http://192.168.2.Y:5353
username: ***
password: ***
# Configure the sync API server, disabled if api port is 0
api:
# Port, default 8080
port: 8080
# if username and password are defined, basic auth is applied to the sync API
# username: username
# password: password
# Configure sync features; by default all features are enabled.
features:
generalSettings: true
queryLogConfig: true
statsConfig: true
clientSettings: true
services: true
filters: true
dhcp:
serverConfig: true
staticLeases: true
dns:
serverConfig: true
accessLists: true
rewrites: true
2022-11-07T13:09:23.397+0100 INFO sync sync/sync.go:196 Start sync {"from": "192.168.2.X:3000", "to": "192.168.2.Y:5353"}
2022-11-07T13:09:23.431+0100 INFO sync sync/sync.go:204 Connected to replica {"from": "192.168.2.X:3000", "to": "192.168.2.Y:5353", "version": "v0.107.17"}
2022-11-07T13:09:23.431+0100 ERROR sync sync/sync.go:207 Replica AdGuard Home version must be >= v0.107.0 {"from": "192.168.2.X:3000", "to": "192.168.2.Y:5353", "error": null, "version": ""}
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).syncTo
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:207
github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:184
github.com/bakito/adguardhome-sync/pkg/sync.Sync.func3
/home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:66
Expected behavior
Have a successful sync
More context
Successful request to the replica in the /status path:
I installed using the go install method. I have my yaml config setup and working and can run 'adguardhome-sync run' and everything syncs. I tried running the adguardhome-sync run --cron "*/10 * * * *" command and then rebooting and my instances never sync. What am I missing?
Describe the bug
On sync the DNS server list is alphabetically sorted which makes the comments useless.
To Reproduce
Steps to reproduce the behavior:
DNS server list on AdGuard main:
# Global requests
https://security.cloudflare-dns.com/dns-query
# Home Lookups
[/lan/]10.100.255.1
[/home.lan/]10.100.255.1
# Offsite Larkhall
[/offsite.lan/]192.168.1.1
DNS Server list post sync on offsite Adguard
# Global requests
# Home Lookups
# Offsite Larkhall
[/lan/]10.100.255.1
[/home.lan/]10.100.255.1
[/offsite.lan/]192.168.1.1
https://security.cloudflare-dns.com/dns-query
Expected behavior
DNS servers to maintain the order they are entered on the main AdGuard server so the comments match.
I tried to update to 0.4.4. but I don't know where to look of the actual version running in indeed 0.4.4. . Any help appreciated.
When I run AdGuard Home, I keep getting a 403 Error
2022-06-11T10:46:00.010+0200 DEBUG client client/client.go:126 do get {"host": "192.169.0.140:3000", "method": "GET", "path": "status"} 2022-06-11T10:46:00.012+0200 DEBUG client client/client.go:138 got response {"host": "192.169.0.140:3000", "method": "GET", "path": "status", "status": 403, "body": "Forbidden"} 2022-06-11T10:46:00.012+0200 ERROR sync sync/sync.go:99 Error getting origin status {"from": "192.169.0.140:3000", "error": "403 Forbidden"} github.com/bakito/adguardhome-sync/pkg/sync.(*worker).sync /home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:99 github.com/bakito/adguardhome-sync/pkg/sync.Sync.func2 /home/bakito/go/src/github.com/bakito/adguardhome-sync/pkg/sync/sync.go:44 github.com/robfig/cron/v3.FuncJob.Run /home/bakito/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:136 github.com/robfig/cron/v3.(*Cron).startJob.func1 /home/bakito/go/pkg/mod/github.com/robfig/cron/[email protected]/cron.go:312
Is your feature request related to a problem? Please describe.
no
Describe the solution you'd like
I'd like an initial instance to be automatically set up.
Describe alternatives you've considered
setup manually via UI
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.