chore(release): production build 2026-05-27 13:05
This commit is contained in:
@@ -1,17 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* HexaHost.de Konfiguration
|
||||
*
|
||||
* HINWEIS: Diese Datei ist veraltet!
|
||||
*
|
||||
* Die Konfiguration wurde nach mail-config.php verschoben.
|
||||
* Bitte verwenden Sie stattdessen:
|
||||
*
|
||||
* require_once 'config/mail-config.php';
|
||||
*
|
||||
* Diese Datei wird nur aus Kompatibilitätsgründen beibehalten.
|
||||
*/
|
||||
|
||||
// Lade die neue Konfiguration
|
||||
|
||||
|
||||
require_once __DIR__ . '/mail-config.php';
|
||||
?>
|
||||
|
||||
@@ -1,30 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* HexaHost.de Mail Configuration
|
||||
*
|
||||
* Dieses Projekt versendet E-Mails nativ über PHP mail().
|
||||
* Es sind keine externen Bibliotheken oder Composer-Installationen erforderlich.
|
||||
*/
|
||||
|
||||
// E-Mail Adressen
|
||||
define('SMTP_FROM_EMAIL', 'kontakt@hexahost.de'); // Absender-E-Mail
|
||||
define('SMTP_TO_EMAIL', 'info@hexahost.de'); // Empfänger-E-Mail für Kontaktformular
|
||||
|
||||
// Sicherheitseinstellungen
|
||||
define('ENABLE_CSRF_PROTECTION', true); // CSRF-Schutz aktivieren
|
||||
define('ENABLE_RATE_LIMITING', true); // Rate-Limiting aktivieren
|
||||
define('MAX_REQUESTS_PER_HOUR', 10); // Max. Anfragen pro Stunde
|
||||
|
||||
// Spam-Schutz Einstellungen
|
||||
define('ENABLE_SPAM_PROTECTION', true); // Spam-Schutz aktivieren
|
||||
define('MAX_MESSAGE_LENGTH', 5000); // Max. Nachrichtenlänge
|
||||
define('MIN_MESSAGE_LENGTH', 10); // Min. Nachrichtenlänge
|
||||
define('SMTP_FROM_EMAIL', 'kontakt@hexahost.de');
|
||||
define('SMTP_TO_EMAIL', 'info@hexahost.de');
|
||||
|
||||
|
||||
define('ENABLE_CSRF_PROTECTION', true);
|
||||
define('ENABLE_RATE_LIMITING', true);
|
||||
define('MAX_REQUESTS_PER_HOUR', 10);
|
||||
|
||||
|
||||
define('ENABLE_SPAM_PROTECTION', true);
|
||||
define('MAX_MESSAGE_LENGTH', 5000);
|
||||
define('MIN_MESSAGE_LENGTH', 10);
|
||||
|
||||
|
||||
define('DEBUG_MODE', false);
|
||||
define('LOG_EMAILS', true);
|
||||
|
||||
// Debug-Einstellungen (nur für Entwicklung)
|
||||
define('DEBUG_MODE', false); // Debug-Modus (true/false)
|
||||
define('LOG_EMAILS', true); // E-Mails loggen (true/false)
|
||||
|
||||
// Zusätzliche Sicherheitsheader
|
||||
define('ADDITIONAL_HEADERS', [
|
||||
'X-Mailer' => 'HexaHost.de Contact Form',
|
||||
'X-Priority' => '3',
|
||||
@@ -35,22 +30,22 @@ define('ADDITIONAL_HEADERS', [
|
||||
'Precedence' => 'bulk'
|
||||
]);
|
||||
|
||||
// Erlaubte Domains für E-Mail-Adressen (optional)
|
||||
|
||||
define('ALLOWED_EMAIL_DOMAINS', [
|
||||
// Leer lassen für alle Domains zu erlauben
|
||||
// 'gmail.com',
|
||||
// 'outlook.com',
|
||||
// 'web.de',
|
||||
// 'gmx.de'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
]);
|
||||
|
||||
// Blacklist für E-Mail-Adressen (optional)
|
||||
|
||||
define('BLACKLISTED_EMAILS', [
|
||||
// 'spam@example.com',
|
||||
// 'test@test.com'
|
||||
|
||||
|
||||
]);
|
||||
|
||||
// Überprüfung der E-Mail-Adressen
|
||||
|
||||
if (!filter_var(SMTP_FROM_EMAIL, FILTER_VALIDATE_EMAIL)) {
|
||||
die('Ungültige SMTP_FROM_EMAIL Adresse');
|
||||
}
|
||||
@@ -59,7 +54,7 @@ if (!filter_var(SMTP_TO_EMAIL, FILTER_VALIDATE_EMAIL)) {
|
||||
die('Ungültige SMTP_TO_EMAIL Adresse');
|
||||
}
|
||||
|
||||
// Logging-Funktion
|
||||
|
||||
function logEmail($type, $data) {
|
||||
if (!LOG_EMAILS) return;
|
||||
|
||||
@@ -76,18 +71,18 @@ function logEmail($type, $data) {
|
||||
file_put_contents($logFile, $logEntry, FILE_APPEND | LOCK_EX);
|
||||
}
|
||||
|
||||
// Hilfsfunktion für E-Mail-Validierung
|
||||
|
||||
function isValidEmail($email) {
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Prüfe Blacklist
|
||||
|
||||
if (in_array($email, BLACKLISTED_EMAILS)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Prüfe Domain-Whitelist (falls gesetzt)
|
||||
|
||||
if (!empty(ALLOWED_EMAIL_DOMAINS)) {
|
||||
$domain = substr(strrchr($email, "@"), 1);
|
||||
if (!in_array($domain, ALLOWED_EMAIL_DOMAINS)) {
|
||||
@@ -98,29 +93,23 @@ function isValidEmail($email) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Hilfsfunktion zum Abrufen der Konfiguration als Array
|
||||
* Kompatibilität mit contact-handler.php
|
||||
*
|
||||
* @param string|null $key Optional: einzelner Schlüssel
|
||||
* @return mixed Konfigurationsarray oder einzelner Wert
|
||||
*/
|
||||
|
||||
function getHexaHostConfig($key = null) {
|
||||
$config = [
|
||||
// Absender/Empfänger
|
||||
|
||||
'from_email' => SMTP_FROM_EMAIL,
|
||||
'from_name' => 'HexaHost.de Kontaktformular',
|
||||
'to_email' => SMTP_TO_EMAIL,
|
||||
'to_name' => 'HexaHost Support',
|
||||
|
||||
// Sicherheit
|
||||
|
||||
'max_requests_per_hour' => MAX_REQUESTS_PER_HOUR,
|
||||
'honeypot_field' => 'website',
|
||||
'enable_csrf' => ENABLE_CSRF_PROTECTION,
|
||||
'min_message_length' => MIN_MESSAGE_LENGTH,
|
||||
'max_message_length' => MAX_MESSAGE_LENGTH,
|
||||
|
||||
// Debug
|
||||
|
||||
'debug_mode' => DEBUG_MODE,
|
||||
'log_errors' => LOG_EMAILS,
|
||||
];
|
||||
|
||||
@@ -1,18 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* HexaHost.de Produkt-Konfiguration
|
||||
*
|
||||
* Hier können Sie alle Preise und Produktinformationen zentral verwalten.
|
||||
* Nach Änderungen: npm run build && npm run deploy
|
||||
*
|
||||
* Verwendung in PHP-Seiten:
|
||||
* require_once 'config/products-config.php';
|
||||
* $packages = getProductPackages('vpc');
|
||||
*/
|
||||
|
||||
// ============================================================================
|
||||
// VIRTUAL PRIVATE CONTAINER (VPC)
|
||||
// ============================================================================
|
||||
|
||||
|
||||
|
||||
|
||||
$PRODUCTS['vpc'] = [
|
||||
'name' => 'Virtual Private Container',
|
||||
'short_name' => 'VPC',
|
||||
@@ -112,9 +103,9 @@ $PRODUCTS['vpc'] = [
|
||||
],
|
||||
];
|
||||
|
||||
// ============================================================================
|
||||
// VIRTUAL PRIVATE SERVER (VPS)
|
||||
// ============================================================================
|
||||
|
||||
|
||||
|
||||
$PRODUCTS['vps'] = [
|
||||
'name' => 'Virtual Private Server',
|
||||
'short_name' => 'VPS',
|
||||
@@ -214,9 +205,9 @@ $PRODUCTS['vps'] = [
|
||||
],
|
||||
];
|
||||
|
||||
// ============================================================================
|
||||
// MAIL GATEWAY
|
||||
// ============================================================================
|
||||
|
||||
|
||||
|
||||
$PRODUCTS['mail-gateway'] = [
|
||||
'name' => 'Mail Gateway',
|
||||
'short_name' => 'Mail',
|
||||
@@ -316,9 +307,9 @@ $PRODUCTS['mail-gateway'] = [
|
||||
],
|
||||
];
|
||||
|
||||
// ============================================================================
|
||||
// WEBHOSTING
|
||||
// ============================================================================
|
||||
|
||||
|
||||
|
||||
$PRODUCTS['webhosting'] = [
|
||||
'name' => 'Webhosting',
|
||||
'short_name' => 'Webhosting',
|
||||
@@ -426,68 +417,52 @@ $PRODUCTS['webhosting'] = [
|
||||
],
|
||||
];
|
||||
|
||||
// ============================================================================
|
||||
// HILFSFUNKTIONEN
|
||||
// ============================================================================
|
||||
|
||||
/**
|
||||
* Alle Produkte abrufen
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
function getAllProducts() {
|
||||
global $PRODUCTS;
|
||||
return $PRODUCTS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ein Produkt abrufen
|
||||
*/
|
||||
|
||||
function getProduct($productId) {
|
||||
global $PRODUCTS;
|
||||
return $PRODUCTS[$productId] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alle Pakete eines Produkts abrufen
|
||||
*/
|
||||
|
||||
function getProductPackages($productId) {
|
||||
global $PRODUCTS;
|
||||
return $PRODUCTS[$productId]['packages'] ?? [];
|
||||
}
|
||||
|
||||
/**
|
||||
* Ein bestimmtes Paket abrufen
|
||||
*/
|
||||
|
||||
function getPackage($productId, $packageId) {
|
||||
global $PRODUCTS;
|
||||
return $PRODUCTS[$productId]['packages'][$packageId] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preis eines Pakets abrufen
|
||||
*/
|
||||
|
||||
function getPackagePrice($productId, $packageId) {
|
||||
$package = getPackage($productId, $packageId);
|
||||
return $package['price'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Minimalen Preis eines Produkts abrufen
|
||||
*/
|
||||
|
||||
function getMinPrice($productId) {
|
||||
global $PRODUCTS;
|
||||
return $PRODUCTS[$productId]['min_price'] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Preis formatiert ausgeben
|
||||
*/
|
||||
|
||||
function formatPrice($price, $withCurrency = true) {
|
||||
return $withCurrency ? $price . '€' : $price;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generiert HTML für eine Paket-Karte
|
||||
*/
|
||||
|
||||
function renderPackageCard($productId, $packageId, $package) {
|
||||
$featuredClass = $package['featured'] ? ' featured' : '';
|
||||
$featuredBadge = $package['featured'] ? '<div class="featured-badge">Beliebt</div>' : '';
|
||||
@@ -535,9 +510,7 @@ function renderPackageCard($productId, $packageId, $package) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Generiert HTML für alle Pakete eines Produkts
|
||||
*/
|
||||
|
||||
function renderAllPackages($productId) {
|
||||
$packages = getProductPackages($productId);
|
||||
$html = '';
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<!-- Cookie Consent Banner -->
|
||||
|
||||
<div id="cookieConsent" class="cookie-consent" role="dialog" aria-labelledby="cookieConsentTitle" aria-describedby="cookieConsentDesc">
|
||||
<div class="cookie-consent-container">
|
||||
<div class="cookie-consent-content">
|
||||
@@ -79,7 +79,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Erweiterte Cookie-Einstellungen (standardmäßig versteckt) -->
|
||||
|
||||
<div id="cookieSettingsPanel" class="cookie-settings-panel" style="display: none;">
|
||||
<div class="cookie-settings-content">
|
||||
<h4>Cookie-Einstellungen</h4>
|
||||
@@ -121,7 +121,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Google Analytics (GA4) mit Consent Mode -->
|
||||
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
function gtag(){dataLayer.push(arguments);}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Helper functions for HexaHost.de
|
||||
*/
|
||||
|
||||
// Sichere Session-Konfiguration
|
||||
|
||||
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
// Session-Cookie-Sicherheit
|
||||
|
||||
ini_set('session.cookie_httponly', 1);
|
||||
ini_set('session.cookie_secure', isset($_SERVER['HTTPS']) ? 1 : 0);
|
||||
ini_set('session.cookie_samesite', 'Strict');
|
||||
@@ -14,14 +12,14 @@ if (session_status() === PHP_SESSION_NONE) {
|
||||
|
||||
session_start();
|
||||
|
||||
// Session-ID regenerieren bei Login/wichtigen Aktionen (Schutz vor Session Fixation)
|
||||
|
||||
if (!isset($_SESSION['initiated'])) {
|
||||
session_regenerate_id(true);
|
||||
$_SESSION['initiated'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// PHP Error Display in Produktion deaktivieren
|
||||
|
||||
if (!defined('DEBUG_MODE') || !DEBUG_MODE) {
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
@@ -29,18 +27,11 @@ if (!defined('DEBUG_MODE') || !DEBUG_MODE) {
|
||||
ini_set('log_errors', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set page configuration and include header
|
||||
*
|
||||
* @param string $title The page title
|
||||
* @param string $description The page description
|
||||
* @param string $page The current page identifier
|
||||
* @param array $scripts Additional scripts to include
|
||||
*/
|
||||
|
||||
function includeHeader($title = '', $description = '', $page = '', $scripts = []) {
|
||||
global $page_title, $page_description, $current_page, $additional_scripts;
|
||||
|
||||
// Set page configuration from parameters
|
||||
|
||||
$page_title = !empty($title)
|
||||
? $title
|
||||
: 'HexaHost.de - Zuverlässiges Hosting aus Niederbayern';
|
||||
@@ -55,28 +46,22 @@ function includeHeader($title = '', $description = '', $page = '', $scripts = []
|
||||
include __DIR__ . '/header.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Include footer
|
||||
*/
|
||||
|
||||
function includeFooter() {
|
||||
include __DIR__ . '/footer.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate breadcrumb navigation
|
||||
*
|
||||
* @param array $breadcrumbs Array of breadcrumb items [['title' => 'Home', 'url' => 'index.html'], ...]
|
||||
*/
|
||||
|
||||
function generateBreadcrumbs($breadcrumbs) {
|
||||
echo '<div class="breadcrumb">';
|
||||
$last_index = count($breadcrumbs) - 1;
|
||||
|
||||
foreach ($breadcrumbs as $index => $item) {
|
||||
if ($index === $last_index) {
|
||||
// Last item (current page)
|
||||
|
||||
echo '<span>' . htmlspecialchars($item['title']) . '</span>';
|
||||
} else {
|
||||
// Link to other pages
|
||||
|
||||
echo '<a href="' . htmlspecialchars($item['url']) . '">' . htmlspecialchars($item['title']) . '</a>';
|
||||
echo '<span>/</span>';
|
||||
}
|
||||
@@ -84,11 +69,7 @@ function generateBreadcrumbs($breadcrumbs) {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate CSRF token for form security
|
||||
*
|
||||
* @return string CSRF token
|
||||
*/
|
||||
|
||||
function generateCSRFToken() {
|
||||
if (!isset($_SESSION['csrf_token'])) {
|
||||
$_SESSION['csrf_token'] = bin2hex(random_bytes(32));
|
||||
@@ -96,9 +77,7 @@ function generateCSRFToken() {
|
||||
return $_SESSION['csrf_token'];
|
||||
}
|
||||
|
||||
/**
|
||||
* CSRF-Token prüfen und nach Erfolg invalidieren (Replay-Schutz)
|
||||
*/
|
||||
|
||||
function validateCSRFToken($token) {
|
||||
if (!isset($_SESSION['csrf_token']) || !is_string($token)) {
|
||||
return false;
|
||||
@@ -110,16 +89,12 @@ function validateCSRFToken($token) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Werte für E-Mail-Header bereinigen (Header-Injection verhindern)
|
||||
*/
|
||||
|
||||
function sanitizeHeaderValue(string $value): string {
|
||||
return str_replace(["\r", "\n", "\0"], '', trim($value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Client-IP für Logging (Cloudflare / vertrauenswürdiger Reverse-Proxy)
|
||||
*/
|
||||
|
||||
function getClientIP(): string {
|
||||
if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])
|
||||
&& filter_var($_SERVER['HTTP_CF_CONNECTING_IP'], FILTER_VALIDATE_IP)) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- Performance: DNS Prefetch & Preconnect -->
|
||||
|
||||
<link rel="dns-prefetch" href="//fonts.googleapis.com">
|
||||
<link rel="dns-prefetch" href="//fonts.gstatic.com">
|
||||
<link rel="dns-prefetch" href="//cdn.hexahost.de">
|
||||
@@ -12,37 +12,37 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="preconnect" href="https://cdn.hexahost.de" crossorigin>
|
||||
|
||||
<!-- Performance: Preload kritischer Ressourcen -->
|
||||
|
||||
<link rel="preload" href="/assets/css/style.css" as="style">
|
||||
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" as="style">
|
||||
|
||||
<title><?php echo isset($page_title) ? htmlspecialchars($page_title) : 'HexaHost.de - Zuverlässiges Hosting aus Niederbayern'; ?></title>
|
||||
|
||||
<!-- SEO Meta Tags -->
|
||||
|
||||
<meta name="description" content="<?php echo isset($page_description) ? htmlspecialchars($page_description) : 'HexaHost.de - Zuverlässiges und preiswertes Hosting aus Niederbayern. VPS, VPC, Mail Gateway und Webhosting Lösungen.'; ?>">
|
||||
<meta name="robots" content="index, follow">
|
||||
<meta name="author" content="HexaHost.de">
|
||||
<meta name="theme-color" content="#0d0821">
|
||||
|
||||
<!-- Open Graph / Social Media -->
|
||||
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:site_name" content="HexaHost.de">
|
||||
<meta property="og:title" content="<?php echo isset($page_title) ? htmlspecialchars($page_title) : 'HexaHost.de'; ?>">
|
||||
<meta property="og:description" content="<?php echo isset($page_description) ? htmlspecialchars($page_description) : 'Zuverlässiges Hosting aus Niederbayern'; ?>">
|
||||
<meta property="og:locale" content="de_DE">
|
||||
|
||||
<!-- Main Stylesheets -->
|
||||
|
||||
<link rel="stylesheet" href="/assets/css/style.css">
|
||||
<link rel="stylesheet" href="/assets/css/custom.css">
|
||||
|
||||
<!-- Fonts -->
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Russo+One&family=Source+Sans+Pro:wght@300;400;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<!-- Favicon -->
|
||||
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
|
||||
<link rel="apple-touch-icon" href="/favicon.svg">
|
||||
|
||||
<!-- Canonical URL (falls gesetzt) -->
|
||||
|
||||
<?php if (isset($canonical_url)): ?>
|
||||
<link rel="canonical" href="<?php echo htmlspecialchars($canonical_url); ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user