`libreportal app generate <name>` (and the menu's "g. Generate App" entry)
was broken three independent ways and incompatible with the per-app
architecture the project actually uses now:
1. Copies from $install_containers_dir/template/ which doesn't exist —
the only template/ in the tree was in scripts/unused/OLD_CONTAINERS/
and was never installed into the live tree. cp -r would just fail.
2. Every sed call used BSD/macOS syntax `sed -i '' -e …`. On Linux
(every distro this targets) the empty '' becomes a positional file
argument, so the substitutions never ran. 8 calls, all broken.
3. Even if it had run, the produced skeleton would have been a
pre-modular-tools / pre-per-port-subdomain app shape: no tools/,
no scripts/ subdir, HOST_NAME=test in the .config. Every active
containers/<app>/ today carries the modular layout the rest of the
framework expects.
Plus the recent cleanups (the prompt loop fix in 9ffc8e4, the per-port
subdomain refactor in 2e4f420) had been peeling pieces off it without
the root question — does the function still belong? — getting asked.
Delete the whole surface:
- scripts/app/app_generate.sh (157 lines, the function body)
- scripts/unused/OLD_CONTAINERS/template/ (the never-installed source
files appGenerate would have copied — stale enough to still carry
HOST_NAME=test, CFG_<X>_HOST_NAME, and 248 lines of compose template)
- menu entry "g. Generate App" + its dispatch in menu_main.sh
- "generate" case branch in cli_app_commands.sh
- `libreportal app generate` line in cli_app_header.sh
- The corresponding entries auto-drop from files_app.sh +
function_manifest.sh via regen.
New apps are added the way the catalog already grew — by hand-crafting
containers/<app>/{<app>.sh, <app>.config, docker-compose.yml,
tools/<app>.tools.json, scripts/<app>_*.sh}. Copying an existing app's
folder + renaming is the closest thing to a "generator" and it's a one-
command operation.
Net: -556 lines, no behaviour lost (the function never worked).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
40 lines
2.4 KiB
Bash
Executable File
40 lines
2.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# App Commands Header
|
|
# Shows available app commands and help information
|
|
|
|
cliShowAppHelp()
|
|
{
|
|
echo ""
|
|
echo "Available App Commands (* is required):"
|
|
echo ""
|
|
echo " libreportal app list [type*] - Display a list of applications"
|
|
echo " available - Show available apps to install"
|
|
echo " installed - Show installed apps"
|
|
echo ""
|
|
echo " libreportal app install [name*] [config] [--reset-network]"
|
|
echo " - Install / reinstall the specified app."
|
|
echo " On reinstall, IPs and ports are preserved by default."
|
|
echo " Pass --reset-network to re-randomize them."
|
|
echo " libreportal app uninstall [name*] - Uninstall the specified app"
|
|
echo ""
|
|
echo " libreportal app start [name*] - Start the specified app (Must be installed)"
|
|
echo " libreportal app stop [name*] - Stop the specified app (Must be installed)"
|
|
echo " libreportal app restart [name*] - Restart the specified app (Must be installed)"
|
|
echo ""
|
|
echo " libreportal app up [name*] - Docker-Compose up (Rebuild app)"
|
|
echo " libreportal app down [name*] - Docker-Compose up (Uninstall app)"
|
|
echo " libreportal app reload [name*] - Docker-Compose up & down (Reinstall app)"
|
|
echo ""
|
|
echo " libreportal app backup [name*] [password] - Backup the specified app (password optional)"
|
|
echo " libreportal app restore [name*] [file|--latest] [password] - Restore from local/remote, prefers local"
|
|
echo " libreportal app restore [name*] [local|remote1|remote2] [file] [password]"
|
|
echo " - Restore from a specific location"
|
|
echo " libreportal app status [name*] - Show status of specified app"
|
|
echo " libreportal app tool [name*] [tool*] [args]"
|
|
echo " - Run a per-app tool (Tools tab actions)."
|
|
echo " [args] is pipe-encoded: key=value|key=value"
|
|
echo " libreportal app tool list [name] - List available tools (all apps, or just [name])"
|
|
echo ""
|
|
}
|