# VLog Worker API Service Template # Copy to /etc/systemd/system/vlog-worker-api.service and customize: # - Replace with your username # - Replace /path/to/vlog with your installation path # - Adjust storage path if not using /mnt/nas/vlog-storage [Unit] Description=VLog Worker API After=network.target postgresql.service mnt-nas.mount Wants=mnt-nas.mount postgresql.service StartLimitIntervalSec=300 StartLimitBurst=5 [Service] Type=simple User= Group= WorkingDirectory=/path/to/vlog EnvironmentFile=/path/to/vlog/.env ExecStart=/path/to/vlog/venv/bin/python -m uvicorn api.worker_api:app --host 0.0.0.0 --port 9002 # Security hardening PrivateTmp=true ProtectSystem=strict ProtectHome=read-only NoNewPrivileges=true CapabilityBoundingSet= AmbientCapabilities= # Allowed paths (NAS storage and working directory) ReadWritePaths=/path/to/vlog /mnt/nas/vlog-storage # Resource limits LimitNOFILE=65535 MemoryMax=2G # Restart policy Restart=on-failure RestartSec=5 # Timeouts TimeoutStartSec=30 TimeoutStopSec=30 [Install] WantedBy=multi-user.target