Merge claude/1

This commit is contained in:
librelad 2026-05-25 23:48:47 +01:00
commit 69641dafd9
3 changed files with 7 additions and 11 deletions

View File

@ -96,7 +96,7 @@ installGluetun()
echo "---- $menu_number. Refreshing Gluetun provider snapshot."
echo ""
webuiGenerateGluetunProviders;
appWebuiRefresh_gluetun;
((menu_number++))
echo ""

View File

@ -1,11 +1,15 @@
#!/bin/bash
# Per-app routine WebUI-refresh hook (appWebuiRefresh_<app>): webui_updater calls
# it on every WebUI update while gluetun is installed; the installer (gluetun.sh)
# and the 'gluetun_refresh_providers' tool call it directly too.
#
# Fetches gluetun's upstream servers.json, slims it down to a
# { providers: { <name>: { vpnTypes, countries } } } shape, and writes it
# to the WebUI data dir so the per-app config dropdowns stay honest as
# gluetun adds/removes providers and protocols. Falls back silently to the
# previous snapshot (or the bundled default) on network failure.
webuiGenerateGluetunProviders() {
appWebuiRefresh_gluetun() {
local output_file="${containers_dir}libreportal/frontend/data/apps/generated/gluetun-providers.json"
local upstream="https://raw.githubusercontent.com/qdm12/gluetun/master/internal/storage/servers.json"
local tmp="$(mktemp)"
@ -78,11 +82,3 @@ webuiGenerateGluetunProviders() {
isNotice "Empty gluetun snapshot generated; ignoring."
fi
}
# Routine WebUI-update hook (appWebuiRefresh_<app>): keep the provider snapshot
# fresh on every WebUI update while gluetun is installed. The installer
# (gluetun.sh) refreshes on first install and the 'gluetun_refresh_providers'
# tool refreshes on demand; this covers the in-between drift.
appWebuiRefresh_gluetun() {
webuiGenerateGluetunProviders
}

View File

@ -11,6 +11,6 @@ appGluetunRefreshProviders()
local tool_args="$1"
isNotice "Refreshing Gluetun provider snapshot..."
webuiGenerateGluetunProviders
appWebuiRefresh_gluetun
isSuccessful "Provider snapshot regenerated."
}