From ded8778b6c2c9103cfbbbe0f2db0edc27d15a3f3 Mon Sep 17 00:00:00 2001 From: gitea-actions Date: Fri, 29 May 2026 09:04:26 +0000 Subject: [PATCH] chore(release): obfuscate and hash production assets [skip ci] --- .githooks/commit-msg | 29 ++++++++++++++++ .gitignore | 1 + .gitmessage | 16 +++++++++ backend/config/mail-config.php | 2 +- backend/config/products-config.php | 33 +++++++++++++++++++ backend/includes/footer.php | 12 +++---- backend/includes/functions.php | 2 ++ backend/includes/header.php | 10 +++--- public/assets/js/contact.0551e1762627.js | 1 + public/assets/js/contact.2511c5f0041c.js | 1 - .../assets/js/cookie-consent.0d0ba07ffb63.js | 1 + .../assets/js/cookie-consent.da9d2eb69283.js | 1 - public/assets/js/main.0b4f5bbc39a7.js | 1 + public/assets/js/main.1342420b5948.js | 1 - public/contact.php | 2 +- public/index.php | 6 ++-- public/robots.txt | 4 +-- scripts/setup-git-hooks.ps1 | 17 ++++++++++ 18 files changed, 119 insertions(+), 21 deletions(-) create mode 100644 .githooks/commit-msg create mode 100644 .gitmessage create mode 100644 public/assets/js/contact.0551e1762627.js delete mode 100644 public/assets/js/contact.2511c5f0041c.js create mode 100644 public/assets/js/cookie-consent.0d0ba07ffb63.js delete mode 100644 public/assets/js/cookie-consent.da9d2eb69283.js create mode 100644 public/assets/js/main.0b4f5bbc39a7.js delete mode 100644 public/assets/js/main.1342420b5948.js create mode 100644 scripts/setup-git-hooks.ps1 diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100644 index 0000000..774abfa --- /dev/null +++ b/.githooks/commit-msg @@ -0,0 +1,29 @@ +#!/bin/sh +# Validiert Commit-Messages nach Conventional Commits +# https://www.conventionalcommits.org/ + +commit_msg_file="$1" + +first_line=$(sed '/^#/d;/^$/d' "$commit_msg_file" | head -n 1) + +# Merge/Revert von Git erlauben +case "$first_line" in + Merge\ *|Revert\ *) + exit 0 + ;; +esac + +pattern='^(feat|fix|docs|style|refactor|perf|test|build|ci|chore)(\([a-z0-9._-]+\))?!?: .+' + +if ! printf '%s\n' "$first_line" | grep -qE "$pattern"; then + echo >&2 "❌ Commit-Message entspricht nicht Conventional Commits." + echo >&2 "" + echo >&2 " Format: type(scope): description" + echo >&2 " Beispiel: feat(products): hide vpc in navigation" + echo >&2 "" + echo >&2 " Erlaubte types: feat, fix, docs, style, refactor, perf, test, build, ci, chore" + echo >&2 " Überspringen: git commit --no-verify" + exit 1 +fi + +exit 0 diff --git a/.gitignore b/.gitignore index ba0d4e7..2a6d516 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ build/ # Environment variables .env .cursorrules +.cursor/ .cursorrules.txt .env.local .env.development.local diff --git a/.gitmessage b/.gitmessage new file mode 100644 index 0000000..d095b9e --- /dev/null +++ b/.gitmessage @@ -0,0 +1,16 @@ +# Conventional Commits – nur die erste nicht-kommentierte Zeile wird verwendet +# Format: type(scope): description +# +# feat Neues Feature +# fix Bugfix +# docs Dokumentation +# style Formatierung (keine Logik) +# refactor Umbau ohne Feature/Fix +# perf Performance +# test Tests +# build Build / Dependencies +# ci CI/CD +# chore Sonstiges +# +# Beispiel (diese Zeile anpassen und Kommentare löschen oder stehen lassen): +# feat(products): hide vpc and vps in navigation diff --git a/backend/config/mail-config.php b/backend/config/mail-config.php index 99c398b..275d361 100644 --- a/backend/config/mail-config.php +++ b/backend/config/mail-config.php @@ -13,7 +13,7 @@ define('SMTP_TO_EMAIL', 'info@hexahost.de'); define('ENABLE_CSRF_PROTECTION', true); define('ENABLE_RATE_LIMITING', true); -define('MAX_REQUESTS_PER_HOUR', 10); +define('MAX_REQUESTS_PER_HOUR', 5); define('ENABLE_SPAM_PROTECTION', true); diff --git a/backend/config/products-config.php b/backend/config/products-config.php index 567e1ba..af56217 100644 --- a/backend/config/products-config.php +++ b/backend/config/products-config.php @@ -444,12 +444,45 @@ $PRODUCTS['webhosting'] = [ ]; +$PRODUCT_VISIBILITY = [ + 'vpc' => false, + 'vps' => false, + 'mail-gateway' => false, + 'webhosting' => true, +]; + + +function isProductVisible(string $productId): bool { + global $PRODUCT_VISIBILITY; + return $PRODUCT_VISIBILITY[$productId] ?? true; +} + + + + +function productHiddenAttr(string $productId): string { + return isProductVisible($productId) ? '' : ' hidden'; +} + + + + + + +function getVisibleProductPageIds(): array { + global $PRODUCT_VISIBILITY; + return array_keys(array_filter($PRODUCT_VISIBILITY, static fn(bool $visible): bool => $visible)); +} + + + + function getAllProducts() { global $PRODUCTS; return $PRODUCTS; diff --git a/backend/includes/footer.php b/backend/includes/footer.php index b775cf9..a94f728 100644 --- a/backend/includes/footer.php +++ b/backend/includes/footer.php @@ -15,10 +15,10 @@
-
+
>
@@ -74,7 +74,7 @@ includeHeader($page_title, $page_description, $current_page); Mehr erfahren
-
+
>
@@ -92,7 +92,7 @@ includeHeader($page_title, $page_description, $current_page); Mehr erfahren
-
+
>
diff --git a/public/robots.txt b/public/robots.txt index 50871d0..b3e7e34 100644 --- a/public/robots.txt +++ b/public/robots.txt @@ -7,8 +7,8 @@ Disallow: /assets/css/ # Allow CSS and JS files for better SEO Allow: /assets/css/style.d01979e8c871.css -Allow: /assets/js/main.1342420b5948.js -Allow: /assets/js/contact.2511c5f0041c.js +Allow: /assets/js/main.0b4f5bbc39a7.js +Allow: /assets/js/contact.0551e1762627.js # Sitemap location Sitemap: https://hexahost.de/sitemap.xml diff --git a/scripts/setup-git-hooks.ps1 b/scripts/setup-git-hooks.ps1 new file mode 100644 index 0000000..ce4d542 --- /dev/null +++ b/scripts/setup-git-hooks.ps1 @@ -0,0 +1,17 @@ +# Einmal pro Clone ausführen: Commit-Template + Conventional-Commits-Hook aktivieren +$ErrorActionPreference = "Stop" +$repoRoot = Resolve-Path (Join-Path $PSScriptRoot "..") + +Push-Location $repoRoot +try { + git config --local commit.template .gitmessage + git config --local core.hooksPath .githooks + + Write-Host "Git Hooks aktiv:" -ForegroundColor Green + Write-Host " commit.template = .gitmessage" + Write-Host " core.hooksPath = .githooks" + Write-Host "" + Write-Host "Commit-Format: feat(scope): beschreibung" +} finally { + Pop-Location +}