Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 0 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@ on:
permissions:
contents: read

# The Headscale module can't be fetched through the Go proxy (a golden-test file
# has a '>' in its path), so it's pulled in via `replace => ../headscale`.
env:
HEADSCALE_REF: 63123196cc21eeb301eec60bf05d5fe0a2bc4787

jobs:
engine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
path: tailground
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
repository: juanfont/headscale
ref: ${{ env.HEADSCALE_REF }}
path: headscale
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: "1.27"
Expand Down Expand Up @@ -56,11 +46,6 @@ jobs:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
path: tailground
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
repository: juanfont/headscale
ref: ${{ env.HEADSCALE_REF }}
path: headscale
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: "1.27"
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ permissions:
contents: read
actions: read # gh run download — restore the previous run's creds for the reaper

env:
HEADSCALE_REF: 63123196cc21eeb301eec60bf05d5fe0a2bc4787

jobs:
corpus:
if: ${{ github.event_name == 'schedule' || inputs.corpus }}
Expand All @@ -38,11 +35,6 @@ jobs:
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with: { path: tailground }
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
repository: juanfont/headscale
ref: ${{ env.HEADSCALE_REF }}
path: headscale
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: "1.27"
Expand Down Expand Up @@ -127,11 +119,6 @@ jobs:
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with: { path: tailground }
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
repository: juanfont/headscale
ref: ${{ env.HEADSCALE_REF }}
path: headscale
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: "1.27"
Expand Down Expand Up @@ -205,11 +192,6 @@ jobs:
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with: { path: tailground }
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
repository: juanfont/headscale
ref: ${{ env.HEADSCALE_REF }}
path: headscale
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: "1.27"
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,13 @@ concurrency:
group: pages
cancel-in-progress: true

env:
HEADSCALE_REF: 63123196cc21eeb301eec60bf05d5fe0a2bc4787

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
path: tailground
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
repository: juanfont/headscale
ref: ${{ env.HEADSCALE_REF }}
path: headscale
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
with:
go-version: "1.27"
Expand Down
8 changes: 3 additions & 5 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ nothing), `go vet ./...` (root module and `server/` separately), and
saying a change works: Go changes get `gofmt`, `go vet`, `go test`; web changes
get `npm run typecheck` and `npm test`.

Building needs a sibling checkout: `go.mod` replaces
`github.com/juanfont/headscale` with `../headscale`. `vendor/`,
Building needs `make vendor`; `vendor/`,
`web/public/engine.wasm` and `wasm_exec.js` are generated and git-ignored.

## Gotchas
Expand All @@ -63,9 +62,8 @@ Things that break silently or are easy to miss:
`testdata/` goldens. Regenerate with `go test ./engine/<pkg> -run TestGolden
-update` only after an intentional behavior change, and review the diff. Never
regenerate just to make a failing test pass.
- **Headscale pin.** `HEADSCALE_REF` is set in `ci.yml`, `e2e.yml` and
`pages.yml`; bump all three together and keep your local `../headscale` on the
same commit. `make vendor` applies `engine/vendor-trim/capabilities.patch` and
- **Headscale version.** The engine builds against published Headscale
(`v0.29.8`). `make vendor` applies `engine/vendor-trim/capabilities.patch` and
fails if it no longer applies (see `engine/vendor-trim/README.md` for why the
config stub exists). Never hand-edit `vendor/`.
- **Tutorials.** Each lesson is a directory
Expand Down
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,7 @@ API; if unavailable, the full scenario is encoded in the URL fragment.

## Develop

Requires Go 1.27+ and Node 20+. The engine builds against a sibling checkout of
Headscale (`go.mod` replaces `github.com/juanfont/headscale` with `../headscale`).
Check out the commit CI pins (`HEADSCALE_REF` in `.github/workflows/ci.yml`):

```sh
git clone https://github.com/juanfont/headscale ../headscale
git -C ../headscale checkout 63123196cc21eeb301eec60bf05d5fe0a2bc4787
```
Requires Go 1.27+ and Node 20+.

