Compare commits

..

No commits in common. "69641dafd9f1ac42ceeb08830fe5c8ca4ae25c14" and "e24927ee6f17eada8eafe8eaa7e041b5bfc412b8" have entirely different histories.

3 changed files with 11 additions and 7 deletions

View File

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

View File

@ -1,15 +1,11 @@
#!/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.
appWebuiRefresh_gluetun() {
webuiGenerateGluetunProviders() {
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)"
@ -82,3 +78,11 @@ appWebuiRefresh_gluetun() {
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..."
appWebuiRefresh_gluetun
webuiGenerateGluetunProviders
isSuccessful "Provider snapshot regenerated."
}