Repository navigation
t3code: run the T3 SSH launcher with a separate HOME - #1743
Merged
Merged
Conversation
The T3 desktop app's SSH launcher starts a second server on ~/.t3 when the main one is slow to answer, and that server moves T3 Connect to its port (pingdotgg/t3code#5749, #14115). sshd now runs that one launch command with HOME=~/.t3-ssh-launch, which holds a copy of server-runtime.json and a link to the shared T3 downloads. A healthy server is reused as before; a fallback server gets empty data. Every other SSH command keeps the real HOME.
SpyrosPsarras
added a commit
that referenced
this pull request
Oct 9, 2026
Review fixes for #1743 (`one/files/ssh-command.sh`). - F1: create the real `~/.t3/runtime` before linking it. Without it, a first launch failed on a dangling link even with a healthy server. The live pod already has the folder, so #1743 was not affected. - F4: replace the copied `server-runtime.json` with an atomic rename, and let two parallel launches create the launch HOME without failing. - F5: print why a launch HOME is refused (symlink, wrong owner) instead of exiting silently. - F2: name the runtime file path once. Checks: `ssh-command.test.sh` adds a first-launch case with no `~/.t3`, 10 rounds of two parallel launches, and the refusal messages. shellcheck passes. The ownership case is skipped where the test can't `chown`.
SpyrosPsarras
added a commit
that referenced
this pull request
Oct 15, 2026
Upstream T3 fixed the cause: since pingdotgg/t3code#16102 a server locks its state directory, and a second server on the same data exits with code 78. The pinned nightly 0.0.46-nightly.20261014.3118 contains it. This reverts #1743 and #1744, plus the later additions from #1804 and the ForceCommand line in isolated-sshd.sh, and drops the wrapper from the homelab README.
SpyrosPsarras
added a commit
that referenced
this pull request
Oct 15, 2026
Removes the A3 SSH launch wrapper (`one/files/ssh-command.sh`). Upstream fixed the problem it worked around. ## Why - pingdotgg/t3code#14115 was closed as completed on 2026-10-14. The maintainer wrote "Fixed by merged #16102". #5749 is still open. - pingdotgg/t3code#16102 (merge `570542662a3f9f3fb44f88778cb24753072f78aa`, "fix(server): enforce one database owner and guard update rollback"): before it opens the database, a server takes an exclusive lock on its state directory (`userdata/server-owner.sqlite`). A second server on the same directory exits with code 78 instead of starting. - `gh api repos/pingdotgg/t3code/compare/570542662a3f9f3fb44f88778cb24753072f78aa...v0.0.46-nightly.20261014.3118 --jq .status` returns `ahead` (by 66). We pin `0.0.46-nightly.20261014.3118` in `2-k3s/13.t3code/env/tools/package.json`, so the pod's server has the lock. ## Change - Reverts #1743 and #1744. Also removes what #1804 added to the wrapper, which was a later extension of the same file. - Deletes `ssh-command.sh` and `ssh-command.test.sh`, plus their CI line and both kustomization entries. - Removes `ForceCommand` from `one/files/sshd.sh` and `env/files/isolated-sshd.sh`. The isolated runtimes still use the rest of `isolated-sshd.sh` as their sshd. - Removes the wrapper from `13.t3code-homelab/README.md`. - Not touched: the phone's LAN pairing route through https://t3code.epaflix.com, and `~/.t3-ssh-launch` on the pod. Deleting that directory is a separate decision. ## Caveat The SSH launcher's fallback server runs the desktop app's T3 version, downloaded into `~/.t3/runtime/versions`, not the pod's pinned version. The lock only protects us if that version contains #16102. - homePC desktop: `t3code-nightly-bin 0.0.46_nightly.20261014.3118`, which contains the fix. - Newest launcher download on the pod: `0.0.46-nightly.20261013.3053`. It does NOT contain the fix (compare status `behind`). - Laptop: unreachable, so its desktop version is unverified. An outdated desktop app can still start a second server on the live data. ## Checks - `git grep -n "ssh-command\|t3-ssh-launch\|ForceCommand" -- . ':!docs/superpowers'` returns nothing. - `bash 2-k3s/13.t3code/one/tools/sync-shared.sh --check` passes. - The whole "T3 config and placement tests" CI step passes locally. - `kustomize build` passes for `13.t3code-homelab` and `13.t3code-work`. `13.t3code/one` needs ksops, so I didn't build it locally. - Standards and Spec review: both passed with no blocking findings. Do not merge without Spyros's approval.
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.
Works around pingdotgg/t3code#5749 and #14115: when the main T3 server is slow to answer, the desktop app's SSH launcher starts a second
serve --base-dir ~/.t3on our live data, and that server moves T3 Connect to port 3774.Change
one/files/ssh-command.sh, set as sshdForceCommand. Only the exact launcher commandsh -l -s -- <16 hex>runs withHOME=~/.t3-ssh-launch(mode 0700, refused if it is a symlink or owned by someone else). That HOME holds a fresh copy ofserver-runtime.jsonon every launch and a link to the shared~/.t3/runtimedownloads.ssh t3code, other commands, rsync and the app's pairing, stop and log scripts (sh -s) keep the real HOME.one/files/ssh-command.test.sh, run in CI.Checks
sync-shared.sh --checkpass.sh -skeeps the real HOME,trueworks.Revert
Revert once an upstream fix that stops a second server on a live state directory is in the pinned T3 nightly. A daily scheduled check watches for that.
Merged before the independent review finished, at Spyros's request. Review findings will land in a follow-up PR.