fix: 源頭就寫對的網址,不靠發佈時改寫(leo 2026-07-21)
leo:「要發佈的正稿,從頭就不要用奇怪的網址,以免改來改去。」 =sanitize 每次改寫是補丁不是解法。改成源頭正確: - README/README.en:死帳號 uncle6me-web → youlinhsieh(該帳號已 suspend, 安裝指令指著它半年沒人發現=別人照做必失敗) - install.sh/update.sh:來源預設改公開 GitHub raw;內部要指私有草稿源 走 TEMPLATE_SOURCE= 環境變數覆寫,不改檔 → 兩邊不再需要維護兩份網址 - tasks-project-sync.yaml 註解範例帳號改通用佔位符 sanitize 降級為「安全網」:正常情況應無需改寫;若它報告改了東西= 源頭又混進錯網址的信號,回頭修源頭。保留它做發佈前驗證(殘留即中止)—— 擋的是「只有外部使用者才會撞到、我們自己永遠測不到」的錯。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,15 +3,18 @@
|
||||
|
||||
由 publish-github.sh 自動呼叫(步驟 3.5),參數=匯出樹的暫存目錄。
|
||||
|
||||
為什麼需要(leo 2026-07-21):
|
||||
「我不想給它 Gitea 網址,因為我們已經計劃要把 gitea 改用 CF 版本了。」
|
||||
🔑 定位(leo 2026-07-21 校正):**這支是安全網,不是主要手段。**
|
||||
|
||||
install.sh / update.sh 內建的抓取來源指向我們的 **private Gitea**:
|
||||
- 別人抓不到(private)→ 裝不起來
|
||||
- 且該網址即將換成 CF 版 → 公開出去的網址馬上失效
|
||||
leo:「要發佈的正稿,**從頭就不要用奇怪的網址,以免改來改去**。」
|
||||
|
||||
→ 公開版一律改指 GitHub raw。私有工作區維持 Gitea 不動,
|
||||
兩邊不必手工維護兩份(改寫發生在發佈當下)。
|
||||
→ 已於同日**源頭修正**:install.sh/update.sh 的來源預設就是公開 GitHub raw
|
||||
(內部要指私有草稿源時走 `TEMPLATE_SOURCE=` 環境變數覆寫,不改檔);
|
||||
README 的死帳號 `uncle6me-web` 也直接改掉。
|
||||
**正常情況下本腳本應該「無需改寫」** ——若它報告改了東西,代表源頭又混進錯網址,
|
||||
那是要回頭修源頭的信號,不是「反正發佈時會自動改」。
|
||||
|
||||
保留它的理由=**發佈前的最後一道驗證**:任何殘留失效來源就 exit 1 中止,
|
||||
避免「別人照著裝卻裝不起來」這種只有外部使用者才會撞到、我們自己永遠測不到的錯。
|
||||
"""
|
||||
import pathlib
|
||||
import re
|
||||
|
||||
+7
-3
@@ -26,9 +26,13 @@ t() { if [ "$IS_ZH" = "yes" ]; then printf '%s\n' "$1"; else printf '%s\n' "$2";
|
||||
# tn = 不換行版(給 prompt 用)
|
||||
tn() { if [ "$IS_ZH" = "yes" ]; then printf '%s' "$1"; else printf '%s' "$2"; fi; }
|
||||
|
||||
REPO_URL="https://git.uncle6.me/Leo/system-dev-template/raw/branch/main/template"
|
||||
# 來源預設=公開 GitHub(leo 2026-07-21:「要發佈的正稿,從頭就不要用奇怪的網址,
|
||||
# 以免改來改去」)。內部指向私有草稿源時用環境變數覆寫,不改檔:
|
||||
# TEMPLATE_SOURCE=https://<私有 raw base> bash scripts/install.sh
|
||||
TEMPLATE_SOURCE="${TEMPLATE_SOURCE:-https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main}"
|
||||
REPO_URL="$TEMPLATE_SOURCE/template"
|
||||
# install.sh / update.sh 住在 main/scripts/(不在 template/)。
|
||||
SCRIPTS_URL="https://git.uncle6.me/Leo/system-dev-template/raw/branch/main/scripts"
|
||||
SCRIPTS_URL="$TEMPLATE_SOURCE/scripts"
|
||||
CREATED=()
|
||||
SKIPPED=()
|
||||
|
||||
@@ -115,7 +119,7 @@ if [ -d "system-dev" ] || [ -d ".claude/wiki" ] || [ -f ".claude/VERSION" ]; the
|
||||
t " 後續的更新、遷移、補新檔,一律由「更新腳本」處理(不要重跑 install):" \
|
||||
" All updates, migrations, and new-file additions are handled by the UPDATER (don't re-run install):"
|
||||
echo ""
|
||||
echo " curl -sSL https://git.uncle6.me/Leo/system-dev-template/raw/branch/main/scripts/update.sh | bash"
|
||||
echo " curl -sSL https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main/scripts/update.sh | bash"
|
||||
echo ""
|
||||
t " (重跑 install 可能建出空白範本、跟你的真資料並存,故在此停止。)" \
|
||||
" (Re-running install could create empty templates alongside your real data, so it stops here.)"
|
||||
|
||||
+5
-1
@@ -23,7 +23,11 @@ esac
|
||||
t() { if [ "$IS_ZH" = "yes" ]; then printf '%s\n' "$1"; else printf '%s\n' "$2"; fi; }
|
||||
tn() { if [ "$IS_ZH" = "yes" ]; then printf '%s' "$1"; else printf '%s' "$2"; fi; }
|
||||
|
||||
REPO_RAW="https://git.uncle6.me/Leo/system-dev-template/raw/branch/main"
|
||||
# 來源預設=公開 GitHub(leo 2026-07-21:「要發佈的正稿,從頭就不要用奇怪的網址,
|
||||
# 以免改來改去」)。發佈時不再需要改寫網址——寫死的就是對外正確的那一個。
|
||||
# 內部要改指私有草稿源(Gitea/未來 CF git)時,用環境變數覆寫,不改檔:
|
||||
# TEMPLATE_SOURCE=https://<你的私有 raw base> bash scripts/update.sh
|
||||
REPO_RAW="${TEMPLATE_SOURCE:-https://raw.githubusercontent.com/youlinhsieh/system-dev-template/main}"
|
||||
TEMPLATE_URL="$REPO_RAW/template"
|
||||
|
||||
UPDATED=()
|
||||
|
||||
Reference in New Issue
Block a user