No description
  • HTML 83.3%
  • Go 14.2%
  • Nix 2.5%
Find a file
2026-03-01 10:09:18 +01:00
flake.lock temP 2026-03-01 10:09:18 +01:00
flake.nix temP 2026-03-01 10:09:18 +01:00
go.mod temP 2026-03-01 10:09:18 +01:00
index.html temP 2026-03-01 10:09:18 +01:00
main.go temP 2026-03-01 10:09:18 +01:00
README.md temP 2026-03-01 10:09:18 +01:00

bearbox

Small static homepage for a personal homelab.

What it is

  • Single Go binary (main.go) that serves the UI and probe endpoints
  • index.html is embedded into the binary at build time
  • Uses Tailwind via CDN (no build step)
  • Supports system dark mode + clickable accent theme cycling
  • Shows a service card linking to /cp/ (Cockpit)
  • Includes a small interactive bear ASCII footer element

Run locally

Run the server directly:

cd /private/tmp/bearbox
go run .

Then visit http://localhost:8080.

To build a self-contained binary:

cd /private/tmp/bearbox
go build -o bearbox .
./bearbox

Optional bind address:

BEARBOX_ADDR=":9090" ./bearbox

Edit

Most customization lives in index.html:

  • Header/title and homelab URL text
  • Service card link, label, and description
  • Accent colors in CSS variables
  • Available themes and bear ASCII variants in the bottom script

Hacking

For a reproducible dev environment, use the Nix flake:

cd /private/tmp/bearbox
nix develop

This shell provides:

  • go
  • fish

Quick iteration loop:

cd /private/tmp/bearbox
go run .

Then open http://localhost:8080, edit index.html, and refresh the page.

API

  • GET / and GET /index.html: homepage
  • GET /ip: remote IP
  • GET /ua: User-Agent
  • GET /lang: Accept-Language
  • GET /method: HTTP method
  • GET /encoding: Accept-Encoding
  • GET /mime: Accept
  • GET /xff: X-Forwarded-For
  • GET /proto: HTTP protocol version
  • GET /all.json: JSON payload with all fields