Compare commits

...

2 Commits

Author SHA1 Message Date
vcordes 4ad0dfd5bc Merge branch 'urvishpatelce-main' 2025-09-03 16:05:59 +02:00
root 627d462a8e fixes 2025-09-01 16:40:37 +00:00
3 changed files with 5 additions and 8 deletions
+1 -2
View File
@@ -84,7 +84,7 @@ class LoginController
$ip = $lxd->getContainerIP($name); $ip = $lxd->getContainerIP($name);
$nginx = $lxd->getContainerServiceStatus($name, 'nginx'); $nginx = $lxd->getContainerServiceStatus($name, 'nginx');
$mysql = $lxd->getContainerServiceStatus($name, 'mysql'); $mysql = $lxd->getContainerServiceStatus($name, 'mariadb');
if ($ip && $nginx === 'active' && $mysql === 'active') { if ($ip && $nginx === 'active' && $mysql === 'active') {
// ---- CHANGED: do NOT return fields/creds here ---- // ---- CHANGED: do NOT return fields/creds here ----
@@ -145,4 +145,3 @@ class LoginController
} }
} }
+3 -5
View File
@@ -1,5 +1,4 @@
<?php <?php
// === Handle API requests === // === Handle API requests ===
$requestUri = $_SERVER['REQUEST_URI']; $requestUri = $_SERVER['REQUEST_URI'];
if (str_starts_with($requestUri, '/api/')) { if (str_starts_with($requestUri, '/api/')) {
@@ -43,8 +42,9 @@ if ($state !== 'Running') {
// === Get container IP === // === Get container IP ===
$ip = $lxd->getContainerIP($container); $ip = $lxd->getContainerIP($container);
$nginx = $lxd->getContainerServiceStatus($container, 'nginx'); $nginx = $lxd->getContainerServiceStatus($container, 'nginx');
$mysql = $lxd->getContainerServiceStatus($container, 'mysql'); $mysql = $lxd->getContainerServiceStatus($container, 'mariadb');
if (!$ip || $nginx !== 'active' || $mysql !== 'active') { if (!$ip || $nginx !== 'active' || $mysql !== 'active') {
redirect($waitingPage); redirect($waitingPage);
@@ -63,11 +63,9 @@ function redirect(string $to): void {
} }
function proxy(string $name, string $targetUrl): void { function proxy(string $name, string $targetUrl): void {
Proxy::$AUTH_KEY = $_ENV['AUTH_KEY'] ?? 'YOUR_DEFAULT_AUTH_KEY'; Proxy::$ENABLE_AUTH = false;
Proxy::$ENABLE_AUTH = true;
Proxy::$HEADER_HTTP_PROXY_AUTH = 'HTTP_PROXY_AUTH'; Proxy::$HEADER_HTTP_PROXY_AUTH = 'HTTP_PROXY_AUTH';
$_SERVER['HTTP_PROXY_AUTH'] = Proxy::$AUTH_KEY;
$_SERVER['HTTP_PROXY_TARGET_URL'] = $targetUrl; $_SERVER['HTTP_PROXY_TARGET_URL'] = $targetUrl;
$responseCode = Proxy::run(); $responseCode = Proxy::run();