upgrade domain
Some checks failed
Deploy / deploy-staging (push) Failing after 28s
Deploy / deploy-production (push) Has been skipped

This commit is contained in:
2026-04-13 01:36:20 +02:00
parent dc7373fc08
commit aea4e9fa5f
9 changed files with 12 additions and 33 deletions

View File

@@ -7,25 +7,11 @@ use Modules\MiningChecker\Support\DebugState as MiningDebugState;
// boot application (config, autoload, services)
require_once __DIR__ . '/../config/fileload.php';
// Access-Protection (Basic Auth)
$uriPath = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/';
$uriPath = preg_replace('~/{2,}~', '/', $uriPath);
$uriPath = trim($uriPath, '/');
$projectRoot = dirname(__DIR__);
$auth = app()->auth();
$isRetoolPath = ($uriPath === 'retool' || str_starts_with($uriPath, 'retool/'));
if (defined('APP_BASIC_AUTH') && APP_BASIC_AUTH && !$isRetoolPath) {
$authUser = getenv('STAGING_AUTH_USER') ?: 'staging';
$authPass = getenv('STAGING_AUTH_PASS') ?: 'staging123';
$user = $_SERVER['PHP_AUTH_USER'] ?? null;
$pass = $_SERVER['PHP_AUTH_PW'] ?? null;
if ($user !== $authUser || $pass !== $authPass) {
header('WWW-Authenticate: Basic realm="Staging"');
header('HTTP/1.0 401 Unauthorized');
echo 'Unauthorized';
exit;
}
}
// OIDC Auth
$publicPaths = [