{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0f27bea8-1271-480e-bf10-99b7813dcca6",
    "slug": "boxcar-payload-cms-cloudflare-r2",
    "name": "Boxcar — Payload CMS + Cloudflare R2",
    "description": "Self-hosted Payload + Next.js blog with Cloudflare R2 media.",
    "url": "https://railway.com/deploy/boxcar-payload-cms-cloudflare-r2",
    "upstream": {
      "repo_url": "https://github.com/sungkhum/Boxcar-Payload-CMS-Cloudflare-Railway-Template"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "Payload-CMS-Cloudflare-Railway-Template",
      "source": {
        "repo": "https://github.com/sungkhum/Boxcar-Payload-CMS-Cloudflare-Railway-Template"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Cron",
      "source": {
        "repo": "https://github.com/sungkhum/Boxcar-Payload-CMS-Cloudflare-Railway-Template"
      },
      "needs_volume": false,
      "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
    }
  ],
  "required_inputs": [
    {
      "key": "R2_BUCKET",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Cloudflare R2 bucket name. Create one in Cloudflare dashboard → R2 → Create Bucket.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "R2_ENDPOINT",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "R2 S3-compatible endpoint, e.g. https://<account_id>.r2.cloudflarestorage.com",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "DATABASE_URI",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Auto-wired to the Postgres service in this template. Leave as-is.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "R2_PUBLIC_URL",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Public URL where uploaded media is served — either your R2 public bucket URL (https://pub-xxx.r2.dev) or a custom domain you've connected.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PAYLOAD_SECRET",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Random secret used to sign session cookies. Auto-generated for you.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "R2_ACCESS_KEY_ID",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Access Key ID for an R2 API token. R2 → Manage API Tokens → Object Read & Write scoped to your bucket.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "R2_SECRET_ACCESS_KEY",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Secret half of that R2 API token (shown only once at token creation).",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PUBLIC_SITE_NAME",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Site name shown in title tags, SEO meta, and the admin header.",
      "secret": false,
      "strategy": "default",
      "default": "Boxcar"
    },
    {
      "key": "NEXT_PUBLIC_SERVER_URL",
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "description": "Public URL of your deployed site, e.g. https://your-domain.com. Read at build time — redeploy after changing.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DATABASE_URI",
      "service": "Cron",
      "description": "Auto-wired to the Postgres service in this template. Leave as-is.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PAYLOAD_SECRET",
      "service": "Cron",
      "description": "Must match PAYLOAD_SECRET on the app service so both processes share the same signing key.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Path inside the container where Postgres stores its data files. Matches the volume mount.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "[Optional] libpq alias — Postgres hostname for in-project connections. Convenience for clients using PG* env vars.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "[Optional] libpq alias for the container's Postgres port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "[Optional] libpq alias for POSTGRES_USER. Lets clients use unprefixed PG* env vars.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "[Optional] libpq alias for POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "[Optional] libpq alias for POSTGRES_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Name of the database created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Internal connection string. Reference this from other services.",
      "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": "[Optional] Validity period (days) of the self-signed SSL cert Railway's image generates.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated superuser password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "[Optional] Public connection string via Railway's TCP proxy. Only needed for local tools or one-off migrations — exposes the DB to the internet.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "[Optional] Seconds Railway waits before SIGKILL during a deploy, giving Postgres time to flush.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "boxcar-payload-cms-cloudflare-r2"
      }
    },
    "cli": "railway deploy --template boxcar-payload-cms-cloudflare-r2",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0f27bea8-1271-480e-bf10-99b7813dcca6",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "19beaaf0-125d-429d-8323-aa342e10ffed": {
                  "icon": "https://devicons.railway.app/payload",
                  "name": "Payload-CMS-Cloudflare-Railway-Template",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/healthz",
                    "preDeployCommand": [
                      "pnpm migrate"
                    ],
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 5
                  },
                  "source": {
                    "repo": "https://github.com/sungkhum/Boxcar-Payload-CMS-Cloudflare-Railway-Template",
                    "rootDirectory": null
                  },
                  "variables": {
                    "R2_BUCKET": {
                      "isOptional": false,
                      "description": "Cloudflare R2 bucket name. Create one in Cloudflare dashboard → R2 → Create Bucket.",
                      "defaultValue": "{{R2_BUCKET}}"
                    },
                    "R2_ENDPOINT": {
                      "isOptional": false,
                      "description": "R2 S3-compatible endpoint, e.g. https://<account_id>.r2.cloudflarestorage.com",
                      "defaultValue": "{{R2_ENDPOINT}}"
                    },
                    "DATABASE_URI": {
                      "isOptional": false,
                      "description": "Auto-wired to the Postgres service in this template. Leave as-is.",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "R2_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public URL where uploaded media is served — either your R2 public bucket URL (https://pub-xxx.r2.dev) or a custom domain you've connected.",
                      "defaultValue": "{{R2_PUBLIC_URL}}"
                    },
                    "PAYLOAD_SECRET": {
                      "isOptional": false,
                      "description": "Random secret used to sign session cookies. Auto-generated for you.",
                      "defaultValue": "{{PAYLOAD_SECRET}}"
                    },
                    "R2_ACCESS_KEY_ID": {
                      "isOptional": false,
                      "description": "Access Key ID for an R2 API token. R2 → Manage API Tokens → Object Read & Write scoped to your bucket.",
                      "defaultValue": "{{R2_ACCESS_KEY_ID}}"
                    },
                    "R2_SECRET_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Secret half of that R2 API token (shown only once at token creation).",
                      "defaultValue": "{{R2_SECRET_ACCESS_KEY}}"
                    },
                    "NEXT_PUBLIC_SITE_NAME": {
                      "isOptional": false,
                      "description": "Site name shown in title tags, SEO meta, and the admin header.",
                      "defaultValue": "Boxcar"
                    },
                    "NEXT_PUBLIC_SERVER_URL": {
                      "isOptional": false,
                      "description": "Public URL of your deployed site, e.g. https://your-domain.com. Read at build time — redeploy after changing.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "362d18a9-2da4-4ed2-a122-f11e6d2bc823": {
                  "icon": "https://devicons.railway.com/i/calendso.svg",
                  "name": "Cron",
                  "deploy": {
                    "startCommand": "pnpm jobs:run",
                    "healthcheckPath": null
                  },
                  "source": {
                    "repo": "https://github.com/sungkhum/Boxcar-Payload-CMS-Cloudflare-Railway-Template",
                    "rootDirectory": null
                  },
                  "variables": {
                    "DATABASE_URI": {
                      "isOptional": false,
                      "description": "Auto-wired to the Postgres service in this template. Leave as-is.",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "PAYLOAD_SECRET": {
                      "isOptional": false,
                      "description": "Must match PAYLOAD_SECRET on the app service so both processes share the same signing key.",
                      "defaultValue": "{{PAYLOAD_SECRET}}"
                    }
                  }
                },
                "75f0c755-6815-4f08-a4d2-5ed8b915f4df": {
                  "icon": "https://devicons.railway.app/i/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": "Path inside the container where Postgres stores its data files. Matches the volume mount.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "[Optional] libpq alias — Postgres hostname for in-project connections. Convenience for clients using PG* env vars.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "[Optional] libpq alias for the container's Postgres port.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "[Optional] libpq alias for POSTGRES_USER. Lets clients use unprefixed PG* env vars.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "[Optional] libpq alias for POSTGRES_DB.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "[Optional] libpq alias for POSTGRES_PASSWORD.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Name of the database created on first boot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Internal connection string. Reference this from other services.",
                      "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": "[Optional] Validity period (days) of the self-signed SSL cert Railway's image generates.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated superuser password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "[Optional] Public connection string via Railway's TCP proxy. Only needed for local tools or one-off migrations — exposes the DB to the internet.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "[Optional] Seconds Railway waits before SIGKILL during a deploy, giving Postgres time to flush.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "75f0c755-6815-4f08-a4d2-5ed8b915f4df": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Payload-CMS-Cloudflare-Railway-Template",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0"
}
