Commit graph

68 commits

Author SHA1 Message Date
Claude
dc59293c5e
Replace Cloudflare DNS challenge with standard Let's Encrypt HTTP-01
Caddy's built-in ACME support handles TLS automatically — no CF_API_TOKEN,
no Cloudflare account, no DNS plugin needed. Requires ports 80+443 forwarded
to the Pi and ACME_EMAIL set in infra/.env.
2026-03-20 11:41:40 +00:00
Claude
3794f4cf36
Fix Dockerfile heredoc parse error in RUN if block
Use printf instead of heredoc for cargo config — heredoc inside a
conditional RUN block confuses Docker's parser (fi becomes an unknown
instruction). The config is always written; unused linker entries are
harmless on native builds.
2026-03-20 10:42:46 +00:00
Claude
3096d251c6
Fix Dockerfile: skip cross-compilers when building natively
gcc-aarch64-linux-gnu is an x86→arm64 cross-compiler; it doesn't exist
on arm64 hosts (like the Pi). Only install cross-toolchains and set cargo
linker config when BUILDPLATFORM != TARGETPLATFORM.
2026-03-20 10:40:12 +00:00
Claude
2060606adc
Consolidate to single .env at repo root
Add ACME_EMAIL to root .env.example.
start.sh now reads root .env and passes it to docker compose.
Removed infra/.env.example.
2026-03-20 10:21:35 +00:00
Claude
d5a5875899
Add TLS setup to start.sh; drop Cloudflare requirement
start.sh now generates proxy/caddy.json at launch time with Let's Encrypt
automatic HTTPS (HTTP-01 or TLS-ALPN-01 challenge — no Cloudflare needed).

Reads DOMAIN_SUFFIX and ACME_EMAIL from infra/.env before starting.
Added infra/.env.example to document required vars.
2026-03-20 10:18:01 +00:00
Claude
b060ec68af
Add start.sh and Makefile build-only targets
start.sh builds via 'make build' (platform auto-detected) then starts
services detached with 'docker compose up -d'.

Makefile gains build/build-<platform> targets that build images without
starting, mirroring the existing up/<platform> targets.
2026-03-20 10:06:24 +00:00
Claude
00da63ec80
Auto-detect platform by default; use DOCKER_DEFAULT_PLATFORM for cross-compile targets
Remove hardcoded platform from compose file so plain 'make up' (or
'docker compose up --build') always builds natively for the host.
Explicit targets (up-arm64, up-armv7, etc.) set DOCKER_DEFAULT_PLATFORM.
2026-03-20 10:03:36 +00:00
Claude
0fecb9a4fe
Add up-win alias (Windows Docker Desktop uses linux/amd64 via WSL2) 2026-03-20 10:02:21 +00:00
Claude
5484b29af6
Add up-x64 alias for up-amd64 in Makefile 2026-03-20 10:01:26 +00:00
Claude
588e74a626
Multi-platform Docker build: amd64, arm64, armv7, armv6
Dockerfile now uses BuildKit TARGETARCH/TARGETVARIANT to pick the Rust
cross-compilation target automatically. The build stage always runs on
the host platform for speed.

Makefile provides named targets:
  make up-amd64   # Mac Intel / Linux desktop
  make up-arm64   # Mac M1/M2/M3, Pi 4/5 (64-bit OS)
  make up-armv7   # Pi 2/3/4 (32-bit OS)
  make up-armv6   # Pi Zero / Pi 1
2026-03-20 09:55:53 +00:00
Shautvast
f92545ed4e armv7 target for my old pi 2026-03-19 15:55:43 +01:00
Shautvast
fd7d417471 latest rust slim 2026-03-19 12:33:08 +01:00
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
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
bddc1a8027
fix: use musl static linking to eliminate glibc version dependency
Build hiy-server targeting aarch64-unknown-linux-musl so the binary
has no glibc dependency at all, making the runtime image irrelevant
to glibc version mismatches. Uses rustls (already in Cargo.toml) so
no OpenSSL vendoring needed. SQLite is bundled by sqlx.
2026-03-19 10:48:46 +00:00
Claude
f6e6d1f8a3
fix: upgrade builder to rust:1.94-slim-bookworm 2026-03-19 10:46:37 +00:00
Claude
4e8aa1614e
fix: pin builder to rust:1.77-slim-bookworm to match runtime glibc
rust:1.77-slim has drifted to a newer Debian base with glibc 2.39,
but debian:bookworm-slim only has glibc 2.36, causing a GLIBC_2.39
not found error at runtime. Pinning to the explicit bookworm variant
keeps both stages on the same glibc version.
2026-03-19 10:45:51 +00: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