docs › For developers and hub operators › Deploy the hub
weechat-radio:$ Deploy the hub
For people running the public server. Most users never need this page.
What you need
- A DigitalOcean account
- Domain
weechatradio.com(already owned for the public hub) - A 2 GB Ubuntu LTS droplet
- A GitHub repowith Actions secrets:
DROPLET_HOST,DROPLET_USER,DROPLET_SSH_KEY
DNS
Create A records, all pointing at the droplet IP:
weechatradio.comwww.weechatradio.comhub.weechatradio.comapi.weechatradio.com
Steps
Steps 1 to 5 set up a new droplet once. After that, each push to main redeploys.
-
Create the droplet
Create a 2 GB Ubuntu droplet in a region close to you. Allow ports 22, 80, 443.
-
Copy the deploy files
Copy
deploy/to the droplet (or clone this repo). -
Set the domain
Copy
deploy/.env.exampleto/opt/wcr/.envand setWCR_DOMAIN=weechatradio.com. -
Start the stack
Point cloud-init at
deploy/cloud-init.yamlon first boot, or run:cd /opt/wcr docker compose -f deploy/docker-compose.yml up -d
-
Wait for certificates
Caddy issues certificates for the three names. Wait a minute.
-
Push to redeploy
GitHub Actions workflow
.github/workflows/deploy.ymlrebuilds the hub and path images and runsdocker compose pull && up -don each push tomain. The path helper answers/api/pathon the main site.
App version vs website
The website and hub image update on every push to main. That does not bump the app version and does not make wcr update download anything.
Bump Cargo.toml, the README badge, OpenAPI version, the numbered changelog, and a v* tag only when wcr / wcr-gui behaviour (or the bits inside the binary) change. wcr update follows those tags.
Backups
Production uses SQLite in the hub container (/data/hub.db and telemetry DB). Optional nightly copy:
docker compose -f deploy/docker-compose.yml exec -T hub \ sh -c 'tar -czf - /data/*.db' > /var/backups/wcr-sqlite-$(date +%F).tar.gz
How you know it worked
https://weechatradio.comshows the homepage, and/map.htmlthe maphttps://hub.weechatradio.com/healthzprintsokhttps://hub.weechatradio.com/versionshows the commit you just pushedwcr nodeon a laptop connects towss://hub.weechatradio.com/ws