{
  "manifest_version": "1.0.0",
  "template": {
    "id": "ba98fdb6-1ae8-493e-b899-b1905057772a",
    "slug": "buzz-relay-2",
    "name": "Buzz Relay",
    "description": "Nostr relay with built-in Git hosting. Auto-wired Postgres, Redis, MinIO.",
    "url": "https://railway.com/deploy/buzz-relay-2",
    "upstream": {
      "repo_url": "https://github.com/INAPP-Mobile/railway-buzz-relay"
    }
  },
  "services": [
    {
      "name": "relay",
      "source": {
        "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay"
      },
      "needs_volume": true,
      "volume_mount_path": "/data/git",
      "http": true
    },
    {
      "name": "redis",
      "source": {
        "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "minio",
      "source": {
        "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "postgres",
      "source": {
        "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "relay",
      "description": "HTTP port for the relay.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "RUST_LOG",
      "service": "relay",
      "description": "Rust log level configuration.",
      "secret": false,
      "strategy": "default",
      "default": "buzz_relay=info,buzz_db=info,buzz_auth=info,buzz_pubsub=info,tower_http=info"
    },
    {
      "key": "REDIS_URL",
      "service": "relay",
      "description": "Redis connection URL. Auto-wired from the sibling 'redis' service over Railway's project-isolated private network (no password needed).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "RELAY_URL",
      "service": "relay",
      "description": "WebSocket URL of this relay (bare wss:// origin, NO path). Must match the scheme clients put in NIP-42 auth relay tags — https:// here makes every client AUTH fail with 'relay url mismatch'.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DATABASE_URL",
      "service": "relay",
      "description": "PostgreSQL connection URL. Auto-wired from the sibling 'postgres' service via companion variable references.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "BUZZ_BIND_ADDR",
      "service": "relay",
      "description": "Address and port the relay listens on.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0:3000"
    },
    {
      "key": "BUZZ_S3_BUCKET",
      "service": "relay",
      "description": "S3 bucket name for media storage.",
      "secret": false,
      "strategy": "default",
      "default": "buzz-media"
    },
    {
      "key": "BUZZ_HEALTH_PORT",
      "service": "relay",
      "description": "Port for the health check endpoint.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "BUZZ_S3_ENDPOINT",
      "service": "relay",
      "description": "S3 endpoint for media storage. Points to the sibling 'minio' service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "BUZZ_AUTO_MIGRATE",
      "service": "relay",
      "description": "Automatically run database migrations on startup.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "BUZZ_CORS_ORIGINS",
      "service": "relay",
      "description": "Allowed CORS origin for web clients.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "BUZZ_METRICS_PORT",
      "service": "relay",
      "description": "Port for Prometheus metrics endpoint.",
      "secret": false,
      "strategy": "default",
      "default": "9102"
    },
    {
      "key": "BUZZ_GIT_REPO_PATH",
      "service": "relay",
      "description": "Filesystem path where git repositories are stored. Must match the volume mount path.",
      "secret": false,
      "strategy": "default",
      "default": "/data/git"
    },
    {
      "key": "BUZZ_S3_ACCESS_KEY",
      "service": "relay",
      "description": "S3 access key. Auto-wired from the sibling 'minio' service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BUZZ_S3_SECRET_KEY",
      "service": "relay",
      "description": "S3 secret key. Auto-wired from the sibling 'minio' service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "BUZZ_MEDIA_BASE_URL",
      "service": "relay",
      "description": "Public base URL for media attachments.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "BUZZ_RELAY_PRIVATE_KEY",
      "service": "relay",
      "description": "Nostr private key (hex) for the relay. Auto-generated if not provided.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "BUZZ_MEDIA_SERVER_DOMAIN",
      "service": "relay",
      "description": "Public domain used for media server URLs.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "BUZZ_S3_ADDRESSING_STYLE",
      "service": "relay",
      "description": "MinIO sibling uses path-style S3 addressing (required for private-network hostnames).",
      "secret": false,
      "strategy": "default",
      "default": "path"
    },
    {
      "key": "BUZZ_GIT_HOOK_HMAC_SECRET",
      "service": "relay",
      "description": "HMAC secret for git hook verification. Auto-generated.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "redis",
      "description": "Redis password. Default literal 'redis' chosen so marketplace first-time deploys authenticate against the relay's literal REDIS_URL out of the box. Rotate this in the dashboard AND update the relay's REDIS_URL to match before going to production.",
      "secret": true,
      "strategy": "default",
      "default": "redis"
    },
    {
      "key": "MINIO_ROOT_USER",
      "service": "minio",
      "description": "MinIO root (admin) username. Referenced by the relay as BUZZ_S3_ACCESS_KEY via ${{minio.MINIO_ROOT_USER}}.",
      "secret": false,
      "strategy": "default",
      "default": "minioadmin"
    },
    {
      "key": "MINIO_ROOT_PASSWORD",
      "service": "minio",
      "description": "MinIO root password — auto-generated at deploy time. Referenced by the relay as BUZZ_S3_SECRET_KEY via ${{minio.MINIO_ROOT_PASSWORD}}.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PGDATA",
      "service": "postgres",
      "description": "Postgres data directory inside the mounted volume. MUST be a subpath of the volume mount path /var/lib/postgresql — this geometry places the volume's lost+found/ at /var/lib/postgresql/lost+found (outside PGDATA), so initdb sees an empty directory and proceeds. DO NOT change this without also changing the volume mount path.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres",
      "description": "Initial database created on first boot. MUST match the database name in the relay's DATABASE_URL (path component: /buzz).",
      "secret": false,
      "strategy": "default",
      "default": "buzz"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres",
      "description": "Postgres superuser name. Used both for the running DB and as the credential prefix in the relay's DATABASE_URL.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Postgres password. Default literal 'postgres' chosen so marketplace first-time deploys authenticate against the relay's literal DATABASE_URL out of the box. Rotate this in the dashboard AND update the relay's DATABASE_URL to match before going to production.",
      "secret": true,
      "strategy": "default",
      "default": "postgres"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "buzz-relay-2"
      }
    },
    "cli": "railway deploy --template buzz-relay-2",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "ba98fdb6-1ae8-493e-b899-b1905057772a",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "4822687a-cad3-4b01-a7ab-69b51fd4c8eb": {
                  "icon": null,
                  "name": "relay",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/_readiness",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay",
                    "rootDirectory": "."
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port for the relay.",
                      "defaultValue": "3000"
                    },
                    "RUST_LOG": {
                      "isOptional": false,
                      "description": "Rust log level configuration.",
                      "defaultValue": "buzz_relay=info,buzz_db=info,buzz_auth=info,buzz_pubsub=info,tower_http=info"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Redis connection URL. Auto-wired from the sibling 'redis' service over Railway's project-isolated private network (no password needed).",
                      "defaultValue": "redis://${{redis.RAILWAY_PRIVATE_DOMAIN}}:6379"
                    },
                    "RELAY_URL": {
                      "isOptional": false,
                      "description": "WebSocket URL of this relay (bare wss:// origin, NO path). Must match the scheme clients put in NIP-42 auth relay tags — https:// here makes every client AUTH fail with 'relay url mismatch'.",
                      "defaultValue": "wss://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "PostgreSQL connection URL. Auto-wired from the sibling 'postgres' service via companion variable references.",
                      "defaultValue": "postgresql://${{postgres.POSTGRES_USER}}:${{postgres.POSTGRES_PASSWORD}}@${{postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/${{postgres.POSTGRES_DB}}"
                    },
                    "BUZZ_BIND_ADDR": {
                      "isOptional": false,
                      "description": "Address and port the relay listens on.",
                      "defaultValue": "0.0.0.0:3000"
                    },
                    "BUZZ_S3_BUCKET": {
                      "isOptional": false,
                      "description": "S3 bucket name for media storage.",
                      "defaultValue": "buzz-media"
                    },
                    "BUZZ_HEALTH_PORT": {
                      "isOptional": false,
                      "description": "Port for the health check endpoint.",
                      "defaultValue": "8080"
                    },
                    "BUZZ_S3_ENDPOINT": {
                      "isOptional": false,
                      "description": "S3 endpoint for media storage. Points to the sibling 'minio' service.",
                      "defaultValue": "http://${{minio.RAILWAY_PRIVATE_DOMAIN}}:8080"
                    },
                    "BUZZ_AUTO_MIGRATE": {
                      "isOptional": false,
                      "description": "Automatically run database migrations on startup.",
                      "defaultValue": "true"
                    },
                    "BUZZ_CORS_ORIGINS": {
                      "isOptional": false,
                      "description": "Allowed CORS origin for web clients.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "BUZZ_METRICS_PORT": {
                      "isOptional": false,
                      "description": "Port for Prometheus metrics endpoint.",
                      "defaultValue": "9102"
                    },
                    "BUZZ_GIT_REPO_PATH": {
                      "isOptional": false,
                      "description": "Filesystem path where git repositories are stored. Must match the volume mount path.",
                      "defaultValue": "/data/git"
                    },
                    "BUZZ_S3_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "S3 access key. Auto-wired from the sibling 'minio' service.",
                      "defaultValue": "${{minio.MINIO_ROOT_USER}}"
                    },
                    "BUZZ_S3_SECRET_KEY": {
                      "isOptional": false,
                      "description": "S3 secret key. Auto-wired from the sibling 'minio' service.",
                      "defaultValue": "${{minio.MINIO_ROOT_PASSWORD}}"
                    },
                    "RELAY_OWNER_PUBKEY": {
                      "isOptional": true,
                      "description": "Optional: Nostr public key (hex) that owns this relay. If empty, the relay runs in open mode.",
                      "defaultValue": ""
                    },
                    "BUZZ_MEDIA_BASE_URL": {
                      "isOptional": false,
                      "description": "Public base URL for media attachments.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}/media"
                    },
                    "BUZZ_RELAY_PRIVATE_KEY": {
                      "isOptional": false,
                      "description": "Nostr private key (hex) for the relay. Auto-generated if not provided.",
                      "defaultValue": "{{BUZZ_RELAY_PRIVATE_KEY}}"
                    },
                    "BUZZ_MEDIA_SERVER_DOMAIN": {
                      "isOptional": false,
                      "description": "Public domain used for media server URLs.",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "BUZZ_S3_ADDRESSING_STYLE": {
                      "isOptional": false,
                      "description": "MinIO sibling uses path-style S3 addressing (required for private-network hostnames).",
                      "defaultValue": "path"
                    },
                    "BUZZ_GIT_HOOK_HMAC_SECRET": {
                      "isOptional": false,
                      "description": "HMAC secret for git hook verification. Auto-generated.",
                      "defaultValue": "{{BUZZ_GIT_HOOK_HMAC_SECRET}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3000": {
                        "port": 3000
                      }
                    }
                  },
                  "volumeMounts": {
                    "4822687a-cad3-4b01-a7ab-69b51fd4c8eb": {
                      "mountPath": "/data/git"
                    }
                  }
                },
                "5f269d51-41b3-4535-ba27-34372375fa69": {
                  "icon": null,
                  "name": "redis",
                  "deploy": {
                    "startCommand": "redis-server --appendonly yes",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay",
                    "rootDirectory": "redis"
                  },
                  "variables": {
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Redis password. Default literal 'redis' chosen so marketplace first-time deploys authenticate against the relay's literal REDIS_URL out of the box. Rotate this in the dashboard AND update the relay's REDIS_URL to match before going to production.",
                      "defaultValue": "redis"
                    }
                  },
                  "volumeMounts": {
                    "5f269d51-41b3-4535-ba27-34372375fa69": {
                      "mountPath": "/data"
                    }
                  }
                },
                "b7d589c1-19d3-4f5b-8c50-cde33884e93c": {
                  "icon": null,
                  "name": "minio",
                  "deploy": {
                    "startCommand": "sh -c \"mkdir -p /data/buzz-media && exec minio server /data --address :8080 --console-address :9001\"",
                    "healthcheckPath": "/minio/health/live",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay",
                    "rootDirectory": "minio"
                  },
                  "variables": {
                    "MINIO_ROOT_USER": {
                      "isOptional": false,
                      "description": "MinIO root (admin) username. Referenced by the relay as BUZZ_S3_ACCESS_KEY via ${{minio.MINIO_ROOT_USER}}.",
                      "defaultValue": "minioadmin"
                    },
                    "MINIO_ROOT_PASSWORD": {
                      "isOptional": false,
                      "description": "MinIO root password — auto-generated at deploy time. Referenced by the relay as BUZZ_S3_SECRET_KEY via ${{minio.MINIO_ROOT_PASSWORD}}.",
                      "defaultValue": "{{MINIO_ROOT_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "b7d589c1-19d3-4f5b-8c50-cde33884e93c": {
                      "mountPath": "/data"
                    }
                  }
                },
                "d6f976b3-36cb-45d7-9e74-c9afbf7347dc": {
                  "icon": null,
                  "name": "postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/INAPP-Mobile/railway-buzz-relay",
                    "rootDirectory": "postgres"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Postgres data directory inside the mounted volume. MUST be a subpath of the volume mount path /var/lib/postgresql — this geometry places the volume's lost+found/ at /var/lib/postgresql/lost+found (outside PGDATA), so initdb sees an empty directory and proceeds. DO NOT change this without also changing the volume mount path.",
                      "defaultValue": "/var/lib/postgresql/data"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Initial database created on first boot. MUST match the database name in the relay's DATABASE_URL (path component: /buzz).",
                      "defaultValue": "buzz"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Postgres superuser name. Used both for the running DB and as the credential prefix in the relay's DATABASE_URL.",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password. Default literal 'postgres' chosen so marketplace first-time deploys authenticate against the relay's literal DATABASE_URL out of the box. Rotate this in the dashboard AND update the relay's DATABASE_URL to match before going to production.",
                      "defaultValue": "postgres"
                    }
                  },
                  "volumeMounts": {
                    "d6f976b3-36cb-45d7-9e74-c9afbf7347dc": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "relay",
      "method": "GET",
      "path": "/_readiness",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T10:14:37.339Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-19T13:32:47.426Z",
  "success_rate_30d": 0.1667,
  "validation": {
    "last_run_id": "run_ea4b1e922e494d3eba62",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "BUILDING,BUILDING,BUILDING,FAILED"
      }
    ],
    "typical_ready_seconds": 360
  }
}
