fix: fixed the ssh login again

This commit is contained in:
robcholz
2026-02-07 20:53:55 -05:00
parent a85287d8ce
commit 6a5624e608

View File

@@ -68,15 +68,6 @@ if [ -z "$USER_HOME" ]; then
USER_HOME="/home/${SSH_USER}"
fi
run_as_user() {
runuser -u "$SSH_USER" -- env HOME="$USER_HOME" "$@"
}
# Ensure user cache dirs are writable (mise writes under ~/.cache/mise)
install -d -m 700 -o "$SSH_USER" -g "$SSH_USER" "${USER_HOME}/.cache"
install -d -m 700 -o "$SSH_USER" -g "$SSH_USER" "${USER_HOME}/.cache/mise"
chown -R "$SSH_USER:$SSH_USER" "${USER_HOME}/.cache" 2>/dev/null || true
# Home mount links (config-driven)
__VIBEBOX_HOME_LINKS__
@@ -98,7 +89,7 @@ fi
# Install Mise
MISE_BIN="${USER_HOME}/.local/bin/mise"
if [ ! -x "$MISE_BIN" ] && ! command -v mise >/dev/null 2>&1; then
run_as_user sh -c 'curl https://mise.run | sh'
curl https://mise.run | HOME="$USER_HOME" sh
fi
echo 'eval "$(~/.local/bin/mise activate bash)"' >> "${USER_HOME}/.bashrc"
@@ -122,11 +113,10 @@ MISE
touch "${USER_HOME}/.config/mise/mise.lock"
if [ -x "$MISE_BIN" ]; then
run_as_user "$MISE_BIN" install
HOME="$USER_HOME" "$MISE_BIN" install
else
run_as_user mise install
HOME="$USER_HOME" mise install
fi
chown -R "$SSH_USER:$SSH_USER" "${USER_HOME}/.cache" "${USER_HOME}/.config/mise" "${USER_HOME}/.local/share/mise" 2>/dev/null || true
# 3) start ssh (don't swallow failures)
# If ssh is already active, don't force start/restart.