Files
hack-house/hh/direnv-autostart/.envrc
T
leetcrypt 1fa8c332ed
CI / rust client (hh) (macos-latest) (push) Waiting to run
CI / rust client (hh) (ubuntu-latest) (push) Waiting to run
CI / rust coverage (push) Waiting to run
CI / python server (3.10) (push) Waiting to run
CI / python server (3.11) (push) Waiting to run
CI / python server (3.12) (push) Waiting to run
CI / headless e2e smoke (push) Waiting to run
CI / dependency audit (push) Waiting to run
CI / secret scanning (push) Waiting to run
chore: consolidate all shell scripts into hh/scripts/
Move the 14 hack-house scripts (bootstrap, lets-hack, host-room, smoke,
demo/film harnesses, connect/join, ensure-docker/vbox) into hh/scripts/
and fix their path resolution for the deeper location. Update cross-refs:
sbx.rs script consts, app.rs hints, CI, direnv .envrc, README, and docs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-06-06 17:49:32 -07:00

36 lines
1.7 KiB
Bash

# .envrc — cd into this directory to summon your hack-house
#
# Powered by direnv (https://direnv.net). Run ./setup.sh once to install direnv,
# hook your shell, and `direnv allow` this file.
#
# Paths resolve RELATIVE TO THIS FILE — no hardcoded paths, so it works wherever
# the repo is cloned (your own $universal/path/hackerhouse).
# hh/ lives one level up from this autostart directory.
export HH_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$PWD/.envrc}")/.." && pwd)"
# A single session, joined as the ACTUAL logged-in user (not the alice/bob demo).
export SESSION="${HH_SESSION:-hackerhouse}"
HH_USER="${HH_USER:-${USER:-$(id -un)}}"
# Mint a strong room password — in MEMORY ONLY, at launch time. Nothing is ever
# written to disk (matches the project's RAM-only secret model) and it is not
# left in your shell environment: it is scoped to the lets-hack child process,
# which boots the server and your client together so they share it. Reveal or
# share it in-app with /pw. Honors a PW you export yourself.
gen_pw() {
if command -v openssl >/dev/null 2>&1; then openssl rand -base64 24
else head -c 18 /dev/urandom | base64; fi
}
# Autostart needs tmux. lets-hack.sh boots a fresh server and a single pane for
# $HH_USER, then (inside tmux) switches your client into it. Guard against
# stacking: if the session is already live, just point at it.
if ! command -v tmux >/dev/null 2>&1; then
echo "install tmux to autostart your hack-house"
elif tmux has-session -t "$SESSION" 2>/dev/null; then
echo "'$SESSION' already live — tmux attach -t $SESSION (reveal its password in-app with /pw)"
else
PW="${PW:-$(gen_pw)}" "$HH_DIR/scripts/lets-hack.sh" "$HH_USER"
fi