Adds Gitea Actions CI/CD for test and production
Continuous Integration / check (pull_request) Failing after 6m55s
Continuous Integration / lighthouse (pull_request) Skipped
Continuous Integration / deploy-test (pull_request) Skipped
Continuous Integration / deploy-production (pull_request) Skipped

The pipeline runs lint, format, tests, build, dependency audit and
Lighthouse (mobile and desktop, Playwright Chromium on the arm64 runner)
on every pull request, push to master and manual run.

Pushes to master deploy to test automatically, and any branch can be
deployed to test manually. Test is a Raspberry Pi with nginx next to the
current WordPress site; the deploy refuses folders containing WordPress.
Production deploys are manual and only from release/* branches, over
FTP with TLS to the IIS webhost.

The IIS web.config and both nginx configs are generated from the same
security header list as the Vite servers, with a test that fails when
the generated files drift. Adds .gitattributes for LF line endings and
pins pnpm through packageManager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 00:18:51 +02:00
co-authored by Claude Opus 5.5
parent 069c7cb7eb
commit e6436601a4
20 changed files with 1394 additions and 10 deletions
+61
View File
@@ -0,0 +1,61 @@
# Gegenereerd door web/config/serverConfig.ts (pnpm server-config). Niet handmatig aanpassen.
# Test-omgeving op de Raspberry Pi, achter de reverse-proxy-Pi (die TLS afhandelt
# met certbot). De proxy moet de Host-header doorgeven (proxy_set_header Host
# $host), anders kiest nginx hier het standaardblok (WordPress).
# Eigen server-blok naast de WordPress-site: bewust geen default_server, zodat
# dit blok alleen de testhostname beantwoordt.
# Pas server_name en root aan aan de server; de rest komt uit de generator.
server {
listen 80;
server_name test.andreaslop.nl;
root /var/www/html/andreaslop-test;
index index.html;
# Achter de reverse proxy: doorverwijzingen relatief houden, anders stuurt
# nginx naar zijn eigen http://-adres in plaats van de https-hostname
absolute_redirect off;
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Cache-Control "no-cache" always;
# Testsite nooit indexeren
location = /robots.txt {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
default_type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
# Bestanden met een hash in de naam: lang cachen
location /assets/ {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Cache-Control "public, max-age=31536000, immutable" always;
try_files $uri =404;
}
# SPA-fallback: onbekende paden krijgen index.html (de router toont de 404)
location / {
add_header Content-Security-Policy "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; font-src 'self'; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'none'" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "DENY" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
add_header X-Robots-Tag "noindex, nofollow" always;
add_header Cache-Control "no-cache" always;
try_files $uri $uri/ /index.html;
}
}
@@ -0,0 +1,18 @@
# Gegenereerd door web/config/serverConfig.ts (pnpm server-config). Niet handmatig aanpassen.
# Reverse proxy voor de testsite naar de hosting-Pi. certbot past dit bestand
# aan voor HTTPS; kopieer het daarna dus niet opnieuw zonder certbot opnieuw te
# draaien.
server {
listen 80;
server_name test.andreaslop.nl;
location / {
proxy_pass http://192.168.1.103;
# Verplicht: de hosting-Pi kiest op basis van de hostname tussen het
# testblok en WordPress
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}