From 296c6ddff1ff78e11afb140908eb6a0a74ea4644 Mon Sep 17 00:00:00 2001 From: librelad Date: Tue, 18 Aug 2026 21:09:33 +0100 Subject: [PATCH] fix(webui): show generated admin passwords again on the app cards MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every app with a generated admin password displayed "(not generated)" in its Login Details. The credential matcher anchored on ^CFG__(ADMIN_)?(PASSWORD)$, which stopped matching when generated keys were given slot numbers — CFG_MATRIX_ADMIN_PASSWORD_1 and friends no longer hit the regex, so the lookup fell through to its placeholder. All ten apps carrying an admin password were affected: adguard, authelia, bookstack, gitea, invidious, matrix, nextcloud, owncloud, pihole and stalwart. Allow an optional _ tail. The anchor is kept otherwise, so a database or upstream credential still cannot be mistaken for a login — CFG__DB_PASSWORD_1 does not match, which is the case the anchor was added for. Co-Authored-By: Claude Opus 5 --- .../frontend/components/apps/core/js/apps-manager.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/containers/libreportal/frontend/components/apps/core/js/apps-manager.js b/containers/libreportal/frontend/components/apps/core/js/apps-manager.js index e381e23..b5a0ca1 100755 --- a/containers/libreportal/frontend/components/apps/core/js/apps-manager.js +++ b/containers/libreportal/frontend/components/apps/core/js/apps-manager.js @@ -967,7 +967,11 @@ class AppsManager { // app's CFG prefix. Without the anchor, loose suffix matches pull in // notification-channel / upstream creds that aren't logins at all // (e.g. CFG_GLUETUN_OPENVPN_PASSWORD). - const loginKey = (kind) => new RegExp(`^CFG_${upper}_(ADMIN_)?(${kind})$`); + // The optional _ tail matches slot-numbered keys. Generated credentials + // carry a slot (CFG_MATRIX_ADMIN_PASSWORD_1) while hand-set ones usually do + // not, and an anchor that allowed neither made every app with a generated + // admin password report "(not generated)" on its own card. + const loginKey = (kind) => new RegExp(`^CFG_${upper}_(ADMIN_)?(${kind})(_\\d+)?$`); const emailKeys = Object.keys(cfg).filter(k => loginKey('EMAIL').test(k)); const userKeys = Object.keys(cfg).filter(k => loginKey('USER(NAME)?').test(k)); const passKeys = Object.keys(cfg).filter(k => loginKey('PASSWORD').test(k));