Compare commits

..
2 Commits
Author SHA1 Message Date
m3tam3re cf1c4b9f31 Merge pull request 'fix(t3code): gitea SSH im Service HOME-unabhaengig machen' (#29) from fix/t3code-ssh-hardening into master
Reviewed-on: #29
2026-10-31 16:46:02 +01:00
m3ta-chiron 56f2295e6e fix(t3code): make gitea SSH access HOME-independent in the service
The T3 threads could clone from gitea interactively (m3tam3re terminal)
but not from the t3code service context. Instead of guessing which link
in the spawn chain drops HOME, make every link irrelevant:

- t3SshConfig: absolute IdentityFile (no ~ resolution needed)
- service env: HOME set explicitly + GIT_SSH_COMMAND pointing at the
  absolute store-path ssh config — git uses exactly this config for
  gitea remotes regardless of HOME or user ssh-config lookup

Verified via nix eval: HOME=/home/m3tam3re and
GIT_SSH_COMMAND=ssh -F /nix/store/...-t3-gitea-ssh-config land in the
unit. After deploy: systemctl restart t3code, then retrigger the clone
thread.
2026-10-31 16:44:15 +01:00
+8 -1
View File
@@ -71,7 +71,7 @@
t3SshConfig = pkgs.writeText "t3-gitea-ssh-config" ''
Host code.m3ta.dev
User gitea
IdentityFile ~/.ssh/gitea
IdentityFile ${cockpitHome}/.ssh/gitea
IdentitiesOnly yes
'';
@@ -137,6 +137,13 @@ in {
environment =
{
T3CODE_PORT = toString port;
# Deterministic service context: HOME explicit so ssh/git resolve
# ~ in every process this service spawns, however deep t3's
# pty/sandbox chain resets the environment.
HOME = cockpitHome;
# Independent of HOME entirely: git uses exactly this ssh config
# (absolute store path) for every gitea remote.
GIT_SSH_COMMAND = "ssh -F ${t3SshConfig}";
}
// gitIdentityEnv;