From 627d462a8ef116b5d380304fd49bbc89827fdd73 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 1 Sep 2025 16:40:37 +0000 Subject: [PATCH] fixes --- api/public/index.php | 2 +- api/src/Controllers/LoginController.php | 4 ++-- api/src/Services/LxdService.php | 4 +++- index.php | 10 ++++------ 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/api/public/index.php b/api/public/index.php index 9fef4d0..d1ec258 100644 --- a/api/public/index.php +++ b/api/public/index.php @@ -25,7 +25,7 @@ $domain = $_ENV['MAIN_COOKIE_DOMAIN'] ?? '.lxdapp.local'; session_set_cookie_params([ 'lifetime' => 0, 'path' => '/', - 'domain' => $domain, +// 'domain' => $domain, 'secure' => false, // set true if using HTTPS 'httponly' => true, 'samesite' => 'Lax', diff --git a/api/src/Controllers/LoginController.php b/api/src/Controllers/LoginController.php index 075b82c..49b4af4 100644 --- a/api/src/Controllers/LoginController.php +++ b/api/src/Controllers/LoginController.php @@ -108,7 +108,7 @@ class LoginController $ip = $lxd->getContainerIP($name); $nginx = $lxd->getContainerServiceStatus($name, 'nginx'); - $mysql = $lxd->getContainerServiceStatus($name, 'mysql'); + $mysql = $lxd->getContainerServiceStatus($name, 'mariadb'); if ($ip && $nginx === 'active' && $mysql === 'active') { // ---- CHANGED: do NOT return fields/creds here ---- @@ -167,4 +167,4 @@ class LoginController return in_array($path, $allow, true) ? $path : '/login'; } } - \ No newline at end of file + diff --git a/api/src/Services/LxdService.php b/api/src/Services/LxdService.php index 6fdef64..9345895 100644 --- a/api/src/Services/LxdService.php +++ b/api/src/Services/LxdService.php @@ -36,6 +36,7 @@ class LxdService curl_setopt($ch, CURLOPT_SSLCERT, $clientCert); curl_setopt($ch, CURLOPT_SSLKEY, $clientKey); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); @@ -84,6 +85,7 @@ class LxdService curl_setopt($ch, CURLOPT_SSLCERT, $clientCert); curl_setopt($ch, CURLOPT_SSLKEY, $clientKey); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET'); @@ -244,4 +246,4 @@ class LxdService } -} \ No newline at end of file +} diff --git a/index.php b/index.php index 47733c3..7d5f21c 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,4 @@ getContainerIP($container); + $nginx = $lxd->getContainerServiceStatus($container, 'nginx'); -$mysql = $lxd->getContainerServiceStatus($container, 'mysql'); +$mysql = $lxd->getContainerServiceStatus($container, 'mariadb'); if (!$ip || $nginx !== 'active' || $mysql !== 'active') { redirect($waitingPage); } // === Proxy to container === -proxy($container, "http://{$ip}{$requestUri}"); +proxy($container, "http://{$host}{$requestUri}"); exit; @@ -63,11 +63,9 @@ function redirect(string $to): void { } function proxy(string $name, string $targetUrl): void { - Proxy::$AUTH_KEY = $_ENV['AUTH_KEY'] ?? 'YOUR_DEFAULT_AUTH_KEY'; - Proxy::$ENABLE_AUTH = true; + Proxy::$ENABLE_AUTH = false; Proxy::$HEADER_HTTP_PROXY_AUTH = 'HTTP_PROXY_AUTH'; - $_SERVER['HTTP_PROXY_AUTH'] = Proxy::$AUTH_KEY; $_SERVER['HTTP_PROXY_TARGET_URL'] = $targetUrl; $responseCode = Proxy::run();