{
  "manifest_version": "1.0.0",
  "template": {
    "id": "bf5670dd-2b3f-4ae6-8715-6d6c54570c67",
    "slug": "deploy-yourls",
    "name": "YOURLS",
    "description": "Open-source URL shortener with click stats and its own API",
    "url": "https://railway.com/deploy/deploy-yourls",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/yourls-railway"
    }
  },
  "services": [
    {
      "name": "MySQL",
      "source": {
        "image": "mysql:9.4"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/mysql",
      "http": false
    },
    {
      "name": "YOURLS",
      "source": {
        "repo": "https://github.com/gridalpha/yourls-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/www/html/user",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "MYSQLHOST",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLPORT",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "3306"
    },
    {
      "key": "MYSQLUSER",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "root"
    },
    {
      "key": "MYSQL_URL",
      "service": "MySQL",
      "description": "Private connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "MYSQLDATABASE",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQLPASSWORD",
      "service": "MySQL",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "MYSQL_DATABASE",
      "service": "MySQL",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "MYSQL_ROOT_PASSWORD",
      "service": "MySQL",
      "description": "Superuser password, read by the server",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "YOURLS",
      "description": "Apache listening port",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "YOURLS_PASS",
      "service": "YOURLS",
      "description": "Admin password",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "YOURLS_SITE",
      "service": "YOURLS",
      "description": "Public base URL, no trailing slash",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "YOURLS_USER",
      "service": "YOURLS",
      "description": "Admin username",
      "secret": false,
      "strategy": "default",
      "default": "admin"
    },
    {
      "key": "YOURLS_DB_HOST",
      "service": "YOURLS",
      "description": "MySQL host and port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "YOURLS_DB_NAME",
      "service": "YOURLS",
      "description": "Database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "yourls"
    },
    {
      "key": "YOURLS_DB_PASS",
      "service": "YOURLS",
      "description": "Password for the scoped role",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "YOURLS_DB_USER",
      "service": "YOURLS",
      "description": "Scoped role created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "yourls"
    },
    {
      "key": "YOURLS_PRIVATE",
      "service": "YOURLS",
      "description": "Restrict links and stats to the admin",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "YOURLS_COOKIEKEY",
      "service": "YOURLS",
      "description": "Signs the session cookie",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "YOURLS_ADMIN_DATABASE_URL",
      "service": "YOURLS",
      "description": "Admin URL, used only to provision",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_HEALTHCHECK_TIMEOUT_SEC",
      "service": "YOURLS",
      "description": "First boot waits for MySQL",
      "secret": false,
      "strategy": "default",
      "default": "600"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "deploy-yourls"
      }
    },
    "cli": "railway deploy --template deploy-yourls",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "bf5670dd-2b3f-4ae6-8715-6d6c54570c67",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "3b2957ec-6c09-406c-be21-4a65d3dfa16d": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mysql.svg",
                  "name": "MySQL",
                  "deploy": {
                    "startCommand": "docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0 --innodb-buffer-pool-size=1G",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "mysql:9.4"
                  },
                  "variables": {
                    "MYSQLHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "MYSQLPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "3306"
                    },
                    "MYSQLUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "root"
                    },
                    "MYSQL_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "mysql://${{MYSQLUSER}}:${{MYSQL_ROOT_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:3306/${{MYSQL_DATABASE}}"
                    },
                    "MYSQLDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{MYSQL_DATABASE}}"
                    },
                    "MYSQLPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{MYSQL_ROOT_PASSWORD}}"
                    },
                    "MYSQL_DATABASE": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "MYSQL_ROOT_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, read by the server",
                      "defaultValue": "{{MYSQL_ROOT_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "3b2957ec-6c09-406c-be21-4a65d3dfa16d": {
                      "mountPath": "/var/lib/mysql"
                    }
                  }
                },
                "4a5f3419-deee-4f97-a099-ce38399b8071": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/yourls.svg",
                  "name": "YOURLS",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/admin/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/yourls-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Apache listening port",
                      "defaultValue": "8080"
                    },
                    "YOURLS_PASS": {
                      "isOptional": false,
                      "description": "Admin password",
                      "defaultValue": "{{YOURLS_PASS}}"
                    },
                    "YOURLS_SITE": {
                      "isOptional": false,
                      "description": "Public base URL, no trailing slash",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "YOURLS_USER": {
                      "isOptional": false,
                      "description": "Admin username",
                      "defaultValue": "admin"
                    },
                    "YOURLS_DB_HOST": {
                      "isOptional": false,
                      "description": "MySQL host and port",
                      "defaultValue": "${{MySQL.MYSQLHOST}}:${{MySQL.MYSQLPORT}}"
                    },
                    "YOURLS_DB_NAME": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "yourls"
                    },
                    "YOURLS_DB_PASS": {
                      "isOptional": false,
                      "description": "Password for the scoped role",
                      "defaultValue": "{{YOURLS_DB_PASS}}"
                    },
                    "YOURLS_DB_USER": {
                      "isOptional": false,
                      "description": "Scoped role created on first boot",
                      "defaultValue": "yourls"
                    },
                    "YOURLS_PRIVATE": {
                      "isOptional": true,
                      "description": "Restrict links and stats to the admin",
                      "defaultValue": "true"
                    },
                    "YOURLS_COOKIEKEY": {
                      "isOptional": false,
                      "description": "Signs the session cookie",
                      "defaultValue": "{{YOURLS_COOKIEKEY}}"
                    },
                    "YOURLS_ADMIN_DATABASE_URL": {
                      "isOptional": false,
                      "description": "Admin URL, used only to provision",
                      "defaultValue": "${{MySQL.MYSQL_URL}}"
                    },
                    "RAILWAY_HEALTHCHECK_TIMEOUT_SEC": {
                      "isOptional": true,
                      "description": "First boot waits for MySQL",
                      "defaultValue": "600"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "4a5f3419-deee-4f97-a099-ce38399b8071": {
                      "mountPath": "/var/www/html/user"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "YOURLS",
      "method": "GET",
      "path": "/admin/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-09T22:14:39.753Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-09T19:50:16.804Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_d2ec108bc96e46f08246",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 114,
    "typical_build_seconds": 41,
    "typical_start_seconds": 10,
    "slowest_service": "YOURLS"
  }
}
