{
  "manifest_version": "1.0.0",
  "template": {
    "id": "0c3eb44c-23ce-4184-b506-54123008af6e",
    "slug": "postgres-daily-backups",
    "name": "Postgres 🥇 Daily Backups",
    "description": "Deploy and Host Postgres 🥇 Daily Backups with Railway",
    "url": "https://railway.com/deploy/postgres-daily-backups",
    "upstream": {
      "repo_url": "https://github.com/imedwei/railway-postgres-backup"
    }
  },
  "services": [
    {
      "name": "Postgres Backup",
      "source": {
        "repo": "https://github.com/imedwei/railway-postgres-backup"
      },
      "needs_volume": false,
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "AWS_REGION",
      "service": "Postgres Backup",
      "description": "AWS region for S3 bucket (default: us-east-1)",
      "secret": false,
      "strategy": "default",
      "default": "us-east-1"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres Backup",
      "description": "PostgreSQL connection string from Railway PostgreSQL service",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "FORCE_BACKUP",
      "service": "Postgres Backup",
      "description": "Override respawn protection and force backup (true/false)",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "S3_PATH_STYLE",
      "service": "Postgres Backup",
      "description": "Use path-style URLs for S3 (needed for MinIO/custom endpoints)",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "RETENTION_DAYS",
      "service": "Postgres Backup",
      "description": "Number of days to keep old backups, 0 to disable cleanup (default: 7)",
      "secret": false,
      "strategy": "default",
      "default": "7"
    },
    {
      "key": "STORAGE_PROVIDER",
      "service": "Postgres Backup",
      "description": "Storage backend - either 'S3' or 'GCS'",
      "secret": false,
      "strategy": "default",
      "default": "S3"
    },
    {
      "key": "BACKUP_FILE_PREFIX",
      "service": "Postgres Backup",
      "description": "Prefix for backup filenames (default: backup)",
      "secret": false,
      "strategy": "default",
      "default": "backup"
    },
    {
      "key": "RESPAWN_PROTECTION_HOURS",
      "service": "Postgres Backup",
      "description": "Minimum hours between backups to prevent frequent restarts (default: 23)",
      "secret": false,
      "strategy": "default",
      "default": "23"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "postgres-daily-backups"
      }
    },
    "cli": "railway deploy --template postgres-daily-backups",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "0c3eb44c-23ce-4184-b506-54123008af6e",
            "serializedConfig": {
              "services": {
                "0eb3a584-a7ff-4ceb-b49e-eb4fcecfa997": {
                  "icon": "https://devicons.railway.app/postgres",
                  "name": "Postgres Backup",
                  "source": {
                    "repo": "imedwei/railway-postgres-backup",
                    "branch": null,
                    "rootDirectory": null
                  },
                  "variables": {
                    "S3_BUCKET": {
                      "isOptional": true,
                      "description": "S3 bucket name for storing backups",
                      "defaultValue": ""
                    },
                    "S3_PREFIX": {
                      "isOptional": true,
                      "description": "Prefix/folder for backup files in S3 bucket (optional)",
                      "defaultValue": ""
                    },
                    "AWS_REGION": {
                      "isOptional": true,
                      "description": "AWS region for S3 bucket (default: us-east-1)",
                      "defaultValue": "us-east-1"
                    },
                    "GCS_BUCKET": {
                      "isOptional": true,
                      "description": "Google Cloud Storage bucket name (when using GCS)",
                      "defaultValue": ""
                    },
                    "GCS_PREFIX": {
                      "isOptional": true,
                      "description": "Prefix/folder for backup files in GCS bucket (optional)",
                      "defaultValue": ""
                    },
                    "S3_ENDPOINT": {
                      "isOptional": true,
                      "description": "Custom S3 endpoint for S3-compatible storage (optional)",
                      "defaultValue": ""
                    },
                    "DATABASE_URL": {
                      "description": "PostgreSQL connection string from Railway PostgreSQL service",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "FORCE_BACKUP": {
                      "description": "Override respawn protection and force backup (true/false)",
                      "defaultValue": "false"
                    },
                    "METRICS_PORT": {
                      "isOptional": true,
                      "description": "Port for Prometheus metrics and health endpoints (optional, e.g., 8080)",
                      "defaultValue": ""
                    },
                    "S3_PATH_STYLE": {
                      "isOptional": true,
                      "description": "Use path-style URLs for S3 (needed for MinIO/custom endpoints)",
                      "defaultValue": "false"
                    },
                    "RETENTION_DAYS": {
                      "description": "Number of days to keep old backups, 0 to disable cleanup (default: 7)",
                      "defaultValue": "7"
                    },
                    "PG_DUMP_OPTIONS": {
                      "isOptional": true,
                      "description": "Additional pg_dump command options (e.g., --verbose --no-owner)",
                      "defaultValue": ""
                    },
                    "STORAGE_PROVIDER": {
                      "description": "Storage backend - either 'S3' or 'GCS'",
                      "defaultValue": "S3"
                    },
                    "AWS_ACCESS_KEY_ID": {
                      "isOptional": true,
                      "description": "AWS access key for S3 authentication",
                      "defaultValue": ""
                    },
                    "GOOGLE_PROJECT_ID": {
                      "isOptional": true,
                      "description": "Google Cloud project ID (when using GCS)",
                      "defaultValue": ""
                    },
                    "BACKUP_FILE_PREFIX": {
                      "description": "Prefix for backup filenames (default: backup)",
                      "defaultValue": "backup"
                    },
                    "AWS_SECRET_ACCESS_KEY": {
                      "isOptional": true,
                      "description": "AWS secret access key for S3 authentication",
                      "defaultValue": ""
                    },
                    "RESPAWN_PROTECTION_HOURS": {
                      "description": "Minimum hours between backups to prevent frequent restarts (default: 23)",
                      "defaultValue": "23"
                    },
                    "GOOGLE_SERVICE_ACCOUNT_JSON": {
                      "isOptional": true,
                      "description": "Service account JSON for GCS authentication (when using GCS)",
                      "defaultValue": ""
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 1,
    "needs_volume": false
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-18T22:09:17.869Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_b57d7dc9b0fc44acb711",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": false,
        "detail": "FAILED"
      }
    ]
  }
}
