You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(server): opt-in DOCSIQ_SERVER_ALLOW_UNAUTHENTICATED to bind non-loopback without api key (#98)
* checkpoint: pre-yolo 2026-05-04T06:17:27
* feat(server): allow unauthenticated non-loopback bind via opt-in override
Today docsiq refuses to start when server.api_key is empty and the bind
host is anything other than loopback. That's the right safe default,
but it makes deployments to trusted private networks (homelabs,
air-gapped clusters, single-tenant LANs) require an api key just for
the boot gate, with no real adversary on the network.
Add server.allow_unauthenticated (DOCSIQ_SERVER_ALLOW_UNAUTHENTICATED=true)
that downgrades the non-loopback refusal to a loud warning. Default is
false — every existing install behaves identically. Operators who set
the override get a prominent boot-time warning naming the bound host
and port plus an explicit "do NOT enable on the public internet" line.
The boot-time error messages now mention the override env var so
anyone hitting the refusal sees both escape hatches (set a key OR set
the override) without grepping the docs.
Tests: 2 new cmd-level cases (override allows non-loopback bind across
'', 0.0.0.0, RFC1918 hosts; error messages mention the override env
var) and 1 new config-level case proving DOCSIQ_SERVER_ALLOW_UNAUTHENTICATED
is reachable via env (regression guard for viper #761 if BindEnv loop
ever regresses).
"⚠️ auth disabled and server.allow_unauthenticated=true — anyone reachable on this network can read all data and use the LLM proxy; do NOT enable on the public internet",
272
+
"host", exposure,
273
+
"port", cfg.Server.Port,
274
+
)
275
+
returnnil
276
+
}
277
+
ifhost=="" {
262
278
returnfmt.Errorf(
263
-
"server.api_key is empty and server.host=%q is not loopback; refusing to start. "+
264
-
"Set DOCSIQ_SERVER_API_KEY or bind to 127.0.0.1/localhost for dev",
265
-
cfg.Server.Host,
279
+
"server.api_key is empty and server.host is unset (binds all interfaces); refusing to start. "+
280
+
"Set DOCSIQ_SERVER_API_KEY, bind to 127.0.0.1/localhost for dev, or set DOCSIQ_SERVER_ALLOW_UNAUTHENTICATED=true to override (trusted networks only)",
0 commit comments