A Go file server for Krazy Kontainers pure Go · zero CGO GPL-3.0

Krazy Kontainers.
Krazy tiny or krazy huge.

KrazyToGo is the system to serve files in minimal Go containers — the file-server binary plus Kontainer packaging, including for and alongside gokrazy. Same static binary on Docker, Podman, and Kubernetes. Pure net/http. Not a whole gokrazy distro — just files, neatly contained.

Module github.com/crimsonflower420/KrazyToGo · package cmd/krazytogo · ~5.4 MiB stripped static binary (linux/amd64)

  • Docker
  • Podman
  • Kubernetes

Kontainers first. Scale either way.

The process stays tiny. The data can be a handful of files or a warehouse. Either way, you get the same static binary in a minimal Go container — a Krazy Kontainer — on the runtime you already run.

Krazy Kontainers

File-server binary + packaging for minimal Go containers. Works for and alongside gokrazy appliances. Honest scope: not a whole gokrazy distro — just serve files, contained.

Krazy tiny ↔ krazy huge

Footprint stays small (~5.4 MiB stripped). Mount a tiny config tree or a huge dataset — the Kontainer shape does not care. Process tiny; data your call.

Three equal runtimes

Docker, Podman, and Kubernetes are first-class ways to contain the server. Same binary, same flags, same /healthz.

Maintainer’s bet. This is one maintainer’s point of view — what we optimize for: tiny process, honest boundaries, Kontainers on Docker / Podman / Kubernetes, gokrazy-friendly packaging. Other takes welcome — future contributors invited to argue with the defaults.

Just enough. Nothing more.

  • Static file serving

    Point -root (or KRAZY_ROOT) at a directory and go. Directory browsing is optional via -browse.

  • Ops-friendly endpoints

    /healthz for probes, Range requests for resumes. Flags beat env beat defaults — short unit files, clear precedence.

  • Krazy Kontainer packaging

    Multi-stage → FROM scratch, non-root UID. Mount a volume, publish a port — same shape under Docker and Podman.

  • Kubernetes first-class

    Hardened manifests with PVC, runAsNonRoot, read-only root FS, and /healthz probes under deploy/kubernetes/.

  • gokrazy-friendly

    Build with -tags gokrazy (listen :80, root /perm/files). Runs for / alongside gokrazy — not a replacement distro.

  • Honest boundaries

    No uploads, no WebDAV, no in-app auth, no UI. Pure net/http, no CGO. Auth and TLS live at the edge.

Install → run → /healthz

Under thirty seconds of reading. Copy-paste from the public product README.

Install
go install github.com/crimsonflower420/KrazyToGo/cmd/krazytogo@latest
Run (after install)
mkdir -p data && echo hello > data/hello.txt
krazytogo -root ./data -addr :8080
# → http://127.0.0.1:8080/hello.txt
# → http://127.0.0.1:8080/healthz  → 200 ok
From a checkout
mkdir -p data && echo hello > data/hello.txt
go run ./cmd/krazytogo -root ./data -addr :8080
Static build
CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o krazytogo ./cmd/krazytogo
./krazytogo -root ./data -addr :8080
Smoke check
curl -fsS http://127.0.0.1:8080/healthz
# → 200 ok

After any deploy, hit /healthz — probes and humans both get a plain 200 ok.

-root / KRAZY_ROOT
Directory to serve (default ./data; /data in images)
-addr / KRAZY_ADDR
Listen address (default :8080; :80 on gokrazy)
-browse / KRAZY_BROWSE
Directory listing (default on; off → dirs 404)

Precedence: flags > env > defaults.

One binary. Three first-class Kontainers.

Docker, Podman, and Kubernetes are equal ways to contain the server. gokrazy stays in the picture as an appliance host you can run for or alongside — packaging, not a whole distro.

Kontainer

Docker

Multi-stage → FROM scratch, USER 65532:65532. Mount content, publish a port. Same Krazy Kontainer image shape as Podman.

Docker
docker build -t krazytogo .
docker run -d -p 8080:8080 \
  -v "$PWD/data:/data" \
  -e KRAZY_ROOT=/data krazytogo

Kontainer

Podman

Same Dockerfile, same scratch image, rootless-friendly. Drop-in commands if you prefer Podman over Docker.

Podman
podman build -t krazytogo .
podman run -d -p 8080:8080 \
  -v "$PWD/data:/data" \
  -e KRAZY_ROOT=/data krazytogo

Kontainer

Kubernetes

Hardened manifests under deploy/kubernetes/. PVC (not hostPath), non-root, read-only root FS, /healthz probes.

  • kubectl apply -k deploy/kubernetes/
  • Edit Deployment image after push
  • Auth / TLS at Ingress or mesh

gokrazy note. Build with -tags gokrazy (listen :80, root /perm/files) when you bake the binary into an appliance image. Prefer Tailscale for access. KrazyToGo is the file server + packaging — not a gokrazy distribution.

Short answers for impatient humans.

What is a Krazy Kontainer?
A minimal Go container that runs the KrazyToGo file-server binary — scratch image, non-root, mount your data. The product is that binary plus packaging, including for / alongside gokrazy. It is not a whole gokrazy distro.
Krazy tiny or krazy huge — which?
Both. The process stays tiny (~5.4 MiB stripped). The data can be a few files or fuckhuge — neatly containerized either way on Docker, Podman, or Kubernetes.
Why not just nginx / Caddy?
Those are reverse proxies with a kitchen sink. KrazyToGo is a single static Go binary that only serves files — same build in a Kontainer on Docker, Podman, and Kubernetes.
Where does auth live?
Outside the process. Prefer Tailscale Serve, or terminate TLS/auth at Caddy / nginx / Ingress. Nothing in-process by design.
How big is the binary?
About 5.4 MiB stripped (CGO_ENABLED=0, -ldflags=-s -w) on linux/amd64. Stdlib only — no module deps.
Can I upload files?
No. Read-oriented serving only. Uploads, WebDAV, and admin UI stay out of scope so the surface stays tiny.
License / support?
GPL-3.0. If it saves you a weekend, buy Grant a coffee.

We will not grow into these.

Clarity beats feature creep. If you need the items below, put another component in front of KrazyToGo — don’t wait for them to land in-process.

  • Not a gokrazy distro — file server + Kontainer packaging for / alongside gokrazy, not a replacement OS image.
  • No in-process auth — use Tailscale, OAuth proxies, or your reverse proxy.
  • No uploads — this is a read-oriented file server, not a dropbox.
  • No WebDAV — mount and sync belong elsewhere.
  • No built-in UI — optional directory browse only; no admin console.
  • No CGO — pure Go, always.
  • Not a reverse proxy — not Caddy; just files. Terminate TLS and auth at the edge.

Fuel the krazy.

KrazyToGo is free software under GPL-3.0. If a Krazy Kontainer saves you an afternoon of wiring up yet another “simple” file server, a coffee keeps the maintainer caffeinated and the binary tiny.