This is the code for the bitcoin++ website. (Conference X Account)
Configuration is loaded from environment variables. For local development,
the app also reads .env from the repo root without overwriting variables
already exported in the shell.
We use nix for this. Installs go + tailwindcss + air dependencies for Makefile.
nix develop
From a clean checkout, enter the Nix shell and start the full local harness:
nix develop
just dev-up
When the server reports that it is listening, open:
http://localhost:8888
just dev-up bootstraps .env, starts local Postgres, applies migrations,
seeds realistic local fixture data, prints a local admin login URL, and runs
the app in the foreground. Stop the foreground process with Ctrl-C.
To stop local harness services:
just dev-down
just dev-down stops the local Postgres service. For lower-level app-only live
reload, use make dev-run.
If local Postgres fails to start because the dev data directory is stale or corrupt, explicitly rebuild the local dev database with:
just dev-reset-db
This moves the previous local data directory aside with a .reset-<timestamp>
suffix before creating a fresh one.
make build
This will put all the files necessary to serve the site into target/
The per-event recordings dashboard lives at /{conf}/admin/recordings and can auto-publish recording rows that have FileURI and PublishAt set. Enable the background worker with:
RECORDINGS_AUTOPUBLISH_ENABLED=true
RECORDINGS_AUTOPUBLISH_POLL_SEC=60
RECORDINGS_NOTIFY_EMAIL=nifty@btcpp.dev
SOCIAL_STATE_KEY=<base64-encoded 32-byte key>
YouTube OAuth tokens and the X Chrome profile are encrypted into Spaces because DigitalOcean App Platform does not persist local disk across deploys. The default object keys are:
YOUTUBE_TOKEN_OBJECT=private/social/youtube-token.json.enc
X_PROFILE_ARCHIVE_OBJECT=private/social/x-chrome-profile.tgz.enc
Set X_UPLOADER_ENABLED=true on exactly one running app component. To repair X auth, run the app locally with the same Spaces credentials plus X_BROWSER_HEADED=true, use the recordings admin page's Bootstrap X action, finish the x.com login in Chrome, then run Test X auth.
YouTube OAuth uses the current event-scoped callback URL, for example https://btcpp.dev/berlin26/admin/recordings/oauth/youtube/callback. Register the event callback URL in the Google OAuth client before authorizing YouTube from that event dashboard.
Note that the Github actions deployer uses Docker and isn't nix-aware, so for now you must make and check-in any CSS changes before deploying.
CSS updates are made automatically by dev-run, so this shouldn't be too hard.
Currently, we deploy the app using Digital Ocean, using the Dockerfile. Sometimes it's useful to test building changes locally. For this, I'd recommend using the doctl app.
Instructions here, but in brief.
doctl app dev build
Then follow the instructions to run.
The Docker image uses environment variables in App Platform. For local
build testing, make sure the needed values are present in .env or exported
in your shell.