librelad ef100acb3c refactor(hosting): website -> containers/weblibreportal; getlibreportal = downloads-only
Move the loose root-level site/ into a proper containers/weblibreportal app
(mirrors getlibreportal): the Eleventy source + nginx serving ./data via publish.sh
(npm run build -> docroot). Fix gen-data.mjs repoRoot (now ../../.. from
containers/weblibreportal/scripts) so it still finds containers/ for the catalogue.

Decouple the two hosts:
- weblibreportal  -> the website (libreportal.org)
- getlibreportal  -> downloads only (install.sh + signed release channels); its
  publish.sh no longer builds the site, and its config text updated to match.

Both are dev-only project hosting and will move to a separate repo later; for now
they live under containers/ as normal apps. ignores updated for their built
docroots; dropped the dead 'site export-ignore'.

Verified: gen-data builds the catalogue from the new location (33 apps), and
weblibreportal/publish.sh produces a docroot with index.html.

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

109 lines
2.9 KiB
Bash

#!/bin/bash
# Category : Features
# Description : weblibreportal - The LibrePortal website (c/u/s/r/i):
installWeblibreportal()
{
local config_variables="$1"
if [[ "$weblibreportal" == *[cCtTuUsSrRiI]* ]]; then
dockerConfigSetupToContainer silent weblibreportal;
local app_name=$CFG_WEBLIBREPORTAL_APP_NAME
initializeAppVariables $app_name;
fi
if [[ "$weblibreportal" == *[cC]* ]]; then
editAppConfig $app_name;
fi
if [[ "$weblibreportal" == *[uU]* ]]; then
dockerUninstallApp $app_name;
fi
if [[ "$weblibreportal" == *[sS]* ]]; then
dockerComposeDown $app_name;
fi
if [[ "$weblibreportal" == *[rR]* ]]; then
dockerComposeRestart $app_name;
fi
if [[ "$weblibreportal" == *[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. Build the site, then browse $app_name."
echo ""
echo " The container serves an EMPTY docroot until you build the site."
echo " From a full repo checkout run:"
echo " containers/weblibreportal/publish.sh $containers_dir$app_name/data"
echo " (runs the Eleventy build → docroot)."
echo ""
menuShowFinalMessages $app_name;
menu_number=0
cd
fi
weblibreportal=n
}