Skip to content

Docker Local Deployment

tkaixiang edited this page Nov 26, 2021 · 4 revisions

Dependencies

Get and Move Stuff To the Right Places

Setting up Sieberrsec CTF Platform locally can be done in a few simple steps. We are going to assume we are on an Ubuntu Server in this guide.

Firstly, clone the repo and move into it

git clone https://github.com/IRS-Cybersec/ctf_platform.git
cd ctf_platform

Build And Run The Containers

docker-compose up
  • After the containers are done building, the client will be running on localhost:20002 and the API is running on localhost:20001.
  • An admin account is automatically created on initial setup, and the login details can be found in the API docker logs.
docker ctf-web-api logs
  • A new secure salt & secret is generated automatically on initial setup as well.

Congratulations! The platform should now be accessible at http://localhost:20002.

Remarks

  • If you want to change any part of the platform (such as changing the logo to your own CTF's logo), simply edit the source code & rebuild the docker
docker-compose up --build
  • Uploaded files and database data are saved in volumes permanently even if you rebuild the docker. If you want to refresh the instance and clear all data, simply run:
docker-compose down -v
docker-compose up -d
  • Updating the platform is as simply as:
git pull
docker-compose up --build

Edit cache database with config.json

If you want to use pre-saved settings on load, you can create a config.json inside /api that looks like this:

{
  "announcements": 0,
  "challenges": 0,
  "registerDisable": false,
  "adminShowDisable": false,
  "submissionDisabled": false,
  "uploadSize": 512000,
  "latestSolveSubmissionID": 0,
  "maxSockets": 5,
  "uploadPath": "/usr/share/nginx/static/profile"
}

The API will automatically insert these settings into the cache database. You only need to enter the settings you want to edit on load. Please delete this file after this is completed as it will load the settings on each restart and might override any settings you make in the platform afterwards.