feat: deployment setup - nginx, Caddy configs, deploy script, API smoke tests

Dieser Commit ist enthalten in:
hafroese 2026-04-02 23:42:14 +02:00
Ursprung 3cd865ccbc
Commit a3cefeef52
4 geänderte Dateien mit 123 neuen und 0 gelöschten Zeilen

11
setup/caddy-edu.txt Normale Datei
Datei anzeigen

@ -0,0 +1,11 @@
# Append to /opt/caddy/Caddyfile on the Pi
edu.senex.de {
reverse_proxy webapps:8080
header {
X-Frame-Options "DENY"
X-Content-Type-Options "nosniff"
Strict-Transport-Security "max-age=31536000; includeSubDomains"
Referrer-Policy "strict-origin-when-cross-origin"
}
}

25
setup/deploy.sh Normale Datei
Datei anzeigen

@ -0,0 +1,25 @@
#!/bin/bash
# Deploy edu.senex.de to Pi
set -e
PI_HOST="hafroes@192.168.10.65"
PI_PATH="/mnt/nas-services/webapps/sites/edu"
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
LOCAL_EDU="$SCRIPT_DIR/../edu"
echo "=== Deploying edu.senex.de ==="
echo "Creating directories on Pi..."
ssh $PI_HOST "mkdir -p $PI_PATH/{css,js,api,content/flashcards,content/tutorials,content/cheatsheets}"
echo "Uploading files..."
scp -r "$LOCAL_EDU/index.html" "$PI_HOST:$PI_PATH/"
scp -r "$LOCAL_EDU/css/"* "$PI_HOST:$PI_PATH/css/"
scp -r "$LOCAL_EDU/js/"* "$PI_HOST:$PI_PATH/js/"
scp -r "$LOCAL_EDU/api/"* "$PI_HOST:$PI_PATH/api/"
scp -r "$LOCAL_EDU/content/"* "$PI_HOST:$PI_PATH/content/" 2>/dev/null || true
echo "Restarting PHP-FPM (opcache)..."
ssh $PI_HOST "docker restart php-fpm"
echo "=== Deployed! Visit https://edu.senex.de ==="

31
setup/nginx-edu.conf Normale Datei
Datei anzeigen

@ -0,0 +1,31 @@
server {
listen 80;
server_name edu.senex.de;
root /var/www/html/edu;
index index.html;
charset utf-8;
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
location / {
try_files $uri $uri/ /index.html;
}
location /api/ {
try_files $uri /api/index.php$is_args$args;
}
location ~ \.php$ {
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
expires 7d;
add_header Cache-Control "public";
}
}