This API allows you to deploy and redeploy Capture The Flag (CTF) instances to Google Cloud Run.
Visit /docs for Swagger UI or /redoc for ReDoc documentation.
Deploy a new CTF instance with custom questions.
{
"service_name": "my-ctf-game",
"project_id": "my-gcp-project",
"region": "us-central1",
"questions": [
{
"question": "What is 2+2?",
"choices": ["3", "4", "5"],
"answer": "4"
}
],
"tec_analytics_endpoint": "https://analytics.example.com"
}
Redeploy an existing CTF instance using data stored in Cloud Storage FUSE mount.
{
"service_name": "my-ctf-game",
"project_id": "my-gcp-project",
"region": "us-central1",
"tec_analytics_endpoint": "https://analytics.example.com"
}
Behavior: Rebuilds and redeploys the container. Database persists in Cloud Storage at gs://ctf-quiz-storage/{QUIZ_ID}/ctf_data.db via FUSE mount.
Destroy a Cloud Run quiz instance while preserving database for future redeployment.
{
"service_name": "my-ctf-game",
"project_id": "my-gcp-project",
"region": "us-central1",
"preserve_data": true
}
Behavior: Deletes Cloud Run service. If preserve_data=true (default), database remains in Cloud Storage and can be reused on redeploy.
Check the status of a deployment or redeploy operation.
List all quizzes and their deployment history. Shows quiz_id, current status, service URLs, and deployment counts.
curl -X POST http://localhost:8000/redeploy -H "Content-Type: application/json" -d '{
"service_name": "my-ctf-game",
"project_id": "my-gcp-project",
"region": "us-central1",
"tec_analytics_endpoint": "https://analytics.example.com"
}'