webuiLibrePortalUpdate runs the per-app refresh hooks on every update (the task processor fires it repeatedly), and gluetun's hook silently pulls a ~7MB servers.json from GitHub each time. The hook's stdout is captured by `result=$($_hook)`, so on a slow link the update just sits with no output right after "Generated apps-tools.json..." — it reads as a freeze. - Throttle the fetch to once per CFG_GLUETUN_PROVIDERS_REFRESH_HOURS (24h default; 0 = manual-only). Direct callers (Tools refresh, install hook) pass GLUETUN_PROVIDERS_FORCE=1 to still get a guaranteed pull. - curl --compressed (this JSON gzips ~7x) + --connect-timeout 15 so a slow or dead link shrinks/fails fast instead of stalling every update. - Print "Refreshing <app> WebUI data..." from the updater loop (outside the output capture) so the step is visible instead of looking hung. Signed-off-by: librelad <librelad@digitalangels.vip> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
36 lines
993 B
Bash
36 lines
993 B
Bash
#!/bin/bash
|
|
|
|
# Gluetun install hooks — post-start provider snapshot refresh + reattach
|
|
# any apps routed through gluetun (their network_mode holds a stale
|
|
# container ID after gluetun was just recreated) + offer to onboard
|
|
# existing apps.
|
|
|
|
gluetun_install_post_start()
|
|
{
|
|
local app_name="$1"
|
|
|
|
((menu_number++))
|
|
echo ""
|
|
echo "---- $menu_number. Refreshing Gluetun provider snapshot."
|
|
echo ""
|
|
|
|
GLUETUN_PROVIDERS_FORCE=1 appWebuiRefresh_gluetun
|
|
|
|
((menu_number++))
|
|
echo ""
|
|
echo "---- $menu_number. Re-attaching gluetun-routed apps (post-recreate)."
|
|
echo ""
|
|
|
|
# Gluetun was just (re)created — every existing routed app holds a
|
|
# stale container ID in its network_mode. Reattach them now so the
|
|
# user doesn't have to chase silent netns drift later.
|
|
appGluetunRoutedRecreate
|
|
|
|
((menu_number++))
|
|
echo ""
|
|
echo "---- $menu_number. Routing existing apps through Gluetun (optional)."
|
|
echo ""
|
|
|
|
gluetunRouteExistingAppsPrompt
|
|
}
|