{
  "manifest_version": "1.0.0",
  "template": {
    "id": "c58f21f9-e437-47eb-8da0-98a1fb5d96f3",
    "slug": "cap-screen-recording",
    "name": "Cap",
    "description": "Screen recorder that turns recordings into shareable video links",
    "url": "https://railway.com/deploy/cap-screen-recording",
    "upstream": {
      "image": "ghcr.io/capsoftware/cap-web:latest"
    }
  },
  "services": [
    {
      "name": "cap-web",
      "source": {
        "image": "ghcr.io/capsoftware/cap-web:latest"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "cap-scheduler",
      "source": {
        "image": "curlimages/curl:latest"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "MySQL",
      "source": {
        "image": "mysql:9.4"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "http": false
    },
    {
      "name": "cap-media-server",
      "source": {
        "image": "ghcr.io/capsoftware/cap-media-server:latest"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "cap-web",
      "description": "HTTP port the app listens on",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "WEB_URL",
      "service": "cap-web",
      "description": "Public base URL for share links",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "CRON_SECRET",
      "service": "cap-web",
      "description": "Bearer token for recovery endpoints",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DATABASE_URL",
      "service": "cap-web",
      "description": "MySQL connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXTAUTH_URL",
      "service": "cap-web",
      "description": "Auth callback base URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_PATH_STYLE",
      "service": "cap-web",
      "description": "Use path-style bucket addressing",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "CAP_AWS_BUCKET",
      "service": "cap-web",
      "description": "Object storage bucket name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CAP_AWS_REGION",
      "service": "cap-web",
      "description": "Bucket region",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXTAUTH_SECRET",
      "service": "cap-web",
      "description": "Session token signing key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MEDIA_SERVER_URL",
      "service": "cap-web",
      "description": "Private transcoder address",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CAP_AWS_ACCESS_KEY",
      "service": "cap-web",
      "description": "Bucket access key",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CAP_AWS_SECRET_KEY",
      "service": "cap-web",
      "description": "Bucket secret key",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_PUBLIC_ENDPOINT",
      "service": "cap-web",
      "description": "Endpoint used for presigned URLs",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_INTERNAL_ENDPOINT",
      "service": "cap-web",
      "description": "Endpoint used for server-side reads",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_ENCRYPTION_KEY",
      "service": "cap-web",
      "description": "32-byte hex field encryption key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MEDIA_SERVER_WEBHOOK_URL",
      "service": "cap-web",
      "description": "Callback base for the transcoder",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CAP_VIDEOS_DEFAULT_PUBLIC",
      "service": "cap-web",
      "description": "New recordings shareable by link",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "MEDIA_SERVER_WEBHOOK_SECRET",
      "service": "cap-web",
      "description": "Shared transcoder secret",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CRON_JOBS",
      "service": "cap-scheduler",
      "description": "Recovery routes to call",
      "secret": false,
      "strategy": "default",
      "default": "finalize-stale-desktop-segments recover-failed-video-processing"
    },
    {
      "key": "CAP_WEB_URL",
      "service": "cap-scheduler",
      "description": "Private address of the app",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "CRON_SECRET",
      "service": "cap-scheduler",
      "description": "Bearer token sent to recovery endpoints",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SCHEDULER_INTERVAL_SECONDS",
      "service": "cap-scheduler",
      "description": "Seconds between recovery runs",
      "secret": false,
      "strategy": "default",
      "default": "900"
    },
    {
      "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": "PORT",
      "service": "cap-media-server",
      "description": "HTTP port the transcoder listens on",
      "secret": false,
      "strategy": "default",
      "default": "3456"
    },
    {
      "key": "MEDIA_SERVER_WEBHOOK_SECRET",
      "service": "cap-media-server",
      "description": "Shared secret required on every request",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "cap-screen-recording"
      }
    },
    "cli": "railway deploy --template cap-screen-recording",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "c58f21f9-e437-47eb-8da0-98a1fb5d96f3",
            "serializedConfig": {
              "buckets": {
                "cfbd3da0-b5b2-40a5-85c7-cb356bf17ae8": {
                  "name": "cap-storage"
                }
              },
              "services": {
                "2d746295-b9f8-429a-9700-93bf0d21f87b": {
                  "icon": "https://raw.githubusercontent.com/CapSoftware/Cap/main/apps/web/public/cap-icon.svg",
                  "name": "cap-web",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/status",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/capsoftware/cap-web:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port the app listens on",
                      "defaultValue": "3000"
                    },
                    "WEB_URL": {
                      "isOptional": false,
                      "description": "Public base URL for share links",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Bearer token for recovery endpoints",
                      "defaultValue": "{{CRON_SECRET}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "MySQL connection string",
                      "defaultValue": "${{MySQL.MYSQL_URL}}"
                    },
                    "NEXTAUTH_URL": {
                      "isOptional": false,
                      "description": "Auth callback base URL",
                      "defaultValue": "${{WEB_URL}}"
                    },
                    "S3_PATH_STYLE": {
                      "isOptional": false,
                      "description": "Use path-style bucket addressing",
                      "defaultValue": "true"
                    },
                    "CAP_AWS_BUCKET": {
                      "isOptional": false,
                      "description": "Object storage bucket name",
                      "defaultValue": "${{cap-storage.BUCKET}}"
                    },
                    "CAP_AWS_REGION": {
                      "isOptional": false,
                      "description": "Bucket region",
                      "defaultValue": "${{cap-storage.REGION}}"
                    },
                    "NEXTAUTH_SECRET": {
                      "isOptional": false,
                      "description": "Session token signing key",
                      "defaultValue": "{{NEXTAUTH_SECRET}}"
                    },
                    "MEDIA_SERVER_URL": {
                      "isOptional": false,
                      "description": "Private transcoder address",
                      "defaultValue": "http://${{cap-media-server.RAILWAY_PRIVATE_DOMAIN}}:3456"
                    },
                    "CAP_AWS_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Bucket access key",
                      "defaultValue": "${{cap-storage.ACCESS_KEY_ID}}"
                    },
                    "CAP_AWS_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Bucket secret key",
                      "defaultValue": "${{cap-storage.SECRET_ACCESS_KEY}}"
                    },
                    "S3_PUBLIC_ENDPOINT": {
                      "isOptional": false,
                      "description": "Endpoint used for presigned URLs",
                      "defaultValue": "${{cap-storage.ENDPOINT}}"
                    },
                    "S3_INTERNAL_ENDPOINT": {
                      "isOptional": false,
                      "description": "Endpoint used for server-side reads",
                      "defaultValue": "${{cap-storage.ENDPOINT}}"
                    },
                    "DATABASE_ENCRYPTION_KEY": {
                      "isOptional": false,
                      "description": "32-byte hex field encryption key",
                      "defaultValue": "{{DATABASE_ENCRYPTION_KEY}}"
                    },
                    "MEDIA_SERVER_WEBHOOK_URL": {
                      "isOptional": false,
                      "description": "Callback base for the transcoder",
                      "defaultValue": "http://${{RAILWAY_PRIVATE_DOMAIN}}:3000"
                    },
                    "CAP_VIDEOS_DEFAULT_PUBLIC": {
                      "isOptional": false,
                      "description": "New recordings shareable by link",
                      "defaultValue": "true"
                    },
                    "MEDIA_SERVER_WEBHOOK_SECRET": {
                      "isOptional": false,
                      "description": "Shared transcoder secret",
                      "defaultValue": "${{cap-media-server.MEDIA_SERVER_WEBHOOK_SECRET}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3000": {
                        "port": 3000
                      }
                    }
                  }
                },
                "5ad96c33-747d-4eec-ad8f-b60c1371606e": {
                  "icon": "https://raw.githubusercontent.com/CapSoftware/Cap/main/apps/web/public/cap-icon.svg",
                  "name": "cap-scheduler",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'echo \"[scheduler] jobs=${CRON_JOBS} interval=${SCHEDULER_INTERVAL_SECONDS}s\"; while true; do for job in $CRON_JOBS; do code=$(curl -s -o /dev/null -w \"%{http_code}\" -m 600 -H \"Authorization: Bearer $CRON_SECRET\" \"$CAP_WEB_URL/api/cron/$job\"); echo \"[scheduler] $job -> $code\"; done; sleep \"$SCHEDULER_INTERVAL_SECONDS\"; done'",
                    "healthcheckPath": null,
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "curlimages/curl:latest"
                  },
                  "variables": {
                    "CRON_JOBS": {
                      "isOptional": false,
                      "description": "Recovery routes to call",
                      "defaultValue": "finalize-stale-desktop-segments recover-failed-video-processing"
                    },
                    "CAP_WEB_URL": {
                      "isOptional": false,
                      "description": "Private address of the app",
                      "defaultValue": "http://${{cap-web.RAILWAY_PRIVATE_DOMAIN}}:3000"
                    },
                    "CRON_SECRET": {
                      "isOptional": false,
                      "description": "Bearer token sent to recovery endpoints",
                      "defaultValue": "${{cap-web.CRON_SECRET}}"
                    },
                    "SCHEDULER_INTERVAL_SECONDS": {
                      "isOptional": false,
                      "description": "Seconds between recovery runs",
                      "defaultValue": "900"
                    }
                  }
                },
                "ab26626e-e159-4f30-98f4-ceb7a37a93ec": {
                  "icon": "https://devicons.railway.app/i/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": {
                    "ab26626e-e159-4f30-98f4-ceb7a37a93ec": {
                      "mountPath": "/var/lib/mysql"
                    }
                  }
                },
                "d270cd71-2cc5-4020-9714-01a70f5dc6e6": {
                  "icon": "https://raw.githubusercontent.com/CapSoftware/Cap/main/apps/web/public/cap-icon.svg",
                  "name": "cap-media-server",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 50
                  },
                  "source": {
                    "image": "ghcr.io/capsoftware/cap-media-server:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port the transcoder listens on",
                      "defaultValue": "3456"
                    },
                    "MEDIA_SERVER_WEBHOOK_SECRET": {
                      "isOptional": false,
                      "description": "Shared secret required on every request",
                      "defaultValue": "{{MEDIA_SERVER_WEBHOOK_SECRET}}"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "cap-web",
      "method": "GET",
      "path": "/api/status",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T10:14:37.339Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-19T16:11:37.855Z",
  "success_rate_30d": 0.1667,
  "validation": {
    "last_run_id": "run_6258d1568aad4362ace7",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": false,
        "detail": "Your workspace has been restricted. Please contact support to resolve this."
      }
    ],
    "typical_ready_seconds": 213,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "cap-web"
  }
}
