CTF Platform built with Next.JS React Framework.
Clone with git clone --recurse-submodules
The platform is built with the following node.js and npm versions. For how to install node.js and npm, refer to this guide.
$ node -v
v16.13.0
$ npm -v
8.1.0
To get started, simply install dependencies with
$ npm install --legacy-peer-deps
You will need to create a .env
file in the project root. Refer to the env.example
file for the environment variables required. The following is how you may obtain some of their values.
-
Database URL
If you are using planning to use the docker-compose provided, you may leave the value as is. However, if you plan on hosting the database instance separately, please modify the value as follows:
postgresql://<USERNAME>:<PASSWORD>@<HOST>:<PORT>/<DATABASE_NAME>
-
Email Server
This field would contain the details required to send emails for user logins. TheEMAIL_SERVER
field uses the following format:
smtp://<USERNAME>:<PASSWORD>@<SERVER NAME>:<PORT>
Below are some guides on how to set up SMTP server for different email providers. -
OAuth Client ID and Secrets
These fields contain the necessary details for the OAuth providers to authenticate users. See below on how to set up an OAuth application with the respective providers.When setting up the OAuth applications, ensure to change the Callback URL for each provider. E.g. Discord Callback URL should be:
https://<yourdomain>/api/auth/callback/discord
-
Next Auth URL
When deploying to production, set theNEXTAUTH_URL
environment variable to the canonical URL of your site.
To make use of runner, you will have to edit the configuration in /runner/config
. A README.md
is provided there.
To run with Docker, do also remember to add your SSL Certs to the nginx config. More details can be found in docker-miisc/README.md
.
If you are using the docker-compose file, you may skip this step. The platform uses a Postgres database. One can initialise the database with the script found in docker-misc
There are several scripts available for development and deployment.
dunhack.me is MIT licensed