Repository navigation
fix: canonical {{ config.x }} template syntax in spore-sync, tailscale, rstudio-server - #6
Merged
Merged
Conversation
…e, rstudio-server
These specs used the Go-style {{ .Config.x }} / {{ .Instance.Name }} form,
which the spawn template engine never supported — it rendered to "<no value>",
so e.g. tailscale's auth key and hostname and spore-sync's mutagen target
expanded to nothing at install time.
Rewrite to the canonical lowercase {{ config.x }} / {{ instance.name }} /
{{ instance.ip }} form and bump each plugin to v1.0.1 (fix). All four registry
plugins now pass 'spawn plugin validate' under the hardened engine.
…v1.1.0)
A stop/start reassigns the instance's public IP; the mutagen session is pinned
to the old address and can't follow it, so the sync silently dies after a
restart. Add a local.reconcile block that terminates and recreates the session
against the new {{ instance.ip }} — spawn start replays it. Bump v1.0.1 -> v1.1.0
(backward-compatible feature). Verified live end-to-end via spawn.
Rework from a manual 'paste your own tskey' plugin to the Globus-style
mint-locally-push-to-remote pattern. On the controller (via local.env_passthrough
of TS_API_CLIENT_ID/SECRET) it exchanges the OAuth client credentials for an API
token, mints a single-use / ephemeral / preauthorized / tagged auth key with
curl+jq, and pushes it; the instance runs 'tailscale up --auth-key={{ pushed.authkey }}'.
- config: tag (required, the ACL tag the node gets — must be owned by the OAuth
client's tag via tagOwners). Removed the manual auth_key config.
- No deprovision: the key is single-use and consumed; the node is ephemeral and
auto-removes from the tailnet when the instance disconnects/terminates.
- No reconcile: Tailscale is an overlay network, IP-independent — the node
reconnects on boot after a stop/start regardless of the new public IP.
- v1.0.1 -> v2.0.0: BREAKING (config changed from auth_key to OAuth env + tag).
One-time controller setup is documented in the spec header (OAuth client with
auth_keys scope, tagOwners ACL, export TS_API_CLIENT_ID/SECRET). Validates under
the hardened engine. NOT yet live-tested (needs a real OAuth client + tailnet).
Live testing against a real Globus login found three bugs, each of which would have failed silently: 1. Capture paths were wrong. "globus gcp create mapped --format json" returns an endpoint_create_result with top-level id and globus_connect_setup_key, NOT the assumed GlobusConnectPersonal.id / .setup_key. Fixed the captures (verified against real output). 2. Remote install URL 404'd for every arch. The real Linux tarball is the globusconnectpersonal-latest.tgz under downloads.globus.org (architecture- independent, extracts to a versioned dir). Rewrote install with "set -eu" (the old multi-line script masked failures behind a trailing ln), curl -fsSL, and tar --strip-components extraction. 3. Deprovision used "globus endpoint delete ... --yes", but that command takes no --yes flag. Removed it. VERIFIED: "spawn plugin remove" now actually deletes the endpoint (404 after). Also documented the globus login (browser / --no-local-server) setup in the spec header. v1.0.0 -> v1.1.0. KNOWN-OPEN: on both aarch64 and x86_64 EC2, "globusconnectpersonal -setup <key>" still fails inside Globus's own relaytool (exit 1, empty output), a GCP-internal issue in the headless context, not a plugin-structure problem. The local half (create+capture+push) and deprovision are verified working end-to-end; the remote configure is blocked on relaytool. Under investigation.
Live-tested the Model A flow against a real Tailscale OAuth client. Two bugs in
the local mint step, both now fixed and verified (node joined the tailnet,
tagged + ephemeral, auto-removed on terminate):
1. `curl -sf ... | jq` under `set -e`: jq reads the one field it needs and
exits, closing the pipe; curl then dies on the broken pipe (exit 56) and
`set -e` aborts the step. Capture the token curl to a variable, then parse.
2. Key description had invalid characters. Template values in `run` steps are
shell-escaped (wrapped in single quotes), so `DESC="spore-{{ instance.name }}"`
became `spore-'tstest'` — and Tailscale rejects a key description containing
quotes (HTTP 400 "description had invalid characters"). Assign the value to
its own shell var first (NAME='...', correct for a bare assignment) and
compose the description from $NAME so no quotes leak into the JSON body.
Verified: `spawn plugin install tailscale --config tag=tag:spore` mints a
single-use ephemeral tagged key from the OAuth client, pushes it, and the
instance joins the tailnet (100.x reachable via `tailscale status`). No
deprovision/reconcile needed (ephemeral node self-removes; overlay network is
IP-independent).
Globus Connect Personal refuses to run as root ("Running Globus Connect Personal
as root is not supported") and stores config under ~/.globusonline. spored runs
plugin remote steps as root, which is why setup kept failing. Mark the
globusconnectpersonal steps (configure/start/health/stop) as_user: true so they
run as the instance's local login user (requires spawn with the as_user feature).
install stays root (downloads to /opt, symlinks into /usr/local/bin which is on
the login PATH). Also drop the earlier retry loop — the failure was root, not an
early-boot window, so retrying was chasing the wrong cause; keep </dev/null.
VERIFIED LIVE: spawn plugin install reaches running, endpoint shows GCP
Connected: True, files transfer both directions (this host <-> instance), and
plugin remove deletes the endpoint.
The plugin docs were thin outlines that didn't explain what a user must do
before a plugin works. Add real walkthroughs:
- CONCEPTS.md: the controller/instance split and WHY it drives setup — the
mint-locally-push-to-instance pattern, prerequisites living on your machine,
env_passthrough (controller secrets), as_user (Globus/root), the
local-matching user ("log in as you", Windows=Administrator), and the
install/reconcile/remove lifecycle incl. the reaper-can't-deprovision caveat.
- plugins/tailscale/README.md: full one-time setup — tagOwners ACL (with the
raw-policy-editor gotcha), OAuth client with auth_keys scope + tag, exporting
TS_API_CLIENT_ID/SECRET; install/verify/teardown; troubleshooting the exact
errors. Ephemeral nodes self-clean.
- plugins/globus-personal-endpoint/README.md: globus login (incl.
--no-local-server), the identity-ownership 403 gotcha, install/verify with a
real transfer, teardown; notes on as_user/root and the relay:2223 requirement.
- plugins/spore-sync/README.md: install mutagen, local_path/remote_path,
stop/start reconcile, two-way-safe conflict behavior, teardown.
- README.md: point to CONCEPTS first, per-plugin READMEs + 'setup needed'
column, fix the stale `--config auth_key=` tailscale example, add --instance
to the install examples.
All four specs still validate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the registry plugins' template syntax and add spore-sync's IP-change reconcile. Companion to spore-host/spawn#347; verified end-to-end against a live instance.
Changes
{{ config.x }}/{{ instance.name }}/{{ instance.ip }}syntax in spore-sync, tailscale, rstudio-server (was Go-style{{ .Config.x }}, which the engine rendered to<no value>). Each bumped to a fix version.local.reconcileblock (v1.1.0): a stop/start reassigns the instance's public IP; the mutagen session is pinned to the old address and can't follow, so the sync silently dies after a restart. The reconcile block terminates + recreates the session at the new{{ instance.ip }};spawn startreplays it.Versions
Verification
All four registry plugins pass
spawn plugin validateunder the hardened engine (spore-host/spawn#347). spore-sync install + bidirectional sync + stop/start reconcile + teardown verified live.