docs: document ACL policy and Taildrive

- README: 新增「ACL 政策與 Taildrive」章節(啟用方式、現行規則、使用指令)
- OPERATIONS: 新增 ACL 政策管理 + Taildrive 操作章節
- CLAUDE.md: Core Components 加入 policy.hujson、image 改為 v0.29.0;補 policy 結構說明
- SUMMARY: 功能特色加入 ACL policy 與 Taildrive 檔案分享

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-18 18:36:46 +08:00
parent 5e48016852
commit 566675c693
4 changed files with 83 additions and 1 deletions

View File

@@ -213,6 +213,43 @@ make prune
- **全域 DNS**: NextDNS、Cloudflare、Google、Quad9
- **本地 DNS 覆蓋**: 已啟用
## ACL 政策與 Taildrive
ACL 政策以 HuJSON 檔管理,啟用方式為 `config.yaml``policy.mode: file``policy.path: /etc/headscale/policy.hujson`(對應 repo 的 `config/policy.hujson`)。
> ⚠️ 沒有 policy 檔時 headscale 預設「全部互通」;一旦啟用 policy`acls` 變成唯一授權來源。`policy.hujson` 內務必保留 allow-all 規則,否則所有節點會立即斷線。
目前規則:
- **acls**`accept src=* dst=*:*` —— 維持全互通。
- **nodeAttrs**:所有節點皆取得 `drive:share` / `drive:access`
- **grants**`tailscale.com/cap/drive`,所有 share 開放讀寫(`rw`)。
修改後驗證與套用:
```bash
# 驗證語法
docker exec headscale headscale policy check --file /etc/headscale/policy.hujson
# 查看目前生效的政策
docker exec headscale headscale policy get
# 套用file 模式需重啟容器讀取)
make restart
```
### Taildrive節點間檔案分享
需 headscale v0.29.0+(已支援 `nodeAttrs` / Taildrive policy。分享端僅 Linux/macOS/WindowsiOS/Android 可存取。
```bash
# 分享端:把目錄分享出去
tailscale drive share <分享名稱> /要分享的/目錄
tailscale drive list
# 存取端
# macOS/Windows用 Finder/檔案總管連 WebDAV
# Linux掛載 http://100.100.100.100:8080/<tailnet>/<peer-name>/<分享名稱>
```
## 故障排除
### 常見問題