host: go live — blog.rose-ash.com served by the SX host in the stack
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 15s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 15s
Promote lib/host into the docker stack behind blog.rose-ash.com (reusing a down Quart subdomain). New compose service sx_host runs lib/host/serve.sh on externalnet; Caddy reverse-proxies blog.rose-ash.com -> sx-dev-sx_host-1:8000. hosts/ fix: http-listen bound inet_addr_loopback only, unreachable from other containers. Add SX_HTTP_HOST env (default loopback for tests/local; stack sets 0.0.0.0) in sx_server.ml. serve.sh made container-friendly (SX_PROJECT_DIR). Verified live through Cloudflare->Caddy: /health, /feed, relations reads serve real JSON; / 404 (no root route yet). rose-ash.com untouched. Conformance 145/145 green with the rebuilt binary. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -745,8 +745,15 @@ let setup_evaluator_bridge env =
|
||||
| _ -> raise (Eval_error "http-listen: (port handler)") in
|
||||
let sock = Unix.socket Unix.PF_INET Unix.SOCK_STREAM 0 in
|
||||
Unix.setsockopt sock Unix.SO_REUSEADDR true;
|
||||
(* Bind host: loopback by default (safe for tests + local runs); set
|
||||
SX_HTTP_HOST=0.0.0.0 to expose on the network (container/Caddy). *)
|
||||
let bind_addr =
|
||||
match Sys.getenv_opt "SX_HTTP_HOST" with
|
||||
| Some h -> (try Unix.inet_addr_of_string h
|
||||
with _ -> Unix.inet_addr_loopback)
|
||||
| None -> Unix.inet_addr_loopback in
|
||||
Unix.bind sock
|
||||
(Unix.ADDR_INET (Unix.inet_addr_loopback, port));
|
||||
(Unix.ADDR_INET (bind_addr, port));
|
||||
Unix.listen sock 64;
|
||||
(* SX runtime is shared across threads — serialize handler calls. *)
|
||||
let mtx = Mutex.create () in
|
||||
|
||||
Reference in New Issue
Block a user