Welcome to the Laval University CTF Chatbot Challenge! This project is designed as a friendly Capture the Flag (CTF) challenge where participants must interact with a chatbot to retrieve a secret code (the flag).
To run this project locally, you'll need:
- An OpenAI API key.
- Python (works on 3.12, probably on older versions too).
- Docker (optional).
See Run locally if you don't want to use docker.
-
Environment Variables
- Create a
.envfile in the root of the project and define the following variables:OPENAI_API_KEY=yourApiKey FLAG=ctf{yourFlagHere}
- Replace
yourApiKeywith your OpenAI API key. - Replace
ctf{yourFlagHere}with the flag participants need to find.
- Replace
- Create a
-
Docker Deployment
- To run the app in a Docker container, use the included
docker-composeconfiguration:docker compose up
- To run the app in a Docker container, use the included
- Language Translation
- If you prefer a language other than French (used during the original competition), update the chatbot prompts in
prompts.py. Modify the system prompt and initial messages to suit your language.
- If you prefer a language other than French (used during the original competition), update the chatbot prompts in
These instruction are to run the app locally to test or for development. The flag is in the files of the project so it as to be hosted in order to work for a CTF.
-
Environment Variables
- Create a
.envfile in the root of the project and define the following variables:OPENAI_API_KEY=yourApiKey FLAG=ctf{yourFlagHere}
- Replace
yourApiKeywith your OpenAI API key. - Replace
ctf{yourFlagHere}with the flag participants need to find.
- Replace
- Create a
-
Install Dependencies
- Install the required Python packages:
pip install -r requirements.txt
- Install the required Python packages:
-
Initialize the Database
- Set up the database:
python db.py
- Set up the database:
-
Run the Application
- Start the application locally:
python main.py
- By default, the development server will start on http://127.0.0.1:5000.
- Start the application locally: