Skip to content

Latest commit

 

History

History
67 lines (47 loc) · 2.35 KB

build.md

File metadata and controls

67 lines (47 loc) · 2.35 KB

Build an instance

Basic setup

$ git clone https://github.com/hugsy/ctfhub
$ cd ctfhub
$ cp .env.example .env
### CHANGE THE CREDENTIALS IN .env ###
$ nano .env
### BUILD EXCALIDRAW USING .env VARIABLES ###
$ docker compose up -d --build

SSL + nginx reverse-proxy on Docker

A standard secure way to deploy an instance of CTFHub is to use it over an SSL layer, and behind a reverse proxy. Using Let's Encrypt you can easily generate a valid SSL certificate, which can be used with an nginx container acting as a reverse-proxy. A boilerplate template was provided to you in scripts/nginx, which you can use in combination of the instructions to generate local SSL certificates. Then run docker compose with multiple files as such:

$ cp scripts/proxy/.env.nginx-proxy.example scripts/proxy/.env
$ nano scripts/proxy/.env
### Edit the file to your need
$ docker compose -f ./docker-compose.yml -f scripts/proxy/docker-compose.yml up -d --build

Note that the example env file have default variables that may not suit your environment. Adjust them to your needs.

Deploy your instance for Excalidraw

In scripts/excalidraw :

$ cd scripts/excalidraw
$ cp .env.example .env
$ nano .env
### edit .env to match your configuration
$ cd ../..
$ nano .env
### update the CTFHUB_EXCALIDRAW_URL setting to point to your local excalidraw
$ docker compose -f ./docker-compose.yml -f scripts/excalidraw/docker-compose.yml up -d --build

Note that the example env file have default variables that may not suit your environment. Adjust them to your needs.

Receive Discord notifications

Create a HTTP Webhook on your Discord and paste that link to the setting CTFHUB_DISCORD_WEBHOOK_URL in your .env file.

Receive Email notifications

Edit your .env and populate the following fields:

CTFHUB_EMAIL_SERVER_HOST=''                                 # smtp.gmail.com or mailgun, or sendgrid etc.
CTFHUB_EMAIL_SERVER_PORT=0
CTFHUB_EMAIL_USERNAME=''
CTFHUB_EMAIL_PASSWORD=''

With the appropriate values

Migration

If you're migrating from the first versions called ctpad, check out see PR #83 to migrate the data to the new environment, search the Setup > Migration part.