{
  "manifest_version": "1.0.0",
  "template": {
    "id": "cdbaa6e3-d476-421b-8d85-6f88035d86a3",
    "slug": "2fauth-railway",
    "name": "2FAuth",
    "description": "2FAuth | Self-hosted TOTP/HOTP manager (Authy alternative)",
    "url": "https://railway.com/deploy/2fauth-railway",
    "upstream": {
      "image": "2fauth/2fauth"
    }
  },
  "services": [
    {
      "name": "2fauth",
      "source": {
        "image": "2fauth/2fauth"
      },
      "needs_volume": true,
      "volume_mount_path": "/2fauth",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2.1"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "2fauth",
      "description": "Port the health check probes",
      "secret": false,
      "strategy": "default",
      "default": "8000"
    },
    {
      "key": "APP_ENV",
      "service": "2fauth",
      "description": "Laravel environment",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "APP_KEY",
      "service": "2fauth",
      "description": "Encrypts 2FA secrets at rest",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "APP_URL",
      "service": "2fauth",
      "description": "Public address, required by WebAuthn",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DB_HOST",
      "service": "2fauth",
      "description": "Private database hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "DB_PORT",
      "service": "2fauth",
      "description": "Database port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "APP_NAME",
      "service": "2fauth",
      "description": "App name shown in UI",
      "secret": false,
      "strategy": "default",
      "default": "2FAuth"
    },
    {
      "key": "APP_DEBUG",
      "service": "2fauth",
      "description": "Never expose stack traces",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "LOG_LEVEL",
      "service": "2fauth",
      "description": "Log verbosity",
      "secret": false,
      "strategy": "default",
      "default": "notice"
    },
    {
      "key": "REDIS_URL",
      "service": "2fauth",
      "description": "Redis connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SITE_OWNER",
      "service": "2fauth",
      "description": "Operator contact address",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "CACHE_STORE",
      "service": "2fauth",
      "description": "Cache backed by Redis",
      "secret": false,
      "strategy": "default",
      "default": "redis"
    },
    {
      "key": "DB_DATABASE",
      "service": "2fauth",
      "description": "Database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_PASSWORD",
      "service": "2fauth",
      "description": "Database password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_USERNAME",
      "service": "2fauth",
      "description": "Database user",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "LOG_CHANNEL",
      "service": "2fauth",
      "description": "Send logs to Railway",
      "secret": false,
      "strategy": "default",
      "default": "stderr"
    },
    {
      "key": "MAIL_MAILER",
      "service": "2fauth",
      "description": "Set to smtp to send real email",
      "secret": false,
      "strategy": "default",
      "default": "log"
    },
    {
      "key": "APP_TIMEZONE",
      "service": "2fauth",
      "description": "Default timezone for records",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "THROTTLE_API",
      "service": "2fauth",
      "description": "API calls per minute per IP",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "DB_CONNECTION",
      "service": "2fauth",
      "description": "Use PostgreSQL, not SQLite",
      "secret": false,
      "strategy": "default",
      "default": "pgsql"
    },
    {
      "key": "LOGIN_THROTTLE",
      "service": "2fauth",
      "description": "Failed logins per minute",
      "secret": false,
      "strategy": "default",
      "default": "5"
    },
    {
      "key": "SESSION_DRIVER",
      "service": "2fauth",
      "description": "Sessions backed by Redis",
      "secret": false,
      "strategy": "default",
      "default": "redis"
    },
    {
      "key": "RAILWAY_RUN_UID",
      "service": "2fauth",
      "description": "Needed to write to the volume",
      "secret": false,
      "strategy": "default",
      "default": "0"
    },
    {
      "key": "TRUSTED_PROXIES",
      "service": "2fauth",
      "description": "Trust Railway's edge headers",
      "secret": false,
      "strategy": "default",
      "default": "*"
    },
    {
      "key": "OTP_LOG_RETENTION",
      "service": "2fauth",
      "description": "OTP log retention in days",
      "secret": false,
      "strategy": "default",
      "default": "365"
    },
    {
      "key": "SESSION_SECURE_COOKIE",
      "service": "2fauth",
      "description": "HTTPS-only session cookie",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "WEBAUTHN_USER_VERIFICATION",
      "service": "2fauth",
      "description": "Passkey verification policy",
      "secret": false,
      "strategy": "default",
      "default": "preferred"
    },
    {
      "key": "AUTHENTICATION_LOG_RETENTION",
      "service": "2fauth",
      "description": "Auth log retention in days",
      "secret": false,
      "strategy": "default",
      "default": "365"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data directory, a subdirectory of the volume mount",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private hostname, reachable only inside the project",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Standard PostgreSQL port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "libpq alias of the superuser name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "libpq alias of the default database",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "libpq alias of the superuser password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Default database created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Private connection string, use this from other services",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity window of the generated self-signed TLS certificate",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Public connection string over the TCP proxy, for external tools",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Grace period for in-flight connections on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Private hostname, reachable only inside the project",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Standard Redis port",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Default ACL user created on first boot",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Private connection string, use this from other services",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Convenience alias of the generated password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Generated password for the default user",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDIS_PUBLIC_URL",
      "service": "Redis",
      "description": "Public connection string over the TCP proxy, for external tools",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "2fauth-railway"
      }
    },
    "cli": "railway deploy --template 2fauth-railway",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "cdbaa6e3-d476-421b-8d85-6f88035d86a3",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "9b7e7018-249c-4a9f-ba9e-991809348986": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/2fauth-light.svg",
                  "name": "2fauth",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'echo \"railway-init: booted as uid=$(id -u)\"; addgroup -g 1000 tfa 2>/dev/null; adduser -D -H -u 1000 -G tfa -s /bin/sh tfa 2>/dev/null; mkdir -p /2fauth; chown -R 1000:1000 /2fauth /srv/bootstrap/cache; exec su -p -c \"id; exec /usr/local/bin/entrypoint.sh\" tfa'",
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "2fauth/2fauth"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the health check probes",
                      "defaultValue": "8000"
                    },
                    "APP_ENV": {
                      "isOptional": false,
                      "description": "Laravel environment",
                      "defaultValue": "production"
                    },
                    "APP_KEY": {
                      "isOptional": false,
                      "description": "Encrypts 2FA secrets at rest",
                      "defaultValue": "{{APP_KEY}}"
                    },
                    "APP_URL": {
                      "isOptional": false,
                      "description": "Public address, required by WebAuthn",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DB_HOST": {
                      "isOptional": false,
                      "description": "Private database hostname",
                      "defaultValue": "${{Postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "DB_PORT": {
                      "isOptional": false,
                      "description": "Database port",
                      "defaultValue": "${{Postgres.PGPORT}}"
                    },
                    "APP_NAME": {
                      "isOptional": false,
                      "description": "App name shown in UI",
                      "defaultValue": "2FAuth"
                    },
                    "APP_DEBUG": {
                      "isOptional": false,
                      "description": "Never expose stack traces",
                      "defaultValue": "false"
                    },
                    "LOG_LEVEL": {
                      "isOptional": false,
                      "description": "Log verbosity",
                      "defaultValue": "notice"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Redis connection string",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "SITE_OWNER": {
                      "isOptional": false,
                      "description": "Operator contact address",
                      "defaultValue": "admin@example.com"
                    },
                    "CACHE_STORE": {
                      "isOptional": false,
                      "description": "Cache backed by Redis",
                      "defaultValue": "redis"
                    },
                    "DB_DATABASE": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "DB_PASSWORD": {
                      "isOptional": false,
                      "description": "Database password",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "DB_USERNAME": {
                      "isOptional": false,
                      "description": "Database user",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "LOG_CHANNEL": {
                      "isOptional": false,
                      "description": "Send logs to Railway",
                      "defaultValue": "stderr"
                    },
                    "MAIL_MAILER": {
                      "isOptional": false,
                      "description": "Set to smtp to send real email",
                      "defaultValue": "log"
                    },
                    "APP_TIMEZONE": {
                      "isOptional": false,
                      "description": "Default timezone for records",
                      "defaultValue": "UTC"
                    },
                    "THROTTLE_API": {
                      "isOptional": false,
                      "description": "API calls per minute per IP",
                      "defaultValue": "60"
                    },
                    "DB_CONNECTION": {
                      "isOptional": false,
                      "description": "Use PostgreSQL, not SQLite",
                      "defaultValue": "pgsql"
                    },
                    "LOGIN_THROTTLE": {
                      "isOptional": false,
                      "description": "Failed logins per minute",
                      "defaultValue": "5"
                    },
                    "SESSION_DRIVER": {
                      "isOptional": false,
                      "description": "Sessions backed by Redis",
                      "defaultValue": "redis"
                    },
                    "RAILWAY_RUN_UID": {
                      "isOptional": false,
                      "description": "Needed to write to the volume",
                      "defaultValue": "0"
                    },
                    "TRUSTED_PROXIES": {
                      "isOptional": false,
                      "description": "Trust Railway's edge headers",
                      "defaultValue": "*"
                    },
                    "OTP_LOG_RETENTION": {
                      "isOptional": false,
                      "description": "OTP log retention in days",
                      "defaultValue": "365"
                    },
                    "SESSION_SECURE_COOKIE": {
                      "isOptional": false,
                      "description": "HTTPS-only session cookie",
                      "defaultValue": "true"
                    },
                    "WEBAUTHN_USER_VERIFICATION": {
                      "isOptional": false,
                      "description": "Passkey verification policy",
                      "defaultValue": "preferred"
                    },
                    "AUTHENTICATION_LOG_RETENTION": {
                      "isOptional": false,
                      "description": "Auth log retention in days",
                      "defaultValue": "365"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8000": {
                        "port": 8000
                      }
                    }
                  },
                  "volumeMounts": {
                    "9b7e7018-249c-4a9f-ba9e-991809348986": {
                      "mountPath": "/2fauth"
                    }
                  }
                },
                "d061b6ff-e728-4719-930d-ec3e4f01a14b": {
                  "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": "Data directory, a subdirectory of the volume mount",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private hostname, reachable only inside the project",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Standard PostgreSQL port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "libpq alias of the superuser name",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "libpq alias of the default database",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "libpq alias of the superuser password",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Default database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string, use this from other services",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity window of the generated self-signed TLS certificate",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "description": "Public connection string over the TCP proxy, for external tools",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period for in-flight connections on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "d061b6ff-e728-4719-930d-ec3e4f01a14b": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "dc069734-cde9-47a6-90d9-b134dc353ace": {
                  "icon": "https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2.1"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Private hostname, reachable only inside the project",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Standard Redis port",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Default ACL user created on first boot",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Private connection string, use this from other services",
                      "defaultValue": "redis://${{REDISUSER}}:${{REDIS_PASSWORD}}@${{REDISHOST}}:${{REDISPORT}}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Convenience alias of the generated password",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for the default user",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    },
                    "REDIS_PUBLIC_URL": {
                      "description": "Public connection string over the TCP proxy, for external tools",
                      "defaultValue": "redis://default:${{REDIS_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}"
                    }
                  },
                  "volumeMounts": {
                    "dc069734-cde9-47a6-90d9-b134dc353ace": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "2fauth",
      "method": "GET",
      "path": "/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-10T18:07:09.751Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_0070733365ca4cb6beae",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 98,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "2fauth"
  }
}
