fix: 替换所有中文括号为英文括号

feat: 新增操作审计字段 user/action/target/result 到 syslog 输出
docs: 更新 README 输出格式和配置示例说明
This commit is contained in:
QClaw Bot
2026-05-13 13:33:45 +08:00
parent 46651fdc10
commit ebc1a2a87c
5 changed files with 104 additions and 70 deletions

View File

@@ -52,11 +52,11 @@ check_deps() {
error "缺少依赖: ${missing[*]} \n请先安装: pip3 install PyMySQL psycopg2-binary PyYAML"
fi
# 检查 MySQL / PostgreSQL 客户端仅检查命令是否存在,不强制要求服务运行
# 检查 MySQL / PostgreSQL 客户端(仅检查命令是否存在,不强制要求服务运行)
if command -v mysql &>/dev/null || command -v psql &>/dev/null; then
info "数据库客户端已找到"
else
warn "未找到 mysql/psql 客户端程序使用 Python DB 驱动,不影响运行"
warn "未找到 mysql/psql 客户端(程序使用 Python DB 驱动,不影响运行)"
fi
info "依赖检查通过 ✓"
@@ -85,7 +85,7 @@ do_install() {
info "文件已复制到 ${INSTALL_DIR}${CONFIG_DIR}"
# 3. 创建 config.yaml如果不存在
# 3. 创建 config.yaml(如果不存在)
if [ ! -f "${CONFIG_DIR}/config.yaml" ]; then
if [ -f "${CONFIG_DIR}/config.yaml.example" ]; then
cp "${CONFIG_DIR}/config.yaml.example" "${CONFIG_DIR}/config.yaml"
@@ -126,7 +126,7 @@ do_uninstall() {
rm -f "/etc/systemd/system/${SYSTEMD_UNIT}"
systemctl daemon-reload
info "删除安装目录确认不再需要..."
info "删除安装目录(确认不再需要)..."
read -rp "是否删除 ${INSTALL_DIR}${CONFIG_DIR}[y/N]: " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
rm -rf "${INSTALL_DIR}" "${CONFIG_DIR}" "${LOG_DIR}" "${DATA_DIR}" "${RUN_DIR}"
@@ -144,7 +144,7 @@ do_status() {
info "服务状态: 运行中 ✓"
systemctl status "${APP_NAME}" --no-pager
elif systemctl is-enabled --quiet "${APP_NAME}"; then
warn "服务状态: 未运行已开机自启"
warn "服务状态: 未运行(已开机自启)"
else
warn "服务状态: 未安装或未启用"
fi
@@ -171,5 +171,5 @@ case "$ACTION" in
install) do_install "$@" ;;
uninstall) do_uninstall "$@" ;;
status) do_status "$@" ;;
*) error "未知操作: $ACTION支持: install | uninstall | status" ;;
*) error "未知操作: $ACTION(支持: install | uninstall | status)" ;;
esac