[Unit]
Description=FlashOps control plane
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=ubuntu
Group=ubuntu
WorkingDirectory=/data/wangzhan/app/storage-labos/flashops
EnvironmentFile=-/etc/flashops/flashops.env
Environment=PYTHONPATH=/data/wangzhan/app/storage-labos/flashops/services/control-plane:/data/wangzhan/app/storage-labos/flashops/services/host-agent
Environment=FLASHOPS_ENV=production
Environment=FLASHOPS_API_HOST=127.0.0.1
Environment=FLASHOPS_API_PORT=18080
Environment=FLASHOPS_DATABASE_URL=sqlite+aiosqlite:////data/wangzhan/app/storage-labos/flashops/var/flashops.db
Environment=FLASHOPS_OBJECT_STORE_URL=/data/wangzhan/app/storage-labos/flashops/var/objects
Environment=FLASHOPS_CORS_ORIGINS=https://flashops.imagebrewing.com
ExecStart=/data/wangzhan/app/storage-labos/flashops/.venv/bin/uvicorn flashops_control.main:app --host 127.0.0.1 --port 18080 --workers 1 --proxy-headers --forwarded-allow-ips=127.0.0.1
Restart=on-failure
RestartSec=3
TimeoutStopSec=15
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=full
ProtectHome=true
ReadWritePaths=/data/wangzhan/app/storage-labos/flashops/var
UMask=0027

[Install]
WantedBy=multi-user.target
