No description
- HTML 83.3%
- Go 14.2%
- Nix 2.5%
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| index.html | ||
| main.go | ||
| README.md | ||
bearbox
Small static homepage for a personal homelab.
What it is
- Single Go binary (
main.go) that serves the UI and probe endpoints index.htmlis 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:
gofish
Quick iteration loop:
cd /private/tmp/bearbox
go run .
Then open http://localhost:8080, edit index.html, and refresh the page.
API
GET /andGET /index.html: homepageGET /ip: remote IPGET /ua:User-AgentGET /lang:Accept-LanguageGET /method: HTTP methodGET /encoding:Accept-EncodingGET /mime:AcceptGET /xff:X-Forwarded-ForGET /proto: HTTP protocol versionGET /all.json: JSON payload with all fields