librelad 061fa5e391 fix(lazy-load): count both braces per line so embedded awk doesn't strand the depth tracker
`webuiSystemUpdate` was calling `webuiSystemMetrics` and getting
"command not found": the lazy-load manifest was missing it (and
`webuiSystemApps`), even though both are defined in
webui_system_metrics.sh.

Cause: the manifest scanner's awk-based depth tracker is line-based.
The first function in that file, `_metricsReadCpu`, contains an
embedded awk script:

    _metricsReadCpu() {
        awk '/^cpu /{        <-- the open brace runs to end-of-line, depth += 1
            ...
        }' /proc/stat        <-- the close brace is mid-line, NOT counted
    }                        <-- depth-- but we started one too high

The increment rule fired for the `/^cpu /{` line (open brace at EOL),
the matching close on the `}' /proc/stat` line was not counted because
the existing depth>0 branch only decremented when stripped was EXACTLY
`}`. Result: depth ended at 1 instead of 0 after _metricsReadCpu, and
every subsequent funcname() header was treated as "still inside a
function" and silently dropped. Same pattern across the ~6 files the
lazy-loader memory called out as "false-positive eager".

Fix: in the depth>0 branch, count open AND close braces per line
symmetrically and apply the net delta. Drops the redundant "exactly
`}`" special-case rule, clamps depth at 0 as a sanity backstop. False
positives from braces inside string literals could under/over-count
locally, but the clamp + the next legitimate `funcname()` header at
depth-0 re-anchors the tracker.

Result on a full regen:
  - 858 → 876 functions indexed (+18 previously-stranded)
  - webuiSystemMetrics + webuiSystemApps now correctly autoloaded
  - eager-file count: 9 → 11 (two files that genuinely have both
    function defs and top-level side effects are now correctly seen
    both as eager AND get their functions indexed — net win on
    every axis)

Verified live: the WebUI updater that was failing with "command not
found" now prints "Updated system information..." cleanly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-27 00:10:35 +01:00
2026-05-21 20:37:54 +01:00

LibrePortal

Your own private corner of the internet — free, open, and yours.

LibrePortal is a self-hosted platform for running the apps you rely on, on your own server: one-click installs, a reverse proxy with automatic SSL, rootless Docker, optional VPN routing, and a clean web dashboard to manage it all.

⚠️ v0.1.0 — early days. Expect rough edges while things settle.

Why LibrePortal

Too many services today treat your data as theirs to take — quietly overstepping boundaries that should never have been crossed. LibrePortal grew out of frustration with that: it's a way to run the apps you depend on on your own server, where your data stays yours. Privacy here isn't a feature to toggle — it's the whole point.

Free & open — forever

The entire platform is free software under the GNU AGPLv3. Self-host it and you get everything — every feature, no paywalls, no telemetry. See our Promise for exactly what that means.

What you get

  • 📦 One-click self-hosted apps (Nextcloud, Vaultwarden, Jellyfin, Gitea, …)
  • 🔀 Traefik reverse proxy + automatic Let's Encrypt SSL
  • 🔒 Rootless Docker, CrowdSec, sane security defaults
  • 🛡️ Optional VPN routing (gluetun) for any app
  • 🖥️ A web dashboard to install, configure, back up, and monitor everything

Quick start

curl -fsSL https://get.libreportal.org/install.sh | sudo bash

This installs a versioned, checksum-verified release (Debian/Ubuntu, root). Put data on separate disks with --system-dir= / --containers-dir= / --backups-dir=.

The get.libreportal.org host is still being set up — until it's live, build a release and install from it locally (see the docs below).

Documentation

  • docs/USER.md — install, place data on separate disks/drives, update, back up, uninstall.
  • docs/DEVELOPMENT.md — run a dev copy, cut stable/edge releases, and test them before publishing.

LibrePortal Connect (optional)

Self-hosting is free and complete. If you'd rather not fiddle with the tricky parts — like reaching your server from your phone, or keeping off-site backups — LibrePortal Connect will handle them for you. Here's the catch that makes us different: we work like a courier carrying a sealed box. We move your data between your devices and store backup copies, but it stays locked and you hold the only key — we can't open it, and we never run your apps for you. Everything we offer, you can also set up yourself for free. Our Promise spells out exactly where that line sits.

Contributing

PRs welcome — see CONTRIBUTING.md. We use a lightweight DCO sign-off (git commit -s), no CLA.

Acknowledgments

LibrePortal has been built from scratch since 2023. Its spark of inspiration was a small installer script from Brian McGonagill (OpenSourceIsAwesome): gitlab.com/bmcgonag/docker_installs. From that seed it grew start to finish — refined, extended, and refactored into the platform it is today.

License

GNU AGPLv3. What's open stays open.

Description
No description provided
Readme AGPL-3.0 12 MiB
Languages
Shell 45.2%
JavaScript 38.5%
CSS 11.6%
TypeScript 3.1%
HTML 1.5%