Update Happy Coder docs with complete setup flow and troubleshooting

- Expand Mobile Access Setup with full authentication steps
  (HAPPY_SERVER_URL, happy auth login, happy connect claude, local claude login)
- Fix launchd path: ~/Library/LaunchAgents/ not /Library/LaunchDaemons/
- Add Common Issues troubleshooting table with fixes for:
  - Invalid API key (Claude not logged in locally)
  - Failed to start daemon (stale lock files)
  - Sessions not showing (missing HAPPY_SERVER_URL)
  - Slow responses (Cloudflare proxy enabled)
- Update DNS note: Cloudflare proxy disabled for WebSocket performance
- Add .zshrc to Files & Configuration table

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Hutson
2025-12-21 13:28:30 -05:00
parent 65b7c48348
commit 23e9df68c9

View File

@@ -479,8 +479,25 @@ happy daemon list
1. Download Happy Coder app: 1. Download Happy Coder app:
- iOS: https://apps.apple.com/us/app/happy-claude-code-client/id6748571505 - iOS: https://apps.apple.com/us/app/happy-claude-code-client/id6748571505
- Android: https://play.google.com/store/apps/details?id=com.ex3ndr.happy - Android: https://play.google.com/store/apps/details?id=com.ex3ndr.happy
2. On Mac Mini, run: `happy auth` and scan QR code with the app 2. On Mac Mini, ensure self-hosted server is configured:
3. Daemon auto-starts on boot via launchd ```bash
echo 'export HAPPY_SERVER_URL="https://happy.htsn.io"' >> ~/.zshrc
source ~/.zshrc
```
3. Authenticate with the Happy server:
```bash
happy auth login --force # Opens browser, scan QR with app
```
4. Connect Claude API access:
```bash
happy connect claude # Links your Anthropic API credentials
```
5. Ensure Claude is logged in locally (critical for spawned sessions):
```bash
claude # Start Claude Code
/login # Authenticate if prompted
```
6. Daemon auto-starts on login via launchd
### Daemon Management ### Daemon Management
```bash ```bash
@@ -506,18 +523,19 @@ cd ~/Projects/homelab && happy claude
### Files & Configuration ### Files & Configuration
| File | Purpose | | File | Purpose |
|------|---------| |------|---------|
| `/Library/LaunchDaemons/com.hutson.happy-daemon.plist` | System LaunchDaemon (starts at boot, KeepAlive enabled) | | `~/Library/LaunchAgents/com.hutson.happy-daemon.plist` | User LaunchAgent (starts at login) |
| `~/.happy/` | Happy Coder config and logs | | `~/.happy/` | Happy Coder config, state, and logs |
| `~/.zshrc` | Contains `HAPPY_SERVER_URL` export |
**Server:** `https://happy.htsn.io` (self-hosted Happy server) **Server:** `https://happy.htsn.io` (self-hosted Happy server on docker-host)
### Troubleshooting ### Troubleshooting
```bash ```bash
# Check if daemon is running # Check if daemon is running
happy daemon status pgrep -f "happy.*daemon"
# Check launchd status (system level) # Check launchd status
launchctl print system/com.hutson.happy-daemon | head -10 launchctl list | grep happy
# List active sessions # List active sessions
happy daemon list happy daemon list
@@ -529,6 +547,15 @@ happy daemon stop && happy daemon start
/Applications/Tailscale.app/Contents/MacOS/Tailscale up /Applications/Tailscale.app/Contents/MacOS/Tailscale up
``` ```
**Common Issues:**
| Issue | Cause | Fix |
|-------|-------|-----|
| "Invalid API key" in spawned session | Claude not logged in locally | Run `claude` then `/login` on Mac Mini |
| "Failed to start daemon" | Stale lock file | `rm -f ~/.happy/daemon.state.json.lock ~/.happy/daemon.state.json` |
| Sessions not showing on phone | HAPPY_SERVER_URL not set | Add to `~/.zshrc`: `export HAPPY_SERVER_URL="https://happy.htsn.io"` |
| Slow responses | Cloudflare proxy enabled | Disable proxy for happy.htsn.io subdomain |
## Happy Server (Self-Hosted Relay) ## Happy Server (Self-Hosted Relay)
Self-hosted Happy Coder relay server for lower latency and no external dependencies. Self-hosted Happy Coder relay server for lower latency and no external dependencies.
@@ -554,7 +581,7 @@ Phone App → https://happy.htsn.io → Traefik → docker-host:3002 → Happy S
**Docker Compose**: `/opt/happy-server/docker-compose.yml` **Docker Compose**: `/opt/happy-server/docker-compose.yml`
**Traefik Config**: `/etc/traefik/conf.d/happy.yaml` (on CT 202) **Traefik Config**: `/etc/traefik/conf.d/happy.yaml` (on CT 202)
**DNS**: happy.htsn.io → 70.237.94.174 (Cloudflare proxied) **DNS**: happy.htsn.io → 70.237.94.174 (Cloudflare DNS-only, NOT proxied for WebSocket performance)
**Credentials**: **Credentials**:
- Master Secret: `3ccbfd03a028d3c278da7d2cf36d99b94cd4b1fecabc49ab006e8e89bc7707ac` - Master Secret: `3ccbfd03a028d3c278da7d2cf36d99b94cd4b1fecabc49ab006e8e89bc7707ac`