diff --git a/install.sh b/install.sh index a2dffdf..4a2a3e1 100644 --- a/install.sh +++ b/install.sh @@ -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