From 4ccf1b49f8ddc4f985d837a01ecdb59408c05085 Mon Sep 17 00:00:00 2001 From: hasani Date: Mon, 10 Nov 2025 13:12:11 +0300 Subject: [PATCH 1/2] fix --- inc/VpnServer.php | 6 ++++-- templates/login.twig | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/inc/VpnServer.php b/inc/VpnServer.php index 78e07f9..8d6c11b 100644 --- a/inc/VpnServer.php +++ b/inc/VpnServer.php @@ -153,8 +153,9 @@ class VpnServer { */ private function testConnection(): bool { $testCommand = sprintf( - "sshpass -p '%s' ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no -o ConnectTimeout=10 %s@%s 'echo test' 2>/dev/null", + "sshpass -p '%s' ssh -p %d -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no -o ConnectTimeout=10 %s@%s 'echo test' 2>/dev/null", $this->data['password'], + $this->data['port'], $this->data['username'], $this->data['host'] ); @@ -173,8 +174,9 @@ class VpnServer { $escapedCommand = escapeshellarg($command); $sshCommand = sprintf( - "sshpass -p '%s' ssh -q -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no %s@%s %s 2>&1", + "sshpass -p '%s' ssh -p %d -q -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no %s@%s %s 2>&1", $this->data['password'], + $this->data['port'], $this->data['username'], $this->data['host'], $escapedCommand diff --git a/templates/login.twig b/templates/login.twig index d33dd5c..c08bef2 100644 --- a/templates/login.twig +++ b/templates/login.twig @@ -62,10 +62,6 @@ - -
-

Default credentials: admin@amnez.ia / admin123

-
{% endblock %} From f3751918b1e4ace874cfb40d05e6456a690db79d Mon Sep 17 00:00:00 2001 From: hasani Date: Mon, 10 Nov 2025 13:38:07 +0300 Subject: [PATCH 2/2] fix port --- inc/VpnClient.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/VpnClient.php b/inc/VpnClient.php index 1cf7732..29be1b9 100644 --- a/inc/VpnClient.php +++ b/inc/VpnClient.php @@ -120,8 +120,9 @@ class VpnClient { $escaped = escapeshellarg($cmd); $sshCmd = sprintf( - "sshpass -p '%s' ssh -q -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no %s@%s %s 2>&1", + "sshpass -p '%s' ssh -p %d -q -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no %s@%s %s 2>&1", $serverData['password'], + $serverData['port'], $serverData['username'], $serverData['host'], $escaped @@ -282,8 +283,9 @@ class VpnClient { $escapedCommand = escapeshellarg($command); $sshCommand = sprintf( - "sshpass -p '%s' ssh -q -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no %s@%s %s 2>&1", + "sshpass -p '%s' ssh -p %d -q -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o PreferredAuthentications=password -o PubkeyAuthentication=no %s@%s %s 2>&1", $serverData['password'], + $serverData['port'], $serverData['username'], $serverData['host'], $escapedCommand