diff --git a/.gitattributes b/.gitattributes index 8c151b6..22c1e1e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3,7 +3,6 @@ # trees never ship in libreportal-.tar.gz. scripts/unused export-ignore scripts/release export-ignore -site export-ignore docs export-ignore .claude export-ignore .gitignore export-ignore diff --git a/.gitignore b/.gitignore index eb5512e..2a1f175 100644 --- a/.gitignore +++ b/.gitignore @@ -14,5 +14,7 @@ npm-debug.log* # Release build output (scripts/release/make_release.sh). /dist/ -# getlibreportal assembled docroot (built by containers/getlibreportal/publish.sh). +# Assembled docroots built by the hosting apps' publish.sh (dev-only). containers/getlibreportal/data/ +containers/weblibreportal/data/ +containers/weblibreportal/dist/ diff --git a/containers/getlibreportal/getlibreportal.config b/containers/getlibreportal/getlibreportal.config index b160168..e02a74f 100644 --- a/containers/getlibreportal/getlibreportal.config +++ b/containers/getlibreportal/getlibreportal.config @@ -22,8 +22,8 @@ CFG_GETLIBREPORTAL_HEADSCALE=false # ============================================================================= CFG_GETLIBREPORTAL_CATEGORY="features" CFG_GETLIBREPORTAL_TITLE="LibrePortal Downloads" -CFG_GETLIBREPORTAL_DESCRIPTION="Website + signed-release host" -CFG_GETLIBREPORTAL_LONG_DESCRIPTION="Serves the LibrePortal website, the install.sh bootstrap, and signed/checksummed release artifacts — i.e. the get.libreportal.org host. Populate its docroot with containers/getlibreportal/publish.sh." +CFG_GETLIBREPORTAL_DESCRIPTION="install.sh + signed-release host" +CFG_GETLIBREPORTAL_LONG_DESCRIPTION="Serves the install.sh bootstrap and signed/checksummed release artifacts — i.e. the get.libreportal.org host. Populate its docroot with containers/getlibreportal/publish.sh. (The website is a separate app: weblibreportal.)" CFG_GETLIBREPORTAL_URL="https://get.libreportal.org" CFG_GETLIBREPORTAL_ACTIONS="configure|install|restart|shutdown|uninstall" # diff --git a/containers/getlibreportal/getlibreportal.sh b/containers/getlibreportal/getlibreportal.sh index 791feba..3cfd675 100644 --- a/containers/getlibreportal/getlibreportal.sh +++ b/containers/getlibreportal/getlibreportal.sh @@ -96,7 +96,8 @@ installGetlibreportal() 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/ releases)." + echo " (copies install.sh + the dist/ releases; the website is" + echo " a separate app, weblibreportal)." echo "" menuShowFinalMessages $app_name; diff --git a/containers/getlibreportal/publish.sh b/containers/getlibreportal/publish.sh index f5d1cc4..cdb149d 100644 --- a/containers/getlibreportal/publish.sh +++ b/containers/getlibreportal/publish.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash # -# Assemble the getlibreportal docroot — the website + install.sh + release -# channels — into the served data dir. Run on a FULL repo checkout (build/release -# machine), since it needs ../../site and ../../dist (both export-ignored, i.e. -# not in release tarballs). +# Assemble the getlibreportal docroot — the bootstrap installer + release channels +# — into the served data dir. (The website is a separate app: weblibreportal.) +# Run on a full repo checkout (it reads ../../dist, which is host-side). # # Usage: publish.sh [TARGET_DIR] # TARGET_DIR defaults to ./data (next to this script). On a host where the app @@ -11,7 +10,6 @@ # containers/getlibreportal/publish.sh /libreportal-containers/getlibreportal/data # # Layout produced: -# / ← built website (repo: site/) # /install.sh ← bootstrap installer (repo: install.sh) # //… ← release manifests + tarballs (repo: dist//) set -euo pipefail @@ -22,22 +20,12 @@ TARGET="${1:-$HERE/data}" echo "Assembling getlibreportal docroot -> $TARGET" mkdir -p "$TARGET" -# Clean only the things we manage (keep the dir itself / its mount). rm -rf "${TARGET:?}"/* "${TARGET:?}"/.??* 2>/dev/null || true -# 1. Website (optional — skip cleanly without the toolchain). -if [[ -d "$ROOT/site" ]] && command -v npm >/dev/null 2>&1; then - ( cd "$ROOT/site" && npm install --silent && npm run build ) - cp -a "$ROOT/site/dist/." "$TARGET/" 2>/dev/null || true - echo " ✓ website" -else - echo " ! site build skipped (no site/ or no npm) — install.sh + releases still published" -fi - -# 2. Bootstrap installer. +# 1. Bootstrap installer. if [[ -f "$ROOT/install.sh" ]]; then cp -f "$ROOT/install.sh" "$TARGET/install.sh"; echo " ✓ install.sh"; fi -# 3. Release channels (from scripts/release/make_release.sh). +# 2. Release channels (from scripts/release/make_release.sh). if [[ -d "$ROOT/dist" ]]; then for ch in "$ROOT/dist"/*/; do [[ -d "$ch" ]] || continue diff --git a/site/.gitignore b/containers/weblibreportal/.gitignore similarity index 100% rename from site/.gitignore rename to containers/weblibreportal/.gitignore diff --git a/containers/weblibreportal/docker-compose.yml b/containers/weblibreportal/docker-compose.yml new file mode 100644 index 0000000..769b052 --- /dev/null +++ b/containers/weblibreportal/docker-compose.yml @@ -0,0 +1,40 @@ +networks: + DOCKER_NETWORK_DATA: #LIBREPORTAL|DOCKER_NETWORK_TAG|DOCKER_NETWORK_DATA + external: true + +services: + weblibreportal-service: #LIBREPORTAL|SERVICE_TAG_1|weblibreportal-service + container_name: weblibreportal-service + image: nginx:alpine + restart: unless-stopped + hostname: weblibreportal + # ./data is the built website (Eleventy → publish.sh). Read-only into nginx. + volumes: + - ./data:/usr/share/nginx/html:ro + - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro + # GLUETUN_OFF_BEGIN + ports: + - "PORTS_DATA_1" #LIBREPORTAL|PORTS_TAG_1|PORTS_DATA_1 + # GLUETUN_OFF_END + labels: + libreportal.category: "CATEGORY_DATA" #LIBREPORTAL|CATEGORY_TAG|CATEGORY_DATA + libreportal.title: "TITLE_DATA" #LIBREPORTAL|TITLE_TAG|TITLE_DATA + traefik.enable: TRAEFIK_ENABLE_DATA #LIBREPORTAL|TRAEFIK_ENABLE_TAG|TRAEFIK_ENABLE_DATA + # TRAEFIK_PORT_1_BEGIN + traefik.http.routers.weblibreportal-service.entrypoints: web,websecure + traefik.http.routers.weblibreportal-service.rule: Host(`DOMAINSUBNAME_DATA_1`) #LIBREPORTAL|DOMAINSUBNAME_TAG_1|DOMAINSUBNAME_DATA_1 + traefik.http.routers.weblibreportal-service.tls: true + traefik.http.routers.weblibreportal-service.tls.certresolver: production + traefik.http.services.weblibreportal-service.loadbalancer.server.port: PORT_INTERNAL_DATA_1 #LIBREPORTAL|PORT_INTERNAL_TAG_1|PORT_INTERNAL_DATA_1 + traefik.http.routers.weblibreportal-service.middlewares: MIDDLEWARE_DATA_1 #LIBREPORTAL|MIDDLEWARE_TAG_1|MIDDLEWARE_DATA_1 + # TRAEFIK_PORT_1_END + healthcheck: + disable: HEALTHCHECK_DATA #LIBREPORTAL|HEALTHCHECK_TAG|HEALTHCHECK_DATA + # GLUETUN_OFF_BEGIN + networks: + DOCKER_NETWORK_DATA: #LIBREPORTAL|DOCKER_NETWORK_TAG|DOCKER_NETWORK_DATA + ipv4_address: IP_DATA_1 #LIBREPORTAL|IP_TAG_1|IP_DATA_1 + # GLUETUN_OFF_END + # GLUETUN_ON_BEGIN + # network_mode: "container:gluetun-service" + # GLUETUN_ON_END diff --git a/site/eleventy.config.cjs b/containers/weblibreportal/eleventy.config.cjs similarity index 100% rename from site/eleventy.config.cjs rename to containers/weblibreportal/eleventy.config.cjs diff --git a/containers/weblibreportal/nginx.conf b/containers/weblibreportal/nginx.conf new file mode 100644 index 0000000..b837668 --- /dev/null +++ b/containers/weblibreportal/nginx.conf @@ -0,0 +1,16 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Static website (Eleventy output). Long-cache the hashed assets; let HTML + # revalidate so content updates show promptly. + location ~* \.(?:css|js|svg|png|jpg|jpeg|gif|ico|woff2?)$ { + add_header Cache-Control "public, max-age=2592000"; + } + location / { + add_header Cache-Control "no-cache, must-revalidate"; + try_files $uri $uri/ $uri.html =404; + } +} diff --git a/site/package-lock.json b/containers/weblibreportal/package-lock.json similarity index 100% rename from site/package-lock.json rename to containers/weblibreportal/package-lock.json diff --git a/site/package.json b/containers/weblibreportal/package.json similarity index 100% rename from site/package.json rename to containers/weblibreportal/package.json diff --git a/containers/weblibreportal/publish.sh b/containers/weblibreportal/publish.sh new file mode 100644 index 0000000..87b8960 --- /dev/null +++ b/containers/weblibreportal/publish.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# +# Build the LibrePortal website (Eleventy) and publish it into the served docroot. +# Run on a full repo checkout (it reads ../*/*.config to build the app catalogue). +# +# Usage: publish.sh [TARGET_DIR] +# TARGET_DIR defaults to ./data (next to this script). On a host where the app +# is installed, pass its live data dir, e.g.: +# containers/weblibreportal/publish.sh /libreportal-containers/weblibreportal/data +set -euo pipefail + +HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +TARGET="${1:-$HERE/data}" + +command -v npm >/dev/null 2>&1 || { echo "publish.sh: npm is required to build the website" >&2; exit 1; } + +echo "Building the website ..." +( cd "$HERE" && npm install --silent && npm run build ) # → ./dist (runs gen-data + eleventy) + +echo "Publishing -> $TARGET" +mkdir -p "$TARGET" +rm -rf "${TARGET:?}"/* "${TARGET:?}"/.??* 2>/dev/null || true +cp -a "$HERE/dist/." "$TARGET/" + +echo "Done. Restart the container to serve it." diff --git a/site/scripts/gen-data.mjs b/containers/weblibreportal/scripts/gen-data.mjs similarity index 97% rename from site/scripts/gen-data.mjs rename to containers/weblibreportal/scripts/gen-data.mjs index 506d84e..a1ef598 100644 --- a/site/scripts/gen-data.mjs +++ b/containers/weblibreportal/scripts/gen-data.mjs @@ -14,7 +14,7 @@ import { fileURLToPath } from 'node:url'; import { dirname, join, resolve } from 'node:path'; const here = dirname(fileURLToPath(import.meta.url)); -const repoRoot = resolve(here, '..', '..'); // site/scripts -> repo root +const repoRoot = resolve(here, '..', '..', '..'); // containers/weblibreportal/scripts -> repo root const containersDir = join(repoRoot, 'containers'); const dataDir = join(here, '..', 'src', '_data'); const iconsDir = join(here, '..', 'src', 'assets', 'apps'); diff --git a/site/src/_data/site.json b/containers/weblibreportal/src/_data/site.json similarity index 100% rename from site/src/_data/site.json rename to containers/weblibreportal/src/_data/site.json diff --git a/site/src/_includes/app-card.njk b/containers/weblibreportal/src/_includes/app-card.njk similarity index 100% rename from site/src/_includes/app-card.njk rename to containers/weblibreportal/src/_includes/app-card.njk diff --git a/site/src/_includes/footer.njk b/containers/weblibreportal/src/_includes/footer.njk similarity index 100% rename from site/src/_includes/footer.njk rename to containers/weblibreportal/src/_includes/footer.njk diff --git a/site/src/_includes/layout.njk b/containers/weblibreportal/src/_includes/layout.njk similarity index 100% rename from site/src/_includes/layout.njk rename to containers/weblibreportal/src/_includes/layout.njk diff --git a/site/src/_includes/topbar.njk b/containers/weblibreportal/src/_includes/topbar.njk similarity index 100% rename from site/src/_includes/topbar.njk rename to containers/weblibreportal/src/_includes/topbar.njk diff --git a/site/src/assets/apps/adguard.svg b/containers/weblibreportal/src/assets/apps/adguard.svg similarity index 100% rename from site/src/assets/apps/adguard.svg rename to containers/weblibreportal/src/assets/apps/adguard.svg diff --git a/site/src/assets/apps/authelia.svg b/containers/weblibreportal/src/assets/apps/authelia.svg similarity index 100% rename from site/src/assets/apps/authelia.svg rename to containers/weblibreportal/src/assets/apps/authelia.svg diff --git a/site/src/assets/apps/bookstack.svg b/containers/weblibreportal/src/assets/apps/bookstack.svg similarity index 100% rename from site/src/assets/apps/bookstack.svg rename to containers/weblibreportal/src/assets/apps/bookstack.svg diff --git a/site/src/assets/apps/crowdsec.svg b/containers/weblibreportal/src/assets/apps/crowdsec.svg similarity index 100% rename from site/src/assets/apps/crowdsec.svg rename to containers/weblibreportal/src/assets/apps/crowdsec.svg diff --git a/site/src/assets/apps/dashy.svg b/containers/weblibreportal/src/assets/apps/dashy.svg similarity index 100% rename from site/src/assets/apps/dashy.svg rename to containers/weblibreportal/src/assets/apps/dashy.svg diff --git a/site/src/assets/apps/default.svg b/containers/weblibreportal/src/assets/apps/default.svg similarity index 100% rename from site/src/assets/apps/default.svg rename to containers/weblibreportal/src/assets/apps/default.svg diff --git a/site/src/assets/apps/focalboard.svg b/containers/weblibreportal/src/assets/apps/focalboard.svg similarity index 100% rename from site/src/assets/apps/focalboard.svg rename to containers/weblibreportal/src/assets/apps/focalboard.svg diff --git a/site/src/assets/apps/gitea.svg b/containers/weblibreportal/src/assets/apps/gitea.svg similarity index 100% rename from site/src/assets/apps/gitea.svg rename to containers/weblibreportal/src/assets/apps/gitea.svg diff --git a/site/src/assets/apps/gluetun.svg b/containers/weblibreportal/src/assets/apps/gluetun.svg similarity index 100% rename from site/src/assets/apps/gluetun.svg rename to containers/weblibreportal/src/assets/apps/gluetun.svg diff --git a/site/src/assets/apps/grafana.svg b/containers/weblibreportal/src/assets/apps/grafana.svg similarity index 100% rename from site/src/assets/apps/grafana.svg rename to containers/weblibreportal/src/assets/apps/grafana.svg diff --git a/site/src/assets/apps/headscale.svg b/containers/weblibreportal/src/assets/apps/headscale.svg similarity index 100% rename from site/src/assets/apps/headscale.svg rename to containers/weblibreportal/src/assets/apps/headscale.svg diff --git a/site/src/assets/apps/invidious.svg b/containers/weblibreportal/src/assets/apps/invidious.svg similarity index 100% rename from site/src/assets/apps/invidious.svg rename to containers/weblibreportal/src/assets/apps/invidious.svg diff --git a/site/src/assets/apps/ipinfo.svg b/containers/weblibreportal/src/assets/apps/ipinfo.svg similarity index 100% rename from site/src/assets/apps/ipinfo.svg rename to containers/weblibreportal/src/assets/apps/ipinfo.svg diff --git a/site/src/assets/apps/jellyfin.svg b/containers/weblibreportal/src/assets/apps/jellyfin.svg similarity index 100% rename from site/src/assets/apps/jellyfin.svg rename to containers/weblibreportal/src/assets/apps/jellyfin.svg diff --git a/site/src/assets/apps/jitsimeet.svg b/containers/weblibreportal/src/assets/apps/jitsimeet.svg similarity index 100% rename from site/src/assets/apps/jitsimeet.svg rename to containers/weblibreportal/src/assets/apps/jitsimeet.svg diff --git a/site/src/assets/apps/libreportal.svg b/containers/weblibreportal/src/assets/apps/libreportal.svg similarity index 100% rename from site/src/assets/apps/libreportal.svg rename to containers/weblibreportal/src/assets/apps/libreportal.svg diff --git a/site/src/assets/apps/linkding.svg b/containers/weblibreportal/src/assets/apps/linkding.svg similarity index 100% rename from site/src/assets/apps/linkding.svg rename to containers/weblibreportal/src/assets/apps/linkding.svg diff --git a/site/src/assets/apps/mastodon.svg b/containers/weblibreportal/src/assets/apps/mastodon.svg similarity index 100% rename from site/src/assets/apps/mastodon.svg rename to containers/weblibreportal/src/assets/apps/mastodon.svg diff --git a/site/src/assets/apps/nextcloud.svg b/containers/weblibreportal/src/assets/apps/nextcloud.svg similarity index 100% rename from site/src/assets/apps/nextcloud.svg rename to containers/weblibreportal/src/assets/apps/nextcloud.svg diff --git a/site/src/assets/apps/ollama.svg b/containers/weblibreportal/src/assets/apps/ollama.svg similarity index 100% rename from site/src/assets/apps/ollama.svg rename to containers/weblibreportal/src/assets/apps/ollama.svg diff --git a/site/src/assets/apps/onlyoffice.svg b/containers/weblibreportal/src/assets/apps/onlyoffice.svg similarity index 100% rename from site/src/assets/apps/onlyoffice.svg rename to containers/weblibreportal/src/assets/apps/onlyoffice.svg diff --git a/site/src/assets/apps/owncloud.svg b/containers/weblibreportal/src/assets/apps/owncloud.svg similarity index 100% rename from site/src/assets/apps/owncloud.svg rename to containers/weblibreportal/src/assets/apps/owncloud.svg diff --git a/site/src/assets/apps/pihole.svg b/containers/weblibreportal/src/assets/apps/pihole.svg similarity index 100% rename from site/src/assets/apps/pihole.svg rename to containers/weblibreportal/src/assets/apps/pihole.svg diff --git a/site/src/assets/apps/portainer.svg b/containers/weblibreportal/src/assets/apps/portainer.svg similarity index 100% rename from site/src/assets/apps/portainer.svg rename to containers/weblibreportal/src/assets/apps/portainer.svg diff --git a/site/src/assets/apps/prometheus.svg b/containers/weblibreportal/src/assets/apps/prometheus.svg similarity index 100% rename from site/src/assets/apps/prometheus.svg rename to containers/weblibreportal/src/assets/apps/prometheus.svg diff --git a/site/src/assets/apps/searxng.svg b/containers/weblibreportal/src/assets/apps/searxng.svg similarity index 100% rename from site/src/assets/apps/searxng.svg rename to containers/weblibreportal/src/assets/apps/searxng.svg diff --git a/site/src/assets/apps/speedtest.svg b/containers/weblibreportal/src/assets/apps/speedtest.svg similarity index 100% rename from site/src/assets/apps/speedtest.svg rename to containers/weblibreportal/src/assets/apps/speedtest.svg diff --git a/site/src/assets/apps/traefik.svg b/containers/weblibreportal/src/assets/apps/traefik.svg similarity index 100% rename from site/src/assets/apps/traefik.svg rename to containers/weblibreportal/src/assets/apps/traefik.svg diff --git a/site/src/assets/apps/trilium.svg b/containers/weblibreportal/src/assets/apps/trilium.svg similarity index 100% rename from site/src/assets/apps/trilium.svg rename to containers/weblibreportal/src/assets/apps/trilium.svg diff --git a/site/src/assets/apps/unbound.svg b/containers/weblibreportal/src/assets/apps/unbound.svg similarity index 100% rename from site/src/assets/apps/unbound.svg rename to containers/weblibreportal/src/assets/apps/unbound.svg diff --git a/site/src/assets/apps/vaultwarden.svg b/containers/weblibreportal/src/assets/apps/vaultwarden.svg similarity index 100% rename from site/src/assets/apps/vaultwarden.svg rename to containers/weblibreportal/src/assets/apps/vaultwarden.svg diff --git a/site/src/assets/apps/wireguard.svg b/containers/weblibreportal/src/assets/apps/wireguard.svg similarity index 100% rename from site/src/assets/apps/wireguard.svg rename to containers/weblibreportal/src/assets/apps/wireguard.svg diff --git a/site/src/assets/favicon.ico b/containers/weblibreportal/src/assets/favicon.ico similarity index 100% rename from site/src/assets/favicon.ico rename to containers/weblibreportal/src/assets/favicon.ico diff --git a/site/src/assets/libreportal.svg b/containers/weblibreportal/src/assets/libreportal.svg similarity index 100% rename from site/src/assets/libreportal.svg rename to containers/weblibreportal/src/assets/libreportal.svg diff --git a/site/src/assets/main.js b/containers/weblibreportal/src/assets/main.js similarity index 100% rename from site/src/assets/main.js rename to containers/weblibreportal/src/assets/main.js diff --git a/site/src/assets/style.css b/containers/weblibreportal/src/assets/style.css similarity index 100% rename from site/src/assets/style.css rename to containers/weblibreportal/src/assets/style.css diff --git a/site/src/index.njk b/containers/weblibreportal/src/index.njk similarity index 100% rename from site/src/index.njk rename to containers/weblibreportal/src/index.njk diff --git a/containers/weblibreportal/weblibreportal.config b/containers/weblibreportal/weblibreportal.config new file mode 100644 index 0000000..7eca311 --- /dev/null +++ b/containers/weblibreportal/weblibreportal.config @@ -0,0 +1,45 @@ +# +# ============================================================================= +# GENERAL CONFIGURATION +# ============================================================================= +# APP_NAME = name of application for use in scripts +# COMPOSE_FILE = default for no app_name in docker-compose file name, app if there is +# BACKUP = if true, include this application in backup operations +# HEALTHCHECK = if true, default docker health checks for that container will be enabled +# AUTHELIA = if true, use Authelia authentication, if false turned off. +# HEADSCALE = options : false, local, remote (see general config). e.g false or local,remote +# +CFG_WEBLIBREPORTAL_APP_NAME=weblibreportal +CFG_WEBLIBREPORTAL_BACKUP=false +CFG_WEBLIBREPORTAL_BACKUP_STRATEGY=auto +CFG_WEBLIBREPORTAL_COMPOSE_FILE=default +CFG_WEBLIBREPORTAL_HEALTHCHECK=true +CFG_WEBLIBREPORTAL_AUTHELIA=false +CFG_WEBLIBREPORTAL_HEADSCALE=false +# +# ============================================================================= +# METADATA +# ============================================================================= +CFG_WEBLIBREPORTAL_CATEGORY="features" +CFG_WEBLIBREPORTAL_TITLE="LibrePortal Website" +CFG_WEBLIBREPORTAL_DESCRIPTION="The libreportal.org marketing/docs site" +CFG_WEBLIBREPORTAL_LONG_DESCRIPTION="The LibrePortal website (Eleventy), data-driven from the app catalogue. Build + publish its docroot with containers/weblibreportal/publish.sh." +CFG_WEBLIBREPORTAL_URL="https://libreportal.org" +CFG_WEBLIBREPORTAL_ACTIONS="configure|install|restart|shutdown|uninstall" +# +# ============================================================================= +# NETWORK CONFIGURATION +# ============================================================================= +# DOMAIN = number of domain from the general config, useful when using multiple domains +# WHITELIST = if true only allow whitelisted ips on traefik, if false allow all +# +CFG_WEBLIBREPORTAL_DOMAIN=1 +CFG_WEBLIBREPORTAL_WHITELIST=false +CFG_WEBLIBREPORTAL_NETWORK=default +# +# ============================================================================= +# PORT CONFIGURATION +# ============================================================================= +# PORT_ = app|name|external:internal|access|protocol|login|traefik|webui|title|path|slug +# +CFG_WEBLIBREPORTAL_PORT_1="weblibreportal-service|webui|random:80|public|tcp|false|true|true|Website|/|weblibreportal" diff --git a/containers/weblibreportal/weblibreportal.sh b/containers/weblibreportal/weblibreportal.sh new file mode 100644 index 0000000..fee5aa1 --- /dev/null +++ b/containers/weblibreportal/weblibreportal.sh @@ -0,0 +1,108 @@ +#!/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 +} diff --git a/containers/weblibreportal/weblibreportal.svg b/containers/weblibreportal/weblibreportal.svg new file mode 100644 index 0000000..a197da1 --- /dev/null +++ b/containers/weblibreportal/weblibreportal.svg @@ -0,0 +1,5 @@ + + + + +