<commit_before># OpenCTF

OpenCTF is an open-source CTF platform designed to be flexible and run under lots of different environments.<commit_msg>some docs<commit_after># OpenCTF

OpenCTF is an open-source CTF platform designed to be flexible and run under lots of different environments.

## Components

There are several components that comprise OpenCTF. For a small setup, it should suffice to simply run them all in the same box. But if you're planning to run a larger-scale CTF, it may be wise to deploy on multiple servers. These components can all live on different servers and talk to each other over the network, for good horizontal scaling.

- **Gateway/Proxy server**: This is the main frontend of the CTF and serves two purposes: to serve as the gateway to the API server and filestore servers, and to serve the static frontend.
- **API Server**: This is the backbone of the CTF. 
- **Static Filestore**: This server actually has two endpoints: one internal-facing (can be protected by a password or SSH) endpoint to receive files, and a public-facing one that serves static files. In reality, this can live on the same server as the gateway, since it also uses Nginx.
- **Task queue**: This server consumes items from the task queue and executes them. Some examples of tasks that are executed are: sending emails, running sandboxed applications, generating files, precomputing the scoreboard.

And then some more common services:

- **SQL Database**: Currently, OpenCTF only supports MySQL (and by extension, MariaDB). Support for other servers is planned, but not likely to be implemented for a while. PRs for porting the migrations into other flavors of SQL are welcome!
- **Redis database (optional)**: This serves as both a cache server and PubSub server. It is not be used for any information that must not be lost, so it's ok to lose this. Without a Redis backend, a built-in hashmap-based implementation will be used.

Of course,
{'fraction_non_alphanumeric': 0.051308363263211906, 'fraction_numerical': 0.0, 'mean_word_length': 4.492957746478873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5644885', 'n_tokens_mistral': 480, 'n_tokens_neox': 465, 'n_words': 308}