- Removed empty bin/fabric file (not used; package.json bin declaration is correct) - Updated fabric-web.service and fabric-prune.service to use /home/coding/.nix-profile/bin/node instead of /usr/bin/node (NixOS node path) - Created ~/.config/fabric/secrets.env with FABRIC_AUTH_TOKEN - Installed and enabled fabric-web.service and fabric-prune.timer Acceptance verified: - systemctl --user status fabric-web.service shows active (running) - curl http://localhost:3000/api/workers returns valid JSON ([]) Closes: bf-1nah
27 lines
864 B
Desktop File
27 lines
864 B
Desktop File
[Unit]
|
|
Description=FABRIC Web Dashboard
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
WorkingDirectory=/home/coding/FABRIC
|
|
# Run with 1GB heap limit, enable heap snapshots for leak detection
|
|
ExecStart=/home/coding/.nix-profile/bin/node --max-old-space-size=1024 dist/cli.js web --port 3000 --source /home/coding/.needle/logs --otlp-http :4318 --heap-snapshots --snapshot-interval 30
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
# Rate limit restarts: 5 times within 2 minutes before entering failed state
|
|
StartLimitInterval=120s
|
|
StartLimitBurst=5
|
|
EnvironmentFile=/home/coding/.config/fabric/secrets.env
|
|
Environment=NODE_ENV=production
|
|
# Memory limits: 1.5GB max, will trigger OOM if exceeded
|
|
MemoryMax=1536M
|
|
MemoryHigh=1200M
|
|
# CPU limit: max 2 cores (200%)
|
|
CPUQuota=200%
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=fabric-web
|
|
|
|
[Install]
|
|
WantedBy=default.target
|