{
  "manifest_version": "1.0.0",
  "template": {
    "id": "f5c4d419-4d85-462d-8327-7c90511f5794",
    "slug": "onedev",
    "name": "OneDev",
    "description": "Self-hosted Git platform with PostgreSQL and persistent storage.",
    "url": "https://railway.com/deploy/onedev",
    "upstream": {
      "repo_url": "https://github.com/monotykamary/railway-template-onedev"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "OneDev",
      "source": {
        "repo": "https://github.com/monotykamary/railway-template-onedev"
      },
      "needs_volume": true,
      "volume_mount_path": "/opt/onedev",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "PostgreSQL data directory.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private PostgreSQL hostname.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "PostgreSQL port.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "PostgreSQL user.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "PostgreSQL database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "PostgreSQL password.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created at initialization.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private PostgreSQL connection URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "PostgreSQL superuser.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Lifetime of the generated PostgreSQL TLS certificate.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated PostgreSQL password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Public PostgreSQL connection URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Graceful deployment drain period.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "OneDev",
      "description": "Railway routing and health-check target for OneDev HTTP.",
      "secret": false,
      "strategy": "default",
      "default": "6610"
    },
    {
      "key": "initial_user",
      "service": "OneDev",
      "description": "Initial OneDev administrator username; used only on an empty installation.",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "initial_email",
      "service": "OneDev",
      "description": "Initial administrator email; change it after first login.",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "initial_password",
      "service": "OneDev",
      "description": "Generated initial administrator password; used only on an empty installation.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "hibernate_dialect",
      "service": "OneDev",
      "description": "OneDev PostgreSQL dialect.",
      "secret": false,
      "strategy": "default",
      "default": "io.onedev.server.persistence.PostgreSQLDialect"
    },
    {
      "key": "initial_server_url",
      "service": "OneDev",
      "description": "Canonical public OneDev URL; used only on an empty installation.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "hibernate_connection_url",
      "service": "OneDev",
      "description": "Private PostgreSQL JDBC URL.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "hibernate_connection_password",
      "service": "OneDev",
      "description": "PostgreSQL password reference.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "hibernate_connection_username",
      "service": "OneDev",
      "description": "PostgreSQL user reference.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "hibernate_connection_driver_class",
      "service": "OneDev",
      "description": "PostgreSQL JDBC driver.",
      "secret": false,
      "strategy": "default",
      "default": "org.postgresql.Driver"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "onedev"
      }
    },
    "cli": "railway deploy --template onedev",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "f5c4d419-4d85-462d-8327-7c90511f5794",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0dd915ad-047f-436c-9882-df52a4c1b0d7": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "PostgreSQL data directory.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private PostgreSQL hostname.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "PostgreSQL port.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "PostgreSQL user.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "PostgreSQL database.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "PostgreSQL password.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created at initialization.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private PostgreSQL connection URL.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "PostgreSQL superuser.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Lifetime of the generated PostgreSQL TLS certificate.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated PostgreSQL password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public PostgreSQL connection URL.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Graceful deployment drain period.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "0dd915ad-047f-436c-9882-df52a4c1b0d7": {
                      "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."
                  }
                },
                "a723d2c4-adc6-41a5-afd8-02307998c6e7": {
                  "icon": "https://raw.githubusercontent.com/monotykamary/railway-template-onedev/main/assets/onedev.png",
                  "name": "OneDev",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 600,
                    "restartPolicyMaxRetries": 3
                  },
                  "source": {
                    "repo": "https://github.com/monotykamary/railway-template-onedev",
                    "commitSha": "0068bade82b77850ca84e72dde08bc2586079939",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Railway routing and health-check target for OneDev HTTP.",
                      "defaultValue": "6610"
                    },
                    "initial_user": {
                      "isOptional": false,
                      "description": "Initial OneDev administrator username; used only on an empty installation.",
                      "defaultValue": "admin"
                    },
                    "initial_email": {
                      "isOptional": false,
                      "description": "Initial administrator email; change it after first login.",
                      "defaultValue": "admin@example.com"
                    },
                    "initial_password": {
                      "isOptional": false,
                      "description": "Generated initial administrator password; used only on an empty installation.",
                      "defaultValue": "{{initial_password}}"
                    },
                    "hibernate_dialect": {
                      "isOptional": false,
                      "description": "OneDev PostgreSQL dialect.",
                      "defaultValue": "io.onedev.server.persistence.PostgreSQLDialect"
                    },
                    "initial_server_url": {
                      "isOptional": false,
                      "description": "Canonical public OneDev URL; used only on an empty installation.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "hibernate_connection_url": {
                      "isOptional": false,
                      "description": "Private PostgreSQL JDBC URL.",
                      "defaultValue": "jdbc:postgresql://${{Postgres.PGHOST}}:${{Postgres.PGPORT}}/${{Postgres.PGDATABASE}}"
                    },
                    "hibernate_connection_password": {
                      "isOptional": false,
                      "description": "PostgreSQL password reference.",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "hibernate_connection_username": {
                      "isOptional": false,
                      "description": "PostgreSQL user reference.",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "hibernate_connection_driver_class": {
                      "isOptional": false,
                      "description": "PostgreSQL JDBC driver.",
                      "defaultValue": "org.postgresql.Driver"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:6610": {
                        "port": 6610
                      }
                    }
                  },
                  "volumeMounts": {
                    "a723d2c4-adc6-41a5-afd8-02307998c6e7": {
                      "mountPath": "/opt/onedev"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "OneDev",
      "method": "GET",
      "path": "/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-08T23:34:16.603Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_57d59e24f158439487e7",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 130,
    "typical_build_seconds": 40,
    "typical_start_seconds": 40,
    "slowest_service": "OneDev"
  }
}
