feat(deploy): public repo quick-install via curl (1Panel style)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nexus Deploy
2026-06-06 00:11:43 +08:00
parent feda614c52
commit 1acac6439a
6 changed files with 222 additions and 99 deletions
+10 -15
View File
@@ -5,16 +5,14 @@
# 适用:新机已装 1Panel / Docker,空库,走 /app/install.html 安装向导
# 风格参考 1Panel quick_start.sh:分阶段检查 + 结束输出访问地址
#
# 用法(私人 Gitea 勿用无认证 raw,会下到 "Not found.":
# 用法(公共仓库,root 下一条命令,参考 1Panel:
#
# 推荐 — 已 clone:
# cd /opt/nexus && sudo bash deploy/install-nexus-fresh.sh --skip-clone
# curl -fsSL "http://66.154.115.8:3000/admin/Nexus/raw/branch/main/deploy/quick-install.sh" | bash
#
# 或 — 带令牌下载后执行:
# echo 'NEXUS_GITEA_TOKEN=...' > /root/.nexus-deploy.env && chmod 600 /root/.nexus-deploy.env
# sudo bash deploy/download-install-fresh.sh
# 已 clone 到 /opt/nexus:
# cd /opt/nexus && bash deploy/install-nexus-fresh.sh --skip-clone
#
# sudo bash deploy/install-nexus-fresh.sh --profile 4c16g
# bash deploy/install-nexus-fresh.sh --profile 4c16g
#
# 凭据(任选其一,无需 export):
# - /root/.nexus-deploy.env
@@ -128,7 +126,9 @@ install_root_commands() {
"${NEXUS_ROOT}/deploy/nexus-1panel.sh" 2>/dev/null || true
ln -sf "${NEXUS_ROOT}/deploy/nx" /usr/local/bin/nx
ln -sf "${NEXUS_ROOT}/deploy/install-nexus-fresh.sh" /usr/local/bin/nexus-fresh
ln -sf "${NEXUS_ROOT}/deploy/quick-install.sh" /usr/local/bin/nexus-install
info "已注册全局命令(root 直接输入即可):"
info " nexus-install — 一键安装(公共仓库 curl)"
info " nx — 主菜单 / 上帝菜单"
info " nexus-fresh — 全新安装脚本"
}
@@ -224,16 +224,11 @@ phase_clone() {
return 0
fi
load_credentials
if [[ -z "${NEXUS_GITEA_TOKEN:-}" ]]; then
error "缺少 Gitea 令牌,无法 clone 私人仓库"
error "请任选一种方式:"
error " echo 'NEXUS_GITEA_TOKEN=你的令牌' > /root/.nexus-deploy.env && chmod 600 /root/.nexus-deploy.env"
error " 或在仓库 push deploy/nexus-1panel.secrets.sh 后重新运行本脚本"
exit 1
fi
local url
url="$(git_clone_url)"
if [[ -z "${NEXUS_GITEA_TOKEN:-}" ]]; then
info "公共仓库:匿名 git clone(无需令牌)"
fi
mkdir -p "$(dirname "$NEXUS_ROOT")"
if [[ -d "${NEXUS_ROOT}/.git" ]]; then