Closes #61.
Surface the live Coder access URL (*.try.coder.app tunnel) in any terminal on login, not just PAM sessions.
Previously coder-redirect.service wrote the URL to /etc/motd, which only shows on SSH/console logins via pam_motd — a local desktop terminal never saw it.
coder-redirect.servicenow caches the discovered tunnel URL to/tmp/coder-access-url(chmod 0644) instead of writing/etc/motd. Itrm -fs the file at the top ofExecStart, so the stale URL is cleared on every boot and on every service restart until the live URL is rediscovered. Both the cleanup and the write are best-effort (|| true) so a/tmphiccup can't tripset -euo pipefailand restart-loop the redirect.- New
environment.interactiveShellInitprints anAccess URL/Local/Redirectbanner by reading that file — no network access. An exportedCODER_ACCESS_URL_SHOWNguard keeps nested shells from reprinting it within a session. This covers local GNOME terminals, console TTYs, and SSH from one place. - Docs updated (
README.md,hosts/incus-vm/README.md,install.sh) to point at the terminal banner //tmp/coder-access-urlinstead of/etc/motd.
The large configuration.nix diff is mostly nixfmt renormalizing the coder-redirect script: removing the heredoc left the block uniformly indented, so the formatter re-based it to the canonical column.
Ran in a workspace with the repo's own toolchain (nix fmt = treefmt: nixfmt/statix/deadnix/shfmt/shellcheck):
nix fmtidempotent (0 changed)shellcheck install.shcleannixosConfigurations._appliance-isoevaluates; builtcoder-redirectscript and renderedinteractiveShellInitinspected — escaping and|| trueguards land correctly- Ran the banner snippet: prints once, guard suppresses the repeat
Not build/boot-tested on real hardware (needs a box).
Implementation notes / decisions
- Dropped
/etc/motdentirely rather than keeping it alongside the banner. Keeping both would double-print on SSH/console (pam_motd + shell banner); consolidating on the shell banner gives one source of truth that also works in desktop terminals. Console TTY and SSH still get the URL because their login shell sources the init. interactiveShellInitvsloginShellInit: GNOME Terminal opens a non-login interactive shell by default, sologinShellInit/profile.dwouldn't fire there.interactiveShellInitcovers it; the exported guard prevents subshell spam.- Hostname read at display time from
/proc/sys/kernel/hostname(always present) to match the previous runtimehostnamebehavior rather than bakingnetworking.hostNameat eval time. /tmpwipe: relying on tmpfs-on-boot isn't guaranteed here, so the explicitrm -finExecStart(which runs on every boot and restart) is what satisfies "wipes on boot or restart of coder-redirect".
🤖 Opened by Coder Agents on behalf of @phorcys420.