fix adguard upstreams, new config

add reset settings adguard button
This commit is contained in:
mercury
2023-02-10 15:42:33 +04:00
parent 6e6cab5709
commit a06252d8f0
4 changed files with 32 additions and 3 deletions
+22
View File
@@ -110,6 +110,9 @@ class Bot
case preg_match('~^/adguardpsswd$~', $this->input['callback'], $m):
$this->adguardpsswd();
break;
case preg_match('~^/adguardreset$~', $this->input['callback'], $m):
$this->adguardreset();
break;
case preg_match('~^/addupstream$~', $this->input['callback'], $m):
$this->addupstream();
break;
@@ -697,6 +700,21 @@ class Bot
$this->menu('adguard');
}
public function adguardreset()
{
$out[] = 'Restart Adguard Home';
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
$out[] = $this->ssh("/AdGuardHome/AdGuardHome -s stop 2>&1", 'ad');
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
$c = yaml_parse_file('/config/AdGuardHome.yaml');
$this->sd($c);
yaml_emit_file('/config/adguard/AdGuardHome.yaml', $c);
$out[] = $this->ssh("/AdGuardHome/AdGuardHome -s start 2>&1", 'ad');
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
sleep(3);
$this->menu('adguard');
}
public function checkdns()
{
$r = $this->send(
@@ -1526,6 +1544,10 @@ DNS-over-HTTPS with IP:
'text' => 'change password',
'callback_data' => "/adguardpsswd",
],
[
'text' => 'reset settings',
'callback_data' => "/adguardreset",
],
],
];
$data[] = [
+5 -2
View File
@@ -1,6 +1,5 @@
bind_host: 0.0.0.0
bind_port: 80
beta_bind_port: 0
users:
- name: admin
password:
@@ -8,6 +7,7 @@ auth_attempts: 5
block_auth_min: 15
http_proxy: ""
language: ""
theme: auto
debug_pprof: false
web_session_ttl: 720
dns:
@@ -31,7 +31,8 @@ dns:
ratelimit_whitelist: []
refuse_any: true
upstream_dns:
- https://dns10.quad9.net/dns-query
- 1.1.1.1
- 8.8.8.8
upstream_dns_file: ""
bootstrap_dns:
- 9.9.9.10
@@ -78,6 +79,8 @@ dns:
private_networks: []
use_private_ptr_resolvers: true
local_ptr_upstreams: []
use_dns64: false
dns64_prefixes: []
serve_http3: false
use_http3_upstreams: false
tls:
+1
View File
@@ -46,6 +46,7 @@ services:
- ./config/clients.json:/config/clients.json
- ./config/pac.json:/config/pac.json
- ./config/unit.json:/config/unit.json
- ./config/AdGuardHome.yaml:/config/AdGuardHome.yaml
- ./config/nginx.conf:/config/nginx.conf
- ./config/ssserver.json:/config/ssserver.json
- ./config/sslocal.json:/config/sslocal.json
+4 -1
View File
@@ -1,4 +1,4 @@
from nginx:stable
from ubuntu:18.04
run apt update && \
apt install -y git net-tools lsof ssh wget && \
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.107.23/AdGuardHome_linux_amd64.tar.gz && \
@@ -6,3 +6,6 @@ tar -xf AdGuardHome_linux_amd64.tar.gz && \
mkdir -p /opt/adguardhome && \
mkdir /root/.ssh
copy config/AdGuardHome.yaml /opt/adguardhome/AdGuardHome.yaml
run wget https://github.com/ameshkov/dnslookup/releases/download/v1.8.1/dnslookup-linux-amd64-v1.8.1.tar.gz && \
tar -xf dnslookup-linux-amd64-v1.8.1.tar.gz
env PATH="$PATH:/linux-amd64"