Linux x86_64 offline release; configurable API and bundled PostgreSQL ports.

- packaging/linux: netx-<ver>-linux-x86_64.tar.gz with bundled Python 3.12,
  PostgreSQL 16 and web/dist (glibc >= 2.17). install.sh (install/update/
  reinstall), netxctl (start/stop/status/logs, set-port, set-bind,
  set-pg-port, reconfigure-db, check-update/update/auto-update, backup,
  uninstall), systemd units, nohup fallback without systemd. Privilege
  drop, detaching and tar go through the bundled Python, so bare images
  without su/runuser/setsid/tar work.
- Updates: same GitHub/Forgejo/manifest sources as Windows, sha256
  verified, pre-update pg_dump, automatic rollback when the new version
  does not come up.
- Non-loopback bind: generated bootstrap admin password and
  NETX_UME_VERIFY_TLS=true, as security_bootstrap requires.
- Build in manylinux2014 + check_bundle.sh (GLIBC <= 2.17, no missing
  libs); release-linux.yml builds on v* tags and smoke-tests offline on
  CentOS 7, Rocky 9, Ubuntu 18.04/24.04, Debian 12, openSUSE Leap 15 and
  openEuler 22.03 before attaching to the release.
- Windows: Setup DB page gets a bundled PG port field and
  /BundledPgPort=; set_pg_port.ps1 + tray "Built-in database port";
  reconfigure keeps the configured port; postgresql.conf is written
  without a BOM (PS 5.1 Set-Content -Encoding utf8 broke postgres).
- Forgejo/GitHub publish scripts include the Linux package.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
oliver 2026-10-14 10:09:07 +08:00
parent c141a37263
commit 846aa3e680
26 changed files with 3120 additions and 9 deletions

View file

@ -214,6 +214,7 @@ try {
$runtimePs1 = Join-Path $PSScriptRoot "runtime_ctl.ps1"
$checkPs1 = Join-Path $PSScriptRoot "check_update.ps1"
$setupPs1 = Join-Path $PSScriptRoot "setup_first_run.ps1"
$pgPortPs1 = Join-Path $PSScriptRoot "set_pg_port.ps1"
$autostartPs1 = Join-Path $PSScriptRoot "install_autostart.ps1"
$updateTaskPs1 = Join-Path $PSScriptRoot "install_update_task.ps1"
@ -631,6 +632,7 @@ $miSource = New-NetxMenuItem -Text (T "Update source" "更新源") -Glyph "updat
$miSourceGithub = New-NetxMenuItem -Text (T "GitHub (default)" "GitHub(默认)") -Glyph "check"
$miSourceForgejo = New-NetxMenuItem -Text "git.avelo.top" -Glyph "check"
$miReconfig = New-NetxMenuItem -Text (T "Reconfigure database…" "重新配置数据库…") -Glyph "repair"
$miPgPort = New-NetxMenuItem -Text (T "Built-in database port…" "内置数据库端口…") -Glyph "settings"
$miLogs = New-NetxMenuItem -Text (T "Open log folder" "打开日志目录") -Glyph "log"
$miData = New-NetxMenuItem -Text (T "Open data folder" "打开数据目录") -Glyph "folder"
$miUpdate = New-NetxMenuItem -Text (T "Check for updates…" "检查更新…") -Glyph "update"
@ -640,7 +642,7 @@ $miStopExit = New-NetxMenuItem -Text (T "Stop NetX and exit" "停止 NetX 并退
[void]$miSource.DropDownItems.AddRange(@($miSourceGithub, $miSourceForgejo))
[void]$miSettings.DropDownItems.AddRange(@(
$miAutostart, $miAutoUpdate, $miSource, (New-NetxMenuSeparator),
$miReconfig, $miLogs, $miData
$miReconfig, $miPgPort, $miLogs, $miData
))
[void]$menu.Items.AddRange(@(
$miHeader, $miStatus, (New-NetxMenuSeparator),
@ -844,6 +846,30 @@ $miReconfig.add_Click({
}
})
$miPgPort.add_Click({
Invoke-NetxTrayDeferred {
if ($script:dbModeLabel -ne (T "Built-in DB" "内置库")) {
Show-NetxDialog (T "NetX uses an external database; use Reconfigure database instead." "当前使用外置数据库,请改用“重新配置数据库”。") "Information" | Out-Null
return
}
try {
$p = Start-NetxChild -File $pgPortPs1 -WindowStyle Normal
} catch {
Show-NetxDialog ((T "Could not change the port: " "无法修改端口:") + $_.Exception.Message) "Error" | Out-Null
return
}
Watch-NetxProcess $p {
param($sp)
$code = Get-NetxExitCode $sp
if ($null -ne $code -and $code -ne 0) {
Show-NetxDialog ((T "Changing the port failed (exit $code)." "修改端口失败(退出码 $code)。")) "Error" | Out-Null
return
}
Read-NetxTrayConfig
}
}
})
# --- updates ---
function Restart-NetxTraySelf {
$trayFile = Join-Path $PSScriptRoot "netx_tray.ps1"