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 48e59f6..8c2b2d9 100644 --- a/backend/config/mail-config.php +++ b/backend/config/mail-config.php @@ -13,7 +13,7 @@ define('SMTP_TO_EMAIL', 'info@hexahost.de'); // Empfänger-E-Mail für Kon // 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 +define('MAX_REQUESTS_PER_HOUR', 5); // Max. Anfragen pro Stunde // Spam-Schutz Einstellungen define('ENABLE_SPAM_PROTECTION', true); // Spam-Schutz aktivieren 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 +}