From 1460b5116362e80aa3b03ef4ca54a04daf26b400 Mon Sep 17 00:00:00 2001 From: Orion Date: Fri, 5 Jun 2026 09:43:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E4=BF=AE=E6=AD=A3=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=BA=93=E6=9B=B4=E6=96=B0=E8=84=9A=E6=9C=AC=E5=85=AC?= =?UTF-8?q?=E7=BD=91=E4=BB=93=E5=BA=93=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update-local-filecodebox.sh | 42 ++++++++----------- 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/deploy/1panel/script-library/update-local-filecodebox.sh b/deploy/1panel/script-library/update-local-filecodebox.sh index 4c8d85c..d8bcb37 100644 --- a/deploy/1panel/script-library/update-local-filecodebox.sh +++ b/deploy/1panel/script-library/update-local-filecodebox.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -REPO_URL="${REPO_URL:-http://127.0.0.1:3000/orion/filecodebox.git}" -TOKEN_FILE="${TOKEN_FILE:-/root/.cache/gitea-filecodebox-token}" +REPO_URL="${REPO_URL:-https://git.orionc.me/orion/filecodebox.git}" PROD_REPO_DIR="${PROD_REPO_DIR:-/opt/src/filecodebox-production}" PROD_DIR="${PROD_DIR:-/opt/1panel/apps/filecodebox/filecodebox}" BRANCH="${BRANCH:-master}" @@ -17,19 +16,13 @@ command -v docker >/dev/null 2>&1 || fail '缺少 docker' command -v curl >/dev/null 2>&1 || fail '缺少 curl' [[ -d "$PROD_DIR" ]] || fail "生产目录不存在:$PROD_DIR" -AUTH_REPO_URL="$REPO_URL" -if [[ -f "$TOKEN_FILE" && "$REPO_URL" == http://127.0.0.1:3000/* ]]; then - TOKEN="$(tr -d '\n' < "$TOKEN_FILE")" - AUTH_REPO_URL="http://orion:${TOKEN}@127.0.0.1:3000/orion/filecodebox.git" -fi - -log "拉取 $BRANCH 分支" +log "拉取公开仓库 $REPO_URL 的 $BRANCH 分支" if [[ ! -d "$PROD_REPO_DIR/.git" ]]; then rm -rf "$PROD_REPO_DIR" - git clone "$AUTH_REPO_URL" "$PROD_REPO_DIR" + git clone "$REPO_URL" "$PROD_REPO_DIR" fi cd "$PROD_REPO_DIR" -git remote set-url origin "$AUTH_REPO_URL" +git remote set-url origin "$REPO_URL" git fetch origin "$BRANCH" git checkout -B "$BRANCH" "origin/$BRANCH" git reset --hard "origin/$BRANCH" @@ -45,21 +38,21 @@ cp -a docker-compose.yml "backups/docker-compose.yml.before-update.$TS" log "同步 1Panel Compose 为本地 master 构建" python3 - </dev/null 2>&1 || true)