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

@@ -92,6 +92,40 @@ headscale users list
headscale users rename --identifier 1 --new-name mainnet
```
## ACL 政策管理
政策檔:`config/policy.hujson`(容器內 `/etc/headscale/policy.hujson`),由 `config.yaml``policy.mode: file` + `policy.path` 啟用。
```bash
# 驗證語法(套用前務必先跑)
docker exec headscale headscale policy check --file /etc/headscale/policy.hujson
# 查看目前生效的政策
docker exec headscale headscale policy get
# 修改後套用file 模式於啟動時讀取,需重啟)
make restart
```
> ⚠️ 啟用 policy 後,`acls` 是唯一授權來源。`policy.hujson` 須保留 allow-all`accept * -> *:*`)才能維持全互通,否則節點立即斷線。修改後務必確認 `headscale nodes list` 仍 online 且能 `tailscale ping`。
### Taildrive節點間檔案分享
權限由 policy 控制:`nodeAttrs` 授予 `drive:share` / `drive:access``grants``tailscale.com/cap/drive` 指定 share 範圍與讀寫權限(`rw` / `ro`)。需 headscale v0.29.0+。
```bash
# 分享端Linux/macOS/Windows
tailscale drive share <分享名稱> /要分享的/目錄
tailscale drive list
tailscale drive unshare <分享名稱>
# 存取端Linux 掛 WebDAV
# http://100.100.100.100:8080/<tailnet>/<peer-name>/<分享名稱>
# 確認能力已下發到節點
docker exec tailscale tailscale debug netmap | grep -i drive
```
## 設備連接流程
### 完整流程