{
  "manifest_version": "1.0.0",
  "template": {
    "id": "9e531029-f81c-4e5e-a486-5085ee1cf151",
    "slug": "ferriskeypostgresql",
    "name": "FerrisKey+PostgreSQL",
    "description": "Unofficial hardened ferriskey docker image from Danny",
    "url": "https://railway.com/deploy/ferriskeypostgresql",
    "upstream": {
      "image": "ghcr.io/ucndanny/ferriskey-hardened:latest"
    }
  },
  "services": [
    {
      "name": "FerrisKey_Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "FerrisKey",
      "source": {
        "image": "ghcr.io/ucndanny/ferriskey-hardened:latest"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "FerrisKey_Postgres",
      "description": "Location where the database will be initialized",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "FerrisKey_Postgres",
      "description": "Railway Private Domain Name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "FerrisKey_Postgres",
      "description": "Port to connect to Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "FerrisKey_Postgres",
      "description": "Required variable for Data panel",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "FerrisKey_Postgres",
      "description": "Required variable for the data panel.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "FerrisKey_Postgres",
      "description": "Required variable for Data panel",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "FerrisKey_Postgres",
      "description": "Default database created when image is started.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "FerrisKey_Postgres",
      "description": "URL to connect to Postgres database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "FerrisKey_Postgres",
      "description": "User to connect to Postgres DB",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "FerrisKey_Postgres",
      "description": "SSL certificate expiry in days.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "FerrisKey_Postgres",
      "description": "Password to connect to DB",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "FerrisKey_Postgres",
      "description": "Allow Postgres to cleanly shut down",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "FERRISKEY_ENV",
      "service": "FerrisKey",
      "description": "Run FerrisKey with production defaults.",
      "secret": true,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "FERRISKEY_LOG_FILTER",
      "service": "FerrisKey",
      "description": "Rust tracing filter; use info for normal production logging.",
      "secret": true,
      "strategy": "default",
      "default": "info"
    },
    {
      "key": "FERRISKEY_WEBAPP_URL",
      "service": "FerrisKey",
      "description": "Public URL used for the FerrisKey web console and initial client configuration.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "FERRISKEY_ADMIN_EMAIL",
      "service": "FerrisKey",
      "description": "Email address for the initial administrator account.",
      "secret": true,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "FERRISKEY_SERVER_HOST",
      "service": "FerrisKey",
      "description": "IPv6 bind address for Railway networking.",
      "secret": true,
      "strategy": "default",
      "default": "::"
    },
    {
      "key": "FERRISKEY_SERVER_PORT",
      "service": "FerrisKey",
      "description": "HTTP port used by the FerrisKey server.",
      "secret": true,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "FERRISKEY_DATABASE_URL",
      "service": "FerrisKey",
      "description": "Connection string for the bundled PostgreSQL service.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "FERRISKEY_ADMIN_PASSWORD",
      "service": "FerrisKey",
      "description": "Password for the initial administrator account.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "FERRISKEY_ADMIN_USERNAME",
      "service": "FerrisKey",
      "description": "Username for the initial administrator account.",
      "secret": true,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "FERRISKEY_ALLOWED_ORIGINS",
      "service": "FerrisKey",
      "description": "Public origin permitted by FerrisKey CORS policy.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "FERRISKEY_SERVER_PUBLIC_URL",
      "service": "FerrisKey",
      "description": "Canonical public origin used in redirects and signed SAML identifiers.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "ferriskeypostgresql"
      }
    },
    "cli": "railway deploy --template ferriskeypostgresql",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "9e531029-f81c-4e5e-a486-5085ee1cf151",
            "serializedConfig": {
              "services": {
                "769e3f7f-2050-4452-88e3-2e5e4ba232f0": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "FerrisKey_Postgres",
                  "deploy": {
                    "requiredMountPath": "/var/lib/postgresql/data"
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Location where the database will be initialized",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Railway Private Domain Name.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Port to connect to Postgres.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{ POSTGRES_USER }}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Required variable for the data panel.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Required variable for Data panel",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created when image is started.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "URL to connect to Postgres database.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "User to connect to Postgres DB",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": true,
                      "description": "SSL certificate expiry in days.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password to connect to DB",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Allow Postgres to cleanly shut down",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "769e3f7f-2050-4452-88e3-2e5e4ba232f0": {
                      "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."
                  }
                },
                "897087b3-001e-422f-8a82-614ddd179140": {
                  "icon": "https://ferriskey.rs/logo.svg",
                  "name": "FerrisKey",
                  "deploy": {
                    "startCommand": "/usr/local/bin/ferriskey-api",
                    "healthcheckPath": "/api/health/ready"
                  },
                  "source": {
                    "image": "ghcr.io/ucndanny/ferriskey-hardened:latest"
                  },
                  "variables": {
                    "FERRISKEY_ENV": {
                      "description": "Run FerrisKey with production defaults.",
                      "defaultValue": "production"
                    },
                    "FERRISKEY_LOG_FILTER": {
                      "description": "Rust tracing filter; use info for normal production logging.",
                      "defaultValue": "info"
                    },
                    "FERRISKEY_WEBAPP_URL": {
                      "description": "Public URL used for the FerrisKey web console and initial client configuration.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "FERRISKEY_ADMIN_EMAIL": {
                      "description": "Email address for the initial administrator account.",
                      "defaultValue": "admin@example.com"
                    },
                    "FERRISKEY_SERVER_HOST": {
                      "description": "IPv6 bind address for Railway networking.",
                      "defaultValue": "::"
                    },
                    "FERRISKEY_SERVER_PORT": {
                      "description": "HTTP port used by the FerrisKey server.",
                      "defaultValue": "8080"
                    },
                    "FERRISKEY_DATABASE_URL": {
                      "description": "Connection string for the bundled PostgreSQL service.",
                      "defaultValue": "${{FerrisKey_Postgres.DATABASE_URL}}"
                    },
                    "FERRISKEY_ADMIN_PASSWORD": {
                      "description": "Password for the initial administrator account.",
                      "defaultValue": "{{FERRISKEY_ADMIN_PASSWORD}}"
                    },
                    "FERRISKEY_ADMIN_USERNAME": {
                      "description": "Username for the initial administrator account.",
                      "defaultValue": "admin"
                    },
                    "FERRISKEY_ALLOWED_ORIGINS": {
                      "description": "Public origin permitted by FerrisKey CORS policy.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "FERRISKEY_SERVER_PUBLIC_URL": {
                      "description": "Canonical public origin used in redirects and signed SAML identifiers.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "FerrisKey",
      "method": "GET",
      "path": "/api/health/ready",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-20T13:27:31.104Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_67d2c34c91e54c249fa6",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "FAILED,SUCCESS"
      }
    ]
  }
}
