Compare commits
2 Commits
main
..
4ad0dfd5bc
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ad0dfd5bc | |||
| 627d462a8e |
@@ -84,7 +84,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 ----
|
||||
@@ -145,4 +145,3 @@ class LoginController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
// === Handle API requests ===
|
||||
$requestUri = $_SERVER['REQUEST_URI'];
|
||||
if (str_starts_with($requestUri, '/api/')) {
|
||||
@@ -43,8 +42,9 @@ if ($state !== 'Running') {
|
||||
|
||||
// === Get container IP ===
|
||||
$ip = $lxd->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);
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user