Files
ServerStack/.workbuddy/memory/2026-07-21.md
T
condor 679e0b4184 init
2026-07-24 18:54:53 +08:00

31 lines
3.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 2026-07-21
## 升级脚本支持范围到 Debian 9-13 / Ubuntu 16-26
- **根因**`lib/check_sw.sh` 的 Debian 依赖 case 只列 `9|10|11|12`Debian 13 会落入 `*` 分支被 `kill -9` 退出。
- **改动**
- `lib/check_sw.sh:151`Debian case 标签 `9|10|11|12``9|10|11|12|13`Debian 13 复用 12 的依赖列表;包名差异(如 libidn11 在新版移除)由 `filter_pkglist()``apt-cache policy` 动态兜底跳过。
- 同步更新支持范围声明注释:`check_sw.sh:4``check_os.sh:5``README.md:14``docs/USAGE.md:3``:196`,由 "Debian 9+ / Ubuntu 16+" 改为 "Debian 9-13 / Ubuntu 16-26"。
- **验证**`bash -n` 两文件 OKDebian 13 现落 `9|10|11|12|13` 分支;`check_os.sh` 门槛只查下限(`<9`/`<16`)无上限拦截,版本号解析 26.04→26、13→13 正确;`sslLibVer` 对 13/24/26 均 `ssl102`Ubuntu 走 `installDepsUbuntu()` 无 case 拦截。
- **边界(未处理)**Ubuntu 24/26 系统 `libicu` 为新版本(74/76+),PHP 7.4 的 intl 扩展可能编译不兼容——属 PHP 模块级适配,本轮仅保证 OS 检测与依赖安装阶段不中途失败,未扩展 `libicu` 降级特例(原 `=~ ^22$` 仅覆盖 22.04)。
- **仍须同步到服务器**:所有改动在本地 `E:\workbuddy\ServerStack\`,需 `rsync`/`git pull` 后重跑 `install.sh` 才生效。
## 限制 Ubuntu 24+ 只能装 PHP 8.x
- **根因**Ubuntu 24+ 系统 `libicu` 为新版(74/76+),PHP 7.4(及 mphp 7.4)编译不兼容 intl 扩展。
- **判断条件**`Family==ubuntu && Ubuntu_ver>=24`(覆盖 24.04 / 25.x / 26.04)。Debian 不限;Ubuntu 22/23 仍允许 7.4。
- **改动(4 文件,`bash -n` 全 OK**
- `core/menu.sh`:交互菜单在 Ubuntu 24+ 把选项 1(php-7.4) 标 `(unavailable on Ubuntu N+)`,选 1 时报错并重新选择。
- `core/argument.sh`:命令行 `--php_option 1` / `--mphp_ver 74` 在 Ubuntu 24+ 直接 `exit 1` 报错。
- `core/validator.sh`:校验阶段同样 `error_exit` 拒绝 7.4 / mphp 74。
- `core/installer.sh`:分发处防御,`php_option=1` / `mphp_ver=74` 在 Ubuntu 24+ 跳过并提示(防绕过校验)。
- **验证**:逻辑模拟各组合正确——Ubuntu 24/25/26 选 7.4 均拒;Ubuntu 22/23、Debian 13 仍允许;空 `Family` 变量有误杀防御(不限制)。
- **仍须同步到服务器**才生效。
## 所有系统防火墙默认选 iptables
- **背景**:项目已裁剪为仅 Debian/Ubuntufirewalld/ufw 已移除),iptables 是唯一的防火墙。原 `iptables_flag` 在交互模式需手动选、命令行模式需传 `--iptables` 才置 `y`,否则非交互安装就不装防火墙。
- **改动(2 文件,`bash -n` 全 OK**
- `core/menu.sh`:交互提示默认 `y``[ -z "${iptables_flag}" ] && iptables_flag=y`,提示文案加 `(default y)`);用户仍可答 `n` 退出。
- `core/argument.sh``parse_arguments` 末尾加 `iptables_flag=${iptables_flag:-y}`,非交互安装即使不传 `--iptables` 也默认启用;同时 `Show_Help` 文案改为 "Enable iptables (enabled by default on all systems)"。
- 底层 `core/os/init_Ubuntu.sh` / `init_Debian.sh``if [ "${iptables_flag}" == 'y' ]` 分支不变,默认开启后所有系统(Debian 9-13 / Ubuntu 16-26)安装时均会装并配置 iptables。
- **验证**:模拟四路径——非交互无 `--iptables`→y、带 `--iptables`→y、交互回车→y、交互答 n→n(退出仍生效)。
- **仍须同步到服务器**才生效。