{
  "manifest_version": "1.0.0",
  "template": {
    "id": "649d8b5d-6ee6-4130-b2c1-06123777141b",
    "slug": "company-brain-gateway",
    "name": "Company Brain Gateway",
    "description": "One isolated private GitHub brain for Codex/Claude in buyer-owned Railway.",
    "url": "https://railway.com/deploy/company-brain-gateway",
    "upstream": {
      "image": "ghcr.io/colin-atlas/atlas-company-brain-gateway@sha256:7b03130159343006f80400fa47ec94505f846dbfa9eecdede868b60743c7ccbc"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "PgVector",
      "source": {
        "image": "pgvector/pgvector:pg16@sha256:1d533553fefe4f12e5d80c7b80622ba0c382abb5758856f52983d8789179f0fb"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Gateway",
      "source": {
        "image": "ghcr.io/colin-atlas/atlas-company-brain-gateway@sha256:7b03130159343006f80400fa47ec94505f846dbfa9eecdede868b60743c7ccbc"
      },
      "needs_volume": true,
      "volume_mount_path": "/srv/company-brain-repos",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "PgVector",
      "description": "PostgreSQL data directory inside the attached persistent volume.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "PgVector",
      "description": "Database name used by the Company Brain Gateway.",
      "secret": false,
      "strategy": "default",
      "default": "gateway"
    },
    {
      "key": "POSTGRES_USER",
      "service": "PgVector",
      "description": "Database user used by the Company Brain Gateway.",
      "secret": false,
      "strategy": "default",
      "default": "gateway"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "PgVector",
      "description": "Generated database password. Keep the generated value.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NODE_ENV",
      "service": "Gateway",
      "description": "Runs the Company Brain Gateway in production mode.",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "REPO_ROOT",
      "service": "Gateway",
      "description": "Persistent Company Brain checkout path inside the Gateway volume. Keep the default.",
      "secret": false,
      "strategy": "default",
      "default": "/srv/company-brain-repos/company-brain"
    },
    {
      "key": "ENABLE_DCR",
      "service": "Gateway",
      "description": "Dynamic Client Registration is disabled by default for a safer launch.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "PUBLIC_URL",
      "service": "Gateway",
      "description": "Automatically uses the Gateway service public Railway domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "REPO_BRANCH",
      "service": "Gateway",
      "description": "Git branch containing canonical Company Brain truth.",
      "secret": false,
      "strategy": "default",
      "default": "main"
    },
    {
      "key": "DATABASE_URL",
      "service": "Gateway",
      "description": "Private PgVector connection string generated from the database service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REPO_SSH_URL",
      "service": "Gateway",
      "description": "Required: SSH clone URL for the private Company Brain repository, for example git@github.com:YOUR_ORG/YOUR_COMPANY_BRAIN.git.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "LOCAL_MODEL_PATH",
      "service": "Gateway",
      "description": "Bundled local embedding model path. Keep the default.",
      "secret": false,
      "strategy": "default",
      "default": "/app/models"
    },
    {
      "key": "APP_ENCRYPTION_KEY",
      "service": "Gateway",
      "description": "Generated 64-character hexadecimal key used to encrypt Gateway secrets.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "GATEWAY_SETUP_MODE",
      "service": "Gateway",
      "description": "Starts in setup mode so the founder can generate and install the repository deploy key. Set to false after setup.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "TRUSTED_PROXY_CIDRS",
      "service": "Gateway",
      "description": "Railway private proxy CIDR used to trust forwarded client details.",
      "secret": false,
      "strategy": "default",
      "default": "100.0.0.0/8"
    },
    {
      "key": "ADMIN_BOOTSTRAP_SECRET",
      "service": "Gateway",
      "description": "Generated administrator bootstrap secret. Store it securely before first login.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_HEALTHCHECK_TIMEOUT_SEC",
      "service": "Gateway",
      "description": "Allows up to 300 seconds for first-boot health checks while the model and repository initialize.",
      "secret": false,
      "strategy": "default",
      "default": "300"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Gateway",
      "description": "Allows 30 seconds for in-flight writes to drain during deploys.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "company-brain-gateway"
      }
    },
    "cli": "railway deploy --template company-brain-gateway",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "649d8b5d-6ee6-4130-b2c1-06123777141b",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "09fde462-1c2e-4e6e-8246-1df92a3cc244": {
                  "icon": "https://devicons.railway.com/i/postgresql.svg",
                  "name": "PgVector",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgvector/pgvector:pg16@sha256:1d533553fefe4f12e5d80c7b80622ba0c382abb5758856f52983d8789179f0fb"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "PostgreSQL data directory inside the attached persistent volume.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name used by the Company Brain Gateway.",
                      "defaultValue": "gateway"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user used by the Company Brain Gateway.",
                      "defaultValue": "gateway"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated database password. Keep the generated value.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "09fde462-1c2e-4e6e-8246-1df92a3cc244": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "72c30077-9058-4a37-acef-61ad36517560": {
                  "icon": "https://devicons.railway.com/i/github-dark.svg",
                  "name": "Gateway",
                  "deploy": {
                    "startCommand": null,
                    "drainingSeconds": 30,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/colin-atlas/atlas-company-brain-gateway@sha256:7b03130159343006f80400fa47ec94505f846dbfa9eecdede868b60743c7ccbc"
                  },
                  "variables": {
                    "NODE_ENV": {
                      "isOptional": false,
                      "description": "Runs the Company Brain Gateway in production mode.",
                      "defaultValue": "production"
                    },
                    "REPO_ROOT": {
                      "isOptional": false,
                      "description": "Persistent Company Brain checkout path inside the Gateway volume. Keep the default.",
                      "defaultValue": "/srv/company-brain-repos/company-brain"
                    },
                    "ENABLE_DCR": {
                      "isOptional": false,
                      "description": "Dynamic Client Registration is disabled by default for a safer launch.",
                      "defaultValue": "false"
                    },
                    "PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Automatically uses the Gateway service public Railway domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "REPO_BRANCH": {
                      "isOptional": false,
                      "description": "Git branch containing canonical Company Brain truth.",
                      "defaultValue": "main"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private PgVector connection string generated from the database service.",
                      "defaultValue": "postgres://${{PgVector.POSTGRES_USER}}:${{PgVector.POSTGRES_PASSWORD}}@${{PgVector.RAILWAY_PRIVATE_DOMAIN}}:5432/${{PgVector.POSTGRES_DB}}"
                    },
                    "REPO_SSH_URL": {
                      "isOptional": false,
                      "description": "Required: SSH clone URL for the private Company Brain repository, for example git@github.com:YOUR_ORG/YOUR_COMPANY_BRAIN.git.",
                      "defaultValue": "{{REPO_SSH_URL}}"
                    },
                    "LOCAL_MODEL_PATH": {
                      "isOptional": false,
                      "description": "Bundled local embedding model path. Keep the default.",
                      "defaultValue": "/app/models"
                    },
                    "APP_ENCRYPTION_KEY": {
                      "isOptional": false,
                      "description": "Generated 64-character hexadecimal key used to encrypt Gateway secrets.",
                      "defaultValue": "{{APP_ENCRYPTION_KEY}}"
                    },
                    "GATEWAY_SETUP_MODE": {
                      "isOptional": false,
                      "description": "Starts in setup mode so the founder can generate and install the repository deploy key. Set to false after setup.",
                      "defaultValue": "true"
                    },
                    "TRUSTED_PROXY_CIDRS": {
                      "isOptional": false,
                      "description": "Railway private proxy CIDR used to trust forwarded client details.",
                      "defaultValue": "100.0.0.0/8"
                    },
                    "ADMIN_BOOTSTRAP_SECRET": {
                      "isOptional": false,
                      "description": "Generated administrator bootstrap secret. Store it securely before first login.",
                      "defaultValue": "{{ADMIN_BOOTSTRAP_SECRET}}"
                    },
                    "RAILWAY_HEALTHCHECK_TIMEOUT_SEC": {
                      "isOptional": false,
                      "description": "Allows up to 300 seconds for first-boot health checks while the model and repository initialize.",
                      "defaultValue": "300"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Allows 30 seconds for in-flight writes to drain during deploys.",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "72c30077-9058-4a37-acef-61ad36517560": {
                      "mountPath": "/srv/company-brain-repos"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Gateway",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0"
}
