feat: add trusted public origins and managed Caddy mode#134
Conversation
roborev: Combined Review (
|
|
Addressed both
|
|
@wesm this is fun; it's all agent-driven on my side (apart from this message, which has been delicately crafted by a meatbag mashing keys, OG-style), and clearly all agent-driven on your side. Wild new frontier we're in. |
|
FWIW this is how I'm using it on my headless DGX Spark, with TLS set up so that I can view everything on any other host on my home network: |
roborev: Combined Review (
|
|
Addressed the latest
|
roborev: Combined Review (
|
|
Addressed the latest managed-Caddy shutdown race in 51b4d05.
|
roborev: Combined Review (
|
|
Addressed the latest host-trust finding in 1eefa65.
|
roborev: Combined Review (
|
|
Addressed the latest default-port host-matching issue in cf8d5c2.
|
|
Added a small README note in 2b7ceec covering privileged ports for managed Caddy on Linux. It now recommends keeping |
roborev: Combined Review (
|
|
thanks @tpn, let me have a go at this and I'll get it merged soon? |
|
All yours! (If nothing else, this has motivated me to set up roborev locally!) |
Use strings.SplitSeq for range loops and slices.Contains for membership checks, as flagged by golangci-lint. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
dbff624 to
a7029fd
Compare
roborev: Combined Review (
|
The guidelines said "LOCAL-ONLY" and "NO AUTHENTICATION NEEDED" unconditionally, which caused false positives now that the branch adds a documented non-loopback proxy mode. Updated guidelines 1, 3-5 to describe the proxy security model (loopback backend + Caddy subnet filtering) and added guideline 17 covering the managed Caddy architecture invariants. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merge related guidelines (auth+proxy, desktop 14/15/16, schema 7/12), cut verbose examples, trim explanatory prose. Same coverage in roughly half the lines. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
thanks @tpn! |
Closes #133.
Adds two related pieces for remote/hostname access:
public_url/public_origins)This keeps the existing DNS-rebinding and CSRF protections intact while making common remote access setups much easier to configure.
Design
Explicit trusted origins instead of wildcard host/origin relaxations: The backend still defaults to loopback-only origin/host allowlists. When
public_urlorpublic_originsare configured, the server derives additional trustedHostandOriginvalues from those explicit inputs rather than weakening the protections globally.Managed proxy is opt-in and keeps the backend on loopback: In managed Caddy mode, agentsview validates that the backend bind host is loopback-only, writes a generated Caddyfile under
~/.agentsview/managed-caddy/, runscaddy validate, then launchescaddy runas a child process. This keeps the CIDR allowlist meaningful because the backend is not exposed directly.Explicit public bind and port: Managed Caddy now has separate backend and frontend settings.
-host/-portremain the backend listener, whileproxy.bind_host/public_portcontrol the public-facing socket. The managed default public port is8443.CIDR allowlists with shorthand normalization:
allowed_subnets/--allowed-subnetaccept repeated CIDRs and normalize shorthand IPv4 input like10.0/16to10.0.0.0/16.Scope
public_url/--public-urlpublic_origins/--public-origincaddyproxy modeproxy.bind_host/--proxy-bind-hostproxy.public_port/--public-portallowed_subnets/--allowed-subnetNot implemented
The patch assumes the
caddyCLI is already installed and available either onPATHor via--caddy-bin.Platform notes
Managed Caddy mode is designed to work anywhere the
caddyCLI works. That includes Linux, macOS, and Windows in principle, but this PR intentionally keeps Caddy installation/packaging out of scope.Changes
public_url, managed proxy settings, CIDR allowlists, and public origin normalization/validationTest plan
CC=gcc CXX=g++ make test)GET /api/v1/versionthrough managed Caddy over TLS withcurl --resolve🤖 Generated with [Codex]