{
  "manifest_version": "1.0.0",
  "template": {
    "id": "9d67e3f0-1d2d-4575-be62-6e0e64f259a6",
    "slug": "openpencil",
    "name": "OpenPencil",
    "description": "Private AI vector design workspace with password protection and storage.",
    "url": "https://railway.com/deploy/openpencil",
    "upstream": {
      "repo_url": "https://github.com/RockinPaul/openpencil-railway-template"
    }
  },
  "services": [
    {
      "name": "openpencil",
      "source": {
        "repo": "https://github.com/RockinPaul/openpencil-railway-template"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "gateway",
      "source": {
        "repo": "https://github.com/RockinPaul/openpencil-railway-template"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "openpencil",
      "description": "Private OpenPencil HTTP and healthcheck port. The gateway references this value automatically.",
      "secret": false,
      "strategy": "default",
      "default": "3100"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "openpencil",
      "description": "Build the durable OpenPencil workspace image from this repository. Keep this value unchanged.",
      "secret": false,
      "strategy": "default",
      "default": "Dockerfile"
    },
    {
      "key": "OPENPENCIL_WEB_ALLOWED_ORIGINS",
      "service": "openpencil",
      "description": "Preserve upstream origin checks using the gateway's exact public origin. Do not set a wildcard.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORT",
      "service": "gateway",
      "description": "Gateway HTTP and healthcheck port. Leave at 8080 unless changing the service's target port too.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "ACCESS_PASSWORD",
      "service": "gateway",
      "description": "Generated private workspace password. Sign in as admin and copy this password from service Variables. Keep it private.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "OPENPENCIL_UPSTREAM",
      "service": "gateway",
      "description": "Private OpenPencil service address. Automatically wired; do not replace with a public endpoint.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RAILWAY_DOCKERFILE_PATH",
      "service": "gateway",
      "description": "Build the password gateway image from this repository. Keep this value unchanged.",
      "secret": false,
      "strategy": "default",
      "default": "Dockerfile.gateway"
    },
    {
      "key": "OPENPENCIL_PUBLIC_ORIGIN",
      "service": "gateway",
      "description": "Exact public HTTPS origin, without a trailing slash. Change this when using a custom domain; other browser origins are rejected.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "openpencil"
      }
    },
    "cli": "railway deploy --template openpencil",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "9d67e3f0-1d2d-4575-be62-6e0e64f259a6",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "6898eecd-4e31-4762-92dc-f9c41ed2683b": {
                  "icon": "https://raw.githubusercontent.com/ZSeven-W/openpencil/v0.8.4/crates/op-host-desktop/assets/icon.png",
                  "name": "openpencil",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 5
                  },
                  "source": {
                    "repo": "https://github.com/RockinPaul/openpencil-railway-template",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Private OpenPencil HTTP and healthcheck port. The gateway references this value automatically.",
                      "defaultValue": "3100"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Build the durable OpenPencil workspace image from this repository. Keep this value unchanged.",
                      "defaultValue": "Dockerfile"
                    },
                    "OPENPENCIL_WEB_ALLOWED_ORIGINS": {
                      "isOptional": false,
                      "description": "Preserve upstream origin checks using the gateway's exact public origin. Do not set a wildcard.",
                      "defaultValue": "${{gateway.OPENPENCIL_PUBLIC_ORIGIN}}"
                    },
                    "OPENPENCIL_WEB_AI_ENDPOINT_ALLOWLIST": {
                      "isOptional": true,
                      "description": "Optional exact URL origins for a deliberately trusted private AI endpoint. Leave empty for normal public providers; no inference server is bundled."
                    }
                  },
                  "volumeMounts": {
                    "6898eecd-4e31-4762-92dc-f9c41ed2683b": {
                      "sizeMB": 1024,
                      "mountPath": "/data"
                    }
                  }
                },
                "84de7651-69b2-4c0d-83e9-535f50b07135": {
                  "icon": null,
                  "name": "gateway",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 5
                  },
                  "source": {
                    "repo": "https://github.com/RockinPaul/openpencil-railway-template",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Gateway HTTP and healthcheck port. Leave at 8080 unless changing the service's target port too.",
                      "defaultValue": "8080"
                    },
                    "ACCESS_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated private workspace password. Sign in as admin and copy this password from service Variables. Keep it private.",
                      "defaultValue": "{{ACCESS_PASSWORD}}"
                    },
                    "OPENPENCIL_UPSTREAM": {
                      "isOptional": false,
                      "description": "Private OpenPencil service address. Automatically wired; do not replace with a public endpoint.",
                      "defaultValue": "${{openpencil.RAILWAY_PRIVATE_DOMAIN}}:${{openpencil.PORT}}"
                    },
                    "RAILWAY_DOCKERFILE_PATH": {
                      "isOptional": false,
                      "description": "Build the password gateway image from this repository. Keep this value unchanged.",
                      "defaultValue": "Dockerfile.gateway"
                    },
                    "OPENPENCIL_PUBLIC_ORIGIN": {
                      "isOptional": false,
                      "description": "Exact public HTTPS origin, without a trailing slash. Change this when using a custom domain; other browser origins are rejected.",
                      "defaultValue": "https://${{gateway.RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "gateway",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-08T21:59:40.747Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-08T22:02:38.414Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_256be4fef128462281ff",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 109,
    "typical_build_seconds": 51,
    "typical_start_seconds": 41,
    "slowest_service": "gateway"
  }
}
