feat(headscale): add file-based ACL policy

Ship policy.hujson (mounted + installed on first deploy, edits preserved) and
wire policy.mode=file / policy.path in config.yaml. Translate the Tailscale
"grants" default into headscale's legacy "acls" format (self-access, tag:shared,
Tailscale SSH), since headscale 0.28 doesn't support grants. Embed in deploy.sh
and document `headscale policy check`.
This commit is contained in:
57_Wolve committed 2026-06-12 16:04:24 -05:00
1 parent 25f20037e9
commit 573785f2cc
6 files changed
+167 -64

No files matched your search

+5 -5
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
#
# build.sh -- (re)embed docker-compose.yml, Caddyfile, config.yaml, and
# .env.example into deploy.sh as a base64-encoded tar.gz payload after the
# __ARCHIVE_BELOW__ marker. Idempotent: strips any existing payload first.
# build.sh -- (re)embed docker-compose.yml, Caddyfile, config.yaml,
# policy.hujson and .env.example into deploy.sh as a base64-encoded tar.gz
# payload after the __ARCHIVE_BELOW__ marker. Idempotent: strips first.
#
# Run after editing any of the loose files. The resulting deploy.sh is
# self-contained and can be scp'd to the target box on its own.
@@ -14,12 +14,12 @@ SCRIPT="$DIR/deploy.sh"
MARKER="__ARCHIVE_BELOW__"
[[ -f "$SCRIPT" ]] || { echo "deploy.sh not found at $SCRIPT" >&2; exit 1; }
for f in docker-compose.yml Caddyfile config.yaml .env.example; do
for f in docker-compose.yml Caddyfile config.yaml policy.hujson .env.example; do
[[ -f "$DIR/$f" ]] || { echo "Missing $DIR/$f" >&2; exit 1; }
done
PAYLOAD=$(tar -czf - -C "$DIR" \
docker-compose.yml Caddyfile config.yaml .env.example | base64)
docker-compose.yml Caddyfile config.yaml policy.hujson .env.example | base64)
TMP=$(mktemp)
trap 'rm -f "$TMP"' EXIT