mirror of
https://github.com/robcholz/vibebox.git
synced 2026-05-23 07:09:40 +02:00
fix: fixed the ssh again
This commit is contained in:
@@ -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`
|
||||
|
||||
+5
-4
@@ -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,
|
||||
|
||||
+10
-3
@@ -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" <<MISE
|
||||
MISE
|
||||
|
||||
touch "${USER_HOME}/.config/mise/mise.lock"
|
||||
mise install
|
||||
if [ -x "$MISE_BIN" ]; then
|
||||
HOME="$USER_HOME" "$MISE_BIN" install
|
||||
else
|
||||
HOME="$USER_HOME" mise install
|
||||
fi
|
||||
|
||||
# 3) start ssh (don't swallow failures)
|
||||
# If ssh is already active, don't force start/restart.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use crate::session_manager::INSTANCE_DIR_NAME;
|
||||
use std::{
|
||||
env,
|
||||
ffi::OsString,
|
||||
@@ -148,7 +149,7 @@ where
|
||||
let cache_dir = cache_home.join("vibe");
|
||||
let guest_mise_cache = cache_dir.join(".guest-mise-cache");
|
||||
|
||||
let instance_dir = project_root.join(".vibe");
|
||||
let instance_dir = project_root.join(INSTANCE_DIR_NAME);
|
||||
|
||||
let basename_compressed = DEBIAN_COMPRESSED_DISK_URL.rsplit('/').next().unwrap();
|
||||
let base_compressed = cache_dir.join(basename_compressed);
|
||||
|
||||
Reference in New Issue
Block a user