/ctfd_auto_setup

Automatically setup CTFd instance with Playwright

Primary LanguagePython

Automatically setup CTFd instance

Set environment variables. Run the script. Be lazy.

Requirements

  • Python 3.9 or greater
  • poetry

Installation

  1. Clone the repository and change it to your working directory.

  2. Install the project:

$ poetry install
  1. Activate the virtual environment and install the web browsers:
$ source `poetry env info --path`/bin/activate
$ playwright install
  1. Set the required variables in a .env file at the root of the repository.
EVENT_NAME=
EVENT_DESCRIPTION=
USER_MODE=   # 0 | 1
ADMIN_USERNAME=
ADMIN_EMAIL=
ADMIN_PASSWORD=
THEME_NAME=  # the only optional parameter, default: "core"
START_DATE=  # "yyyy-mm-dd"
START_TIME=  # "hh:mm" in 24hrs format
END_DATE=    # "yyyy-mm-dd"
END_TIME=    # "hh:mm" in 24hrs format

Usage

ctfd_setup [-h] [-d] [--url URL] [-t TIMEOUT]

Automatically setup CTFd instance.

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Run headful browser with a slowmo
  --url URL             URL of the CTFd (default: http://localhost:8000)
  -t TIMEOUT, --timeout TIMEOUT
                        default maximum navigation time in milliseconds (default: 30000)
  1. Activate the virtual environment:
$ source `poetry env info --path`/bin/activate
  1. Run the project:
$ ctfd_setup

Credits