Revert main to dev deployment model: remove bootstrap and use ../backend/ paths

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
smueller
2026-05-22 14:10:21 +02:00
parent 8afba16905
commit d0e5baa443
33 changed files with 76 additions and 1671 deletions

View File

@@ -3,67 +3,6 @@
* Helper functions for HexaHost.de
*/
$configDir = defined('HEXAHOST_CONFIG_DIR')
? HEXAHOST_CONFIG_DIR
: __DIR__ . '/../config';
$siteConfigFile = $configDir . '/site-config.php';
if (is_file($siteConfigFile)) {
require_once $siteConfigFile;
} elseif (!function_exists('getSiteHost')) {
define('SITE_DOMAIN_PRODUCTION', 'hexahost.de');
define('SITE_DOMAIN_DEVELOPMENT', 'dev.hexahost.de');
function getSiteHost()
{
$host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : SITE_DOMAIN_PRODUCTION;
$host = strtolower($host);
if (strpos($host, ':') !== false) {
$host = explode(':', $host, 2)[0];
}
return $host;
}
function isDevelopmentSite()
{
return getSiteHost() === SITE_DOMAIN_DEVELOPMENT;
}
function getSiteBaseUrl()
{
$https = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
|| (isset($_SERVER['SERVER_PORT']) && (int) $_SERVER['SERVER_PORT'] === 443);
return ($https ? 'https' : 'http') . '://' . getSiteHost();
}
function getAllowedOrigins()
{
return [
'https://' . SITE_DOMAIN_PRODUCTION,
'https://www.' . SITE_DOMAIN_PRODUCTION,
'https://' . SITE_DOMAIN_DEVELOPMENT,
'http://localhost',
'http://127.0.0.1',
'http://localhost:8000',
];
}
function getCanonicalBaseUrl()
{
return 'https://' . SITE_DOMAIN_PRODUCTION;
}
}
// Fehleranzeige auf Dev/localhost für einfacheres Debugging
$hexahostHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
if (
(function_exists('isDevelopmentSite') && isDevelopmentSite())
|| preg_match('/^(localhost|127\.0\.0\.1)(:\d+)?$/', $hexahostHost)
) {
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
}
// Sichere Session-Konfiguration
if (session_status() === PHP_SESSION_NONE) {
// Session-Cookie-Sicherheit
@@ -112,11 +51,6 @@ function includeHeader($title = '', $description = '', $page = '', $scripts = []
$current_page = $page;
$additional_scripts = $scripts;
if (!isset($canonical_url)) {
$requestPath = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH) ?: '/';
$canonical_url = rtrim(getCanonicalBaseUrl(), '/') . $requestPath;
}
include __DIR__ . '/header.php';
}
@@ -161,3 +95,4 @@ function generateCSRFToken() {
}
return $_SESSION['csrf_token'];
}
?>

View File

@@ -1,8 +1,4 @@
<!DOCTYPE html>
<?php
$configDir = defined('HEXAHOST_CONFIG_DIR') ? HEXAHOST_CONFIG_DIR : __DIR__ . '/../config';
require_once $configDir . '/products-config.php';
?>
<html lang="de">
<head>
<meta charset="UTF-8">
@@ -65,12 +61,8 @@ require_once $configDir . '/products-config.php';
<li class="nav-dropdown">
<a href="#" class="nav-link <?php echo (in_array($current_page, ['vpc', 'vps', 'mail-gateway', 'webhosting'])) ? 'active' : ''; ?>">Produkte</a>
<ul class="dropdown-menu">
<?php if (isProductVisible('vpc')): ?>
<li><a href="/vpc" class="<?php echo ($current_page === 'vpc') ? 'active' : ''; ?>">Virtual Private Container</a></li>
<?php endif; ?>
<?php if (isProductVisible('vps')): ?>
<li><a href="/vps" class="<?php echo ($current_page === 'vps') ? 'active' : ''; ?>">Virtual Private Server</a></li>
<?php endif; ?>
<li><a href="/mail-gateway" class="<?php echo ($current_page === 'mail-gateway') ? 'active' : ''; ?>">Mail Gateway</a></li>
<li><a href="/webhosting" class="<?php echo ($current_page === 'webhosting') ? 'active' : ''; ?>">Webhosting</a></li>
</ul>