Add a Private Community Apps template for the Fluxer stack.

Unraid Apps installs one container, so the template supervises the official compose bundle instead of pretending Fluxer is a single image.
This commit is contained in:
Michael Sloan committed 2026-11-23 21:47:54 -05:00
1 parent 1f6c4c0c39
commit 028c71e5a9
7 files changed
+210 -4

No files matched your search

+58
View File
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
# Runs inside the fluxer-stack container from the Community Apps template.
# Clones this repo onto the Unraid host, prepares the official compose bundle,
# and starts it through the host Docker socket. Stopping this container stops
# the Fluxer stack. Starting it brings the stack back.
set -euo pipefail
REPO_URL="${FLUXER_REPO_URL:-https://git.masengr.com/Michael-A-Sloan/Fluxer-selfhost-unraid.git}"
ROOT="${FLUXER_REPO:-/mnt/user/appdata/fluxer-selfhost}"
APPDATA="${FLUXER_APPDATA:-/mnt/user/appdata/fluxer}"
DOMAIN="${FLUXER_DOMAIN:-}"
MODE="$(printf '%s' "${FLUXER_MODE:-proxy}" | tr '[:upper:]' '[:lower:]')"
STACK=""
stop_stack() {
if [[ -n "$STACK" && -f "$STACK/docker-compose.yml" ]]; then
echo "Stopping the Fluxer compose stack."
docker compose --project-directory "$STACK" stop || true
fi
exit 0
}
if [[ -z "$DOMAIN" || "$DOMAIN" == "chat.example.com" ]]; then
echo "Set FLUXER_DOMAIN to your real hostname, not chat.example.com, then start this container again." >&2
exit 1
fi
case "$MODE" in
proxy|direct) ;;
*)
echo "FLUXER_MODE must be proxy or direct. It is: $MODE" >&2
exit 1
;;
esac
mkdir -p "$ROOT" "$APPDATA"
if [[ ! -f "$ROOT/scripts/prepare-unraid.sh" ]]; then
echo "Cloning $REPO_URL into $ROOT"
git clone --depth 1 "$REPO_URL" "$ROOT"
fi
STACK="$ROOT/stack"
export FLUXER_ALLOW_ANY_PATH=1
export FLUXER_APPDATA="$APPDATA"
export FLUXER_STACK="$STACK"
echo "Preparing Fluxer for $DOMAIN ($MODE)"
bash "$ROOT/scripts/prepare-unraid.sh" "$DOMAIN" "--$MODE"
docker compose --project-directory "$STACK" up -d
echo "Fluxer is up. This container stays running so Unraid shows the app as started."
echo "The setup token is FLUXER_SETUP_TOKEN in $STACK/.env"
trap stop_stack TERM INT
while true; do
sleep 3600
done
+43
View File
@@ -0,0 +1,43 @@
#!/usr/bin/env bash
# Copy the Fluxer template into Community Apps' Private folder, and into the
# Docker template dropdown. Run this on the Unraid server.
set -euo pipefail
cd "$(dirname "$0")/.."
SRC="unraid/fluxer.xml"
PRIVATE_DIR="/boot/config/plugins/community.applications/private/fluxer"
PRIVATE="${PRIVATE_DIR}/fluxer.xml"
USER_DIR="/boot/config/plugins/dockerMan/templates-user"
USER="${USER_DIR}/my-fluxer.xml"
if [[ ! -f "$SRC" ]]; then
echo "Missing $SRC" >&2
exit 1
fi
if [[ ! -d /boot/config/plugins ]]; then
echo "Unraid flash config was not found. Run this on the Unraid server." >&2
exit 1
fi
first="$(head -n 1 "$SRC")"
if [[ "$first" != '<?xml version="1.0"?>' ]]; then
echo "Template does not start with an XML declaration." >&2
exit 1
fi
mkdir -p "$PRIVATE_DIR" "$USER_DIR"
cp "$SRC" "$PRIVATE"
cp "$SRC" "$USER"
echo "Installed:"
echo " $PRIVATE"
echo " $USER"
echo
echo "Next:"
echo " 1. Open Apps and refresh the page."
echo " 2. Open the Private section and install Fluxer Stack."
echo " 3. Set FLUXER_DOMAIN to your hostname, then Apply."
echo
echo "The Docker page template dropdown also lists my-fluxer after a refresh."