Skip to content

Configuration#

You can specify configuration to rCTF through conf.d or environment variables. Most values can be set through either.

YAML and JSON files in the conf.d directory are sorted alphabetically. Files later alphabetically have higher priority when merging config. Environment variables are always given highest priority.

In general, all config should be specified via YAML/JSON when possible as they provide the most flexibility.

For example, if 00-example.yaml contained:

meta:
  description: abc
  imageUrl: https://example.com

and 99-example.yml contained:

ctfName: foo
meta:
  description: xyz

and the environment contained:

RCTF_NAME=bar

The resulting config would be:

ctfName: bar
meta:
  description: xyz
  imageUrl: https://example.com

Configuration#

Core#

Important values to configure to customize your CTF.

YAML/JSON name environment name required default value type description
ctfName RCTF_NAME yes (none) string name of the CTF throughout the UI
meta.description RCTF_META_DESCRIPTION yes '' string OpenGraph and Twitter embed description
meta.imageUrl RCTF_IMAGE_URL yes '' string OpenGraph and Twitter embed image URL
origin RCTF_ORIGIN yes (none) string public URL of the rCTF instance
homeContent RCTF_HOME_CONTENT yes '' string markdown content for the homepage of the CTF. documentation
startTime RCTF_START_TIME yes (none) integer time at which the CTF starts, in milliseconds since the epoch
endTime RCTF_END_TIME yes (none) integer time at which the CTF ends, in milliseconds since the epoch
divisions (none) yes (none) object division IDs and their respective names. documentation
defaultDivision (none) no (none) string default division ID. documentation
divisionACLs (none) no (none) array ACLs for restricting division access. documentation
faviconUrl RCTF_FAVICON_URL no (rCTF favicon) string URL to custom favicon image

Additional#

Optional configuration to enable additional features.

YAML/JSON name environment name required default value type description
sponsors (none) yes [] array list of CTF sponsors. documentation
globalSiteTag RCTF_GLOBAL_SITE_TAG no (none) string Google Analytics site tag
logoUrl RCTF_LOGO_URL no (none) string URL to raster image of the CTF's logo. used in emails
email.provider (none) no (none) provider provider for email sending. documentation
email.from (none) no (none) provider from: address when sending email. documentation
ctftime.clientId RCTF_CTFTIME_CLIENT_ID no (none) string CTFtime OAuth client ID. documentation
ctftime.clientSecret RCTF_CTFTIME_CLIENT_SECRET no (none) string CTFtime OAuth client secret. documentation
recaptcha.siteKey RCTF_RECAPTCHA_SITE_KEY no (none) string reCAPTCHA public site key. documentation
recaptcha.secretKey RCTF_RECAPTCHA_SECRET_KEY no (none) string reCAPTCHA secret key. documentation
recaptcha.protectedActions (none) no (none) array list of reCAPTCHA protected actions. documentation

Advanced#

Configuration for advanced users - sane defaults are automatically set by the installation script.

YAML/JSON name environment name required default value type description
tokenKey RCTF_TOKEN_KEY yes (none) string base64 encoded 32 byte key used for encrypting tokens
proxy.cloudflare (none) yes false boolean whether or not rCTF is behind Cloudflare; if true, do not use proxy.trust
proxy.trust (none) yes false boolean, string, string array, or integer X-Forwarded-For trust: the trust parameter to proxy-addr
loginTimeout RCTF_LOGIN_TIMEOUT yes 3600000 integer lifetime of registration, email update, and recovery links, in milliseconds
userMembers RCTF_USER_MEMBERS yes true boolean whether to allow a user to provide emails for individual members
database.migrate RCTF_DATABASE_MIGRATE yes never before | only | never how to run postgreSQL migrations. documentation
instanceType RCTF_INSTANCE_TYPE yes all all | frontend | leaderboard what type of instance to run. documentation
challengeProvider (none) yes database provider provider for challenges. documentation
uploadProvider (none) yes local provider provider for challenge file uploads. documentation
database.sql RCTF_DATABASE_URL either database.sql or database.sql.* (none) string postgres:// connection URI
database.sql.host RCTF_DATABASE_HOST either database.sql or database.sql.* (none) string hostname of a postgreSQL server
database.sql.port RCTF_DATABASE_PORT either database.sql or database.sql.* (none) string port number that postgreSQL is running on
database.sql.user RCTF_DATABASE_USERNAME either database.sql or database.sql.* (none) string postgreSQL username to authenticate with
database.sql.password RCTF_DATABASE_PASSWORD either database.sql or database.sql.* (none) string postgreSQL password to authenticate with
database.sql.database RCTF_DATABASE_DATABASE either database.sql or database.sql.* (none) string postgreSQL database to use
database.redis RCTF_REDIS_URL either database.redis or database.redis.* (none) string redis:// connection URI
database.redis.host RCTF_REDIS_HOST either database.sql or database.sql.* (none) string hostname of a redis server
database.redis.post RCTF_REDIS_PORT either database.sql or database.sql.* (none) string port number that redis is running on
database.redis.password RCTF_REDIS_PASSWORD either database.sql or database.sql.* (none) string redis password to authenticate with
database.redis.database RCTF_REDIS_DATABASE either database.sql or database.sql.* (none) string redis numerical database ID to use
leaderboard.maxLimit RCTF_LEADERBOARD_MAX_LIMIT yes 100 integer maximum number of users retrievable in a single leaderboard request
leaderboard.maxOffset RCTF_LEADERBOARD_MAX_OFFSET yes 4294967296 integer maximum offset from the beginning of the leaderboard
leaderboard.updateInterval RCTF_LEADERBOARD_UPDATE_INTERVAL yes 10000 integer interval at which the leaderboard is recalculated, in milliseconds
leaderboard.graphMaxTeams RCTF_LEADERBOARD_GRAPH_MAX_TEAMS yes 10 integer maximum number of users retrievable in a graph request
leaderboard.graphSampleTime RCTF_LEADERBOARD_GRAPH_SAMPLE_TIME yes 1800000 integer interval at which the score graph is sampled, in milliseconds

Custom conf.d location#

The conf.d directory can be renamed or moved elsewhere. To do so, set the RCTF_CONF_PATH environment variable to the location of a directory of YAML or JSON configuration files. If specified as a relative path, the path is evaluated from the current working directory.