CI / test (push) Successful in 2m26s
- service.v: --install-service / --uninstall-service / --service-status Windows (sc.exe SCM), Linux systemd, Linux openrc — auto-détection OS - main.v: nouveaux flags service, help mis à jour - Dockerfile: multi-stage (V from source → alpine:3.20 minimal) - docker-compose.yml: prêt à l'emploi avec healthcheck - scripts/install.sh: one-liner Linux (detect OS/arch, build, install) - scripts/install.ps1: one-liner Windows PowerShell Docs: ROADMAP Phase 4.5 marqué DONE, version 0.4.5
66 lines
2.5 KiB
PowerShell
66 lines
2.5 KiB
PowerShell
# ntfy-bridge Windows installer
|
|
# Run: powershell -ExecutionPolicy Bypass -File install.ps1
|
|
|
|
param(
|
|
[string]$ConfigPath = "ntfy-bridge.yaml"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
Write-Host "╔══════════════════════════════════════════════════════════════╗" -ForegroundColor Cyan
|
|
Write-Host "║ ntfy-bridge Windows installer ║" -ForegroundColor Cyan
|
|
Write-Host "╚══════════════════════════════════════════════════════════════╝" -ForegroundColor Cyan
|
|
Write-Host ""
|
|
|
|
# Check if V is installed
|
|
$v = Get-Command v -ErrorAction SilentlyContinue
|
|
if (-not $v) {
|
|
Write-Host "V compiler not found. Downloading..."
|
|
|
|
# Download V weekly build
|
|
$vUrl = "https://github.com/vlang/v/releases/download/weekly.2024.32/v_windows.zip"
|
|
$vZip = "$env:TEMP\v_windows.zip"
|
|
$vDir = "$env:LOCALAPPDATA\v"
|
|
|
|
Invoke-WebRequest -Uri $vUrl -OutFile $vZip
|
|
Expand-Archive -Path $vZip -DestinationPath $vDir -Force
|
|
Remove-Item $vZip
|
|
|
|
$env:PATH = "$vDir\v;$env:PATH"
|
|
Write-Host "V installed to $vDir"
|
|
}
|
|
|
|
# Build
|
|
Write-Host "Building ntfy-bridge..."
|
|
v -prod -o ntfy-bridge.exe .
|
|
|
|
# Copy to a permanent location
|
|
$installDir = "$env:ProgramFiles\ntfy-bridge"
|
|
New-Item -ItemType Directory -Force -Path $installDir | Out-Null
|
|
Copy-Item -Force ntfy-bridge.exe $installDir\
|
|
Copy-Item -Force dashboard.html $installDir\
|
|
|
|
# Copy example config if not exists
|
|
if (-not (Test-Path "$installDir\ntfy-bridge.yaml")) {
|
|
Copy-Item ntfy-bridge.example.yaml "$installDir\ntfy-bridge.yaml"
|
|
Write-Host ""
|
|
Write-Host " ⚠️ Edit $installDir\ntfy-bridge.yaml to configure your sources!" -ForegroundColor Yellow
|
|
}
|
|
|
|
# Install as Windows service
|
|
Write-Host "Installing as Windows service..."
|
|
& "$installDir\ntfy-bridge.exe" --install-service --config "$installDir\ntfy-bridge.yaml" 2>&1 | Out-Null
|
|
|
|
Write-Host ""
|
|
Write-Host "Done! ntfy-bridge is installed and running as a Windows service." -ForegroundColor Green
|
|
Write-Host ""
|
|
Write-Host " Install dir: $installDir"
|
|
Write-Host " Config: $installDir\ntfy-bridge.yaml"
|
|
Write-Host " Dashboard: http://localhost:9090/"
|
|
Write-Host " Health: http://localhost:9090/health"
|
|
Write-Host ""
|
|
Write-Host " Service commands:"
|
|
Write-Host " sc query ntfy-bridge"
|
|
Write-Host " sc stop ntfy-bridge"
|
|
Write-Host " sc start ntfy-bridge"
|