Syncing the repo
The CTF repository is not read from Git directly. Instead, the manager keeps a local copy of it and only updates it when an admin triggers a sync. This means you can push changes to the repository at any time without them going live immediately.
Configuration
The repository is configured using these environment variables on the manager:
| Variable | Description |
|---|---|
GIT_URL | URL of the Git repository, for example https://gitlab.com/my-org/my-ctf.git |
GIT_BRANCH | Branch to check out, for example main |
REPO_DIR | Optional, where the local copy is stored. Defaults to /data/repo |
Syncing
The repository is not synced automatically, not even on the first start. After installing the platform, and after every change you want to publish, an admin has to sync it: open Administration → Repository Sync in the frontend and click Sync repository.
A sync makes a fresh shallow clone of the configured branch and then replaces the local copy. Changes to challenges and the event configuration take effect immediately after the sync. Challenge instances that are already running are not changed. Players have to restart their instance to get the new version.
Checking the sync status
The same page shows which commit is currently live: its title, hash, author and time. Authors can see it too, but only admins can sync. If the repository was never synced, the page says so, and players don't see any challenges yet.
Automating syncs
To sync from CI, for example after every push to the event branch, call the syncRepo mutation of the GraphQL API with an admin's token.