Hacking on Berth
make build # bin/berth and bin/berthd
make test # go test -race ./... (runs on Linux too, with a fake container runtime)
To try Berth without touching ~/.berth or the default ports:
export BERTH_HOME=/tmp/berth-dev
bin/berth init --no-tunnel --no-launchd --yes --skip-github
# edit caddy_http, caddy_https, caddy_lan_http, caddy_admin and webhook_addr
# in $BERTH_HOME/config.json, then regenerate Caddy's starting config:
rm $BERTH_HOME/caddy.json && bin/berth init --no-tunnel --no-launchd --yes --skip-github
# and in two terminals:
caddy run --config $BERTH_HOME/caddy.json
bin/berthd --debug
The admin page is plain files in internal/admin/ui. To look at it against
your real Berth without signing in, run a loopback-only preview that signs
requests as a test viewer, then open http://127.0.0.1:7799:
BERTH_ADMIN_PREVIEW=7799 BERTH_ADMIN_PREVIEW_SECS=600 go test ./internal/daemon -run TestAdminPreview
The S3 client has a test against a real S3-compatible server. It's skipped
unless BERTH_S3_TEST=<endpoint>,<bucket>,<access key>,<secret> is set;
internal/offsite/live_test.go shows how to run one locally with rclone.
To cut a release, scripts/release.sh v0.2.0 runs the tests, tags, pushes,
and points the Homebrew formula at the new tarball.
The website, berth.computer, lives in site/ and is
itself a Berth app (berth create site --repo dps/berth --path site). Its
docs are this README, one page per ## section with the sidebar taken from
the Contents list, so after editing the README run make site and commit
what it writes. Do the same after changing site.css or site.js: their
links carry a hash of the file, so Cloudflare never serves an old copy with
a new page. The release script checks it's all up to date.