Files
Nexus/docs/changelog/2026-06-04-nexus-1panel-unified-script.md
T
Nexus Deploy 65e4478b4b feat(deploy): load credentials from nexus-1panel.secrets.sh
Keep secrets out of tracked scripts; support git add -f secrets file,
git remote token parsing, and port/firewall checks for one-click install.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 23:37:37 +08:00

2.1 KiB
Raw Blame History

Changelog: 1Panel 统一一键脚本 + 资源档位

日期: 2026-06-04

摘要

合并 install-1panel-docker.shupgrade-1panel-docker.shdeploy/nexus-1panel.sh:域名、Gitea、路径等默认已填;支持 install / upgrade / check / init-token;可选 --profile 2c8g|4c16g|1c4g--cpus N --mem-gb N 自动匹配 MySQL/Redis/Nexus 内存与连接池。

动机

用户要求单脚本、少 export、可按机器核数/内存选档。

涉及文件

  • deploy/nexus-1panel.sh — 主入口
  • deploy/install-1panel-docker.shdeploy/upgrade-1panel-docker.sh — 转调主脚本
  • deploy/nexus-1panel.secrets.sh.example — 令牌模板(真实令牌用 init-token 或 gitignore 的 nexus-1panel.secrets.sh
  • docker/profiles/{1c4g,2c8g,4c16g}.env
  • docker/mysql-prod-{1c4g,4c16g}.cnf
  • docker/docker-compose.prod.yml — 档位变量化

服务器用法

# 首次(写入令牌,仅需一次)
bash deploy/nexus-1panel.sh init-token '你的Gitea令牌'

# 2核8G(默认)
bash deploy/nexus-1panel.sh install

# 4核16G
bash deploy/nexus-1panel.sh install --profile 4c16g

# 或指定规格自动匹配档位
bash deploy/nexus-1panel.sh install --cpus 4 --mem-gb 16

# 已 clone 在 /opt/nexus
cd /opt/nexus && bash deploy/nexus-1panel.sh install --skip-clone

# 升级
bash deploy/nexus-1panel.sh upgrade
bash deploy/nexus-1panel.sh check

迁移/重启

  • 改档位后需 docker compose up -d --buildinstall/upgrade 已包含)
  • MySQL innodb_buffer_pool 变更可能需容器重建

后续(同批)

  • 凭据集中在 deploy/nexus-1panel.secrets.shgitignore);私人仓库可 git add -f 后服务器零 export 安装
  • install / upgrade 前检测 Gitea 端口可达性;检测本机 80/443/8600 与 UFW/firewalld 放行提醒
  • 子命令 ports 可单独跑端口检查
  • 安装成功后检测 https://域名/health 外网是否可达

验证

  • bash -n deploy/nexus-1panel.sh
  • bash deploy/nexus-1panel.sh ports
  • 服务器:install --skip-clone + curl http://127.0.0.1:8600/health