# ─────────────────────────────────────────────────────────────────────────── # arcrun self-hosted .env 範本 # # 用法(AI 操盤手會幫你做):把這個檔複製成 .env,然後照下面說明, # 一格一格把「=」右邊填上。左邊的名稱(KEY)不要改。 # cp .env.example .env # # 這個 .env 只放在你自己電腦/專案,已被 .gitignore 排除,不會上傳。 # ─────────────────────────────────────────────────────────────────────────── # ── ① Cloudflare(最基礎,這兩格沒填,下面什麼都跑不了)──────────────────────── # # arcrun 跑在「你自己的 Cloudflare」上(免費額度即可,不必綁信用卡)。 # 你要先有一個 Cloudflare 帳號,然後拿兩串東西貼回來: # # 1) 帳號代碼(Account ID): # 登入 https://dash.cloudflare.com → 右側欄就有「Account ID」→ 複製貼到下面。 # # 2) 金鑰(API Token): # https://dash.cloudflare.com/profile/api-tokens → Create Custom Token → # 勾三組權限(缺一不可): # · Account / Workers Scripts / Edit # · Account / Workers KV Storage / Edit # · Account / D1 / Edit ← 必勾!arcrun 用 D1 存 workflow/recipe, # 漏勾會在 acr init 建 D1 時報 Authentication error # → 建立後複製那串 token 貼到下面。(不需要 R2、不需要綁卡,D1 也在免費額度。) # CLOUDFLARE_ACCOUNT_ID= CLOUDFLARE_API_TOKEN= # ── ② 身份與加密(自架單人用,這兩格你自己決定/保管)────────────────────────── # # NAMESPACE:你的資料分區標籤。隨便取個英數小名即可(例:leo、myteam)。 # 這不是密碼,只是用來分隔你的資料。 # # ENCRYPTION_KEY:你的 credential 加密金鑰,64 個以上的 hex 字元。你自己保管。 # 不會的話,AI 可以幫你產一串: # node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" # ⚠️ 這串忘了 = 你之前上傳加密的 credential 就解不開了,請留底。 # (安裝完還要把「同一串」設進你的 worker,acr init 會印確切指令給你跟著做。) # NAMESPACE= ENCRYPTION_KEY= # ── ③ 各服務的 token(要連哪個服務才填哪個;可之後再加)──────────────────────── # # 連外部服務(Notion、Gmail、Telegram…)的 token 放這裡,給 AI 幫你 # 透過 `acr creds push` 加密上傳(不會明文留在雲端)。要連什麼就加一行。 # # 例:連 Notion → 去 https://www.notion.com/my-integrations 建一個 integration、 # 拿它的 token(ntn_… 開頭),把你要讀的 database 分享給這個 integration, # 然後填在下面: # # NOTION_INTEGRATION_TOKEN=