# Jalankan tunnel ngrok ke Laragon (port 80).
# Sekali saja: daftar di https://dashboard.ngrok.com/signup lalu:
#   ngrok config add-authtoken TOKEN_ANDA

$ErrorActionPreference = "Stop"

if (-not (Get-Command ngrok -ErrorAction SilentlyContinue)) {
    Write-Host "ngrok belum terpasang. Install: winget install ngrok.ngrok" -ForegroundColor Red
    exit 1
}

Write-Host "Pastikan Laragon Apache sudah Start All." -ForegroundColor Yellow
Write-Host "Tunnel: port 80 -> https://xxxx.ngrok-free.app" -ForegroundColor Cyan
Write-Host ""
Write-Host "Setelah URL muncul, buka di HP/browser:" -ForegroundColor Green
Write-Host "  https://XXXX.ngrok-free.app/UASKTEE/" -ForegroundColor Green
Write-Host ""
Write-Host "Daftarkan di Google Cloud Console -> Authorized redirect URIs:" -ForegroundColor Green
Write-Host "  https://XXXX.ngrok-free.app/UASKTEE/callback.php" -ForegroundColor Green
Write-Host ""
Write-Host "Tekan Ctrl+C untuk stop ngrok." -ForegroundColor Yellow
Write-Host ""

ngrok http --host-header=rewrite 80
