Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加gfw后启动不了,取消后成功启动 #147

Open
NoNameCanUse9 opened this issue Mar 2, 2024 · 3 comments
Open

添加gfw后启动不了,取消后成功启动 #147

NoNameCanUse9 opened this issue Mar 2, 2024 · 3 comments

Comments

@NoNameCanUse9
Copy link

Issue Details

如题 添加gfw后启动不了,取消后成功启动

  • Version of AdGuard Home luci:
    • v1.0-7
  • Version of AdGuard Home server:
    • v0.107.44
  • Operating system and version:

Screenshots

Screenshot:

image
1709375271371

log信息
2024/03/02 18:21:18.051652 26164#1 [error] parsing configuration file: parsing config file for upgrade: yaml: line 15: did not find expected key
2024/03/02 18:21:18.050078 26164#1 [debug] reading config file: /etc/AdGuardHome.yaml
2024/03/02 18:21:18.049520 26164#1 [debug] current working directory is /usr/bin/AdGuardHome
2024/03/02 18:21:18.048947 26164#1 [info] AdGuard Home, version v0.107.44

Additional Information

yaml文件
dns:
bind_hosts:
- 0.0.0.0
port: 533
anonymize_client_ip: false
ratelimit: 20
ratelimit_subnet_len_ipv4: 24
ratelimit_subnet_len_ipv6: 56
ratelimit_whitelist: []
refuse_any: true
upstream_dns:

  • '[/programaddstart/]#'
  • '[/programaddend/]#'
    • https://doh.pub/dns-query
    • https://dns.alidns.com/dns-query
      upstream_dns_file: ""
      bootstrap_dns:
    • 202.96.134.33
      fallback_dns: []
      upstream_mode: parallel
      fastest_timeout: 1s
      allowed_clients: []
      disallowed_clients: []
      blocked_hosts:
    • version.bind
    • id.server
    • hostname.bind
      trusted_proxies:
    • 127.0.0.0/8
    • ::1/128
      cache_size: 4194304
      cache_ttl_min: 0
      cache_ttl_max: 0
      cache_optimistic: false
      bogus_nxdomain: []
      aaaa_disabled: false
      enable_dnssec: false
      edns_client_subnet:
      custom_ip: ""
      enabled: false
      use_custom: false
      max_goroutines: 300
      handle_ddr: true
      ipset: []
      ipset_file: ""
      bootstrap_prefer_ipv6: false
      upstream_timeout: 10s
      private_networks: []
      use_private_ptr_resolvers: true
      local_ptr_upstreams: []
      use_dns64: false
      dns64_prefixes: []
      serve_http3: false
      use_http3_upstreams: false
      serve_plain_dns: true
@hbcraft
Copy link

hbcraft commented Jul 14, 2024

有解决方法了吗?

@NoNameCanUse9
Copy link
Author

有解决方法了吗?

没有,已经不用了,

@ggtony233
Copy link

ggtony233 commented Sep 24, 2024

/usr/share/AdGuardHome/gfw2adg.sh脚本的问题,yaml文件缩进不正确就会出现无法启动的情况,要么让开发者自己修改脚本搞定缩进的问题,要么把gfw的上游列表放到upstream_dns_file这个设置项里面
折腾一晚上搞明白了

if (white==0)
    {print("    - '\''[/"fin"/]"upst"'\''");}
else{
    print("    - '\''[/"fin"/]#'\''");}
}END{print("    - '\''[/programaddend/]#'\''")}' > /tmp/adguard.list
grep programaddstart $configpath
if [ "$?" == "0" ]; then
        sed -i '/programaddstart/,/programaddend/c\    - '\''\[\/programaddstart\/\]#'\''' $configpath
        sed -i '/programaddstart/'r/tmp/adguard.list $configpath
else
        sed -i '1i\    - '\''[/programaddstart/]#'\''' /tmp/adguard.list

找到上面说的脚本里的这段代码vim打开,我这里已经是改好的,没改的话可以直接复制拿去替换,也可以自己手动把所有的-减号前面再加两个空格就行

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants