librelad 63b53c7751 feat(hosting): getlibreportal as a first-class LibrePortal app (phase E)
Redo the download/website host as a normal app under containers/ (dogfooded — the
project hosts its own downloads on LibrePortal), instead of the bespoke repo-root
thing. Modeled on speedtest: standard getlibreportal.{config,sh,svg} +
docker-compose.yml (tagged template) so it plugs into the app scan + install
dispatch (installGetlibreportal) like every other app. nginx serves ./data (the
app data dir) — no special /web.

- getlibreportal.config: features category, public (login=false — it's a download
  host), no backup (regenerable), healthcheck on.
- docker-compose.yml: nginx:alpine, ./data:ro docroot + ./nginx.conf, traefik tags.
- nginx.conf: install.sh + latest.json no-cache; tarball/.sha256/.minisig immutable.
- publish.sh: assembles the docroot (built site + install.sh + dist/<channel>) into
  a target data dir; run on a full repo checkout (site/ + dist/ are host-side).
- exec bits set on the run-directly scripts (make_release.sh, install.sh, publish.sh).
- .gitattributes: dropped the stray 'getlibreportal export-ignore' (the no-slash
  pattern would also have excluded containers/getlibreportal — the app must ship);
  data/ gitignored.

Verified: app discovered by the site catalog (32 apps), installGetlibreportal matches
the dispatch name, and the full release->publish flow yields a docroot with the
website + install.sh + the signed/checksummed stable channel. The actual app-install
run + DNS/TLS for get.libreportal.org are operational steps (need a real host).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-25 20:02:47 +01:00

109 lines
3.0 KiB
Bash

#!/bin/bash
# Category : Features
# Description : getlibreportal - Website + signed-release host (c/u/s/r/i):
installGetlibreportal()
{
local config_variables="$1"
if [[ "$getlibreportal" == *[cCtTuUsSrRiI]* ]]; then
dockerConfigSetupToContainer silent getlibreportal;
local app_name=$CFG_GETLIBREPORTAL_APP_NAME
initializeAppVariables $app_name;
fi
if [[ "$getlibreportal" == *[cC]* ]]; then
editAppConfig $app_name;
fi
if [[ "$getlibreportal" == *[uU]* ]]; then
dockerUninstallApp $app_name;
fi
if [[ "$getlibreportal" == *[sS]* ]]; then
dockerComposeDown $app_name;
fi
if [[ "$getlibreportal" == *[rR]* ]]; then
dockerComposeRestart $app_name;
fi
if [[ "$getlibreportal" == *[iI]* ]]; then
isHeader "Install $app_name"
((menu_number++))
echo ""
echo "---- $menu_number. Setting up install folder and config file for $app_name."
echo ""
dockerConfigSetupToContainer "loud" "$app_name" "install" "$config_variables";
isSuccessful "Install folders and Config files have been setup for $app_name."
((menu_number++))
echo ""
echo "---- $menu_number. Setting up the $app_name docker-compose.yml file."
echo ""
dockerComposeSetupFile $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Updating file permissions before starting."
echo ""
fixPermissionsBeforeStart $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Running the docker-compose.yml to install and start $app_name"
echo ""
dockerComposeUpdateAndStartApp $app_name install;
((menu_number++))
echo ""
echo "---- $menu_number. Running Application specific updates (if required)"
echo ""
appUpdateSpecifics $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Running Headscale setup (if required)"
echo ""
setupHeadscale $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Adding $app_name to the Apps Database table."
echo ""
databaseInstallApp $app_name;
((menu_number++))
echo ""
echo "---- $menu_number. Updating WebUI config file."
echo ""
webuiContainerSetup $app_name install;
((menu_number++))
echo ""
echo "---- $menu_number. Populate the docroot, then browse $app_name."
echo ""
echo " The container serves an EMPTY docroot until you publish content."
echo " From a full repo checkout (build/release machine) run:"
echo " containers/getlibreportal/publish.sh $containers_dir$app_name/data"
echo " (builds the site + copies install.sh + the dist/<channel> releases)."
echo ""
menuShowFinalMessages $app_name;
menu_number=0
cd
fi
getlibreportal=n
}