ci deploy (src 64628e9)
This commit is contained in:
47
sgame-admin.service
Normal file
47
sgame-admin.service
Normal file
@ -0,0 +1,47 @@
|
||||
[Unit]
|
||||
Description=SGame admin server (江湖录后台:玩家反馈 + 埋点 + 看板)
|
||||
Documentation=https://git.xindiegaming.top/bia/sgame-admin-server
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=sgame
|
||||
Group=sgame
|
||||
WorkingDirectory=/opt/sgame-admin
|
||||
ExecStart=/opt/sgame-admin/server -config /opt/sgame-admin/config.yaml
|
||||
# 密钥(JWT_SECRET / INIT_ADMIN_PASSWORD / INGEST_APP_KEY)走这个文件,
|
||||
# 权限 600、属主 sgame,不进任何仓库。
|
||||
EnvironmentFile=/opt/sgame-admin/env
|
||||
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
|
||||
# —— 资源闸 ——
|
||||
# VPS 总共 459MB,还跑着 Caddy / frps / v2ray / vaultwarden。
|
||||
# 实测常驻 ~30MB,150M 留了 5 倍余量:真涨到这个数说明有泄漏,
|
||||
# 宁可让它被 OOM kill 然后自动重启,也不能把整机拖进 swap 抖动。
|
||||
#
|
||||
# 目标机是 CentOS 7 = systemd 219 + cgroup v1,只认 MemoryLimit;
|
||||
# 新版的 MemoryMax 在这里会被静默忽略,内存闸等于没写。
|
||||
MemoryLimit=150M
|
||||
# 单核机器,限制 CPU 配额避免某次重聚合把 Caddy 饿死
|
||||
CPUQuota=80%
|
||||
TasksMax=256
|
||||
|
||||
# —— 加固 ——
|
||||
# 同样受 systemd 219 限制:ProtectSystem=strict、ReadWritePaths、
|
||||
# ProtectKernelTunables、RestrictSUIDSGID 都是 232+ 才有的,写了只会被忽略
|
||||
# 并刷 warning。full 已经把 /usr /boot /etc 挂成只读,而本服务只写
|
||||
# /opt/sgame-admin/data,够用。
|
||||
NoNewPrivileges=true
|
||||
PrivateTmp=true
|
||||
ProtectSystem=full
|
||||
ProtectHome=true
|
||||
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=sgame-admin
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user