```sh
make vendor # once, and after any dependency bump (vendors Headscale and applies engine/vendor-trim/capabilities.patch)
Expand Down
5 changes: 3 additions & 2 deletions engine/vendor-trim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ allowlist, while the Tailscale control plane accepts more of them. This makes
Tailground report a parse error for valid policies. `capabilities.patch` adds
the missing names to the vendored allowlist; `make vendor` applies it after
`go mod vendor`. It currently adds `tailscale.com/cap/aperture` (Aperture
gateway grants). Drop a line when upstream Headscale allowlists that name; if
the patch no longer applies after a bump, re-create it against the new file.
gateway grants) plus `cap/secrets` and `cap/pam`. Drop a line when upstream
Headscale allowlists those names; if the patch no longer applies after a bump,
re-create it against the new file.
15 changes: 9 additions & 6 deletions engine/vendor-trim/capabilities.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
--- a/hscontrol/policy/v2/types.go
+++ b/hscontrol/policy/v2/types.go
@@ -2277,6 +2277,14 @@
// tailscale.com/cap/secrets is the capability used by setec
// (github.com/tailscale/setec); allow it so it can be granted via policy.
peercap.Cap("tailscale.com/cap/secrets"): true,
@@ -2346,5 +2346,17 @@
tailcfg.PeerCapabilityKubernetes: true, // tailscale.com/cap/kubernetes
tailcfg.PeerCapabilityTsIDP: true, // tailscale.com/cap/tsidp
+
+ // tailscale.com/cap/secrets is the capability used by setec
+ // (github.com/tailscale/setec); allow it so it can be granted via policy.
+ tailcfg.PeerCapability("tailscale.com/cap/secrets"): true,
+
+ // tailscale.com/cap/aperture is granted to Aperture gateway users; the
+ // Tailscale control plane accepts it, so Tailground must too.
+ peercap.Cap("tailscale.com/cap/aperture"): true,
+ tailcfg.PeerCapability("tailscale.com/cap/aperture"): true,
+
+ // tailscale.com/cap/pam is added to the default policy when PAM is enabled;
+ // the Tailscale control plane accepts it, so Tailground must too.
+ peercap.Cap("tailscale.com/cap/pam"): true,
+ tailcfg.PeerCapability("tailscale.com/cap/pam"): true,
}

// validateGrantSrcDstCombination validates [Grant]-specific source/destination
76 changes: 40 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,53 +1,55 @@
module github.com/frozenprocess/tailground

go 1.27.0
go 1.27.3

require (
github.com/juanfont/headscale v0.0.0-00010101000000-000000000000
github.com/juanfont/headscale v0.29.8
github.com/rs/zerolog v1.35.1
github.com/tailscale/hujson v0.0.0-20260302212456-ecc657c15afd
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
golang.org/x/oauth2 v0.36.0
tailscale.com v1.103.0-pre.0.20260819232550-0e84b4a3a0a0
tailscale.com/client/tailscale/v2 v2.9.0
github.com/tailscale/hujson v0.0.0-20260727124030-b80ff77dac4f
go4.org/netipx v0.0.0-20260823151212-3075585bcbeb
golang.org/x/oauth2 v0.37.0
tailscale.com v1.104.4
tailscale.com/client/tailscale/v2 v2.12.0
)

require (
filippo.io/edwards25519 v1.2.0 // indirect
github.com/akutz/memconn v0.1.0 // indirect
github.com/alexbrainman/sspi v0.0.0-20250919150558-7d374ff0d59e // indirect
github.com/coder/websocket v1.8.14 // indirect
github.com/coder/websocket v1.8.15 // indirect
github.com/coreos/go-oidc/v3 v3.18.0 // indirect
github.com/creachadair/msync v0.8.2 // indirect
github.com/dblohm7/wingoes v0.0.0-20250822163801-6d8e6105c62d // indirect
github.com/creachadair/msync v0.10.1 // indirect
github.com/dblohm7/wingoes v0.0.0-20260526185140-fb298caac7ca // indirect
github.com/fsnotify/fsnotify v1.10.1 // indirect
github.com/fxamacker/cbor/v2 v2.9.1 // indirect
github.com/gaissmai/bart v0.26.1 // indirect
github.com/fxamacker/cbor/v2 v2.9.3 // indirect
github.com/gaissmai/bart v0.29.0 // indirect
github.com/go-jose/go-jose/v4 v4.1.4 // indirect
github.com/go-json-experiment/json v0.0.0-20260623181947-01eb4420fa68 // indirect
github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/godbus/dbus/v5 v5.2.2 // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/go-cmp v0.7.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 // indirect
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
github.com/huin/goupnp v1.3.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.5 // indirect
github.com/jsimonetti/rtnetlink v1.4.2 // indirect
github.com/klauspost/compress v1.19.1 // indirect
github.com/klauspost/compress v1.20.0 // indirect
github.com/mattn/go-colorable v0.1.15 // indirect
github.com/mattn/go-isatty v0.0.23 // indirect
github.com/mdlayher/netlink v1.8.0 // indirect
github.com/mdlayher/socket v0.5.1 // indirect
github.com/mattn/go-isatty v0.0.24 // indirect
github.com/mdlayher/netlink v1.11.2 // indirect
github.com/mdlayher/socket v0.7.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.3.1 // indirect
github.com/pires/go-proxyproto v0.9.2 // indirect
github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.69.0 // indirect
github.com/pelletier/go-toml/v2 v2.4.3 // indirect
github.com/pires/go-proxyproto v0.15.0 // indirect
github.com/prometheus/client_model v0.6.3 // indirect
github.com/prometheus/common v0.71.0 // indirect
github.com/puzpuzpuz/xsync/v4 v4.5.0 // indirect
github.com/safchain/ethtool v0.7.0 // indirect
github.com/sagikazarmark/locafero v0.12.0 // indirect
github.com/samber/lo v1.53.0 // indirect
github.com/spf13/afero v1.15.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
github.com/spf13/pflag v1.0.10 // indirect
Expand All @@ -56,24 +58,26 @@ require (
github.com/tailscale/certstore v0.1.1-0.20260409135935-3638fb84b77d // indirect
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect
github.com/tailscale/web-client-prebuilt v0.0.0-20251127225136-f19339b67368 // indirect
github.com/tailscale/wireguard-go v0.0.0-20260813211458-aa425f19bcbf // indirect
github.com/tailscale/web-client-prebuilt v0.0.0-20260917222731-e0ed2d0d0fea // indirect
github.com/tailscale/wireguard-go v0.0.0-20260928213032-417aef361226 // indirect
github.com/x448/float16 v0.8.4 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go.yaml.in/yaml/v3 v3.0.5 // indirect
go4.org/mem v0.0.0-20240501181205-ae6ca9944745 // indirect
golang.org/x/crypto v0.54.0 // indirect
golang.org/x/exp v0.0.0-20260603202125-055de637280b // indirect
golang.org/x/net v0.57.1-0.20260729233039-99c3b0a8f463 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/term v0.45.0 // indirect
golang.org/x/text v0.40.0 // indirect
golang.org/x/time v0.15.0 // indirect
golang.org/x/crypto v0.58.0 // indirect
golang.org/x/exp v0.0.0-20260908205506-85c1c2202aba // indirect
golang.org/x/net v0.60.0 // indirect
golang.org/x/sync v0.24.0 // indirect
golang.org/x/sys v0.49.0 // indirect
golang.org/x/term v0.47.0 // indirect
golang.org/x/text v0.43.0 // indirect
golang.org/x/time v0.16.0 // indirect
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
google.golang.org/protobuf v1.36.11 // indirect
golang.zx2c4.com/wireguard/windows v1.0.1 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20260610212136-7ab31c22f7ad // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa // indirect
google.golang.org/grpc v1.83.2 // indirect
google.golang.org/protobuf v1.36.12 // indirect
gorm.io/gorm v1.31.1 // indirect
gvisor.dev/gvisor v0.0.0-20260224225140-573d5e7127a8 // indirect
gvisor.dev/gvisor v0.0.0-20260915211658-a6f909f08a72 // indirect
)

replace github.com/juanfont/headscale => ../headscale
Loading
Loading