feat(config): per-file icons before the config-section names

Config sections (Basic, Mail, DNS, Firewall, …) rendered as a bare name. Add a
small data-driven icon before each: config files now carry a `# @icon <emoji>`
directive in their header, the config generator surfaces it as the subcategory's
`icon`, and the config editor prepends it to the section <h3> (covers every
render path — regular/master/toggle/domains/catalogs/whitelist — since they all
drop displaySubcategory straight into the heading).

- webui_generate_configs.sh: parse `# @icon` (first 10 lines) → emit "icon".
- config-manager.js: prepend subcategoryData.icon to the section title.
- configs/**: added an @icon to all 23 base config files (backup/general/network/
  security/webui). The live install's config files get the same directive + a
  configs.json regen so existing installs show the icons too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
This commit is contained in:
librelad 2026-07-06 22:33:08 +01:00
parent 4242159217
commit 9b32444475
25 changed files with 43 additions and 6 deletions

View File

@ -1,5 +1,6 @@
# ================================================================================
# Backup Engine - **ADVANCED** Engine-level knobs most users won't need to touch
# @icon ⚙️
# ================================================================================
CFG_BACKUP_ENGINE=restic # Default Backup Engine - Fallback engine for new locations (each location can override) [restic:Restic|borg:BorgBackup|kopia:Kopia]
CFG_BACKUP_DEFAULT_PATH= # Default Backup Location - Base directory for locations set to Automatic path mode; each location lives in its own numbered subfolder (<path>/<id>). Empty = the LibrePortal backups root (own mount-able).

View File

@ -1,4 +1,5 @@
# ================================================================================
# Backup General - Scheduling
# @icon 💾
# ================================================================================
CFG_BACKUP_CRONTAB_APP="0 5 * * *" # App Backup Schedule - Crontab schedule for application backups

View File

@ -1,5 +1,6 @@
# ================================================================================
# Backup Retention - Default retention policy applied at every forget pass.
# @icon 🗓️
# Per-location overrides supported via the Locations edit modal.
#
# Most users should pick a "Backup style" preset on the Schedule page rather

View File

@ -1,5 +1,6 @@
# ================================================================================
# General - Basic system settings and identification
# @icon 🏷️
# ================================================================================
CFG_INSTALL_NAME=Change-Me # Installation Name - The name for your LibrePortal instance
CFG_TIMEZONE=Etc/UTC # System Timezone - Timezone for scheduled tasks and logging timestamps

View File

@ -1,5 +1,6 @@
# ================================================================================
# App Catalogs - Extra app-catalog sources the App Center browses
# @icon 🗂️
# ================================================================================
# Each slot is a catalog base URL served with a signed /<channel>/index.json
# (channel defaults to stable; append |<channel> for another). Sources are tried

View File

@ -1,5 +1,6 @@
# ================================================================================
# Docker - Container runtime installation and configuration **ADVANCED**
# @icon 🐳
# ================================================================================
CFG_DOCKER_INSTALL_TYPE=rootless # Docker Installation Type - rootless (default, recommended): containers run unprivileged so a breakout isn't host root; rooted: legacy, containers run as root [rootless|rooted]
CFG_DOCKER_INSTALL_USER=dockerinstall # Docker Install User - Username for Docker installation operations

View File

@ -1,5 +1,6 @@
# ================================================================================
# Installation Setup - Local or Git Repository configuration and version control
# @icon 📦
# ================================================================================
CFG_INSTALL_MODE=release # Installation Mode - How LibrePortal is fetched + updated. Hidden by default — only shown when Developer Mode is on (click the LibrePortal logo 10 times) or when the install is already on git/local (auto-enables Developer Mode). **DEV** [release:Release - Stable|git:Git clone|local:Local folder]
CFG_RELEASE_BASE_URL=https://get.libreportal.org # Release Host - Base URL serving the release channels (override for self-hosting) **ADVANCED**

View File

@ -1,4 +1,5 @@
# ================================================================================
# LibrePortal - Specific LibrePortal configurations **ADVANCED**
# @icon 🪐
# ================================================================================
CFG_LIBREPORTAL_USER_PASS=changeme # LibrePortal User Password - Password for the LibrePortal system user account

View File

@ -1,5 +1,6 @@
# ================================================================================
# Mail - Mail Server Settings
# @icon ✉️
# ================================================================================
CFG_MAIL_ENABLED=false # Mail Enabled - Enable mail server configuration for applications
CFG_MAIL_HOST=mail.domain.com # Mail Server Host - Your mail server hostname

View File

@ -1,5 +1,6 @@
# ================================================================================
# Terminal - System utilities and advanced settings **ADVANCED**
# @icon 🖥️
# ================================================================================
CFG_UPDATER_CHECK=60 # Update Check Interval - Hours between system update checks
CFG_SWAPFILE_SIZE=2G # Swap File Size - Size of swap file for memory management

View File

@ -1,5 +1,6 @@
# ================================================================================
# DNS - Dynamic Name Server Addresses
# @icon 🌐
# ================================================================================
CFG_DNS_SERVER_1=9.9.9.9 # Primary DNS - Primary DNS server for network resolution

View File

@ -1,5 +1,6 @@
# ================================================================================
# Docker Network - Network settings for the Docker Network **ADVANCED**
# @icon 🕸️
# ================================================================================
CFG_NETWORK_NAME=vpn # Network Name - Docker network name for container communication

View File

@ -1,5 +1,6 @@
# ================================================================================
# Domains - Domain configuration for Traefik web services
# @icon 🌍
# ================================================================================
CFG_DOMAIN_1= # Domain 1 - Domain slot 1 for a Traefik
CFG_DOMAIN_2= # Domain 2 - Domain slot 2 for a Traefik

View File

@ -1,5 +1,6 @@
# ================================================================================
# Firewall - Host firewall and port-whitelist automation **ADVANCED**
# @icon 🧱
# ================================================================================
CFG_REQUIREMENT_UFW=true # Firewall Protection - Install and configure the Uncomplicated Firewall (UFW) for system security
CFG_REQUIREMENT_UFWD=true # Docker Firewall - Install UFW-Docker for container-aware firewall management (rooted Docker only)

View File

@ -1,5 +1,6 @@
# ================================================================================
# Headscale - VPN service configuration **ADVANCED**
# @icon 🛰️
# ================================================================================
CFG_HEADSCALE_HOST= # Headscale Host - Headscale server hostname for VPN services
CFG_HEADSCALE_KEY= # Headscale Key - Authentication key for Headscale server

View File

@ -1,5 +1,6 @@
# ================================================================================
# Ports - Settings for the Network Ports **ADVANCED**
# @icon 🔌
# ================================================================================
CFG_PORT_RANGE=3000-9999 # Port allocation range - Range for port allocation Start to End

View File

@ -1,5 +1,6 @@
# ================================================================================
# Rootless Networking - Network stack and behaviour for rootless Docker **ADVANCED**
# @icon 🔀
# ================================================================================
CFG_ROOTLESS_NET=pasta # Rootless Network Driver - Network stack for rootless Docker. pasta (default): actively maintained, preserves the real client source IP on inbound connections, lower idle CPU; slirp4netns: legacy fallback, maintenance-only upstream. The matching rootlesskit port driver is selected automatically. On Debian, the installer also applies the local AppArmor override pasta needs (see scripts/docker/install/rootless/rootless_apparmor.sh) so this is a single-toggle switch. **ADVANCED** [pasta:Pasta (default, actively maintained)|slirp4netns:slirp4netns (legacy fallback)]

View File

@ -1,4 +1,5 @@
# ================================================================================
# Whitelist - Allow specific IPs for Specified Treafik Apps
# @icon ✅
# ================================================================================
CFG_IPS_WHITELIST=HOSTIPHERE # IP Whitelist - Comma separated list of allowed IP addresses

View File

@ -1,5 +1,6 @@
# ================================================================================
# Logins - User accounts and authentication credentials
# @icon 🔑
# ================================================================================
CFG_TRAEFIK_USER=RANDOMIZEDUSERNAME1 # Traefik Username - Username for Traefik Admin Panel login and protected apps
CFG_TRAEFIK_PASS=RANDOMIZEDPASSWORD2 # Traefik Password - Password for Traefik Admin Panel login and protected apps

View File

@ -1,5 +1,6 @@
# ================================================================================
# SSH & Access Hardening - Secure remote access and auth-storage toggles **ADVANCED**
# @icon 🔐
# ================================================================================
CFG_REQUIREMENT_SSHKEY_DOWNLOADER=false # SSH Key Downloader - Enable SSH key download functionality for remote access
CFG_REQUIREMENT_SSH_DISABLE_PASSWORDS=false # Disable SSH Passwords - Disable password authentication for SSH (requires key-based access only)

View File

@ -1,5 +1,6 @@
# ================================================================================
# WebUI Logins - Web interface authentication settings
# @icon 🪟
# ================================================================================
CFG_WEBUI_USERNAME=RANDOMIZEDUSERNAME1 # WebUI Username - Username for web interface login
CFG_WEBUI_PASSWORD=RANDOMIZEDPASSWORD1 # WebUI Password - Password for web interface login

View File

@ -1,5 +1,6 @@
# ================================================================================
# WebUI Logs - Log-streaming behaviour for the Services tab **ADVANCED**
# @icon 📜
# ================================================================================
CFG_WEBUI_LOG_STREAM_IDLE_TIMEOUT_MINUTES=10 # Idle Timeout - Disconnect a log stream after this much silence. The viewer overlays a Resume button so the user can re-open the stream. 0 disables.
CFG_WEBUI_LOG_STREAM_MAX_DURATION_MINUTES=60 # Max Duration - Hard cap on a single stream. Resume button appears at the cap. 0 disables (not recommended).

View File

@ -1,5 +1,6 @@
# ================================================================================
# WebUI Updater - Automatic app update, CVE & improvement scanning **ADVANCED**
# @icon 🔄
# ================================================================================
CFG_UPDATER_SCAN_INTERVAL=30 # App Scan Interval - Minutes between automatic app update/CVE/improvement scans. 0 disables.
CFG_HOTFIX_AUTO=security-breakage # Hotfix Auto-Apply - Which signed hotfix severities apply automatically on the update check [security-breakage|all|off]

View File

@ -250,6 +250,12 @@ if (typeof window.ConfigManager === 'undefined') {
if (typeof ConfigShared !== 'undefined' && ConfigShared.stripCategoryPrefix) {
displaySubcategory = ConfigShared.stripCategoryPrefix(displaySubcategory, category);
}
// Prepend the per-file icon (the "# @icon <emoji>" directive, surfaced as
// subcategoryData.icon by the config generator) before the section name —
// every renderer drops displaySubcategory straight into its <h3>.
if (subcategoryData && subcategoryData.icon) {
displaySubcategory = subcategoryData.icon + ' ' + displaySubcategory;
}
var subcategoryDescription = this.utils.cleanDescription(subcategoryData.description || '');
// The subcategoryData IS the config items, not a container for them

View File

@ -160,16 +160,22 @@ EOF
config_file="$category_dir/$subcategory"
[[ -f "$config_file" ]] || continue
# Find the first header comment ("# Title - Description") in the
# first 5 lines of the file. Was `head -5 | grep | head -1` (3
# forks); now pure bash.
# Find the first header comment ("# Title - Description") AND an
# optional "# @icon <emoji>" directive in the first 10 lines. The
# icon renders before the section name in the config editor.
header_line=""
sub_icon=""
_read_count=0
while IFS= read -r _l && (( _read_count < 5 )); do
while IFS= read -r _l && (( _read_count < 10 )); do
((_read_count++))
if [[ "$_l" == \#*' - '* ]]; then
if [[ -z "$header_line" && "$_l" == \#*' - '* ]]; then
header_line="$_l"
break
fi
if [[ -z "$sub_icon" && "$_l" == '#'*'@icon '* ]]; then
sub_icon="${_l#*@icon }"
sub_icon="${sub_icon%$'\r'}"
sub_icon="${sub_icon#"${sub_icon%%[![:space:]]*}"}"
sub_icon="${sub_icon%"${sub_icon##*[![:space:]]}"}"
fi
done < "$config_file"
@ -190,6 +196,7 @@ EOF
description="${description%"${description##*[![:space:]]}"}"
title=$(jsonEscape "$title")
description=$(jsonEscape "$description")
sub_icon=$(jsonEscape "$sub_icon")
if [[ $first_subcategory == true ]]; then
first_subcategory=false
@ -199,6 +206,7 @@ EOF
fi
printf ' "title": "%s",\n' "$title" >> "$temp_file"
printf ' "description": "%s",\n' "$description" >> "$temp_file"
printf ' "icon": "%s",\n' "$sub_icon" >> "$temp_file"
printf ' "category": "%s"\n' "$category_name" >> "$temp_file"
printf ' }\n' >> "$temp_file"
done