services/mac-studio.md

Mac Studio

The local workhorse — 192.168.1.189 (this machine). All services proxied through nginx at 192.168.1.185 and gated by the auth service. See services/nginx-auth-service.md.

Services Overview

Service Port Domain Startup Description
nginx-auth-service 8085 (internal, no external domain) pm2 on boot (~/Work/pm2_processes/pm2.nginx-auth-service.json) Session-based auth for nginx auth_request
notes 8007 (internal) pm2 on boot (~/Work/pm2_processes/pm2.notes.json) Personal notes web app (markdown viewer)
OpenClaw 18789 max.dph.am launchd (auto) AI assistant Control UI
ttyd 80808089 (ext) term.dph.am launchd (auto) Browser-based terminal
pi-webui 49998 pi.dph.am pi-webui CLI Pi coding agent web UI
Reasonix 49999 rsx.dph.am npx reasonix code ... Reasonix coding agent dashboard

🖥️ ttyd — Web Terminal

ttyd shares a terminal over the web. Lighter alternative to code-server.

Served at term.dph.am via nginx proxy (see services/nginx-auth-service.md).

  • Local URL: http://localhost:8080
  • Proxy URL: https://term.dph.am (behind nginx auth)
  • Internal port: 8080
  • External port (nginx): 8089
  • Log: ~/Library/Logs/ttyd.log
  • Log: ~/Library/Logs/ttyd.log
  • Theme: Dark (#0e0e1e bg, #cdd6f4 fg)

Stack

ttyd -Wtmux new -A -s web → shell (persistent tmux session)

Manage

Start / stop is via launchd:

launchctl load ~/Library/LaunchAgents/com.user.ttyd.plist      # start
launchctl unload ~/Library/LaunchAgents/com.user.ttyd.plist    # stop
launchctl list com.user.ttyd                                    # check if running

Auto-starts on login and auto-restarts if it crashes.

Quick Config Override

Add query params to the URL (no restart needed):

http://localhost:8080/?fontSize=20&fontFamily=JetBrains%20Mono

All xterm.js ITerminalOptions are supported this way — cursorStyle, lineHeight, theme, etc.

The Plist

~/Library/LaunchAgents/com.user.ttyd.plist — full ProgramArguments:

Argument Value
-t fontSize=16 Font size in px
-t lineHeight=1 Line height
-t fontFamily=... JetBrains Mono, Fira Code, monospace
-t theme=... {"background": "#0e0e1e", "foreground": "#cdd6f4"}
Command tmux new -A -s web

Interactive Shortcut

Also defined in ~/.extras.bash for when you want to run it manually:

start_ttyd() {
  ttyd -W -p 8080 \
    -t fontSize=16 \
    -t lineHeight=1 \
    -t fontFamily="JetBrains Mono, Fira Code, monospace" \
    -t 'theme={"background": "#0e0e1e", "foreground": "#cdd6f4"}' \
    tmux new -A -s web
}