Skip to content

feat: production serving, Tailscale sidecar, README update - #8

Merged
aterrylu merged 3 commits into
mainfrom
terry/project-session-view
Mar 8, 2026
Merged

feat: production serving, Tailscale sidecar, README update#8
aterrylu merged 3 commits into
mainfrom
terry/project-session-view

Conversation

@aterrylu

@aterrylu aterrylu commented Mar 8, 2026

Copy link
Copy Markdown
Owner

Summary

  • Hono serves dashboard: Built static files served from the API server with SPA fallback — single port, single process in production
  • Tailscale sidecar: Docker container in deploy/ creates a dedicated autonomos node on the tailnet, proxying 80/443 to the host
  • Simplified Makefile: Three targets — up (dev/prod), down, check. Both modes start the Tailscale sidecar
  • README rewrite: Reflects actual state — setup instructions, tech stack, deployment guide

Follows up on PRs #6 and #7.

Test plan

  • make up MODE=prod → dashboard served at localhost:3000, API works, SPA fallback works
  • make up → Vite HMR on :5173, API on :3000, Tailscale sidecar proxies to :5173
  • Access http://autonomos from another device on tailnet

🤖 Generated with Claude Code

aterrylu and others added 3 commits March 8, 2026 12:55
… cleanup

- Fix onExit handler accumulation: register once per session via guard set
- Add try/catch on /api/projects for SDK errors
- Persist sidebarOpen in Zustand (survives refresh), default to open
- Client clears session immediately on PTY exit (WS close code 4010)
- Extract PageTheme type alias in Sidebar (simplifier)
- Type the listSessions result to avoid implicit any

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hono now serves the built dashboard static files in production (with SPA
fallback). Tailscale sidecar in deploy/ creates a dedicated `autonomos`
node on the tailnet, proxying 80/443 to the host.

- Makefile simplified to `up`, `down`, `check`
- `make up` = dev (Vite HMR + sidecar at :5173)
- `make up MODE=prod` = prod (built dashboard + sidecar at :3000)
- deploy/ holds Docker Compose + generated serve.json
- .env.example documents required TS_AUTHKEY
- Removed redundant package.json scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace research-phase README with actual setup instructions,
tech stack, deployment guide, and project structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aterrylu
aterrylu enabled auto-merge (squash) March 8, 2026 20:33

app.get("/", (c) => c.json({ name: "autonomos", version: "0.0.1" }));
app.use("*", cors({ origin: process.env.CORS_ORIGIN || "*" }));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Warning

Problem: cors({ origin: "*" }) is the fallback when CORS_ORIGIN is unset — meaning any origin can call the API in both dev and prod.

Why it matters: Even behind Tailscale, a wildcard CORS policy allows any page running on an authorized tailnet device to make credentialed cross-origin requests to autonomOS. If a tab on the same machine opens a malicious site, it can hit your API freely.

Suggested fix: Add CORS_ORIGIN to .env.example so it's always set in prod, or tighten the default:

// .env.example
CORS_ORIGIN=http://autonomos

// index.ts — keep wildcard only in explicit dev mode
app.use("*", cors({ origin: process.env.CORS_ORIGIN || "http://localhost:5173" }));

Low urgency for a personal tailnet tool, but worth closing the loop.

@nox-0x nox-0x left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean PR — production serving via Hono static + SPA fallback is solid, the Tailscale sidecar setup is well-structured, and the PTY onExit → 4010 close code handshake is a nice touch for clean client-side cleanup. One non-blocking note: the wildcard CORS fallback (origin: "*") is worth tightening — consider adding CORS_ORIGIN=http://autonomos to .env.example so prod always has a sane default. Nothing here blocks merge.

@aterrylu
aterrylu merged commit a0a4842 into main Mar 8, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/project-session-view branch March 8, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants