Add Dosh host workflows and reconnect QoL
ci / test (push) Has been cancelled
ci / remote-bench (push) Has been cancelled

This commit is contained in:
DuProcess
2026-06-12 13:48:44 -04:00
parent c56e8f9fe1
commit e3f61a4efb
3 changed files with 306 additions and 40 deletions
+40 -2
View File
@@ -11,6 +11,7 @@ from_current=0
start_server=1
force_config=0
update_cache="${DOSH_UPDATE_CACHE:-$HOME/.cache/dosh/source}"
quiet="${DOSH_UPDATE_QUIET:-0}"
usage() {
cat <<'EOF'
@@ -136,10 +137,12 @@ else
need git
mkdir -p "$(dirname "$update_cache")"
if [ -d "$update_cache/.git" ]; then
[ "$quiet" = "1" ] && echo "Updating Dosh source"
git -C "$update_cache" remote set-url origin "$repo"
git -C "$update_cache" fetch --depth 1 origin main
git -C "$update_cache" checkout -q -B main FETCH_HEAD
else
[ "$quiet" = "1" ] && echo "Downloading Dosh source"
rm -rf "$update_cache"
git clone --depth 1 --branch main "$repo" "$update_cache" >/dev/null
fi
@@ -147,10 +150,19 @@ else
fi
cd "$src_dir"
[ "$quiet" = "1" ] && echo "Building Dosh $role"
if [ "$role" = "client" ]; then
cargo build --release --bin dosh-client
if [ "$quiet" = "1" ]; then
cargo build -q --release --bin dosh-client
else
cargo build --release --bin dosh-client
fi
else
cargo build --release
if [ "$quiet" = "1" ]; then
cargo build -q --release
else
cargo build --release
fi
fi
bindir="$prefix/bin"
@@ -245,8 +257,34 @@ dosh_port = $port
default_session = "new"
reconnect_timeout_secs = 5
view_only = false
predict = false
cache_attach_tickets = true
credential_cache = "~/.local/share/dosh/credentials"
EOF
fi
hosts_config="$config_dir/hosts.toml"
if [ "$force_config" -eq 1 ] || [ ! -f "$hosts_config" ]; then
default_server="${server:-user@example.com}"
if [ -n "$dosh_host" ]; then
host_udp="$dosh_host"
else
host_udp="$default_server"
fi
cat >"$hosts_config" <<EOF
# Example:
# [palav]
# ssh = "palav"
# dosh_host = "palav.dev"
# port = 50000
# default_command = "tm"
# predict = false
[default]
ssh = "$default_server"
dosh_host = "$host_udp"
port = $port
predict = false
EOF
fi
fi