{
  "manifest_version": "1.0.0",
  "template": {
    "id": "2ac7a5ae-48dc-4b22-b11e-9a72d22bd8fb",
    "slug": "ctfd",
    "name": "CTFd",
    "description": "Capture-the-flag platform for running security competitions",
    "url": "https://railway.com/deploy/ctfd",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/ctfd-railway"
    }
  },
  "services": [
    {
      "name": "ctfd",
      "source": {
        "repo": "https://github.com/gridalpha/ctfd-railway"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "MySQL",
      "source": {
        "image": "mysql:9.4"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "http": false
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "ctfd",
      "description": "Port Railway health-checks; gunicorn binds 8000",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "WORKERS",
      "service": "ctfd",
      "description": "gunicorn worker processes",
      "secret": false,
      "strategy": "default",
      "default": "4"
    },
    {
      "key": "CTF_NAME",
      "service": "ctfd",
      "description": "Event name, seeded on first boot",
      "secret": false,
      "strategy": "default",
      "default": "CTFd"
    },
    {
      "key": "ERROR_LOG",
      "service": "ctfd",
      "description": "gunicorn error log to stdout",
      "secret": false,
      "strategy": "default",
      "default": "-"
    },
    {
      "key": "REDIS_URL",
      "service": "ctfd",
      "description": "Cache and session store connection",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "ACCESS_LOG",
      "service": "ctfd",
      "description": "gunicorn access log to stdout",
      "secret": false,
      "strategy": "default",
      "default": "-"
    },
    {
      "key": "LOG_FOLDER",
      "service": "ctfd",
      "description": "Submission and login log directory",
      "secret": false,
      "strategy": "default",
      "default": "/var/log/CTFd"
    },
    {
      "key": "SECRET_KEY",
      "service": "ctfd",
      "description": "Signs session cookies, must stay stable",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "UPDATE_CHECK",
      "service": "ctfd",
      "description": "Do not phone home for version checks",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "WORKER_CLASS",
      "service": "ctfd",
      "description": "gunicorn worker class",
      "secret": false,
      "strategy": "default",
      "default": "gevent"
    },
    {
      "key": "AWS_S3_BUCKET",
      "service": "ctfd",
      "description": "Attachment bucket name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AWS_S3_REGION",
      "service": "ctfd",
      "description": "Bucket region",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CTF_USER_MODE",
      "service": "ctfd",
      "description": "users or teams, first boot only",
      "secret": false,
      "strategy": "default",
      "default": "users"
    },
    {
      "key": "DATABASE_HOST",
      "service": "ctfd",
      "description": "Private MySQL hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DATABASE_NAME",
      "service": "ctfd",
      "description": "MySQL database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_PORT",
      "service": "ctfd",
      "description": "MySQL port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_USER",
      "service": "ctfd",
      "description": "MySQL username",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REVERSE_PROXY",
      "service": "ctfd",
      "description": "ProxyFix hops: real client IP behind the edge",
      "secret": false,
      "strategy": "default",
      "default": "2,1,1,1,0"
    },
    {
      "key": "CTF_DESCRIPTION",
      "service": "ctfd",
      "description": "Event description, first boot",
      "secret": false,
      "strategy": "default",
      "default": "A capture the flag event."
    },
    {
      "key": "UPLOAD_PROVIDER",
      "service": "ctfd",
      "description": "Store challenge files in object storage",
      "secret": false,
      "strategy": "default",
      "default": "s3"
    },
    {
      "key": "AWS_ACCESS_KEY_ID",
      "service": "ctfd",
      "description": "Bucket access key",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_PASSWORD",
      "service": "ctfd",
      "description": "MySQL password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_PROTOCOL",
      "service": "ctfd",
      "description": "SQLAlchemy driver for MySQL",
      "secret": false,
      "strategy": "default",
      "default": "mysql+pymysql"
    },
    {
      "key": "PRESET_ADMIN_NAME",
      "service": "ctfd",
      "description": "Administrator display name",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "PRESET_ADMIN_EMAIL",
      "service": "ctfd",
      "description": "Administrator email, change this",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "AWS_S3_ENDPOINT_URL",
      "service": "ctfd",
      "description": "S3-compatible endpoint",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AWS_SECRET_ACCESS_KEY",
      "service": "ctfd",
      "description": "Bucket secret key",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PRESET_ADMIN_PASSWORD",
      "service": "ctfd",
      "description": "Administrator password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "AWS_S3_ADDRESSING_STYLE",
      "service": "ctfd",
      "description": "Path-style addressing, required for browsers",
      "secret": false,
      "strategy": "default",
      "default": "path"
    },
    {
      "key": "EXTRA_CONFIGS_FORCE_TYPES",
      "service": "ctfd",
      "description": "Keep credentials as strings",
      "secret": false,
      "strategy": "default",
      "default": "PRESET_ADMIN_PASSWORD=str,PRESET_ADMIN_NAME=str"
    },
    {
      "key": "RAILWAY_HEALTHCHECK_TIMEOUT_SEC",
      "service": "ctfd",
      "description": "Window for a cold first boot",
      "secret": false,
      "strategy": "default",
      "default": "600"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "ctfd",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "30"
    },
    {
      "key": "MYSQLHOST",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLPORT",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "3306"
    },
    {
      "key": "MYSQLUSER",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "root"
    },
    {
      "key": "MYSQL_URL",
      "service": "MySQL",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLDATABASE",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQLPASSWORD",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_DATABASE",
      "service": "MySQL",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "MYSQL_ROOT_PASSWORD",
      "service": "MySQL",
      "description": "Root password, read by the server",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Auth password, read by the server",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "ctfd"
      }
    },
    "cli": "railway deploy --template ctfd",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "2ac7a5ae-48dc-4b22-b11e-9a72d22bd8fb",
            "serializedConfig": {
              "buckets": {
                "0453a8af-01a4-469c-901e-e3d4ab5191d0": {
                  "name": "ctfd-uploads"
                }
              },
              "services": {
                "1adcd0f6-f717-4147-a74b-b986c97b29e4": {
                  "icon": "https://raw.githubusercontent.com/gridalpha/ctfd-railway/main/ctfd-mark.svg",
                  "name": "ctfd",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthcheck",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/ctfd-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway health-checks; gunicorn binds 8000",
                      "defaultValue": "8000"
                    },
                    "WORKERS": {
                      "isOptional": true,
                      "description": "gunicorn worker processes",
                      "defaultValue": "4"
                    },
                    "CTF_NAME": {
                      "isOptional": true,
                      "description": "Event name, seeded on first boot",
                      "defaultValue": "CTFd"
                    },
                    "ERROR_LOG": {
                      "isOptional": false,
                      "description": "gunicorn error log to stdout",
                      "defaultValue": "-"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Cache and session store connection",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "ACCESS_LOG": {
                      "isOptional": false,
                      "description": "gunicorn access log to stdout",
                      "defaultValue": "-"
                    },
                    "LOG_FOLDER": {
                      "isOptional": false,
                      "description": "Submission and login log directory",
                      "defaultValue": "/var/log/CTFd"
                    },
                    "SECRET_KEY": {
                      "isOptional": false,
                      "description": "Signs session cookies, must stay stable",
                      "defaultValue": "{{SECRET_KEY}}"
                    },
                    "UPDATE_CHECK": {
                      "isOptional": false,
                      "description": "Do not phone home for version checks",
                      "defaultValue": "false"
                    },
                    "WORKER_CLASS": {
                      "isOptional": true,
                      "description": "gunicorn worker class",
                      "defaultValue": "gevent"
                    },
                    "AWS_S3_BUCKET": {
                      "isOptional": false,
                      "description": "Attachment bucket name",
                      "defaultValue": "${{ctfd-uploads.BUCKET}}"
                    },
                    "AWS_S3_REGION": {
                      "isOptional": false,
                      "description": "Bucket region",
                      "defaultValue": "${{ctfd-uploads.REGION}}"
                    },
                    "CTF_USER_MODE": {
                      "isOptional": true,
                      "description": "users or teams, first boot only",
                      "defaultValue": "users"
                    },
                    "DATABASE_HOST": {
                      "isOptional": false,
                      "description": "Private MySQL hostname",
                      "defaultValue": "${{MySQL.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "DATABASE_NAME": {
                      "isOptional": false,
                      "description": "MySQL database name",
                      "defaultValue": "${{MySQL.MYSQLDATABASE}}"
                    },
                    "DATABASE_PORT": {
                      "isOptional": false,
                      "description": "MySQL port",
                      "defaultValue": "${{MySQL.MYSQLPORT}}"
                    },
                    "DATABASE_USER": {
                      "isOptional": false,
                      "description": "MySQL username",
                      "defaultValue": "${{MySQL.MYSQLUSER}}"
                    },
                    "REVERSE_PROXY": {
                      "isOptional": false,
                      "description": "ProxyFix hops: real client IP behind the edge",
                      "defaultValue": "2,1,1,1,0"
                    },
                    "CTF_DESCRIPTION": {
                      "isOptional": true,
                      "description": "Event description, first boot",
                      "defaultValue": "A capture the flag event."
                    },
                    "UPLOAD_PROVIDER": {
                      "isOptional": false,
                      "description": "Store challenge files in object storage",
                      "defaultValue": "s3"
                    },
                    "AWS_ACCESS_KEY_ID": {
                      "isOptional": false,
                      "description": "Bucket access key",
                      "defaultValue": "${{ctfd-uploads.ACCESS_KEY_ID}}"
                    },
                    "DATABASE_PASSWORD": {
                      "isOptional": false,
                      "description": "MySQL password",
                      "defaultValue": "${{MySQL.MYSQLPASSWORD}}"
                    },
                    "DATABASE_PROTOCOL": {
                      "isOptional": false,
                      "description": "SQLAlchemy driver for MySQL",
                      "defaultValue": "mysql+pymysql"
                    },
                    "PRESET_ADMIN_NAME": {
                      "isOptional": true,
                      "description": "Administrator display name",
                      "defaultValue": "admin"
                    },
                    "PRESET_ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Administrator email, change this",
                      "defaultValue": "admin@example.com"
                    },
                    "AWS_S3_ENDPOINT_URL": {
                      "isOptional": false,
                      "description": "S3-compatible endpoint",
                      "defaultValue": "${{ctfd-uploads.ENDPOINT}}"
                    },
                    "AWS_SECRET_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Bucket secret key",
                      "defaultValue": "${{ctfd-uploads.SECRET_ACCESS_KEY}}"
                    },
                    "PRESET_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Administrator password",
                      "defaultValue": "{{PRESET_ADMIN_PASSWORD}}"
                    },
                    "AWS_S3_ADDRESSING_STYLE": {
                      "isOptional": false,
                      "description": "Path-style addressing, required for browsers",
                      "defaultValue": "path"
                    },
                    "EXTRA_CONFIGS_FORCE_TYPES": {
                      "isOptional": true,
                      "description": "Keep credentials as strings",
                      "defaultValue": "PRESET_ADMIN_PASSWORD=str,PRESET_ADMIN_NAME=str"
                    },
                    "RAILWAY_HEALTHCHECK_TIMEOUT_SEC": {
                      "isOptional": false,
                      "description": "Window for a cold first boot",
                      "defaultValue": "600"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8000": {
                        "port": 8000
                      }
                    }
                  }
                },
                "4087d67a-5593-46d3-ac05-acfc9b677a84": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mysql.svg",
                  "name": "MySQL",
                  "deploy": {
                    "startCommand": "docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "mysql:9.4"
                  },
                  "variables": {
                    "MYSQLHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "MYSQLPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "3306"
                    },
                    "MYSQLUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "root"
                    },
                    "MYSQL_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "mysql://${{ MYSQLUSER }}:${{ MYSQL_ROOT_PASSWORD }}@${{ RAILWAY_PRIVATE_DOMAIN }}:3306/${{ MYSQL_DATABASE }}"
                    },
                    "MYSQLDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{ MYSQL_DATABASE }}"
                    },
                    "MYSQLPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{ MYSQL_ROOT_PASSWORD }}"
                    },
                    "MYSQL_DATABASE": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "MYSQL_ROOT_PASSWORD": {
                      "isOptional": false,
                      "description": "Root password, read by the server",
                      "defaultValue": "{{MYSQL_ROOT_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "4087d67a-5593-46d3-ac05-acfc9b677a84": {
                      "mountPath": "/var/lib/mysql"
                    }
                  }
                },
                "b035c657-71b5-4c8b-870d-77f371974931": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "redis://${{ REDISUSER }}:${{ REDIS_PASSWORD }}@${{ REDISHOST }}:${{ REDISPORT }}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Auth password, read by the server",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "b035c657-71b5-4c8b-870d-77f371974931": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "ctfd",
      "method": "GET",
      "path": "/healthcheck",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-15T10:14:39.124Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-15T07:08:35.078Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_a52922f475a040a1a956",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": false,
        "detail": "Your workspace has been restricted. Please contact support to resolve this."
      }
    ]
  }
}
