Repository navigation
Use dropbear -e to forward container env to SSH sessions - #13
Merged
Merged
Conversation
Dropbear login shells don't inherit the container environment, so TZ and XDG_RUNTIME_DIR are absent over SSH. This breaks timezone display and prevents tools like zellij from finding sessions started from the GUI (which sets XDG_RUNTIME_DIR=/config/.XDG for its socket path). The init script now writes /etc/profile.d/devtop-env.sh at startup, sourced automatically by every SSH login shell. https://claude.ai/code/session_01XrvMKQ6TFAUnXn7Mw7dt5q
dropbear -e passes the daemon's environment (loaded via with-contenv) to every login shell, making TZ, DISPLAY, XDG_RUNTIME_DIR and all other container vars available over SSH automatically — no profile.d workarounds needed. Also enables launching GUI apps from SSH since DISPLAY is forwarded. Remove the profile.d file-writing logic from the init script. https://claude.ai/code/session_01XrvMKQ6TFAUnXn7Mw7dt5q
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
Replace the
profile.dfile-writing approach with dropbear's built-in-eflag, which passes the daemon's environment directly to every login shell.Since the dropbear service runs under
with-contenv, it already holds the full container environment. With-e, that env is forwarded to SSH sessions verbatim —TZ,XDG_RUNTIME_DIR,DISPLAY, and everything else. This also means GUI apps can be launched directly from an SSH session sinceDISPLAY=:1.0is forwarded.This approach is cleaner and completely generic: it requires no knowledge of which specific vars matter, and works correctly on any image that uses
with-contenvto set up the container environment.Also removes the
profile.dfile-writing logic from the init script that was manually exporting justTZandXDG_RUNTIME_DIR.Test plan
envover SSH matches the GUI terminal env closelyzellij attachover SSH finds GUI sessionsxterm) launched over SSH appears on the desktophttps://claude.ai/code/session_01XrvMKQ6TFAUnXn7Mw7dt5q