Update Socket.IO deployment documentation and fixCertPermissions.sh script for improved service user configuration

This commit enhances the Socket.IO deployment documentation by adding a new section on configuring the systemd service to run as `www-data`, ensuring proper permissions for SSL certificate access. It also updates the fixCertPermissions.sh script to handle cases where the service user is not defined or is set to `nobody`, defaulting to `www-data` and verifying its existence. These changes improve the overall security and functionality of the deployment process.
This commit is contained in:
Torsten Schulz (local)
2025-11-16 09:50:26 +01:00
parent 56c708d3a0
commit a81c3453b5
3 changed files with 85 additions and 10 deletions

30
tt-tagebuch.service Normal file
View File

@@ -0,0 +1,30 @@
[Unit]
Description=TT-Tagebuch Node.js Service
After=network.target mysql.service
[Service]
Type=simple
User=www-data
Group=www-data
WorkingDirectory=/var/www/tt-tagebuch.de/backend
ExecStart=/usr/bin/node server.js
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
SyslogIdentifier=tt-tagebuch
# Umgebungsvariablen
Environment=NODE_ENV=production
# PORT: HTTP-Server für API (wird von Apache auf Port 443 proxied)
Environment=PORT=3050
# HTTPS_PORT: HTTPS-Server für Socket.IO (direkt erreichbar auf Port 3051)
Environment=HTTPS_PORT=3051
# Sicherheit
NoNewPrivileges=true
PrivateTmp=true
[Install]
WantedBy=multi-user.target