From 61d3105832f6d0587a869ae7b533a997b301b659 Mon Sep 17 00:00:00 2001 From: robcholz <84130577+robcholz@users.noreply.github.com> Date: Fri, 6 Feb 2026 23:05:04 -0500 Subject: [PATCH] fix: fixed the ssh again --- docs/implementations.md | 2 +- src/instance.rs | 9 +++++---- src/ssh.sh | 13 ++++++++++--- src/vm.rs | 3 ++- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/implementations.md b/docs/implementations.md index 8eb26e5..616e37f 100644 --- a/docs/implementations.md +++ b/docs/implementations.md @@ -34,7 +34,7 @@ Example: Each session has the following members: - `id`: session id -- `directory`: project directory (absolute) +- `directory`: project directory (absolute), if directory changes name, this should also change. - `last_active`: utc time indicating the last active time for the session Sessions info are stored in `~/.vibebox/sessions.toml` diff --git a/src/instance.rs b/src/instance.rs index 04d9bc7..0890f94 100644 --- a/src/instance.rs +++ b/src/instance.rs @@ -17,7 +17,7 @@ use std::sync::mpsc::Sender; use uuid::Uuid; use crate::{ - session_manager::INSTANCE_DIR_NAME, + session_manager::{GLOBAL_DIR_NAME, INSTANCE_DIR_NAME}, tui::{self, AppState}, vm::{self, DirectoryShare, LoginAction, VmInput}, }; @@ -25,7 +25,6 @@ use crate::{ const INSTANCE_TOML: &str = "instance.toml"; const SSH_KEY_NAME: &str = "ssh_key"; const SERIAL_LOG_NAME: &str = "serial.log"; -const SSH_GUEST_DIR: &str = "/root/.vibebox"; const DEFAULT_SSH_USER: &str = "vibecoder"; const SSH_CONNECT_RETRIES: usize = 30; const SSH_CONNECT_DELAY_MS: u64 = 500; @@ -66,14 +65,16 @@ pub fn run_with_ssh( } let config = Arc::new(Mutex::new(config)); + let ssh_guest_dir = format!("/root/{}", GLOBAL_DIR_NAME); + let extra_shares = vec![DirectoryShare::new( instance_dir.clone(), - SSH_GUEST_DIR.into(), + ssh_guest_dir.clone().into(), true, )?]; let extra_login_actions = - build_ssh_login_actions(&config, &project_name, SSH_GUEST_DIR, SSH_KEY_NAME); + build_ssh_login_actions(&config, &project_name, ssh_guest_dir.as_str(), SSH_KEY_NAME); vm::run_with_args_and_extras( args, diff --git a/src/ssh.sh b/src/ssh.sh index 312a25e..1caf118 100644 --- a/src/ssh.sh +++ b/src/ssh.sh @@ -78,10 +78,13 @@ fi chown -h "${SSH_USER}:${SSH_USER}" "${USER_HOME}/.codex" "${USER_HOME}/.claude" 2>/dev/null || true # Install Mise -curl https://mise.run | sh +MISE_BIN="${USER_HOME}/.local/bin/mise" +if [ ! -x "$MISE_BIN" ] && ! command -v mise >/dev/null 2>&1; then + curl https://mise.run | HOME="$USER_HOME" sh +fi echo 'eval "$(~/.local/bin/mise activate bash)"' >> "${USER_HOME}/.bashrc" -export PATH="${USER_HOME}/.local/bin:$PATH" +export PATH="${USER_HOME}/.local/bin:/usr/local/bin:$PATH" mkdir -p "${USER_HOME}/.config/mise" @@ -100,7 +103,11 @@ cat > "${USER_HOME}/.config/mise/config.toml" <