{
  "manifest_version": "1.0.0",
  "template": {
    "id": "8c6525b6-0c84-4cc1-84cc-61e0b871ee6f",
    "slug": "cloudreve-drive",
    "name": "Cloudreve",
    "description": "Self-hosted cloud drive for storing, previewing and sharing files",
    "url": "https://railway.com/deploy/cloudreve-drive",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/cloudreve-railway"
    }
  },
  "services": [
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "cloudreve",
      "source": {
        "repo": "https://github.com/gridalpha/cloudreve-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/cloudreve/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "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"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Cluster location on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "cloudreve",
      "description": "HTTP listening port",
      "secret": false,
      "strategy": "default",
      "default": "5212"
    },
    {
      "key": "CR_ADMIN_EMAIL",
      "service": "cloudreve",
      "description": "Administrator login, change after first sign-in",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "CR_CONF_Redis.DB",
      "service": "cloudreve",
      "description": "Redis database index",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "CR_ADMIN_PASSWORD",
      "service": "cloudreve",
      "description": "Administrator password, change after first sign-in",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "CR_BOOTSTRAP_PORT",
      "service": "cloudreve",
      "description": "Loopback port used during setup",
      "secret": false,
      "strategy": "default",
      "default": "5399"
    },
    {
      "key": "CR_SKIP_BOOTSTRAP",
      "service": "cloudreve",
      "description": "Set 1 to skip first-run setup",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "CR_CONF_Redis.Server",
      "service": "cloudreve",
      "description": "Redis host and port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CR_CONF_Database.Type",
      "service": "cloudreve",
      "description": "Database driver",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "CR_CONF_Redis.Password",
      "service": "cloudreve",
      "description": "Redis auth password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CR_SETTING_DEFAULT_siteURL",
      "service": "cloudreve",
      "description": "Public base URL, seeded first boot",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "CR_CONF_Database.DatabaseURL",
      "service": "cloudreve",
      "description": "Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_HEALTHCHECK_TIMEOUT_SEC",
      "service": "cloudreve",
      "description": "Covers the two-phase first boot",
      "secret": false,
      "strategy": "default",
      "default": "600"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "cloudreve",
      "description": "Clean shutdown window for uploads",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "cloudreve-drive"
      }
    },
    "cli": "railway deploy --template cloudreve-drive",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "8c6525b6-0c84-4cc1-84cc-61e0b871ee6f",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "28e214f2-6ffa-4a25-8593-6dda4bfb73b4": {
                  "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": {
                    "28e214f2-6ffa-4a25-8593-6dda4bfb73b4": {
                      "mountPath": "/data"
                    }
                  }
                },
                "82c59b59-0a35-45bc-80c8-48c1a50cd8cb": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Cluster location on the volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL certificate expiry in days",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "82c59b59-0a35-45bc-80c8-48c1a50cd8cb": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "a628020a-af8e-46fc-848f-3a2faa5f33d1": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/cloudreve.svg",
                  "name": "cloudreve",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/api/v4/site/ping",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/cloudreve-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP listening port",
                      "defaultValue": "5212"
                    },
                    "CR_ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Administrator login, change after first sign-in",
                      "defaultValue": "admin@example.com"
                    },
                    "CR_CONF_Redis.DB": {
                      "isOptional": false,
                      "description": "Redis database index",
                      "defaultValue": "0"
                    },
                    "CR_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Administrator password, change after first sign-in",
                      "defaultValue": "{{CR_ADMIN_PASSWORD}}"
                    },
                    "CR_BOOTSTRAP_PORT": {
                      "isOptional": true,
                      "description": "Loopback port used during setup",
                      "defaultValue": "5399"
                    },
                    "CR_SKIP_BOOTSTRAP": {
                      "isOptional": true,
                      "description": "Set 1 to skip first-run setup",
                      "defaultValue": "0"
                    },
                    "CR_CONF_Redis.Server": {
                      "isOptional": false,
                      "description": "Redis host and port",
                      "defaultValue": "${{Redis.REDISHOST}}:${{Redis.REDISPORT}}"
                    },
                    "CR_CONF_Database.Type": {
                      "isOptional": false,
                      "description": "Database driver",
                      "defaultValue": "postgres"
                    },
                    "CR_CONF_Redis.Password": {
                      "isOptional": false,
                      "description": "Redis auth password",
                      "defaultValue": "${{Redis.REDISPASSWORD}}"
                    },
                    "CR_SETTING_DEFAULT_siteURL": {
                      "isOptional": false,
                      "description": "Public base URL, seeded first boot",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "CR_CONF_Database.DatabaseURL": {
                      "isOptional": false,
                      "description": "Postgres connection string",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "RAILWAY_HEALTHCHECK_TIMEOUT_SEC": {
                      "isOptional": true,
                      "description": "Covers the two-phase first boot",
                      "defaultValue": "600"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": true,
                      "description": "Clean shutdown window for uploads",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:5212": {
                        "port": 5212
                      }
                    }
                  },
                  "volumeMounts": {
                    "a628020a-af8e-46fc-848f-3a2faa5f33d1": {
                      "mountPath": "/cloudreve/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "cloudreve",
      "method": "GET",
      "path": "/api/v4/site/ping",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-04T17:54:19.363Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-04T18:01:54.707Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_03ab6284774249bea3fa",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 149,
    "typical_build_seconds": 77,
    "typical_start_seconds": 20,
    "slowest_service": "cloudreve"
  }
}
