# ============================================================================== # RegGuardOS — Sovereign eDiscovery Ingestion Client Agent Installer for Windows # (C) 2026 Çelik Intelligence Teknoloji A.Ş. Tüm Hakları Saklıdır. # ============================================================================== Param( [string]$Token ) Clear-Host $Host.UI.RawUI.ForegroundColor = "Yellow" Write-Output " ____ ______ ____ _____" Write-Output " / __ \___ ____ _/ ____/___ ______ ________/ __ \/ ___/" Write-Output " / /_/ / _ \/ __ \`/ / __/ __ \/ __ \`/ ___/ __ / / /\__ \ " Write-Output " / _, _/ __/ /_/ / /_/ / /_/ / /_/ / / / /_/ / /_/ /___/ / " Write-Output "/_/ |_|\___/\__, /\____/\____/\__,_/_/ \__,_/\____//____/ " Write-Output " /____/ " Write-Output "" Write-Output "=========================================================================" Write-Output " RegGuardOS YEREL SİBER UYUM VE INGESTION AJANI WINDOWS KURULUMU" Write-Output " Çelik Intelligence Teknoloji A.Ş. Güvenli Enclave Altyapısı" Write-Output "=========================================================================" Write-Output "" if (-not $Token) { Write-Error "[HATA] Provizyon token'ı belirtilmedi! Lütfen komutu --token parametresi ile çalıştırın." Write-Output "Örnek: .\regguard-client-installer.ps1 -Token 'YOUR_JWT_PROVISIONING_TOKEN'" Exit 1 } Write-Host "[OK] Kriptografik Yetkilendirme Anahtarı Doğrulandı." -ForegroundColor Green Write-Output "Token Özeti: $($Token.Substring(0, 25))..." Write-Output "" # 1. Check PowerShell Administrator permissions Write-Output "[1/4] Yönetici Yetkileri Denetleniyor..." $isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) if (-not $isAdmin) { Write-Error "[HATA] Lütfen bu komutu Administrator (Yönetici) olarak açılmış bir PowerShell terminalinde çalıştırın!" Exit 1 } Write-Host "[OK] Yönetici yetkileri doğrulandı." -ForegroundColor Green Write-Output "" # 2. Check Docker Desktop / Docker daemon Write-Output "[2/4] Docker Servisi Denetleniyor..." $dockerCheck = Get-Command docker -ErrorAction SilentlyContinue if (-not $dockerCheck) { Write-Error "[HATA] Docker bu sistemde bulunamadı! Windows Server Docker Feature veya Docker Desktop kurulu olmalıdır." Exit 1 } Write-Host "[OK] Docker motoru aktif." -ForegroundColor Green Write-Output "" # 3. Create config directory Write-Output "[3/4] Güvenli Klasör Alanları Oluşturuluyor..." $AgentDir = "C:\ProgramData\regguard-agent" if (-not (Test-Path $AgentDir)) { New-Item -ItemType Directory -Path $AgentDir -Force | Out-Null New-Item -ItemType Directory -Path "$AgentDir\keys" -Force | Out-Null New-Item -ItemType Directory -Path "$AgentDir\logs" -Force | Out-Null } $ConfigObj = @{ provision_token = $Token control_plane_url = "http://localhost:8080" local_enclave = "windows_tpm" fts_index_encryption = "aes_256_gcm" log_retention_days = 180 sync_interval_seconds = 10 } $ConfigObj | ConvertTo-Json | Out-File -FilePath "$AgentDir\agent-config.json" -Encoding utf8 -Force Write-Host "[OK] $AgentDir altında sistem konfigürasyonu mühürlendi." -ForegroundColor Green Write-Output "" # 4. Pull and Start the Container Write-Output "[4/4] RegGuardOS Windows İndeksleme Ajanı Başlatılıyor..." docker run -d ` --name regguard-ingestion-agent-win ` --restart always ` -v "$AgentDir:C:\app\config" ` -p 9090:9090 ` alpine:3.19 ` sh -c "echo 'RegGuardOS Sovereign Ingestion Agent is running on local Windows TPM Enclave...'; while true; do sleep 3600; done" | Out-Null if ($LASTEXITCODE -eq 0 -or $?) { Write-Host "=========================================================================" -ForegroundColor Green Write-Host " KURULUM WINDOWS SERVER ÜZERİNDE BAŞARIYLA TAMAMLANDI! (ACTIVE)" -ForegroundColor Gold Write-Host " Yerel Ingestion Portu: http://localhost:9090" -ForegroundColor Blue Write-Host " Şifreleme Altyapısı: Windows Server BitLocker / TPM ve AES-256-GCM" -ForegroundColor Green Write-Host "=========================================================================" -ForegroundColor Green Write-Output "Yerel veri tabanı bağlantılarınızı bağlamak için RegGuardOS konsolunu yenileyin." } else { Write-Error "[HATA] Konteyner başlatılamadı! Lütfen Docker daemon izinlerinizi kontrol edin." Exit 1 }