-
Clone the repository.
-
Rename .git folders to make them usable:
./rename.py git
-
Install testing dependencies:
pip3 install pipenv==2022.8.30 pipenv install --deploy
-
Run the development environment to experiment with new changes:
rm -rf tmp tmp-ctfd/ cp -R ctfd/data/ tmp-ctfd/ docker-compose -f docker-compose-dev.yaml up -d
-
Make the desired changes:
- All services except CTFd are completely configured as code so desired changes should be made to the files in the appropriate folders.
- To make changes in CTFd, use the admin credentials.
-
Shutdown the environment, move changes made in CTFd and rebuild it:
docker-compose -f docker-compose-dev.yaml down ./apply.sh # save CTFd changes docker-compose -f docker-compose-dev.yaml up -d --build
-
Run tests:
pytest -n 2 tests/
-
Rename .git folders to allow push:
./rename.py notgit
-
Commit and push!
Follow the checklist below to add a challenge:
- CTFd:
- Write challenge description.
- Choose category according to difficulty level.
- Make sure the challenge is visible and has value according to difficulty.
- Write hints in order of usage.
- Add a flag. Make sure to select if it's case-insensitive.
- Gitea:
- Configure a new repository in gitea.yaml.
- Create the repository under gitea/repositories. Use an open-source repository that use the MIT license as a template for the challenge repository.
- Jenkins:
- Configure Jenkins and add new jobdsl files in the casc.yaml file.
- Make sure jobs don't run periodically. Jobs should be triggered by events / polling.
- Validate that the new challenge doesn't interfere with other challenges.
- GitLab:
- Configure Gitlab by changing the gitlab.tf file and run
terraform init
to update lock file. - To upload new repositories add the releqvant line in repositories.sh.
- If any additional files are needed place them inside the resources' folder.
- Configure Gitlab by changing the gitlab.tf file and run
- Make sure the flag is not accessible when solving other challenges.
- Write tests.
- Write the solution.
- Update README.md if needed.
- In order to run the CI, make sure you have a CircleCI account and that you’ve clicked “Set Up Project” on your fork of the project.