Skip to content

EkiXu/CTFm

Repository files navigation

logo

Backend: Frontend:

A CTF Competition Platform

中文文档

How to build

require docker,docker-compose

  1. create docker-swarm
docker swarm init
  1. label node
docker node ls
docker node update --label-add name=linux-1 <节点 ID>
  1. pull the codes
git clone https://github.com/EkiXu/CTFm
cd CTFm

git submodule update --init --recursive
mkdir backend/log/
  1. create secret for passwords
echo -n "<your secret here>" > "./secrets/DB_PASSWORD"
echo -n "<your secret here>" > "./secrets/REDIS_PASSWORD"
echo -n "<your secret here>" > "./secrets/SECRET_KEY"
  1. regenerate frontend code
cd frontend
yarn install
yarn build
  1. regenerate dashboard code
cd dashboard
yarn install
yarn build
  1. start the project by docker-compose
docker-compose up -d --build
  1. initialize the database and super admin
docker-compose exec ctfm /bin/bash 
python manage.py migrate
python manage.py createsuperuser

Configuration

your can modify some preferences by creating backend/CTFm_backend/local_settings.py

About Recaptcha

Get the api key from https://www.google.com/recaptcha/

put your client key atfrontend/.env

VUE_APP_BASE_API = '/api/v1'
VUE_APP_RECAPTCHA_PUBLIC_KEY = '<your RECAPTCHA_CLIENT_KEY>'

and rebuild your frontend dist

yarn build

put the line below in your local_settings.py

#backend/CTFm_backend/local_settings.py
DRF_RECAPTCHA_SECRET_KEY = "<your RECAPTCHA_SERVER_KEY>"

Abount Email Verification

CTFm now is using TencentClound SDK for Email Verification codes at [backend/user/utils.py]

About Dynamic Challenge

Inspired by CTFd-Whale

Example Config:

#backend/CTFm_backend/local_settings.py
ENABLE_EMAIL_VALIDATION = True

TENCENT_SECRET_ID = ""
TENCENT_SECRET_KEY = ""


EMAIL = "contest@noreply.mrctf.fun"

REGISTER_VALIDATION_EMAIL_TEMPLATE = 13280
RESET_PASSWORD_EMAIL_TEMPLATE = 13281

TodoList

  • Basic Challenge Manage
  • Basic User Profile
  • Scoreboard & TrendChart
  • ChangePassword
  • Notification Manage
  • Realtime Notification
  • Dynamic Challenge Score Support
  • Boardcast TOP3 Socrer via Websocket
  • Dynamic Docker Challenge Support
  • Team Support
  • Plugin System

Contribution

All kinds of contributions are welcomed.