From 37c03164ea145367414d06f68623966b7f8b93b7 Mon Sep 17 00:00:00 2001 From: Robert Wartenberg Date: Wed, 19 Aug 2026 12:02:01 +0200 Subject: [PATCH] include HTML page http://localhost:8080/perspektivwerk/ into server --- development-system/docker-compose.yml | 9 ++++++++- development-system/public/.htaccess | 4 ++++ .../tests/PerspektivwerkRoute.Tests.ps1 | 18 ++++++++++++++++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 development-system/tests/PerspektivwerkRoute.Tests.ps1 diff --git a/development-system/docker-compose.yml b/development-system/docker-compose.yml index 61b6a4e..4a309b1 100644 --- a/development-system/docker-compose.yml +++ b/development-system/docker-compose.yml @@ -12,11 +12,16 @@ services: command: - sh - -c - - chown -R www-data:www-data /var/www/html/var /var/www/html/system/tmp && chmod 775 /var/www/html/system/tmp && exec apache2-foreground + - chown -R www-data:www-data /var/www/html/var /var/www/html/system/tmp /var/www/html/files /var/www/html/templates /var/www/html/assets/images && chmod 775 /var/www/html/system/tmp && exec apache2-foreground volumes: - ./:/var/www/html - contao_vendor:/var/www/html/vendor - contao_var:/var/www/html/var + # Contao importiert eigene Templates. Der Windows-Bind-Mount wäre für + # Apache nicht beschreibbar, daher liegt dieses Verzeichnis im Volume. + - contao_templates:/var/www/html/templates + # Contao erzeugt Bildableitungen zur Laufzeit (z. B. deferred images). + - contao_assets_images:/var/www/html/assets/images # Windows-Bind-Mounts können die POSIX-Schreibrechte für Apache verlieren. # Contao legt hier beim Import temporäre Dateien ab. - contao_system_tmp:/var/www/html/system/tmp @@ -54,4 +59,6 @@ volumes: mariadb_data: contao_vendor: contao_var: + contao_templates: + contao_assets_images: contao_system_tmp: diff --git a/development-system/public/.htaccess b/development-system/public/.htaccess index 17b7b7f..b3f78c1 100644 --- a/development-system/public/.htaccess +++ b/development-system/public/.htaccess @@ -40,6 +40,10 @@ RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteRule ^index\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L] + # Serve the standalone Perspektivwerk mockup instead of passing the + # directory request to Contao's front controller. + RewriteRule ^perspektivwerk/?$ perspektivwerk/index.html [L] + # If the requested filename exists, simply serve it. # We only want to let Apache serve files and not directories. RewriteCond %{REQUEST_FILENAME} -f diff --git a/development-system/tests/PerspektivwerkRoute.Tests.ps1 b/development-system/tests/PerspektivwerkRoute.Tests.ps1 new file mode 100644 index 0000000..87a0398 --- /dev/null +++ b/development-system/tests/PerspektivwerkRoute.Tests.ps1 @@ -0,0 +1,18 @@ +$projectRoot = Split-Path -Parent $PSScriptRoot +$mockupPath = Join-Path $projectRoot 'public\perspektivwerk\index.html' +$htaccessPath = Join-Path $projectRoot 'public\.htaccess' + +Describe 'Perspektivwerk static route' { + It 'contains the static mockup entry point' { + (Test-Path -LiteralPath $mockupPath) | Should Be $true + } + + It 'routes /perspektivwerk to the static entry point before the Contao fallback' { + $htaccess = Get-Content -LiteralPath $htaccessPath -Raw + $staticRouteIndex = $htaccess.IndexOf('RewriteRule ^perspektivwerk/?$ perspektivwerk/index.html [L]') + $fallbackIndex = $htaccess.IndexOf('RewriteRule ^ %{ENV:BASE}/index.php [L]') + + $staticRouteIndex | Should BeGreaterThan -1 + $staticRouteIndex | Should BeLessThan $fallbackIndex + } +}