{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f948437f-4639-454e-b928-ce5a3bba42ff",
    "slug": "mas-and-synapse",
    "name": "MAS and Synapse",
    "description": "we use mas and synapse for homeserver",
    "url": "https://railway.com/deploy/mas-and-synapse",
    "upstream": {
      "repo_url": "https://github.com/Penghuot/ess-helm"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "synapse",
      "source": {
        "repo": "https://github.com/Penghuot/ess-helm"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "mas-service",
      "source": {
        "repo": "https://github.com/Penghuot/ess-helm"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "synapse-db",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "mas-db",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "synapse",
      "description": "Port Synapse listens on inside the container. Example: 8008",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_CLIENT_ID",
      "service": "synapse",
      "description": "OIDC client ID registered for Synapse with MAS. Example: 0000000000000000000SYNAPSE",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_PUBLIC_URL",
      "service": "synapse",
      "description": "Public URL of MAS service. Example: https://mas-service-production-6c0a.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "SYNAPSE_DB_HOST",
      "service": "synapse",
      "description": "Host for Synapse PostgreSQL database, auto-injected by Railway. Example: containers-us-west-123.railway.app",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SYNAPSE_DB_NAME",
      "service": "synapse",
      "description": "Name of Synapse PostgreSQL database, auto-injected by Railway. Example: railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SYNAPSE_DB_PORT",
      "service": "synapse",
      "description": "Port for Synapse PostgreSQL database, auto-injected by Railway. Example: 5432",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SYNAPSE_DB_USER",
      "service": "synapse",
      "description": "Username for Synapse PostgreSQL database, auto-injected by Railway. Example: postgres",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MAS_CLIENT_SECRET",
      "service": "synapse",
      "description": "OIDC client secret registered for Synapse with MAS. Example: 7XG6t2DaxVLtk81T3JaPRO9c3GBsfhapSutjnn/ieGE=",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MAS_MATRIX_ENDPOINT",
      "service": "synapse",
      "description": "Public endpoint of MAS service. Example: https://mas-service-production-6c0a.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "SYNAPSE_DB_PASSWORD",
      "service": "synapse",
      "description": "Password for Synapse PostgreSQL database, auto-injected by Railway. Example: auto-generated",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SYNAPSE_FORM_SECRET",
      "service": "synapse",
      "description": "Secret used for CSRF protection in Synapse forms. Example: 574308507c1054af6354fcfe02d580120f01349e5b5abd6e0194e69beb531983",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "SYNAPSE_SERVER_NAME",
      "service": "synapse",
      "description": "The server name for your Synapse homeserver, auto-injected by Railway. Example: synape-production-7433.up.railway.app",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "SYNAPSE_PUBLIC_BASEURL",
      "service": "synapse",
      "description": "Public base URL for Synapse, auto-injected by Railway. Example: https://synape-production-7433.up.railway.app/",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "MAS_MATRIX_SHARED_SECRET",
      "service": "synapse",
      "description": "Shared secret for secure communication with MAS. Must match MAS side. Example: 95946d21b1ae4cf8aef0c801b44dd35226d7a5f1ca500c08563151e128a89398",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "SYNAPSE_MACAROON_SECRET_KEY",
      "service": "synapse",
      "description": "Secret key used to sign macaroons (auth tokens). Example: 8f8f25f9a17fa9a7b495f8e8f44b9344ca47081f5defb0416b57b241c5d56284",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MAS_CLIENT_ID",
      "service": "mas-service",
      "description": "OIDC client ID registered for Synapse. Example: 0000000000000000000SYNAPSE",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_PUBLIC_URL",
      "service": "mas-service",
      "description": "Full public URL for MAS, auto-injected by Railway. Example: https://mas-service-production-6c0a.up.railway.app",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "ELEMENT_WEB_URL",
      "service": "mas-service",
      "description": "Public URL of your Element Web client. Example: https://web-element-production-1fad.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_LISTEN_ADDR",
      "service": "mas-service",
      "description": "Network address and port MAS listens on inside the container. Example: 0.0.0.0:8080",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0:8080"
    },
    {
      "key": "MAS_PUBLIC_BASE",
      "service": "mas-service",
      "description": "Base public URL for MAS, auto-injected by Railway. Example: https://mas-service-production-6c0a.up.railway.app",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "MAS_SIGNING_KEY",
      "service": "mas-service",
      "description": "RSA private key used by MAS to sign tokens. Example: -----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY-----",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MAS_DATABASE_URI",
      "service": "mas-service",
      "description": "Connection string for MAS PostgreSQL database, auto-injected by Railway. Example: postgres://user:password@host:5432/dbname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MAS_EMAIL_DOMAIN",
      "service": "mas-service",
      "description": "Domain used for email addresses issued by MAS. Example: matrix.synape-production-7433.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_CLIENT_SECRET",
      "service": "mas-service",
      "description": "OIDC client secret registered for Synapse. Example: 7XG6t2DaxVLtk81T3JaPRO9c3GBsfhapSutjnn/ieGE=",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MAS_ENCRYPTION_KEY",
      "service": "mas-service",
      "description": "Key used by MAS for encrypting sensitive data. Example: e30ced82286c06d0d873277811e4d004afb200744080969cad9cebbbda4d0149",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MAS_MATRIX_ENDPOINT",
      "service": "mas-service",
      "description": "Public endpoint MAS uses to reach Synapse. Example: https://synape-production-7433.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "ELEMENT_WEB_CLIENT_ID",
      "service": "mas-service",
      "description": "OIDC client ID registered for Element Web. Example: 00000000000000000000SEC0ND",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_MATRIX_HOMESERVER",
      "service": "mas-service",
      "description": "The domain name of the homeserver. Example: synape-production-7433.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_MATRIX_SERVER_NAME",
      "service": "mas-service",
      "description": "The internal server name for your Matrix homeserver. Example: synape-production-7433.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_CLIENT_REDIRECT_URI",
      "service": "mas-service",
      "description": "Redirect URI Synapse uses for OIDC callback. Example: https://synape-production-7433.up.railway.app/_synapse/client/oidc/callback",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MAS_MATRIX_SHARED_SECRET",
      "service": "mas-service",
      "description": "Shared secret for secure communication between MAS and Synapse. Example: 95946d21b1ae4cf8aef0c801b44dd35226d7a5f1ca500c08563151e128a89398",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "MAS_MATRIX_PUBLIC_ENDPOINT",
      "service": "mas-service",
      "description": "The public HTTPS endpoint MAS uses to reach Synapse. Example: https://synape-production-7433.up.railway.app",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGHOST",
      "service": "synapse-db",
      "description": "Host for the PostgreSQL database, auto-injected by Railway. Example: containers-us-west-123.railway.app",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGUSER",
      "service": "synapse-db",
      "description": "Username for the PostgreSQL database, auto-injected by Railway. Example: postgres",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "synapse-db",
      "description": "Name of the PostgreSQL database, auto-injected by Railway. Example: railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "synapse-db",
      "description": "Password for the PostgreSQL database, auto-injected by Railway. Example: auto-generated secret",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "synapse-db",
      "description": "Internal connection string for PostgreSQL. Example: postgresql://postgres:password@containers-us-west-123.railway.app:5432/railway",
      "secret": false,
      "strategy": "default",
      "default": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_PRIVATE_DOMAIN}:5432/${PGDATABASE}"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "synapse-db",
      "description": "Generates a random 32-character password for PostgreSQL. Example: auto-generated secret like AbCdEfGhIjKlMnOpQrStUvWxYz123456",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "synapse-db",
      "description": "Public connection string for PostgreSQL via Railway TCP proxy. Example: postgresql://postgres:password@proxy.railway.app:5432/railway",
      "secret": false,
      "strategy": "default",
      "default": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_TCP_PROXY_DOMAIN}:${RAILWAY_TCP_PROXY_PORT}/${PGDATABASE}"
    },
    {
      "key": "PGHOST",
      "service": "mas-db",
      "description": "Host for the MAS PostgreSQL database, auto-injected by Railway. Example: containers-us-west-123.railway.app",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGUSER",
      "service": "mas-db",
      "description": "Username for the MAS PostgreSQL database, auto-injected by Railway. Example: postgres",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "mas-db",
      "description": "Name of the MAS PostgreSQL database, auto-injected by Railway. Example: railway",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "mas-db",
      "description": "Password for the MAS PostgreSQL database, auto-injected by Railway. Example: auto-generated secret",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "mas-db",
      "description": "Internal connection string for MAS PostgreSQL. Example: postgresql://postgres:password@containers-us-west-123.railway.app:5432/railway",
      "secret": false,
      "strategy": "default",
      "default": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_PRIVATE_DOMAIN}:5432/${PGDATABASE}"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "mas-db",
      "description": "Generates a random 32-character password for MAS PostgreSQL. Example: auto-generated secret like AbCdEfGhIjKlMnOpQrStUvWxYz123456",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "mas-db",
      "description": "Public connection string for MAS PostgreSQL via Railway TCP proxy. Example: postgresql://postgres:password@proxy.railway.app:5432/railway",
      "secret": false,
      "strategy": "default",
      "default": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_TCP_PROXY_DOMAIN}:${RAILWAY_TCP_PROXY_PORT}/${PGDATABASE}"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mas-and-synapse"
      }
    },
    "cli": "railway deploy --template mas-and-synapse",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f948437f-4639-454e-b928-ce5a3bba42ff",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "45e0a05d-dd2e-4439-8297-66db095e6f14": {
                  "icon": "https://devicons.railway.com/i/coder-dark.png",
                  "name": "synapse",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/Penghuot/ess-helm",
                    "rootDirectory": "/to-test-with-railway/synapse"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Synapse listens on inside the container. Example: 8008",
                      "defaultValue": "{{PORT}}"
                    },
                    "MAS_CLIENT_ID": {
                      "isOptional": false,
                      "description": "OIDC client ID registered for Synapse with MAS. Example: 0000000000000000000SYNAPSE",
                      "defaultValue": "{{MAS_CLIENT_ID}}"
                    },
                    "MAS_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public URL of MAS service. Example: https://mas-service-production-6c0a.up.railway.app",
                      "defaultValue": "{{MAS_PUBLIC_URL}}"
                    },
                    "SYNAPSE_DB_HOST": {
                      "isOptional": false,
                      "description": "Host for Synapse PostgreSQL database, auto-injected by Railway. Example: containers-us-west-123.railway.app",
                      "defaultValue": "${{synapse-db.PGHOST}}"
                    },
                    "SYNAPSE_DB_NAME": {
                      "isOptional": false,
                      "description": "Name of Synapse PostgreSQL database, auto-injected by Railway. Example: railway",
                      "defaultValue": "${{synapse-db.PGDATABASE}}"
                    },
                    "SYNAPSE_DB_PORT": {
                      "isOptional": false,
                      "description": "Port for Synapse PostgreSQL database, auto-injected by Railway. Example: 5432",
                      "defaultValue": "${{synapse-db.PGPORT}}"
                    },
                    "SYNAPSE_DB_USER": {
                      "isOptional": false,
                      "description": "Username for Synapse PostgreSQL database, auto-injected by Railway. Example: postgres",
                      "defaultValue": "${{synapse-db.PGUSER}}"
                    },
                    "MAS_CLIENT_SECRET": {
                      "isOptional": false,
                      "description": "OIDC client secret registered for Synapse with MAS. Example: 7XG6t2DaxVLtk81T3JaPRO9c3GBsfhapSutjnn/ieGE=",
                      "defaultValue": "{{MAS_CLIENT_SECRET}}"
                    },
                    "MAS_MATRIX_ENDPOINT": {
                      "isOptional": false,
                      "description": "Public endpoint of MAS service. Example: https://mas-service-production-6c0a.up.railway.app",
                      "defaultValue": "{{MAS_MATRIX_ENDPOINT}}"
                    },
                    "SYNAPSE_DB_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for Synapse PostgreSQL database, auto-injected by Railway. Example: auto-generated",
                      "defaultValue": "${{synapse-db.PGPASSWORD}}"
                    },
                    "SYNAPSE_FORM_SECRET": {
                      "isOptional": false,
                      "description": "Secret used for CSRF protection in Synapse forms. Example: 574308507c1054af6354fcfe02d580120f01349e5b5abd6e0194e69beb531983",
                      "defaultValue": "{{SYNAPSE_FORM_SECRET}}"
                    },
                    "SYNAPSE_SERVER_NAME": {
                      "isOptional": false,
                      "description": "The server name for your Synapse homeserver, auto-injected by Railway. Example: synape-production-7433.up.railway.app",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "SYNAPSE_PUBLIC_BASEURL": {
                      "isOptional": false,
                      "description": "Public base URL for Synapse, auto-injected by Railway. Example: https://synape-production-7433.up.railway.app/",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}/"
                    },
                    "MAS_MATRIX_SHARED_SECRET": {
                      "isOptional": false,
                      "description": "Shared secret for secure communication with MAS. Must match MAS side. Example: 95946d21b1ae4cf8aef0c801b44dd35226d7a5f1ca500c08563151e128a89398",
                      "defaultValue": "{{MAS_MATRIX_SHARED_SECRET}}"
                    },
                    "SYNAPSE_MACAROON_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Secret key used to sign macaroons (auth tokens). Example: 8f8f25f9a17fa9a7b495f8e8f44b9344ca47081f5defb0416b57b241c5d56284",
                      "defaultValue": "{{SYNAPSE_MACAROON_SECRET_KEY}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "6cbc20dc-4ff8-4aae-9717-bf561ac2fc5d": {
                  "icon": "https://devicons.railway.com/i/coder-white.png",
                  "name": "mas-service",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 3
                  },
                  "source": {
                    "repo": "https://github.com/Penghuot/ess-helm",
                    "rootDirectory": "/to-test-with-railway/mas"
                  },
                  "variables": {
                    "MAS_CLIENT_ID": {
                      "isOptional": false,
                      "description": "OIDC client ID registered for Synapse. Example: 0000000000000000000SYNAPSE",
                      "defaultValue": "{{MAS_CLIENT_ID}}"
                    },
                    "MAS_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Full public URL for MAS, auto-injected by Railway. Example: https://mas-service-production-6c0a.up.railway.app",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "ELEMENT_WEB_URL": {
                      "isOptional": false,
                      "description": "Public URL of your Element Web client. Example: https://web-element-production-1fad.up.railway.app",
                      "defaultValue": "{{ELEMENT_WEB_URL}}"
                    },
                    "MAS_LISTEN_ADDR": {
                      "isOptional": false,
                      "description": "Network address and port MAS listens on inside the container. Example: 0.0.0.0:8080",
                      "defaultValue": "0.0.0.0:8080"
                    },
                    "MAS_PUBLIC_BASE": {
                      "isOptional": false,
                      "description": "Base public URL for MAS, auto-injected by Railway. Example: https://mas-service-production-6c0a.up.railway.app",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "MAS_SIGNING_KEY": {
                      "isOptional": false,
                      "description": "RSA private key used by MAS to sign tokens. Example: -----BEGIN RSA PRIVATE KEY----- ... -----END RSA PRIVATE KEY-----",
                      "defaultValue": "{{MAS_SIGNING_KEY}}"
                    },
                    "MAS_DATABASE_URI": {
                      "isOptional": false,
                      "description": "Connection string for MAS PostgreSQL database, auto-injected by Railway. Example: postgres://user:password@host:5432/dbname",
                      "defaultValue": "${{mas-db.DATABASE_URL}}"
                    },
                    "MAS_EMAIL_DOMAIN": {
                      "isOptional": false,
                      "description": "Domain used for email addresses issued by MAS. Example: matrix.synape-production-7433.up.railway.app",
                      "defaultValue": "{{MAS_EMAIL_DOMAIN}}"
                    },
                    "MAS_CLIENT_SECRET": {
                      "isOptional": false,
                      "description": "OIDC client secret registered for Synapse. Example: 7XG6t2DaxVLtk81T3JaPRO9c3GBsfhapSutjnn/ieGE=",
                      "defaultValue": "{{MAS_CLIENT_SECRET}}"
                    },
                    "MAS_ENCRYPTION_KEY": {
                      "isOptional": false,
                      "description": "Key used by MAS for encrypting sensitive data. Example: e30ced82286c06d0d873277811e4d004afb200744080969cad9cebbbda4d0149",
                      "defaultValue": "{{MAS_ENCRYPTION_KEY}}"
                    },
                    "MAS_MATRIX_ENDPOINT": {
                      "isOptional": false,
                      "description": "Public endpoint MAS uses to reach Synapse. Example: https://synape-production-7433.up.railway.app",
                      "defaultValue": "{{MAS_MATRIX_ENDPOINT}}"
                    },
                    "ELEMENT_WEB_CLIENT_ID": {
                      "isOptional": false,
                      "description": "OIDC client ID registered for Element Web. Example: 00000000000000000000SEC0ND",
                      "defaultValue": "{{ELEMENT_WEB_CLIENT_ID}}"
                    },
                    "MAS_MATRIX_HOMESERVER": {
                      "isOptional": false,
                      "description": "The domain name of the homeserver. Example: synape-production-7433.up.railway.app",
                      "defaultValue": "{{MAS_MATRIX_HOMESERVER}}"
                    },
                    "MAS_MATRIX_SERVER_NAME": {
                      "isOptional": false,
                      "description": "The internal server name for your Matrix homeserver. Example: synape-production-7433.up.railway.app",
                      "defaultValue": "{{MAS_MATRIX_SERVER_NAME}}"
                    },
                    "MAS_CLIENT_REDIRECT_URI": {
                      "isOptional": false,
                      "description": "Redirect URI Synapse uses for OIDC callback. Example: https://synape-production-7433.up.railway.app/_synapse/client/oidc/callback",
                      "defaultValue": "{{MAS_CLIENT_REDIRECT_URI}}"
                    },
                    "MAS_MATRIX_SHARED_SECRET": {
                      "isOptional": false,
                      "description": "Shared secret for secure communication between MAS and Synapse. Example: 95946d21b1ae4cf8aef0c801b44dd35226d7a5f1ca500c08563151e128a89398",
                      "defaultValue": "{{MAS_MATRIX_SHARED_SECRET}}"
                    },
                    "MAS_MATRIX_PUBLIC_ENDPOINT": {
                      "isOptional": false,
                      "description": "The public HTTPS endpoint MAS uses to reach Synapse. Example: https://synape-production-7433.up.railway.app",
                      "defaultValue": "{{MAS_MATRIX_PUBLIC_ENDPOINT}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "ae5d4b30-cf54-48f6-8cc7-b1a368aaedaa": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "synapse-db",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Host for the PostgreSQL database, auto-injected by Railway. Example: containers-us-west-123.railway.app",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Username for the PostgreSQL database, auto-injected by Railway. Example: postgres",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Name of the PostgreSQL database, auto-injected by Railway. Example: railway",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password for the PostgreSQL database, auto-injected by Railway. Example: auto-generated secret",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Internal connection string for PostgreSQL. Example: postgresql://postgres:password@containers-us-west-123.railway.app:5432/railway",
                      "defaultValue": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_PRIVATE_DOMAIN}:5432/${PGDATABASE}"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generates a random 32-character password for PostgreSQL. Example: auto-generated secret like AbCdEfGhIjKlMnOpQrStUvWxYz123456",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public connection string for PostgreSQL via Railway TCP proxy. Example: postgresql://postgres:password@proxy.railway.app:5432/railway",
                      "defaultValue": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_TCP_PROXY_DOMAIN}:${RAILWAY_TCP_PROXY_PORT}/${PGDATABASE}"
                    }
                  },
                  "volumeMounts": {
                    "ae5d4b30-cf54-48f6-8cc7-b1a368aaedaa": {
                      "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."
                  }
                },
                "b2ed63d2-5a7f-4367-a506-b4883543f241": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "mas-db",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Host for the MAS PostgreSQL database, auto-injected by Railway. Example: containers-us-west-123.railway.app",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Username for the MAS PostgreSQL database, auto-injected by Railway. Example: postgres",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Name of the MAS PostgreSQL database, auto-injected by Railway. Example: railway",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password for the MAS PostgreSQL database, auto-injected by Railway. Example: auto-generated secret",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Internal connection string for MAS PostgreSQL. Example: postgresql://postgres:password@containers-us-west-123.railway.app:5432/railway",
                      "defaultValue": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_PRIVATE_DOMAIN}:5432/${PGDATABASE}"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generates a random 32-character password for MAS PostgreSQL. Example: auto-generated secret like AbCdEfGhIjKlMnOpQrStUvWxYz123456",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public connection string for MAS PostgreSQL via Railway TCP proxy. Example: postgresql://postgres:password@proxy.railway.app:5432/railway",
                      "defaultValue": "postgresql://${PGUSER}:${POSTGRES_PASSWORD}@${RAILWAY_TCP_PROXY_DOMAIN}:${RAILWAY_TCP_PROXY_PORT}/${PGDATABASE}"
                    }
                  },
                  "volumeMounts": {
                    "b2ed63d2-5a7f-4367-a506-b4883543f241": {
                      "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": "synapse",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0"
}
