hack-house/hh/direnv-autostart/.envrc
leetcrypt ff5186a9d3 feat(hh): graceful shutdown, crypt default theme, neutralize branding, share-prep
- Graceful shutdown: Ctrl+C quits in chat (interrupts PTY while driving),
  RAII TermGuard + panic hook + SIGTERM/SIGHUP always restore the terminal
- Default theme is now "crypt" (neutral monochrome); theme sigil mirrored in
  chat/roster/help so the pentagram only renders under the "church" theme
- Neutralize inverted-pentagram branding across CLI, scripts, docs, and Cargo
  metadata (kept only in themes/church.toml + the render-time placeholder)
- Rewrite root README around hack-house; add bootstrap.sh, SECURITY.md,
  CODE_OF_CONDUCT.md, CHANGELOG.md, and issue/PR templates
- .gitignore cleanup; stop tracking .venv

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-31 23:23:19 -07:00

36 lines
1.7 KiB
Plaintext

# .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/lets-hack.sh" "$HH_USER"
fi