LibrePortal/containers/marketplace/scripts/marketplace_install_hooks.sh
librelad 897f514735 feat(marketplace): the marketplace server ships as a dev-mode LibrePortal app
containers/marketplace — nginx:alpine app (standard drop-in contract:
config + tagged compose + icon + install hook) whose docroot serves BOTH
halves of the marketplace: the signed catalog channel tree (index.json /
payloads, published into data/<channel>/ by the release tools) and a
self-contained client-rendered browse site over the same file (search,
category chips, trust badges, copyable 'libreportal app add <slug>' —
no third-party assets, no backend, no build step). The official
marketplace is an instance of this app; self-hosting one = installing it
and pointing CFG_RELEASE_BASE_URL at it. Boxes only ever trust the
minisign signature on the catalog, never the website.

New generic gating convention: CFG_<APP>_DEV_ONLY=true keeps an app out
of the App Center grid unless Developer Mode is on (CFG_DEV_MODE, the
same flag the **DEV** config-field filter uses); an installed dev-only
app always stays visible. The marketplace app is the first user.

Cache policy: catalog/channel manifests no-cache; payloads short
revalidating cache (same-id re-publish); version-pinned release
artifacts immutable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: librelad <librelad@digitalangels.vip>
2026-07-03 21:40:33 +01:00

19 lines
834 B
Bash

#!/bin/bash
# Marketplace install hooks — seed the served docroot. The generic installApp
# driver handles compose/start; this converges the browse-UI files on every
# (re)install (always refreshed from the definition), while published channel
# data (stable/, edge/ — the operator's signed catalog) is never touched.
marketplace_install_post_setup()
{
local app_name="$1"
local src="${install_containers_dir%/}/$app_name/resources/site"
local dest="$containers_dir$app_name/data"
runFileOp mkdir -p "$dest" || return 1
runFileOp cp -f "$src/index.html" "$dest/index.html" || return 1
runFileOp cp -f "${install_containers_dir%/}/$app_name/$app_name.svg" "$dest/marketplace.svg" || return 1
isSuccessful "Marketplace site seeded. Publish a catalog into it: rsync dist/<channel>/ $dest/<channel>/"
}