1Panel/backend/app/service
巴山夜语 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.go feat: Add certificate validation when creating AI Proxy (#7994) 2025-02-25 15:21:16 +08:00
app.go feat: Adding GPU acceleration configuration to some applications (#7865) 2025-02-13 07:02:08 +00:00
app_install.go fix: Optimize database password verification and password change (#8294) 2025-04-02 16:03:44 +08:00
app_utils.go feat: Added partial prompt messages (#7900) 2025-02-18 10:08:52 +00:00
auth.go feat: support load ollama model details (#7867) 2025-02-13 14:56:24 +00:00
backup.go feat: Support for asynchronously obtaining the backup file size (#7660) 2025-01-07 06:35:33 +00:00
backup_app.go feat: 应用升级备份保留 3 份 (#6116) 2024-08-13 07:28:55 +00:00
backup_mysql.go fix: Fix the issue of loading errors for editing container port data (#7945) 2025-02-21 04:01:49 +00:00
backup_postgresql.go fix: Fix the issue of loading errors for editing container port data (#7945) 2025-02-21 04:01:49 +00:00
backup_redis.go style:fit some code style (#5601) 2024-06-28 14:04:08 +08:00
backup_runtime.go style:fit some code style (#5601) 2024-06-28 14:04:08 +08:00
backup_website.go feat: 增加 Go 运行环境 (#5632) 2024-07-01 18:35:15 +08:00
clam.go feat(systemctl): implement service manager initialization and command execution (#8380) 2025-04-17 10:26:13 +08:00
command.go fix: Redis 数据库连接信息移除密码限制 (#5239) 2024-05-31 09:35:20 +00:00
compose_template.go
container.go fix: Fixed an update failure when the container network is bridge (#8290) 2025-04-02 03:37:53 +00:00
container_compose.go fix: 解决容器编排路径为空时无法删除的问题 (#6862) 2024-10-27 15:18:02 +00:00
container_network.go pref: 释放容器 client 连接 (#4700) 2024-04-25 08:45:12 +00:00
container_volume.go fix: 统一时区获取方法 (#6175) 2024-08-19 10:30:42 +00:00
cronjob.go fix: Modify database verification rules (#8342) 2025-04-08 02:39:52 +00:00
cronjob_backup.go fix: 解决快照列表排序的问题 (#6816) 2024-10-23 02:46:17 +00:00
cronjob_helper.go fix: Fix the problem of failed MySQL permission modification (#8351) 2025-04-08 10:49:53 +00:00
dashboard.go feat: Support Ollama model management (#7866) 2025-02-13 15:28:29 +08:00
database.go style:fit some code style (#5601) 2024-06-28 14:04:08 +08:00
database_common.go fix: Fix the loading method of slow logs in MySQL and MariaDB (#7915) 2025-02-19 09:48:36 +00:00
database_mysql.go fix: mysql 绑定用户增加输入校验 (#6149) 2024-08-16 06:00:31 +00:00
database_postgresql.go fix: 解决 MariaDB 数据库同步失败的问题 (#5605) 2024-06-28 07:30:59 +00:00
database_redis.go fix: 处理数据库遮罩问题 (#5215) 2024-05-30 15:13:21 +08:00
device.go feat(systemctl): implement service manager initialization and command execution (#8380) 2025-04-17 10:26:13 +08:00
device_clean.go feat(systemctl): implement service manager initialization and command execution (#8380) 2025-04-17 10:26:13 +08:00
docker.go feat(systemctl): implement service manager initialization and command execution (#8380) 2025-04-17 10:26:13 +08:00
entry.go feat: Add MCP management (#8299) 2025-04-02 09:01:54 +00:00
fail2ban.go fix: 解决 Fail2ban 禁用方式切换失败的问题 (#3704) 2024-01-25 18:18:47 +08:00
favorite.go
file.go fix: Fix the loading method of slow logs in MySQL and MariaDB (#7915) 2025-02-19 09:48:36 +00:00
firewall.go fix(forward): Fix the problem of duplicate creation of port forwardin… (#7975) 2025-02-24 09:21:14 +00:00
ftp.go perf: Optimize FTP sync function for better performance and readability (#7479) 2024-12-20 15:45:05 +08:00
group.go
helper.go
host.go fix: 解决主机默认分组失败的问题 (#2839) 2023-11-07 15:41:28 +00:00
host_tool.go feat(systemctl): implement service manager initialization and command execution (#8380) 2025-04-17 10:26:13 +08:00
image.go fix: Optimize image deletion error return (#7602) 2024-12-30 09:17:49 +00:00
image_repo.go fix: 解决容器镜像仓库编辑失败的问题 (#6845) 2024-10-25 14:11:55 +00:00
logs.go feat: Optimize Location Information Display in System Login Logs (#7459) 2024-12-20 04:16:25 +00:00
mcp_server.go feat: update mcp proxy_pass (#8374) 2025-04-10 16:45:24 +08:00
monitor.go refactor: 调整主机监控任务时间为整分钟执行 (#6379) 2024-09-05 08:41:48 +00:00
nginx.go pref: 释放容器 client 连接 (#4700) 2024-04-25 08:45:12 +00:00
nginx_utils.go feat: Nginx 配置支持 Lua 模块 (#3844) 2024-02-06 06:02:12 +00:00
php_extensions.go fix: 解决 PHP 模版添加失败的问题 (#3541) 2024-01-09 07:57:34 +00:00
process.go
recycle_bin.go fix: 解决回收站文件放置错误问题 (#4203) 2024-03-15 08:40:07 +00:00
runtime.go feat(runtime): correct typo in variable name (#7172) 2024-11-25 12:05:42 +08:00
runtime_utils.go feat(appstore): Handle Requests After Application Installation (#7206) 2024-11-28 10:42:40 +00:00
setting.go feat(systemctl): implement service manager initialization and command execution (#8380) 2025-04-17 10:26:13 +08:00
snapshot.go feat: basic support riscv64 (#8369) 2025-04-17 10:24:04 +08:00
snapshot_create.go WIP: refactor(service): Refactor OpenRC service manager (#8416) 2025-04-23 17:04:08 +08:00
snapshot_recover.go WIP: refactor(service): Refactor OpenRC service manager (#8416) 2025-04-23 17:04:08 +08:00
ssh.go WIP: refactor(service): Refactor OpenRC service manager (#8416) 2025-04-23 17:04:08 +08:00
upgrade.go WIP: refactor(service): Refactor OpenRC service manager (#8416) 2025-04-23 17:04:08 +08:00
website.go Fix issue with errors when reverse proxy source text includes comments. (#8444) 2025-04-22 07:51:06 +00:00
website_acme_account.go feat: 不同类型 ACME 账号支持使用同一个邮箱 (#3344) 2023-12-15 07:48:09 +00:00
website_ca.go feat(system-security): Support Hot Reloading of System Certificates (#7152) 2024-11-22 09:48:13 +00:00
website_dns_account.go feat: 升级 github.com/go-jose/go-jose/v3 版本到 v3.0.3 (#4121) 2024-03-08 08:14:07 +00:00
website_ssl.go feat: Fix Issue with DNS Account Deletion After Certificate Update Ap… (#7303) 2024-12-10 03:15:38 +00:00
website_utils.go feat: Added streaming transmission configuration (#7875) 2025-02-15 12:59:38 +00:00