Management system for counterparty email addresses used for the Sunrise protocol.
Local development runs the server behind Caddy so that the
app is served over TLS at https://localhost, and uses Air
to rebuild and restart the server on every change.
-
Create your environment file from the template and fill in the required values:
cp .env.template .env.envis gitignored and is watched by Air, so edits to it trigger a restart. -
Install the tools (once):
brew install caddy go install github.com/air-verse/air@latest -
In one terminal, start Caddy with the repository
Caddyfile. It terminates TLS onhttps://localhostand reverse proxies to the server onlocalhost:8000:caddy run --config CaddyfileThe first run asks for permission to install Caddy's local CA so the browser trusts the certificate (you can also run
caddy trustahead of time). -
In another terminal, start the server with Air using the
.air.tomlconfig:airAir runs
go generate ./..., builds./cmd/daybreak, and runsdaybreak serveon:8000, rebuilding whenever Go, template, static, or.envfiles change. -
Open https://localhost.
Note: The Google OAuth credentials (
GOOGLE_CLIENT_ID/GOOGLE_CLIENT_SECRET) are configured for local development over TLS: the authorized redirect URI ishttps://localhost/auth/callback. Make sureDAYBREAK_ORIGIN(andDAYBREAK_ALLOW_ORIGINS) in your.envare set tohttps://localhostand that you access the app through Caddy rather thanhttp://localhost:8000, otherwise the OAuth redirect will be rejected.