Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3087bee82d | |||
| 96fbf5a3c3 |
+21
-1
@@ -271,6 +271,9 @@ class Bot
|
||||
case preg_match('~^/addOcUser$~', $this->input['callback'], $m):
|
||||
$this->addOcUser();
|
||||
break;
|
||||
case preg_match('~^/changeOcExpose$~', $this->input['callback'], $m):
|
||||
$this->changeOcExpose();
|
||||
break;
|
||||
case preg_match('~^/addXrUser$~', $this->input['callback'], $m):
|
||||
$this->addXrUser();
|
||||
break;
|
||||
@@ -4129,7 +4132,9 @@ DNS-over-HTTPS with IP:
|
||||
preg_match('~^camouflage_secret[^\n]+?"([^"]+)*"~sm', $ocserv, $m);
|
||||
$cs = $m[1];
|
||||
preg_match('~^dns = ([^\n]+)~sm', $ocserv, $m);
|
||||
$dns = $m[1];
|
||||
$dns = $m[1];
|
||||
preg_match('~^expose-iroutes = (true)~sm', $ocserv, $m);
|
||||
$expose = $m[1];
|
||||
$pass = htmlspecialchars($pac['ocserv']);
|
||||
$text[] = "Menu -> OpenConnect";
|
||||
if (!empty($m[1])) {
|
||||
@@ -4150,6 +4155,12 @@ DNS-over-HTTPS with IP:
|
||||
'callback_data' => "/changeOcDns",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('expose-iroutes') . ' ' . $this->i18n($expose ? 'on' : 'off'),
|
||||
'callback_data' => "/changeOcExpose",
|
||||
],
|
||||
];
|
||||
$data[] = [
|
||||
[
|
||||
'text' => $this->i18n('add peer'),
|
||||
@@ -4177,6 +4188,15 @@ DNS-over-HTTPS with IP:
|
||||
];
|
||||
}
|
||||
|
||||
public function changeOcExpose()
|
||||
{
|
||||
$c = file_get_contents('/config/ocserv.conf');
|
||||
preg_match('~^expose-iroutes = ([^\n]+)~sm', $c, $m);
|
||||
$t = preg_replace('~^expose-iroutes[^\n]+~sm', "expose-iroutes = " . ($m[1] == 'true' ? 'false' : 'true'), $c);
|
||||
$this->restartOcserv($t);
|
||||
$this->menu('oc');
|
||||
}
|
||||
|
||||
public function deloc($i)
|
||||
{
|
||||
$clients = $this->getClientsOc();
|
||||
|
||||
@@ -341,4 +341,8 @@ $i = [
|
||||
'en' => 'fake html',
|
||||
'ru' => 'фейк заглушка',
|
||||
],
|
||||
'expose-iroutes' => [
|
||||
'en' => 'expose-iroutes',
|
||||
'ru' => 'изоляция клиентов',
|
||||
],
|
||||
];
|
||||
|
||||
+1
-1
@@ -584,7 +584,7 @@ route = default
|
||||
# When set to true, all client's iroutes are made visible to all
|
||||
# connecting clients except for the ones offering them. This option
|
||||
# only makes sense if config-per-user is set.
|
||||
#expose-iroutes = true
|
||||
expose-iroutes = false
|
||||
|
||||
# Groups that a client is allowed to select from.
|
||||
# A client may belong in multiple groups, and in certain use-cases
|
||||
|
||||
@@ -462,6 +462,11 @@ services:
|
||||
default:
|
||||
ipv4_address: 10.10.0.11
|
||||
logging: *default-logging
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.50'
|
||||
memory: 200M
|
||||
np:
|
||||
image: mercurykd/vpnbot-np:1.1
|
||||
build:
|
||||
|
||||
Reference in New Issue
Block a user