53 lines
1.6 KiB
Desktop File
53 lines
1.6 KiB
Desktop File
# Application web de la veille législative (SvelteKit, adapter-node).
|
|||
|
|
#
|
||
|
|
# Démarrée par veille-web.socket à la première requête, elle s'arrête d'elle-même
|
||
|
|
# après IDLE_TIMEOUT secondes sans trafic, et systemd la réveille à la suivante.
|
||
|
|
#
|
||
|
|
# Node ≥ 20.6 requis : les variables ne sont PAS chargées automatiquement en
|
||
|
|
# production, d'où --env-file.
|
||
|
|
|
||
|
|
[Unit]
|
||
|
|
Description=Veille législative — application web
|
||
|
|
Documentation=file:///opt/veille-legislative/README.md
|
||
|
|
Requires=veille-web.socket
|
||
|
|
After=network.target veille-web.socket
|
||
|
|
|
||
|
|
[Service]
|
||
|
|
Type=simple
|
||
|
|
User=veille
|
||
|
|
Group=veille
|
||
|
|
WorkingDirectory=/opt/veille-legislative/web
|
||
|
|
ExecStart=/usr/bin/node --env-file=/opt/veille-legislative/.env build
|
||
|
|
|
||
|
|
Environment=NODE_ENV=production
|
||
|
|
Environment=VEILLE_DB=/opt/veille-legislative/data/veille.db
|
||
|
|
# Mise en sommeil après cinq minutes sans requête.
|
||
|
|
Environment=IDLE_TIMEOUT=300
|
||
|
|
# Obligatoire derrière un reverse proxy, sinon les soumissions de formulaire
|
||
|
|
# sont refusées (« Cross-site POST form submissions are forbidden »).
|
||
|
|
# Alternative : PROTOCOL_HEADER=x-forwarded-proto + HOST_HEADER=x-forwarded-host
|
||
|
|
Environment=ORIGIN=https://veille.example.org
|
||
|
|
|
||
|
|
Restart=on-failure
|
||
|
|
RestartSec=5
|
||
|
|
|
||
|
|
# Durcissement : l'application ne fait que lire la base.
|
||
|
|
NoNewPrivileges=true
|
||
|
|
PrivateTmp=true
|
||
|
|
ProtectSystem=strict
|
||
|
|
ProtectHome=true
|
||
|
|
ReadOnlyPaths=/opt/veille-legislative/data
|
||
|
|
ProtectKernelTunables=true
|
||
|
|
ProtectKernelModules=true
|
||
|
|
ProtectControlGroups=true
|
||
|
|
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
|
||
|
|
RestrictNamespaces=true
|
||
|
|
LockPersonality=true
|
||
|
|
|
||
|
|
StandardOutput=journal
|
||
|
|
StandardError=journal
|
||
|
|
SyslogIdentifier=veille-web
|
||
|
|
|
||
|
|
[Install]
|
||
|
|
WantedBy=multi-user.target
|