Upgrading from v1
Migration guide from rCTF v1 to v2, covering database changes, API differences, and configuration updates.
This guide covers what changed between rCTF v1 and v2, and what you need to do to upgrade.
In short, swap the image and restart#
The upgrade is automated. Point your existing deployment at the v2 image and start it. Drizzle migrations run on boot, and v1 recaptcha / globalSiteTag config gets converted to the new shape at startup. No manual SQL, no config rewrite needed to get back online.
services: rctf: image: ghcr.io/otter-sec/rctf-new:latestWarning (Back up the database first)
Migrations are forward-only and modify the schema in place. Take a PostgreSQL dump (e.g. pg_dump) before swapping the image so you have a way back if something goes wrong.
If you want to know what actually changes (new tables, new columns, API differences, and config sections worth rewriting by hand), read on. None of it is required to upgrade.
Database migration#
Drizzle ORM handles schema changes and runs them automatically when database.migrate is before (the default in the bundled container). To run them by hand:
bun run db:migrateNew tables#
New columns on users#
New columns on challenges#
API changes#
All v1 routes still work. The v2 API lives at /api/v2/... and adds several improvements and new endpoints.
Captcha field rename#
V2 routes use captchaCode instead of recaptchaCode in request bodies. This applies to every endpoint that supports captcha validation.
File uploads#
The v2 admin upload endpoint (POST /api/v2/admin/upload) takes binary files via multipart/form-data rather than the base64-encoded data URIs v1 used.
New v2 endpoints#
Response differences#
- Challenge files in v2 include a
sizefield (v1 did not track file sizes) - Challenge solves in v2 include user profile data (avatar, country, status) and blood status
- Leaderboard in v2 supports a
searchquery parameter for team name search (rate limited)
Configuration changes#
Captcha provider#
The v1 recaptcha top-level config gets converted to the new captcha.provider format at startup automatically. We still recommend migrating to the new format by hand:
recaptcha: siteKey: your-site-key secretKey: your-secret-key protectedActions: - registercaptcha: provider: name: captcha/recaptcha options: siteKey: your-site-key secretKey: your-secret-key protectedEndpoints: - registerThe new format also supports captcha/hcaptcha and captcha/turnstile providers.
Analytics provider#
The v1 globalSiteTag config gets converted to the analytics.provider format automatically. Migrate to:
analytics: provider: name: analytics/google options: siteTag: G-XXXXXXXXAdditional analytics providers are also available, such as analytics/cloudflare.
New configuration sections#
v2 adds the following configuration sections:
See the Configuration reference for details on every option.