on main help sign in
fix: fixed the ssh again
61d3105robcholz
docs/implementations.md+1−1
@@ -34,7 +34,7 @@ Example:
34Each session has the following members:
34Each session has the following members:
35
35
36- `id`: session id
36- `id`: session id
37−- `directory`: project directory (absolute)
37+- `directory`: project directory (absolute), if directory changes name, this should also change.
38- `last_active`: utc time indicating the last active time for the session
38- `last_active`: utc time indicating the last active time for the session
39
39
40Sessions info are stored in `~/.vibebox/sessions.toml`
40Sessions info are stored in `~/.vibebox/sessions.toml`
src/instance.rs+5−4
@@ -17,7 +17,7 @@ use std::sync::mpsc::Sender;
17use uuid::Uuid;
17use uuid::Uuid;
18
18
19use crate::{
19use crate::{
20− session_manager::INSTANCE_DIR_NAME,
20+ session_manager::{GLOBAL_DIR_NAME, INSTANCE_DIR_NAME},
21 tui::{self, AppState},
21 tui::{self, AppState},
22 vm::{self, DirectoryShare, LoginAction, VmInput},
22 vm::{self, DirectoryShare, LoginAction, VmInput},
23};
23};
@@ -25,7 +25,6 @@ use crate::{
25const INSTANCE_TOML: &str = "instance.toml";
25const INSTANCE_TOML: &str = "instance.toml";
26const SSH_KEY_NAME: &str = "ssh_key";
26const SSH_KEY_NAME: &str = "ssh_key";
27const SERIAL_LOG_NAME: &str = "serial.log";
27const SERIAL_LOG_NAME: &str = "serial.log";
28−const SSH_GUEST_DIR: &str = "/root/.vibebox";
29const DEFAULT_SSH_USER: &str = "vibecoder";
28const DEFAULT_SSH_USER: &str = "vibecoder";
30const SSH_CONNECT_RETRIES: usize = 30;
29const SSH_CONNECT_RETRIES: usize = 30;
31const SSH_CONNECT_DELAY_MS: u64 = 500;
30const SSH_CONNECT_DELAY_MS: u64 = 500;
@@ -66,14 +65,16 @@ pub fn run_with_ssh(
66 }
65 }
67 let config = Arc::new(Mutex::new(config));
66 let config = Arc::new(Mutex::new(config));
68
67
68+ let ssh_guest_dir = format!("/root/{}", GLOBAL_DIR_NAME);
69+
69 let extra_shares = vec![DirectoryShare::new(
70 let extra_shares = vec![DirectoryShare::new(
70 instance_dir.clone(),
71 instance_dir.clone(),
71− SSH_GUEST_DIR.into(),
72+ ssh_guest_dir.clone().into(),
72 true,
73 true,
73 )?];
74 )?];
74
75
75 let extra_login_actions =
76 let extra_login_actions =
76− build_ssh_login_actions(&config, &project_name, SSH_GUEST_DIR, SSH_KEY_NAME);
77+ build_ssh_login_actions(&config, &project_name, ssh_guest_dir.as_str(), SSH_KEY_NAME);
77
78
78 vm::run_with_args_and_extras(
79 vm::run_with_args_and_extras(
79 args,
80 args,
src/ssh.sh+10−3
@@ -78,10 +78,13 @@ fi
78chown -h "${SSH_USER}:${SSH_USER}" "${USER_HOME}/.codex" "${USER_HOME}/.claude" 2>/dev/null || true
78chown -h "${SSH_USER}:${SSH_USER}" "${USER_HOME}/.codex" "${USER_HOME}/.claude" 2>/dev/null || true
79
79
80# Install Mise
80# Install Mise
81+MISE_BIN="${USER_HOME}/.local/bin/mise"
82+if [ ! -x "$MISE_BIN" ] && ! command -v mise >/dev/null 2>&1; then
81−curl https://mise.run | sh
83+ curl https://mise.run | HOME="$USER_HOME" sh
84+fi
82echo 'eval "$(~/.local/bin/mise activate bash)"' >> "${USER_HOME}/.bashrc"
85echo 'eval "$(~/.local/bin/mise activate bash)"' >> "${USER_HOME}/.bashrc"
83
86
84−export PATH="${USER_HOME}/.local/bin:$PATH"
87+export PATH="${USER_HOME}/.local/bin:/usr/local/bin:$PATH"
85
88
86mkdir -p "${USER_HOME}/.config/mise"
89mkdir -p "${USER_HOME}/.config/mise"
87
90
@@ -100,7 +103,11 @@ cat > "${USER_HOME}/.config/mise/config.toml" <<MISE
100MISE
103MISE
101
104
102touch "${USER_HOME}/.config/mise/mise.lock"
105touch "${USER_HOME}/.config/mise/mise.lock"
106+if [ -x "$MISE_BIN" ]; then
107+ HOME="$USER_HOME" "$MISE_BIN" install
108+else
103−mise install
109+ HOME="$USER_HOME" mise install
110+fi
104
111
105# 3) start ssh (don't swallow failures)
112# 3) start ssh (don't swallow failures)
106# If ssh is already active, don't force start/restart.
113# If ssh is already active, don't force start/restart.
src/vm.rs+2−1
@@ -1,3 +1,4 @@
1+use crate::session_manager::INSTANCE_DIR_NAME;
1use std::{
2use std::{
2 env,
3 env,
3 ffi::OsString,
4 ffi::OsString,
@@ -148,7 +149,7 @@ where
148 let cache_dir = cache_home.join("vibe");
149 let cache_dir = cache_home.join("vibe");
149 let guest_mise_cache = cache_dir.join(".guest-mise-cache");
150 let guest_mise_cache = cache_dir.join(".guest-mise-cache");
150
151
151− let instance_dir = project_root.join(".vibe");
152+ let instance_dir = project_root.join(INSTANCE_DIR_NAME);
152
153
153 let basename_compressed = DEBIAN_COMPRESSED_DISK_URL.rsplit('/').next().unwrap();
154 let basename_compressed = DEBIAN_COMPRESSED_DISK_URL.rsplit('/').next().unwrap();
154 let base_compressed = cache_dir.join(basename_compressed);
155 let base_compressed = cache_dir.join(basename_compressed);