{
  "manifest_version": "1.0.0",
  "template": {
    "id": "13512bd6-be4d-4f10-b44a-a8978e1b7191",
    "slug": "ctfd-platform",
    "name": "CTFd | Capture The Flag Platform with MariaDB",
    "description": "CTFd 3.8 CTF platform, MariaDB + Redis, admin ready on boot, files kept",
    "url": "https://railway.com/deploy/ctfd-platform",
    "upstream": {
      "image": "ghcr.io/two-workspaces/ctfd:0a35f6b"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "MariaDB",
      "source": {
        "image": "mariadb:11.8.9"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "http": false
    },
    {
      "name": "CTFd",
      "source": {
        "image": "ghcr.io/two-workspaces/ctfd:0a35f6b"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/uploads",
      "http": true
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.10.2-alpine"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "MARIADB_USER",
      "service": "MariaDB",
      "description": "Database user",
      "secret": false,
      "strategy": "default",
      "default": "ctfd"
    },
    {
      "key": "MARIADB_DATABASE",
      "service": "MariaDB",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "ctfd"
    },
    {
      "key": "MARIADB_PASSWORD",
      "service": "MariaDB",
      "description": "Auto-generated database password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "MARIADB_ROOT_PASSWORD",
      "service": "MariaDB",
      "description": "Auto-generated root password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "MariaDB",
      "description": "Time for MariaDB to shut down cleanly on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "CTFd",
      "description": "Port CTFd listens on - leave as is",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "WORKERS",
      "service": "CTFd",
      "description": "Gunicorn workers (gevent, so one handles many players). Raise with more RAM for big events",
      "secret": false,
      "strategy": "default",
      "default": "1"
    },
    {
      "key": "CTFD_NAME",
      "service": "CTFd",
      "description": "Event name shown on the site, set on first boot only - change it later in Admin > Config",
      "secret": false,
      "strategy": "default",
      "default": "My CTF"
    },
    {
      "key": "REDIS_URL",
      "service": "CTFd",
      "description": "Redis cache - private network, leave as is",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "SECRET_KEY",
      "service": "CTFd",
      "description": "Signs sessions - auto-generated, keep it secret",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DATABASE_URL",
      "service": "CTFd",
      "description": "MariaDB - private network, leave as is",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REVERSE_PROXY",
      "service": "CTFd",
      "description": "Trust Railway's proxy for client IPs and HTTPS - leave as is",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "UPLOAD_FOLDER",
      "service": "CTFd",
      "description": "Challenge files live on the volume here - leave as is",
      "secret": false,
      "strategy": "default",
      "default": "/var/uploads"
    },
    {
      "key": "CTFD_ADMIN_NAME",
      "service": "CTFd",
      "description": "Admin user name, created on first boot only (not an email address)",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "CTFd",
      "description": "Run as root so CTFd can write to the uploads volume",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "CTFD_ADMIN_EMAIL",
      "service": "CTFd",
      "description": "Your email - the admin account's email, created on first boot",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "CTFD_ADMIN_PASSWORD",
      "service": "CTFd",
      "description": "Admin password, set on first boot only - copy it from here to log in, then change it in CTFd",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Auto-generated Redis password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "ctfd-platform"
      }
    },
    "cli": "railway deploy --template ctfd-platform",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "13512bd6-be4d-4f10-b44a-a8978e1b7191",
            "serializedConfig": {
              "services": {
                "1fdcdb6f-208d-4580-8d1c-f0d1ba203ad1": {
                  "icon": "https://raw.githubusercontent.com/devicons/devicon/master/icons/mariadb/mariadb-original.svg",
                  "name": "MariaDB",
                  "build": {},
                  "deploy": {
                    "startCommand": "docker-entrypoint.sh mariadbd --datadir=/var/lib/mysql/data --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --wait_timeout=28800",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "mariadb:11.8.9"
                  },
                  "variables": {
                    "MARIADB_USER": {
                      "isOptional": false,
                      "description": "Database user",
                      "defaultValue": "ctfd"
                    },
                    "MARIADB_DATABASE": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "ctfd"
                    },
                    "MARIADB_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated database password",
                      "defaultValue": "{{MARIADB_PASSWORD}}"
                    },
                    "MARIADB_ROOT_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated root password",
                      "defaultValue": "{{MARIADB_ROOT_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time for MariaDB to shut down cleanly on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "1fdcdb6f-208d-4580-8d1c-f0d1ba203ad1": {
                      "mountPath": "/var/lib/mysql"
                    }
                  }
                },
                "cd7ca364-c934-4662-b428-d669942ab9e5": {
                  "icon": "https://raw.githubusercontent.com/CTFd/CTFd/3.8.9/CTFd/themes/core/static/img/ctfd.svg",
                  "name": "CTFd",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthcheck",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/two-workspaces/ctfd:0a35f6b"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port CTFd listens on - leave as is",
                      "defaultValue": "8000"
                    },
                    "WORKERS": {
                      "isOptional": false,
                      "description": "Gunicorn workers (gevent, so one handles many players). Raise with more RAM for big events",
                      "defaultValue": "1"
                    },
                    "CTFD_NAME": {
                      "isOptional": false,
                      "description": "Event name shown on the site, set on first boot only - change it later in Admin > Config",
                      "defaultValue": "My CTF"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Redis cache - private network, leave as is",
                      "defaultValue": "redis://default:${{Redis.REDIS_PASSWORD}}@${{Redis.RAILWAY_PRIVATE_DOMAIN}}:6379"
                    },
                    "SECRET_KEY": {
                      "isOptional": false,
                      "description": "Signs sessions - auto-generated, keep it secret",
                      "defaultValue": "{{SECRET_KEY}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "MariaDB - private network, leave as is",
                      "defaultValue": "mysql+pymysql://ctfd:${{MariaDB.MARIADB_PASSWORD}}@${{MariaDB.RAILWAY_PRIVATE_DOMAIN}}:3306/ctfd"
                    },
                    "REVERSE_PROXY": {
                      "isOptional": false,
                      "description": "Trust Railway's proxy for client IPs and HTTPS - leave as is",
                      "defaultValue": "true"
                    },
                    "UPLOAD_FOLDER": {
                      "isOptional": false,
                      "description": "Challenge files live on the volume here - leave as is",
                      "defaultValue": "/var/uploads"
                    },
                    "CTFD_ADMIN_NAME": {
                      "isOptional": false,
                      "description": "Admin user name, created on first boot only (not an email address)",
                      "defaultValue": "admin"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Run as root so CTFd can write to the uploads volume",
                      "defaultValue": "0"
                    },
                    "CTFD_ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Your email - the admin account's email, created on first boot",
                      "defaultValue": "{{CTFD_ADMIN_EMAIL}}"
                    },
                    "CTFD_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Admin password, set on first boot only - copy it from here to log in, then change it in CTFd",
                      "defaultValue": "{{CTFD_ADMIN_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "cd7ca364-c934-4662-b428-d669942ab9e5": {
                      "mountPath": "/var/uploads"
                    }
                  }
                },
                "e8c22f8b-3102-4fec-bb59-f140d3ab2c5e": {
                  "icon": "https://devicons.railway.app/i/redis.svg",
                  "name": "Redis",
                  "build": {},
                  "deploy": {
                    "startCommand": "/bin/sh -c \"exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save '' --appendonly no\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.10.2-alpine"
                  },
                  "variables": {
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated Redis password",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {}
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "CTFd",
      "method": "GET",
      "path": "/healthcheck",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-11-07T16:15:10.050Z",
  "generator_version": "0.1.0"
}
