fix: 移除 ProtectSystem 沙箱限制,修复 unix socket 创建失败
ProtectSystem=strict/full 把 /etc /opt 等挂载为只读, 即使 ReadWritePaths 配合也会有各种坑。 服务已用专用低权用户 portal_page 运行,文件系统权限本身就够了, 没必要再加 systemd 文件系统沙箱。
This commit is contained in:
+4
-4
@@ -170,11 +170,11 @@ StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=${SERVICE_NAME}
|
||||
|
||||
# 安全加固
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=full
|
||||
# 安全加固:专用低权用户运行,无需额外文件系统沙箱
|
||||
# ProtectSystem=strict/full 会阻止写入 /etc 和 /opt 等目录,
|
||||
# 导致配置文件和 unix socket 无法创建,得不偿失
|
||||
ProtectHome=true
|
||||
ReadWritePaths=${DATA_DIR} ${CONFIG_DIR} ${LOG_DIR} ${PID_DIR} ${INSTALL_DIR}
|
||||
NoNewPrivileges=true
|
||||
|
||||
# 环境变量
|
||||
Environment=GIN_MODE=release
|
||||
|
||||
Reference in New Issue
Block a user