sub2api.service 752 B

123456789101112131415161718192021222324252627282930313233
  1. [Unit]
  2. Description=Sub2API - AI API Gateway Platform
  3. Documentation=https://github.com/Wei-Shaw/sub2api
  4. After=network.target postgresql.service redis.service
  5. Wants=postgresql.service redis.service
  6. [Service]
  7. Type=simple
  8. User=sub2api
  9. Group=sub2api
  10. WorkingDirectory=/opt/sub2api
  11. ExecStart=/opt/sub2api/sub2api
  12. Restart=always
  13. RestartSec=5
  14. StandardOutput=journal
  15. StandardError=journal
  16. SyslogIdentifier=sub2api
  17. # Security hardening
  18. NoNewPrivileges=true
  19. ProtectSystem=strict
  20. ProtectHome=true
  21. PrivateTmp=true
  22. ReadWritePaths=/opt/sub2api
  23. # Environment - Server configuration
  24. # Modify these values to change listen address and port
  25. Environment=GIN_MODE=release
  26. Environment=SERVER_HOST=0.0.0.0
  27. Environment=SERVER_PORT=8080
  28. [Install]
  29. WantedBy=multi-user.target