Plugin that connects to an Instancier compatible API in order to instanciate challenges on CTFd.
If the CTF is team based, instances will be per team.
The plugin is should be placed in i_challenges
.
- To install clone this repository to the CTFd/plugins folder.
- Rename the cloned repository into
i_challenges
. - Add the following values as environment variables or edit CTFd/config.py to add the following entries:
4TS_INSTANCER_BASE_URL
: The base URI leading to your Instancier API4TS_INSTANCER_TOKEN
: A secret token to communicate with the Instancier API.
slug
is defined when creating an instanciated challenge, the instancier api should know this slug beforehand.
instance_id
can be the user_id
or the team_id
depending on the CTFd gamemode.
GET /api/v1/{slug}/{instance_id}
: Get the current statusPOST /api/v1/{slug}/{instance_id}
: Trigger instanciation, response is the statusDELETE /api/v1/{slug}/{instance_id}
: Trigger deletion, response is the status
The API must response with this following schema :
{
"status": "Stopped / Starting / Stopping / Running",
"servers": [
{
"kind": "http",
"host": "cdsfj.com"
},
{
"kind": "tcp",
"host": "cdsfj.com",
"port": "5656"
}
]
}
port
is only set for tcp challenges. http challenges are served with https.
The plugin does not support different base path. API routes must be served strictly at the routes above.