1Panel/backend/utils
巴山夜语 6b379389d3
Some checks failed
SonarCloud Scan / SonarCloud (push) Has been cancelled
WIP: refactor(service): Refactor OpenRC service manager (#8416)
* refactor(service): 重构 OpenRC 服务管理器

- 更新 IsEnabled 和 IsActive 检查逻辑,使用更可靠的命令
- 修复 ServiceExists 检查,直接使用文件路径判断
- 优化 FindServices 函数,扫描 /etc/init.d 目录
- 调整 BuildCommand 函数,支持 OpenRC 特定操作
- 修改 ParseStatus 函数,使用更新后的正则表达式

* feat(backend): 优化 Fail2ban 初始化配置以支持 Alpine 系统

- 增加对 Alpine 系统的特殊配置支持
- 改进防火墙类型检测逻辑,支持多种防火墙服务
- 增加 SSH 端口和认证日志路径的自动检测
- 优化配置文件模板,提高兼容性和安全性

* refactor(backend): 重构 SSH 日志解析功能

- 改进了对不同日志格式的支持,包括 secure, auth 和 messages 文件
- 优化了日志解析逻辑,提高了代码的可读性和可维护性
- 增加了对 RFC3339 时间格式的支持
- 改善了对失败登录尝试的解析,包括无效用户和连接关闭的情况
- 重构了日期解析和 IP 地址验证的逻辑

* refactor(upgrade): 优化升级服务中的初始化脚本选择逻辑

- 新增 selectInitScript 函数,根据系统初始化管理器类型选择合适的初始化脚本
- 支持 systemd、openrc 和 sysvinit 三种初始化管理器
- 对于 sysvinit,增加对 /etc/rc.common 文件存在性的判断,以区分不同的初始化脚本
- 默认情况下使用当前服务名称作为初始化脚本名称

* fix(upgrade): 修复升级时初始化脚本更新问题

- 修改了 criticalUpdates 数组中的服务脚本更新逻辑
- 在 selectInitScript 函数中增加了复制脚本文件的逻辑,以应对服务名和脚本名不一致的情况

* feat(snap): 添加初始化脚本到快照

- 在创建快照时,将服务脚本复制到 initscript 目录
- 然后将整个 initscript 目录复制到快照的目标目录
- 添加了日志输出,便于调试和记录

* refactor(backend): 重构快照恢复流程

- 移除了未使用的 import 语句
- 删除了注释掉的代码块
- 修改了 1Panel 服务恢复的逻辑,增加了对当前服务名称的获取
- 快照恢复过程中,根据宿主机类型,自动选择初始化服务脚本
- 添加了日志输出以提高可追踪性
- 优化了文件路径的处理方式

---------

Co-authored-by: gcsong023 <gcsong023@users.noreply.github.com>
2025-04-23 17:04:08 +08:00
..
ai_tools feat: Support gpu of schema v11 (#7988) 2025-02-25 14:16:34 +08:00
captcha feat: 升级验证码组件版本到 v1.3.6 (#3298) 2023-12-13 03:28:09 +00:00
cloud_storage feat: allow tencent cloud cos dual stack domain (#8123) 2025-03-11 23:58:23 +08:00
cmd fix: 解决 Docker 重启失败的问题 (#6805) 2024-10-22 09:42:28 +00:00
common feat(systemctl): implement service manager initialization and command execution (#8380) 2025-04-17 10:26:13 +08:00
compose feat: 应用同步优化 (#1564) 2023-07-06 08:30:22 +00:00
copier
docker perf: 优化应用同步查询接口 (#5241) 2024-05-31 09:57:20 +00:00
encrypt feat: Added password encryption for login functionality (#7764) 2025-01-23 18:09:12 +08:00
env feat: node.js 运行环境增加模块管理 (#2488) 2023-10-10 09:34:28 +00:00
files fix: 解决主机文件压缩解压特殊字符问题 (#6451) 2024-09-11 08:20:15 +00:00
firewall fix(iptables): 复杂环境下转发删除端口错误 (#7868) 2025-02-13 22:56:09 +08:00
geo feat: Optimize Location Information Display in System Login Logs (#7459) 2024-12-20 04:16:25 +00:00
http fix: Fixed an issue where the language pack initialization download f… (#7375) 2024-12-16 09:00:10 +00:00
ini_conf fix: 移除项目未使用代码 (#3948) 2024-02-22 07:32:07 +00:00
jwt
mfa feat: 2FA支持前一个验证码 (#5942) 2024-07-26 11:15:53 +08:00
mysql fix: Fix the mysql root account permission switchover exception (#8378) 2025-04-11 07:08:02 +00:00
nginx feat: Add MCP management (#8299) 2025-04-02 09:01:54 +00:00
ntp fix: 系统时间同步样式修改 (#1123) 2023-05-24 07:43:21 +00:00
postgresql fix: Fix the issue of backup failure due to complex passwords in the pg (#7596) 2024-12-30 13:36:51 +08:00
redis fix: 修改面板设置证书时间显示不一致的问题 (#5267) 2024-06-04 03:41:50 +00:00
ssh fix(container): Fix cpu surge when the container terminal executes exit (#8096) 2025-03-07 11:06:59 +00:00
ssl feat: Website SSL DNS Type support WestCN (#8305) 2025-04-02 10:21:54 +00:00
systemctl WIP: refactor(service): Refactor OpenRC service manager (#8416) 2025-04-23 17:04:08 +08:00
terminal fix: Modify the container terminal connection mode (#8301) 2025-04-02 10:19:54 +00:00
toolbox WIP: refactor(service): Refactor OpenRC service manager (#8416) 2025-04-23 17:04:08 +08:00
websocket pref: 完善告警通知 (#6227) 2024-08-23 13:53:00 +00:00
xpack feat: Support Ollama model management (#7866) 2025-02-13 15:28:29 +08:00