fix(install): drop Gitea token warning for public repo installs
Public anonymous clone needs no secrets file; document token as optional for private repos only. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -81,7 +81,7 @@ nx god # 上帝菜单(重启 Python / 升级 / 日志)
|
||||
| 迁机保留旧密钥 | `nexus-1panel.sh install --from-env /path/to/old/.env` |
|
||||
| 显式复用 secrets 文件 | `nexus-1panel.sh install --reuse-secrets`(**勿用于新机**) |
|
||||
|
||||
`deploy/nexus-1panel.secrets.sh` 只应放 `NEXUS_GITEA_TOKEN`,不要放生产 `SECRET_KEY`。
|
||||
**Gitea 令牌**:公共仓库 `curl | bash` / `git clone` **不需要**配置。仅私人仓库时可选 `/root/.nexus-deploy.env` 或 `nexus-1panel.sh init-token`。
|
||||
|
||||
## 安装向导 `/app/install.html`
|
||||
|
||||
|
||||
@@ -14,9 +14,7 @@
|
||||
#
|
||||
# bash deploy/install-nexus-fresh.sh --profile 4c16g
|
||||
#
|
||||
# 凭据(仅 Gitea git 用,NEXUS 密钥由安装脚本按机自动生成):
|
||||
# - /root/.nexus-deploy.env → NEXUS_GITEA_TOKEN
|
||||
# - deploy/nexus-1panel.secrets.sh 勿放生产 SECRET_KEY(新机勿复用)
|
||||
# 公共仓库匿名 clone,无需 Gitea 令牌。NEXUS 密钥由安装脚本按机自动生成。
|
||||
# =============================================================================
|
||||
|
||||
set -euo pipefail
|
||||
@@ -114,7 +112,7 @@ load_credentials() {
|
||||
set -a
|
||||
source "${NEXUS_ROOT}/deploy/nexus-1panel.secrets.sh"
|
||||
set +a
|
||||
info "已加载 ${NEXUS_ROOT}/deploy/nexus-1panel.secrets.sh(仅 git 令牌)"
|
||||
info "已加载 ${NEXUS_ROOT}/deploy/nexus-1panel.secrets.sh(可选)"
|
||||
fi
|
||||
unset NEXUS_SECRET_KEY NEXUS_API_KEY NEXUS_ENCRYPTION_KEY
|
||||
info "全新安装:NEXUS 密钥将在 docker/.env.prod 中按本机自动生成"
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# 复制为 deploy/nexus-1panel.secrets.sh(值见本地 SECRETS.md)
|
||||
# 私人仓库单人使用: git add -f deploy/nexus-1panel.secrets.sh && git push
|
||||
# 可选 — 仅私人 Gitea 仓库需要(公共仓库匿名 clone,新机无需此文件)
|
||||
# 复制: cp deploy/nexus-1panel.secrets.sh.example deploy/nexus-1panel.secrets.sh
|
||||
|
||||
NEXUS_GITEA_TOKEN='你的Gitea_Access_Token'
|
||||
# NEXUS_GITEA_TOKEN='你的Gitea_Access_Token'
|
||||
|
||||
# 新机安装勿填下面三项(install-nexus-fresh / --fresh 会自动按机生成)
|
||||
# 仅迁机时: bash deploy/nexus-1panel.sh install --reuse-secrets
|
||||
# NEXUS_SECRET_KEY=''
|
||||
# NEXUS_API_KEY=''
|
||||
# NEXUS_ENCRYPTION_KEY=''
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
# bash deploy/nexus-1panel.sh check
|
||||
# bash deploy/nexus-1panel.sh ports
|
||||
#
|
||||
# 凭据: deploy/nexus-1panel.secrets.sh(与 SECRETS.md 一致,gitignore)
|
||||
# 私人仓库可: git add -f deploy/nexus-1panel.secrets.sh && git push
|
||||
# 公共仓库匿名 clone,无需 Gitea 令牌。
|
||||
# 仅私人仓库可选: deploy/nexus-1panel.secrets.sh 或 /root/.nexus-deploy.env
|
||||
# 或 clone 时 URL 带令牌,脚本会从 git remote 自动解析
|
||||
|
||||
set -euo pipefail
|
||||
@@ -83,7 +83,7 @@ Nexus 1Panel 一键脚本
|
||||
升级选项:
|
||||
--no-backup --prune --dry-run
|
||||
|
||||
凭据: deploy/nexus-1panel.secrets.sh(推荐)或 /root/.nexus-deploy.env
|
||||
Git: 公共仓库匿名 clone(无需令牌);私人仓库见 init-token
|
||||
EOF
|
||||
exit 0
|
||||
}
|
||||
@@ -117,10 +117,6 @@ load_secrets() {
|
||||
source "$secrets_file"
|
||||
set +a
|
||||
info "已加载 $secrets_file"
|
||||
elif [[ ! -f "$NEXUS_DEPLOY_ENV" ]]; then
|
||||
warn "未找到 $(secrets_file_path)"
|
||||
warn " 请复制: cp deploy/nexus-1panel.secrets.sh.example deploy/nexus-1panel.secrets.sh 并填入凭据"
|
||||
warn " 或: bash $0 init-bundle (从本机 SECRETS 生成,见 deploy/README-1panel.md)"
|
||||
fi
|
||||
if [[ -f "$NEXUS_DEPLOY_ENV" ]]; then
|
||||
# shellcheck disable=SC1090
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
# 2026-06-05 — 安装脚本不再提示 Gitea 令牌
|
||||
|
||||
## 摘要
|
||||
|
||||
公共仓库已支持匿名 clone/pull,移除 `nexus-1panel.sh` 在未找到
|
||||
`nexus-1panel.secrets.sh` 时的 WARN 提示;文档与 example 标明令牌为可选项。
|
||||
|
||||
## 动机
|
||||
|
||||
用户新机 `curl | bash` 安装时看到「未找到 secrets 文件」误以为必须配置令牌。
|
||||
|
||||
## 涉及文件
|
||||
|
||||
- `deploy/nexus-1panel.sh` — 删除 load_secrets 警告块
|
||||
- `deploy/install-nexus-fresh.sh` — 注释更新
|
||||
- `deploy/README-1panel.md` — 明确无需令牌
|
||||
- `deploy/nexus-1panel.secrets.sh.example` — 改为可选私人仓库说明
|
||||
|
||||
## 验证
|
||||
|
||||
- 无 secrets 文件时 `load_secrets` 静默,公共 URL clone 正常
|
||||
- 仍可通过 `init-token` 或 secrets 文件为私人仓库配置令牌
|
||||
Reference in New Issue
Block a user