{
  "manifest_version": "1.0.0",
  "template": {
    "id": "fa276864-e05e-4ee5-a37e-65e332908171",
    "slug": "gitea",
    "name": "Gitea | Open Source GitHub, BitBucket Alternative",
    "description": "Self-host Gitea - Git, Pull Requests, Gitea Actions CI/CD and more.",
    "url": "https://railway.com/deploy/gitea",
    "upstream": {
      "image": "gitea/gitea:latest"
    }
  },
  "services": [
    {
      "name": "Gitea",
      "source": {
        "image": "gitea/gitea:latest"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    },
    {
      "name": "Postgres",
      "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": "Gitea",
      "description": "HTTP server listening port",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "USER_GID",
      "service": "Gitea",
      "description": "Container group ID",
      "secret": false,
      "strategy": "default",
      "default": "1000"
    },
    {
      "key": "USER_UID",
      "service": "Gitea",
      "description": "Container user ID",
      "secret": false,
      "strategy": "default",
      "default": "1000"
    },
    {
      "key": "GITEA__database__HOST",
      "service": "Gitea",
      "description": "Postgres server hostname and port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "GITEA__database__NAME",
      "service": "Gitea",
      "description": "Database name for Gitea",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "GITEA__database__USER",
      "service": "Gitea",
      "description": "Username for Postgres authentication",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "GITEA__server__DOMAIN",
      "service": "Gitea",
      "description": "Public domain of Gitea instance",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "GITEA__database__PASSWD",
      "service": "Gitea",
      "description": "Password for Postgres authentication",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "GITEA__server__ROOT_URL",
      "service": "Gitea",
      "description": "Base URL for Gitea web interface",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "GITEA__DEFAULT__APP_NAME",
      "service": "Gitea",
      "description": "Display name of Gitea instance",
      "secret": false,
      "strategy": "default",
      "default": "My Gitea"
    },
    {
      "key": "GITEA__database__DB_TYPE",
      "service": "Gitea",
      "description": "Database engine used by Gitea",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "GITEA__server__HTTP_PORT",
      "service": "Gitea",
      "description": "Internal HTTP port used by Gitea",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "GITEA__database__SSL_MODE",
      "service": "Gitea",
      "description": "Disable SSL for database connection",
      "secret": false,
      "strategy": "default",
      "default": "disable"
    },
    {
      "key": "GITEA__server__DISABLE_SSH",
      "service": "Gitea",
      "description": "Disable built-in SSH server",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "GITEA__security__SECRET_KEY",
      "service": "Gitea",
      "description": "Secret key for encryption",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "GITEA__security__INTERNAL_TOKEN",
      "service": "Gitea",
      "description": "Internal authentication token",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "GITEA__server__START_SSH_SERVER",
      "service": "Gitea",
      "description": "Do not start SSH service",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "GITEA__service__DISABLE_REGISTRATION",
      "service": "Gitea",
      "description": "Allow new user registrations",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Directory storing Postgres data",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Internal hostname for Postgres",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Default Postgres server port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Username for Postgres login",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Default database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Password for Postgres authentication",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database created during initialization",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Internal Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Default Postgres administrator user",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate validity duration",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated password for Postgres user",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "External Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Graceful shutdown draining time",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "gitea"
      }
    },
    "cli": "railway deploy --template gitea",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "fa276864-e05e-4ee5-a37e-65e332908171",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "0fa7bcac-5d83-4635-b905-99726de9aef9": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/gitea.svg",
                  "name": "Gitea",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "gitea/gitea:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP server listening port",
                      "defaultValue": "3000"
                    },
                    "USER_GID": {
                      "isOptional": false,
                      "description": "Container group ID",
                      "defaultValue": "1000"
                    },
                    "USER_UID": {
                      "isOptional": false,
                      "description": "Container user ID",
                      "defaultValue": "1000"
                    },
                    "GITEA__database__HOST": {
                      "isOptional": false,
                      "description": "Postgres server hostname and port",
                      "defaultValue": "${{Postgres.PGHOST}}:5432"
                    },
                    "GITEA__database__NAME": {
                      "isOptional": false,
                      "description": "Database name for Gitea",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "GITEA__database__USER": {
                      "isOptional": false,
                      "description": "Username for Postgres authentication",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "GITEA__server__DOMAIN": {
                      "isOptional": false,
                      "description": "Public domain of Gitea instance",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "GITEA__database__PASSWD": {
                      "isOptional": false,
                      "description": "Password for Postgres authentication",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "GITEA__server__ROOT_URL": {
                      "isOptional": false,
                      "description": "Base URL for Gitea web interface",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}/"
                    },
                    "GITEA__DEFAULT__APP_NAME": {
                      "isOptional": false,
                      "description": "Display name of Gitea instance",
                      "defaultValue": "My Gitea"
                    },
                    "GITEA__database__DB_TYPE": {
                      "isOptional": false,
                      "description": "Database engine used by Gitea",
                      "defaultValue": "postgres"
                    },
                    "GITEA__server__HTTP_PORT": {
                      "isOptional": false,
                      "description": "Internal HTTP port used by Gitea",
                      "defaultValue": "3000"
                    },
                    "GITEA__database__SSL_MODE": {
                      "isOptional": false,
                      "description": "Disable SSL for database connection",
                      "defaultValue": "disable"
                    },
                    "GITEA__server__DISABLE_SSH": {
                      "isOptional": false,
                      "description": "Disable built-in SSH server",
                      "defaultValue": "true"
                    },
                    "GITEA__security__SECRET_KEY": {
                      "isOptional": false,
                      "description": "Secret key for encryption",
                      "defaultValue": "{{GITEA__security__SECRET_KEY}}"
                    },
                    "GITEA__security__INTERNAL_TOKEN": {
                      "isOptional": false,
                      "description": "Internal authentication token",
                      "defaultValue": "{{GITEA__security__INTERNAL_TOKEN}}"
                    },
                    "GITEA__server__START_SSH_SERVER": {
                      "isOptional": false,
                      "description": "Do not start SSH service",
                      "defaultValue": "false"
                    },
                    "GITEA__service__DISABLE_REGISTRATION": {
                      "isOptional": false,
                      "description": "Allow new user registrations",
                      "defaultValue": "false"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "0fa7bcac-5d83-4635-b905-99726de9aef9": {
                      "mountPath": "/data"
                    }
                  }
                },
                "2b797371-103c-43f7-83da-2871195e32a9": {
                  "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:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Directory storing Postgres data",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Internal hostname for Postgres",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Default Postgres server port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Username for Postgres login",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Default database name",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password for Postgres authentication",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created during initialization",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Internal Postgres connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Default Postgres administrator user",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL certificate validity duration",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for Postgres user",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "External Postgres connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Graceful shutdown draining time",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "2b797371-103c-43f7-83da-2871195e32a9": {
                      "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": "Gitea",
      "method": "GET",
      "path": "/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-22T22:14:50.114Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-20T17:39:06.851Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_c42e18548aec45639bd5",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 44,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "Postgres"
  }
}
