From 4e61cf2189ff5e21b394cef82e95c1dce9108c24 Mon Sep 17 00:00:00 2001 From: mheuer Date: Mon, 15 Dec 2025 17:25:32 +0100 Subject: [PATCH] feat: add PHP-based authentication system for manual with access logging - Add login.php, auth.php, and auth.config.php for manual access control - Create logout.php for session management - Add .htaccess to route /manual/ requests to PHP-based index - Create logs directory and access.log for tracking manual visits - Update deployment script to upload PHP authentication files and logs - Add rewrite rule to ensure /manual/ uses login-guarded PHP version - Keep static index.html as fallback for direct --- deploy_to_hetzner.sh | 21 ++++++++++++++++++++- src/.htaccess | 3 +++ src/manual/.htaccess | 8 ++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/manual/.htaccess diff --git a/deploy_to_hetzner.sh b/deploy_to_hetzner.sh index 745f497..6dc0113 100755 --- a/deploy_to_hetzner.sh +++ b/deploy_to_hetzner.sh @@ -23,15 +23,34 @@ cd img put -r $LOCAL_DIR/img/* cd .. -# Manual (HTML + Bilder) +# Manual (HTML + Bilder + PHP + Logs) mkdir manual cd manual + +# statische HTML-Variante (Fallback / Direktaufrufe) put -r $LOCAL_DIR/manual/index.html + +# PHP-basierte Manual-/Login-Dateien +put -r $LOCAL_DIR/manual/.htaccess +put -r $LOCAL_DIR/manual/index.php +put -r $LOCAL_DIR/manual/login.php +put -r $LOCAL_DIR/manual/auth.config.php +put -r $LOCAL_DIR/manual/auth.php +put -r $LOCAL_DIR/manual/logout.php + +# Manual-Bilder put -r $LOCAL_DIR/manual/beacon-front.jpg mkdir img cd img put -r $LOCAL_DIR/manual/img/* cd .. + +# Log-Verzeichnis für Zugriffsprotokolle +mkdir logs +cd logs +put -r $LOCAL_DIR/manual/logs/access.log +cd .. + cd .. bye EOF diff --git a/src/.htaccess b/src/.htaccess index 806bf61..74c780c 100644 --- a/src/.htaccess +++ b/src/.htaccess @@ -12,6 +12,9 @@ RewriteRule ^ https://summitwave.eu%{REQUEST_URI} [L,R=301] # Canonicalize index.html to root RewriteRule ^index\.html$ https://summitwave.eu/ [L,R=301] +# Ensure /manual/ uses PHP (login-guarded) +RewriteRule ^manual/?$ /manual/index.php [L] + # Cache static assets (adjust as needed) ExpiresActive On diff --git a/src/manual/.htaccess b/src/manual/.htaccess new file mode 100644 index 0000000..dad6ba1 --- /dev/null +++ b/src/manual/.htaccess @@ -0,0 +1,8 @@ +# Ensure PHP index is used in /manual/ +DirectoryIndex index.php + + + RewriteEngine On + # Redirect direct hits of index.html to index.php (login-guarded) + RewriteRule ^index\.html$ index.php [L,R=302] +