From 02995bfe9827c0c329c9c397411d83bd6918d096 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sat, 1 Feb 2025 17:06:10 +0200 Subject: feat: Add XAMPP setup --- apache/httpd.conf.tpl | 4 --- apache/sites/nowayforward_human.conf.tpl | 15 +++++++++-- controllers/archive.php | 2 +- migrations/01-default-data.sql | 2 +- models/database.php | 19 +++++++++++--- views/global/router.php | 9 ++++++- xampp/setup.php | 44 ++++++++++++++++++++++++++++++++ 7 files changed, 82 insertions(+), 13 deletions(-) create mode 100644 xampp/setup.php diff --git a/apache/httpd.conf.tpl b/apache/httpd.conf.tpl index 950ff21..5dafc78 100644 --- a/apache/httpd.conf.tpl +++ b/apache/httpd.conf.tpl @@ -30,7 +30,3 @@ User ${USER} Group users AddType application/javascript .js - -SetEnv MYSQL_UNIX_SOCKET ${MYSQL_UNIX_SOCKET} -SetEnv USER ${USER} -SetEnv ARCHIVES_DIR ${ARCHIVES_DIR} diff --git a/apache/sites/nowayforward_human.conf.tpl b/apache/sites/nowayforward_human.conf.tpl index 2a5f58f..637ee4f 100644 --- a/apache/sites/nowayforward_human.conf.tpl +++ b/apache/sites/nowayforward_human.conf.tpl @@ -4,9 +4,21 @@ Alias /archives "${ARCHIVES_DIR}" - SetHandler "proxy:unix:${PHP_FPM_SOCKET}|fcgi://localhost/" + + SetHandler "proxy:unix:${PHP_FPM_SOCKET}|fcgi://localhost/" + + # Database + SetEnv SERVER ${SERVER} + SetEnv PORT ${PORT} + SetEnv USER ${USER} + SetEnv PASSWORD ${PASSWORD} + SetEnv MYSQL_UNIX_SOCKET ${MYSQL_UNIX_SOCKET} + + # Project + SetEnv ARCHIVES_DIR ${ARCHIVES_DIR} + RewriteEngine On RewriteCond %{HTTP:Authorization} ^(.*) @@ -14,6 +26,5 @@ RewriteCond %{REQUEST_URI} !/archives.* RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f - RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /global/router.php diff --git a/controllers/archive.php b/controllers/archive.php index 70f2b6d..ae25482 100644 --- a/controllers/archive.php +++ b/controllers/archive.php @@ -380,7 +380,7 @@ class DownloadPage { // Add the header for the archives $phpTag = $dom->createElement('script', ' - +