{
  "manifest_version": "1.0.0",
  "template": {
    "id": "fca7234c-ac04-4456-8720-1c987f8cf8de",
    "slug": "BZOvXb",
    "name": "Flagr",
    "description": "Feature flagging, A/B testing, and dynamic configuration microservice in Go",
    "url": "https://railway.com/deploy/BZOvXb",
    "upstream": {
      "image": "ghcr.io/openflagr/flagr"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "tcp_ports": [
        5432
      ],
      "http": false
    },
    {
      "name": "Flagr",
      "source": {
        "image": "ghcr.io/openflagr/flagr"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "On-disk database location",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Public host",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Public Port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Database username",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Default database",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Database password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_DSN",
      "service": "Postgres",
      "description": "Public DSN",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Public URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database username",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "PGHOST_PRIVATE",
      "service": "Postgres",
      "description": "Private host",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT_PRIVATE",
      "service": "Postgres",
      "description": "Private Port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Database password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PRIVATE_DSN",
      "service": "Postgres",
      "description": "Private DSN",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_PRIVATE_URL",
      "service": "Postgres",
      "description": "Private URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PORT",
      "service": "Flagr",
      "description": "Internal port",
      "secret": false,
      "strategy": "default",
      "default": "18000"
    },
    {
      "key": "FLAGER_HOST",
      "service": "Flagr",
      "description": "Public host",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "FLAGR_BASE_PATH",
      "service": "Flagr",
      "description": "Public base path",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "FLAGR_DB_DBDRIVER",
      "service": "Flagr",
      "description": "Use Postgres database",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "FLAGER_PRIVATE_HOST",
      "service": "Flagr",
      "description": "Private host:port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "FLAGR_LOGRUS_FORMAT",
      "service": "Flagr",
      "description": "Enable JSON logging",
      "secret": false,
      "strategy": "default",
      "default": "json"
    },
    {
      "key": "FLAGR_BASE_PATH_PRIVATE",
      "service": "Flagr",
      "description": "Private base path",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "FLAGR_BASIC_AUTH_ENABLED",
      "service": "Flagr",
      "description": "Enable basic auth",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "FLAGR_DB_DBCONNECTIONSTR",
      "service": "Flagr",
      "description": "Private database URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "FLAGR_BASIC_AUTH_PASSWORD",
      "service": "Flagr",
      "description": "Basic auth password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "FLAGR_BASIC_AUTH_USERNAME",
      "service": "Flagr",
      "description": "Basic auth username<br>**used for authenticating with the Web UI and the API**",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "FLAGR_CORS_ALLOWED_ORIGINS",
      "service": "Flagr",
      "description": "Allowed origin",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "ENABLE_ALPINE_PRIVATE_NETWORKING",
      "service": "Flagr",
      "description": "<a href=\"https://docs.railway.app/guides/private-networking#workaround-for-alpine-based-images\">Workaround for Alpine-based images</a>",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "FLAGR_BASIC_AUTH_WHITELIST_PATHS",
      "service": "Flagr",
      "description": "Leave the health check unsecure",
      "secret": false,
      "strategy": "default",
      "default": "/api/v1/health"
    },
    {
      "key": "FLAGR_DB_DBCONNECTION_RETRY_DELAY",
      "service": "Flagr",
      "description": "250 millisecond delay between retry attempts",
      "secret": false,
      "strategy": "default",
      "default": "250ms"
    },
    {
      "key": "FLAGR_DB_DBCONNECTION_RETRY_ATTEMPTS",
      "service": "Flagr",
      "description": "25 connection attempts",
      "secret": false,
      "strategy": "default",
      "default": "25"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "BZOvXb"
      }
    },
    "cli": "railway deploy --template BZOvXb",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "fca7234c-ac04-4456-8720-1c987f8cf8de",
            "serializedConfig": {
              "services": {
                "e9e85d8c-7790-4745-ab12-c3ca9d8b6f02": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {},
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "On-disk database location",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Public host",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Public Port",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_PORT}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Database username",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Default database",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Database password",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database",
                      "defaultValue": "railway"
                    },
                    "DATABASE_DSN": {
                      "isOptional": false,
                      "description": "Public DSN",
                      "defaultValue": "${{PGUSER}}:${{POSTGRES_PASSWORD}}@tcp(${{PGHOST}}:${{PGPORT}})/${{PGDATABASE}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Public URL",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{PGHOST}}:${{PGPORT}}/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database username",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry",
                      "defaultValue": "820"
                    },
                    "PGHOST_PRIVATE": {
                      "isOptional": false,
                      "description": "Private host",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT_PRIVATE": {
                      "isOptional": false,
                      "description": "Private Port",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PRIVATE_DSN": {
                      "isOptional": false,
                      "description": "Private DSN",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@tcp(${{PGHOST_PRIVATE}}:${{PGPORT_PRIVATE}})/${{PGDATABASE}}"
                    },
                    "DATABASE_PRIVATE_URL": {
                      "isOptional": false,
                      "description": "Private URL",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{PGHOST_PRIVATE}}:${{PGPORT_PRIVATE}}/${{PGDATABASE}}"
                    }
                  },
                  "networking": {
                    "tcpProxies": {
                      "5432": {}
                    },
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "e9e85d8c-7790-4745-ab12-c3ca9d8b6f02": {
                      "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."
                  }
                },
                "fba2b605-41cf-43b2-ba78-fa1da959a4fc": {
                  "name": "Flagr",
                  "build": {},
                  "deploy": {
                    "healthcheckPath": "/api/v1/health"
                  },
                  "source": {
                    "image": "ghcr.io/openflagr/flagr"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Internal port",
                      "defaultValue": "18000"
                    },
                    "FLAGER_HOST": {
                      "isOptional": false,
                      "description": "Public host",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "FLAGR_BASE_PATH": {
                      "isOptional": false,
                      "description": "Public base path",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}/api/v1"
                    },
                    "FLAGR_DB_DBDRIVER": {
                      "isOptional": false,
                      "description": "Use Postgres database",
                      "defaultValue": "postgres"
                    },
                    "FLAGER_PRIVATE_HOST": {
                      "isOptional": false,
                      "description": "Private host:port",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}:${{PORT}}"
                    },
                    "FLAGR_LOGRUS_FORMAT": {
                      "isOptional": false,
                      "description": "Enable JSON logging",
                      "defaultValue": "json"
                    },
                    "FLAGR_BASE_PATH_PRIVATE": {
                      "isOptional": false,
                      "description": "Private base path",
                      "defaultValue": "https://${{RAILWAY_PRIVATE_DOMAIN}}:${{PORT}}/api/v1"
                    },
                    "FLAGR_BASIC_AUTH_ENABLED": {
                      "isOptional": false,
                      "description": "Enable basic auth",
                      "defaultValue": "true"
                    },
                    "FLAGR_DB_DBCONNECTIONSTR": {
                      "isOptional": false,
                      "description": "Private database URL",
                      "defaultValue": "${{Postgres.DATABASE_PRIVATE_URL}}"
                    },
                    "FLAGR_BASIC_AUTH_PASSWORD": {
                      "isOptional": false,
                      "description": "Basic auth password",
                      "defaultValue": "{{FLAGR_BASIC_AUTH_PASSWORD}}"
                    },
                    "FLAGR_BASIC_AUTH_USERNAME": {
                      "isOptional": false,
                      "description": "Basic auth username<br>**used for authenticating with the Web UI and the API**",
                      "defaultValue": "{{FLAGR_BASIC_AUTH_USERNAME}}"
                    },
                    "FLAGR_CORS_ALLOWED_ORIGINS": {
                      "isOptional": false,
                      "description": "Allowed origin",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "ENABLE_ALPINE_PRIVATE_NETWORKING": {
                      "isOptional": false,
                      "description": "<a href=\"https://docs.railway.app/guides/private-networking#workaround-for-alpine-based-images\">Workaround for Alpine-based images</a>",
                      "defaultValue": "true"
                    },
                    "FLAGR_BASIC_AUTH_WHITELIST_PATHS": {
                      "isOptional": false,
                      "description": "Leave the health check unsecure",
                      "defaultValue": "/api/v1/health"
                    },
                    "FLAGR_DB_DBCONNECTION_RETRY_DELAY": {
                      "isOptional": false,
                      "description": "250 millisecond delay between retry attempts",
                      "defaultValue": "250ms"
                    },
                    "FLAGR_DB_DBCONNECTION_RETRY_ATTEMPTS": {
                      "isOptional": false,
                      "description": "25 connection attempts",
                      "defaultValue": "25"
                    }
                  },
                  "networking": {
                    "tcpProxies": {},
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {}
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Flagr",
      "method": "GET",
      "path": "/api/v1/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T22:14:44.200Z",
  "generator_version": "0.1.0"
}
