Commit graph

21 commits

Author SHA1 Message Date
巴山夜语
79020abb1c
feat(systemctl): implement service manager initialization and command execution (#8380)
* feat(systemctl): 实现服务管理器初始化和命令执行

- 新增 systemctl 包,实现对 systemd、openrc 和 sysvinit 三种服务管理器的支持
- 添加服务状态检查、启动、停止、重启和启用/禁用功能
- 实现服务发现和智能服务名处理
- 添加配置文件查看功能
- 优化错误处理和日志记录

* refactor(system): 重构系统服务管理逻辑

- 引入 systemctl 工具包以统一处理系统服务
- 优化服务状态获取、配置文件路径解析等逻辑
- 重构 HostToolService 中的 GetToolStatus 方法
- 更新 DockerService、SettingService 等相关服务的处理方式
- 调整快照创建和恢复过程中的服务处理逻辑

* feat(utils): 添加目录复制功能并优化文件复制逻辑

- 新增 CopyDirs 函数,用于复制整个目录及其内容
- 添加对符号链接的复制支持
- 实现通用的 Copy 函数,根据文件类型自动选择 CopyFile 或 CopyDirs
- 在 CopyFile 函数中增加对源文件是目录的检查和错误提示

* refactortoolbox: 重构 Fail2ban 和 Pure-FTPd 的管理逻辑

- 优化了 Fail2ban 和 Pure-FTPd 的启动、停止、重启等操作的实现
- 改进了 Fail2ban 版本信息的获取方法
- 统一了错误处理和日志记录的格式
- 调整了部分导入的包,提高了代码的可维护性

* build: 禁用 CGO 以提高构建性能和兼容性

- 在 Linux 后端构建命令中添加 CGO_ENABLED=0 环境变量
- 此修改可以提高构建速度,并确保生成的二进制文件在没有 C 库依赖的环境中也能运行

* refactor(docker): 重构 Docker 服务的重启和操作逻辑

- 添加 isDockerSnapInstalled 函数来判断 Docker 是否通过 Snap 安装
- 在 OperateDocker 和 restartDocker 函数中增加对 Snap 安装的处理
- 移除未使用的 getDockerRestartCommand 函数

* fix(service): 优化快照恢复后的服务重启逻辑

- 在使用 systemd 管理服务时,增加 daemon-reload 操作以确保服务配置更新
- 重启 1panel 服务,以应用快照恢复的更改

* refactor(server): 支持非 systemd 系统的恢复操作

- 增加 isSystemd 函数判断系统是否为 systemd 类型
- 根据系统类型选择性地恢复服务文件
- 兼容 systemd 和非 systemd 系统的恢复流程

* fix(upgrade): 优化升级过程中的服务重启逻辑

- 移动服务重启逻辑到版本号更新之后,修复因提前重启导致的版本号未更新BUG。
- 在 systemctl 重启之前添加 daemon-reload 命令

---------

Co-authored-by: gcsong023 <gcsong023@users.noreply.github.com>
2025-04-17 10:26:13 +08:00
e1bdd215b1
fix: 编辑计划任务和病毒扫描告警问题处理 (#7058) 2024-11-14 21:52:37 +08:00
bfa667584a
fix: 编辑计划任务和病毒扫描告警问题处理 (#7047)
Refs #7039
2024-11-14 16:15:47 +08:00
ssongliu
5e8b23db6a
fix: 快照恢复忽略应用恢复失败问题 (#7012) 2024-11-12 17:34:23 +08:00
d287fc1186
fix: 解析病毒扫描内容格式处理 (#6790) 2024-10-21 14:06:20 +00:00
425892cfc4
refactor: 调整包引用 (#6758) 2024-10-17 13:35:32 +00:00
acf94b052b
feat: 增加病毒扫描和计划任务告警 (#6709)
Some checks failed
Build Test / build-linux-binary (push) Failing after 8s
Build / SonarCloud (push) Failing after 7s
sync2gitee / repo-sync (push) Failing after 4s
2024-10-14 09:51:17 +00:00
ssongliu
8187a19e6e
fix: 修改版本号复制方式 (#6187) 2024-08-20 09:38:47 +00:00
ssongliu
64405fba3d
fix: 统一时区获取方法 (#6175)
Some checks failed
Build Test / build-linux-binary (push) Failing after -7m59s
Build / SonarCloud (push) Failing after -8m2s
sync2gitee / repo-sync (push) Failing after -8m3s
2024-08-19 10:30:42 +00:00
ssongliu
34e14636d4
fix: 解决 ClamAV 卸载后定时任务无法停止的问题 (#6143)
Refs #6100
2024-08-15 15:16:30 +00:00
ssongliu
3c0dc7459c
feat: 工具箱病毒扫描支持定时扫描 (#5847) 2024-07-17 08:55:28 +00:00
ssongliu
12c6fe6331
feat: 病毒扫描增加状态判断 (#5817)
Some checks failed
Build Test / build-linux-binary (push) Failing after -6m31s
Build / SonarCloud (push) Failing after -6m38s
sync2gitee / repo-sync (push) Failing after -6m39s
Refs #5769
2024-07-15 04:05:26 +00:00
zhengkunwang
9a635e99b2
feat: 增加 clamdscan 服务检测 (#5784)
Some checks failed
Build Test / build-linux-binary (push) Failing after -6m27s
Build / SonarCloud (push) Failing after -6m30s
sync2gitee / repo-sync (push) Failing after -6m32s
2024-07-12 06:11:25 +00:00
ssongliu
577dfadb9a
feat: 病毒扫描增加病毒库刷新状态 (#5710) 2024-07-08 07:47:23 +00:00
ssongliu
0c2653d270
fix: 解决病毒扫描病毒策略更新失败的问题 (#5709)
Some checks failed
Build Test / build-linux-binary (push) Failing after -6m15s
Build / SonarCloud (push) Failing after -6m19s
sync2gitee / repo-sync (push) Failing after -6m13s
2024-07-08 10:32:24 +08:00
ssongliu
0105da02af
pref: 优化 ClamAV 提示信息 (#5693) 2024-07-05 08:52:39 +00:00
ssongliu
f370f7eacf
fix: 优化病毒扫描报告界面 (#5675) 2024-07-04 08:00:32 +00:00
ssongliu
f131aae344
feat: ClamAV 增加病毒文件处理策略 (#5635) 2024-07-02 09:25:25 +00:00
yonwoo9
3adf1aebb8
style:fit some code style (#5601) 2024-06-28 14:04:08 +08:00
ssongliu
2fafe3dcb5
fix: 优化病毒扫描样式 (#5577)
Some checks failed
Build Test / build-linux-binary (push) Failing after -5m52s
Build / SonarCloud (push) Failing after -5m54s
sync2gitee / repo-sync (push) Failing after -5m55s
2024-06-26 14:40:52 +00:00
ssongliu
97b790a092
feat: 增加病毒扫描工具 (#5546) 2024-06-24 05:52:42 +00:00