Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion deploy/scripts/check-native-vps-health.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ for protected_service in x-ui.service callsnif.service vpn-misa-bot.service; do
fi
done

if curl --fail --silent --show-error --max-time 15 "${PUBLIC_BASE_URL%/}/healthz" >/dev/null; then
health_ready=0
for _attempt in {1..10}; do
if curl --fail --silent --max-time 15 "${PUBLIC_BASE_URL%/}/healthz" >/dev/null; then
health_ready=1
break
fi
sleep 2
done
if [ "${health_ready}" -eq 1 ]; then
printf 'OK %s/healthz\n' "${PUBLIC_BASE_URL%/}"
else
printf 'FAIL %s/healthz\n' "${PUBLIC_BASE_URL%/}" >&2
Expand Down
9 changes: 9 additions & 0 deletions docs/releases/v0.3.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Borotalk v0.3.1 — исправление VPS bundle

Патч исправляет переносы строк Linux-файлов в нативном VPS-установщике,
собранном на Windows.

- shell entrypoints и конфигурация systemd/Nginx/coturn всегда упаковываются с
LF-переносами;
- сборка автоматически распаковывает и проверяет критичные entrypoints;
- функциональность v0.3.0 и формат установки не изменились.
24 changes: 24 additions & 0 deletions scripts/Build-NativeVpsBundle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ try {
$targetPath = Join-Path $stagingRoot $relativePath
New-Item -ItemType Directory -Path (Split-Path -Parent $targetPath) -Force | Out-Null
Copy-Item -LiteralPath $sourcePath -Destination $targetPath
# Git may check files out with CRLF on Windows. Linux entrypoints and
# systemd/nginx/coturn configuration must be packaged with LF endings.
if ($relativePath -like "*.sh" -or $relativePath -like "deploy/native/*") {
$bytes = [System.IO.File]::ReadAllBytes($targetPath)
$text = [System.Text.Encoding]::UTF8.GetString($bytes).Replace("`r`n", "`n")
[System.IO.File]::WriteAllText(
$targetPath,
$text,
[System.Text.UTF8Encoding]::new($false)
)
}
}

tar -czf $archivePath -C $stagingRoot .
Expand All @@ -46,6 +57,19 @@ try {
if ("./.env" -in $archiveListing -or "./.env.local-vps" -in $archiveListing) {
throw "Refusing to include a local environment file in the VPS bundle."
}
$validationRoot = Join-Path $temporaryRoot "validation"
New-Item -ItemType Directory -Path $validationRoot -Force | Out-Null
tar -xzf $archivePath -C $validationRoot ./INSTALL_VPS_NATIVE.sh ./deploy/scripts/backup-native-data.sh
if ($LASTEXITCODE -ne 0) { throw "Could not validate Linux entrypoints." }
foreach ($entrypoint in @(
(Join-Path $validationRoot "INSTALL_VPS_NATIVE.sh"),
(Join-Path $validationRoot "deploy/scripts/backup-native-data.sh")
)) {
$bytes = [System.IO.File]::ReadAllBytes($entrypoint)
if ($bytes -contains 13) {
throw "Linux entrypoint contains a carriage return: $entrypoint"
}
}

$header = @'
#!/usr/bin/env bash
Expand Down
Loading