-
Notifications
You must be signed in to change notification settings - Fork 12
Docker Production Deployment
- Docker
- Docker-Compose
- A web server (we will be using Nginx here)
Setting up Sieberrsec CTF Platform 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
docker-compose up
- After the containers are done building, the
client
will be running onlocalhost:20002
and theAPI
is running onlocalhost:20001
. - An admin account is automatically created on initial setup, and the login details can be found in the API docker logs.
docker logs ctf-web-api
- A new secure salt & secret is generated automatically on initial setup as well.
We provide an example nginx
config file ctf_platform.conf which you can use as a reference to setup nginx.conf
or a virtualhost. Simply copy the config over and remember to restart your nginx server after editing the config.
Important: Please change server_name ctf.example.com
to YOUR.DOMAIN.COM
, or if you are not using any domains, place it as server_name _
Congratulations! The platform should now be accessible at YOUR.DOMAIN.COM
. If you want HTTPS , you can consider looking at installing and setting up Certbot or acme.sh.
- 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
### 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.