backup dnstt keys
This commit is contained in:
+11
@@ -1834,6 +1834,10 @@ class Bot
|
|||||||
'private' => file_get_contents('/certs/cert_private'),
|
'private' => file_get_contents('/certs/cert_private'),
|
||||||
'public' => file_get_contents('/certs/cert_public'),
|
'public' => file_get_contents('/certs/cert_public'),
|
||||||
] : false,
|
] : false,
|
||||||
|
'dnstt' => file_exists('/config/dnstt/server.key') ? [
|
||||||
|
'private' => file_get_contents('/config/dnstt/server.key'),
|
||||||
|
'public' => file_get_contents('/config/dnstt/server.pub'),
|
||||||
|
] : false,
|
||||||
'mtproto' => file_get_contents('/config/mtprotosecret'),
|
'mtproto' => file_get_contents('/config/mtprotosecret'),
|
||||||
'mtprotodomain' => file_get_contents('/config/mtprotodomain'),
|
'mtprotodomain' => file_get_contents('/config/mtprotodomain'),
|
||||||
'xray' => $this->getXray(),
|
'xray' => $this->getXray(),
|
||||||
@@ -1986,6 +1990,13 @@ class Bot
|
|||||||
$this->setUpstreamDomainOcserv($json['pac']['domain']);
|
$this->setUpstreamDomainOcserv($json['pac']['domain']);
|
||||||
$this->setUpstreamDomainNaive($json['pac']['domain']);
|
$this->setUpstreamDomainNaive($json['pac']['domain']);
|
||||||
}
|
}
|
||||||
|
// dnstt
|
||||||
|
if (!empty($json['dnstt'])) {
|
||||||
|
$out[] = 'update dnstt certificates';
|
||||||
|
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
||||||
|
file_put_contents('/config/dnstt/server.key', $json['dnstt']['private']);
|
||||||
|
file_put_contents('/config/dnstt/server.pub', $json['dnstt']['public']);
|
||||||
|
}
|
||||||
// nginx
|
// nginx
|
||||||
$out[] = 'reset nginx';
|
$out[] = 'reset nginx';
|
||||||
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
$this->update($this->input['chat'], $this->input['message_id'], implode("\n", $out));
|
||||||
|
|||||||
Reference in New Issue
Block a user