chore: add systemd unit and cloudflare tunnel config

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SfihHazrSHXgndJtSNLubJ
This commit is contained in:
Tony Averty 2026-10-21 13:55:10 +02:00
parent 2d146a4e8e
commit ac569444af
No known key found for this signature in database
2 changed files with 36 additions and 0 deletions

27
deploy/aitools.service Normal file
View file

@ -0,0 +1,27 @@
[Unit]
Description=AiTools (panel prospection IA)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=aitools
WorkingDirectory=/opt/aitools
ExecStart=/usr/bin/node --env-file=/opt/aitools/.env --no-warnings=ExperimentalWarning src/server.js
Restart=on-failure
RestartSec=5
Environment=NODE_ENV=production
# Le serveur web reste léger ; Claude Code (enfant) tourne déjà en nice 10
Nice=5
MemoryMax=900M
# Durcissement
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=read-only
ReadWritePaths=/opt/aitools/data -/home/aitools/.claude -/home/aitools/.claude.json
ProtectKernelTunables=true
ProtectControlGroups=true
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,9 @@
# /etc/cloudflared/config.yml
# Créé avec : cloudflared tunnel create aitools
tunnel: aitools
credentials-file: /etc/cloudflared/<TUNNEL_ID>.json
ingress:
- hostname: ai.tony-averty.dev
service: http://127.0.0.1:3100
- service: http_status:404