Commit graph

9 commits

Author SHA1 Message Date
Claude
2df3c579e4
fix: switch Docker access to TCP via socat proxy; add Caddy error logging
- Add docker-proxy (alpine/socat) sidecar that exposes the Docker Unix
  socket as TCP on port 2375, so server needs no privileged socket mount
- Set DOCKER_HOST=tcp://docker-proxy:2375 in server environment
- App containers are still spawned on the host daemon and join hiy-net,
  so Caddy can still reach them
- Log actual Caddy PUT response body and HTTP status on failure
  instead of a silent warning
2026-03-19 11:24:50 +00:00
Claude
2e98ce957e
fix: make Caddy route upsert robust against missing/invalid routes
- Add --fail to the GET so a 404 (no 'hiy' server yet, stale volume)
  falls back to [] instead of passing error JSON to Python
- Python now guards against non-list responses with try/except
- Always re-append the dashboard catch-all route so it survives
  even when routes are rebuilt from scratch
2026-03-19 11:17:06 +00:00
Claude
a8b22d8e2d
fix: switch to Caddy JSON config so dynamic routes work correctly
The Caddyfile created a server with an auto-generated name, not 'hiy',
so build.sh's PUT to /config/apps/http/servers/hiy/routes was creating
a parallel server that never received traffic.

- Replace Caddyfile with caddy.json that names the server 'hiy' with
  the dashboard as a catch-all fallback route
- Insert app routes at index 0 so host-matched routes are evaluated
  before the catch-all dashboard fallback
- Update docker-compose to mount caddy.json and pass --config flag
2026-03-19 11:02:57 +00:00
Claude
11db59d612
fix: guard against non-dict route entries when filtering Caddy routes
r.get() crashed when the Caddy API returned a routes array containing
string elements. Added isinstance(r, dict) check and also made the
match[0] traversal safer by using any() over the match list.
2026-03-19 10:55:40 +00:00
Claude
3d35e220e4
build.sh: give actionable instructions when Caddy is unreachable
The old message just said 'expose manually if needed' with no guidance.
Now it prints the exact docker commands to publish the port directly
and how to find the container IP for a custom reverse proxy.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
2026-03-19 10:27:17 +00:00
Claude
54ddc0d856
build.sh: fix empty array expansion under set -u
${arr[@]} with set -u throws 'unbound variable' when the array is empty.
Use ${arr[@]+"${arr[@]}"} which only expands if the array is set.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
2026-03-19 09:58:20 +00:00
Claude
efca2b5941
build.sh: skip --env-file when env file does not exist
docker run fails hard if the path passed to --env-file is missing.
Make the flag conditional so apps without an env file (or where the
file hasn't been created yet) still start successfully.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
2026-03-19 09:47:21 +00:00
Shautvast
98385ea743 proper var use 2026-03-19 10:45:52 +01:00
Claude
8f5bb158cb
M1: Rust control plane, builder, dashboard, and infra
- Cargo workspace with hiy-server (axum 0.7 + sqlx SQLite + tokio)
- SQLite schema: apps, deploys, env_vars (inline migrations, no daemon)
- Background build worker: sequential queue, streams stdout/stderr to DB
- REST API: CRUD for apps, deploys, env vars; GitHub webhook with HMAC-SHA256
- SSE endpoint for live build log streaming
- Monospace HTMX-free dashboard: app list + per-app detail, log viewer, env editor
- builder/build.sh: clone/pull → detect strategy (Dockerfile/buildpack/static)
  → docker build → swap container → update Caddy via admin API → prune images
- infra/docker-compose.yml + Dockerfile.server for local dev (no Pi needed)
- proxy/Caddyfile: auto-HTTPS off for local, comment removed for production
- .env.example

Compiles clean (zero warnings). Run locally:
  cp .env.example .env && cargo run --bin hiy-server

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
2026-03-19 08:25:59 +00:00