LibrePortal/containers/owncloud/scripts/owncloud_setup_config.sh
librelad 898068a390 refactor(apps): make app tools + helpers fully self-contained per app
Each app now carries everything under containers/<app>/: Tools-tab actions in
tools/ (declaration <app>.tools.json + function <app>_<tool_id>.sh) and logic
helpers in scripts/ (e.g. <app>_auth.sh). The container scan live-sources every
.sh under the app (maxdepth 3, prunes only resources/) and webui_tools.sh
auto-merges the .tools.json, so an app is a true drop-in — no central edit, no
array regen.

- Empty the central webui_tools.sh heredoc; all 34 tools across 11 apps now
  come from per-app declarations (verified byte-identical to the old output).
- Retire the orphaned mattermost tool scripts to scripts/unused (there is no
  containers/mattermost; its install fn already lived in unused).
- Update the dispatch comment/error path, the auth-adapter doc, and
  DEVELOPMENT.md to the new convention.
- Regenerate static arrays (files_app.sh no longer lists app/containers/*).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-05-25 22:45:33 +01:00

29 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
appOwnCloudSetupConfig()
{
isNotice "ownCloud is currently being set up, please wait..."
isNotice "This may take a few minutes..."
echo ""
# Run the health check loop with timings
dockerCheckContainerHealthLoop "owncloud" 180 15
# If container is healthy
if dockerCheckContainerHealth "owncloud"; then
isSuccessful "OwnCloud container is healthy, continuing with the install."
# config.php is owned by the in-container uid (165568), so the whole
# normalise (wait for ownCloud to write it, strip the default
# trusted_domains/overwrite.cli.url, append the LibrePortal ones, fix
# ownership) runs in the root-owned appcfg helper with validated args.
if runAppCfg owncloud-config "$public" "$host_setup" "$ip_setup" "$public_ip_v4"; then
isSuccessful "ownCloud config.php normalised (trusted_domains + overwrite.cli.url)."
else
isError "Failed to normalise ownCloud config.php."
fi
else
isError "Container is not healthy. Setup seems to have failed."
fi
}