Add Unraid Docker templates and update scripts for Fluxer.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Michael SloanandCursor committed 2026-09-21 22:42:30 -04:00
commit 941ba8706c
15 files changed
+596

No files matched your search

+56
View File
@@ -0,0 +1,56 @@
#!/usr/bin/env bash
# Prepare Unraid appdata, clone the Fluxer mirror, and write example configs.
# Does not start containers and does not overwrite an existing config.json.
set -euo pipefail
APPDATA="${FLUXER_APPDATA:-/mnt/user/appdata/fluxer}"
SRC_DIR="${APPDATA}/src"
PACKAGING_DIR="$(cd "$(dirname "$0")/.." && pwd)"
FLUXER_REMOTE="${FLUXER_REMOTE:-https://git.masengr.com/Michael-A-Sloan/fluxer.git}"
if [[ ! -d /mnt/user/appdata ]]; then
echo "Error: /mnt/user/appdata not found. Run this on the Unraid server." >&2
exit 1
fi
mkdir -p "${APPDATA}/mysql" "${APPDATA}/redis" "${APPDATA}/storage"
if [[ ! -d "${SRC_DIR}/.git" ]]; then
echo "Cloning Fluxer mirror into ${SRC_DIR}"
git clone "${FLUXER_REMOTE}" "${SRC_DIR}"
else
echo "Fluxer source already present at ${SRC_DIR}"
fi
if [[ ! -f "${APPDATA}/config.json" ]]; then
cp "${PACKAGING_DIR}/config.example.json" "${APPDATA}/config.json"
echo "Wrote ${APPDATA}/config.json — edit token, owners, and passwords before starting the bot."
else
echo "Keeping existing ${APPDATA}/config.json"
fi
if [[ ! -f "${APPDATA}/nodelink.config.json" ]]; then
cp "${PACKAGING_DIR}/nodelink.config.json" "${APPDATA}/nodelink.config.json"
echo "Wrote ${APPDATA}/nodelink.config.json"
fi
if [[ ! -d "${APPDATA}/storage/locales" && -d "${SRC_DIR}/storage/locales" ]]; then
cp -a "${SRC_DIR}/storage/." "${APPDATA}/storage/"
echo "Copied Fluxer storage/locales into appdata"
fi
# Official Fluxer image runs as uid/gid 10001.
chown -R 10001:10001 "${APPDATA}/storage" "${APPDATA}/config.json" 2>/dev/null || true
if ! docker network inspect fluxer-net >/dev/null 2>&1; then
docker network create fluxer-net
echo "Created docker network fluxer-net"
else
echo "Docker network fluxer-net already exists"
fi
echo
echo "Bootstrap done."
echo " Appdata: ${APPDATA}"
echo " Source: ${SRC_DIR}"
echo "Next: sh scripts/update.sh"
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
# Install / refresh Fluxer Unraid Docker templates (does not touch volumes or running data).
set -euo pipefail
cd "$(dirname "$0")/.."
DEST_DIR="/boot/config/plugins/dockerMan/templates-user"
TEMPLATES=(
unraid/my-fluxer-mysql.xml
unraid/my-fluxer-redis.xml
unraid/my-fluxer-nodelink.xml
unraid/my-fluxer-bot.xml
)
if [[ ! -d "${DEST_DIR}" ]]; then
echo "Error: Unraid Docker templates folder not found: ${DEST_DIR}" >&2
echo "Run this on the Unraid server (not your PC)." >&2
exit 1
fi
for SRC in "${TEMPLATES[@]}"; do
if [[ ! -f "${SRC}" ]]; then
echo "Error: missing ${SRC}" >&2
exit 1
fi
DEST="${DEST_DIR}/$(basename "${SRC}")"
FIRST_LINE="$(head -n 1 "${SRC}")"
if [[ "${FIRST_LINE}" != '<?xml version="1.0"?>' ]]; then
echo "ERROR: ${SRC} does not start with XML." >&2
exit 1
fi
cp "${SRC}" "${DEST}"
echo "Installed ${DEST}"
done
if ! docker network inspect fluxer-net >/dev/null 2>&1; then
docker network create fluxer-net
echo "Created docker network fluxer-net"
fi
echo
echo "Hard-refresh the Unraid Docker page (Ctrl+F5), then Add Container in this order:"
echo " 1. fluxer-mysql"
echo " 2. fluxer-redis"
echo " 3. fluxer-nodelink"
echo " 4. fluxer-bot"
echo
echo "Repository names must stay:"
echo " mysql:8.0"
echo " redis:7-alpine"
echo " fluxer-nodelink:latest"
echo " fluxer-bot:latest"
echo
echo "See unraid/INSTALL.md"
+52
View File
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Sync the Fluxer Gitea mirror and rebuild local Unraid images.
# Then Force update fluxer-bot / fluxer-nodelink in the Unraid Docker UI.
set -euo pipefail
APPDATA="${FLUXER_APPDATA:-/mnt/user/appdata/fluxer}"
SRC_DIR="${APPDATA}/src"
PACKAGING_DIR="$(cd "$(dirname "$0")/.." && pwd)"
if [[ ! -d /var/run ]]; then
echo "Error: run this on the Unraid server." >&2
exit 1
fi
if [[ ! -x "${PACKAGING_DIR}/scripts/bootstrap.sh" ]]; then
echo "Error: bootstrap.sh missing next to this script." >&2
exit 1
fi
sh "${PACKAGING_DIR}/scripts/bootstrap.sh"
echo "Updating fluxer-unraid packaging"
git -C "${PACKAGING_DIR}" pull --ff-only
echo "Updating Fluxer source mirror"
git -C "${SRC_DIR}" pull --ff-only
if [[ -d "${SRC_DIR}/storage/locales" ]]; then
cp -a "${SRC_DIR}/storage/locales" "${APPDATA}/storage/"
chown -R 10001:10001 "${APPDATA}/storage" 2>/dev/null || true
fi
echo "Building fluxer-bot:latest"
DOCKER_BUILDKIT=1 docker build \
-f "${SRC_DIR}/docker/Dockerfile" \
-t fluxer-bot:latest \
"${SRC_DIR}"
echo "Building fluxer-nodelink:latest"
DOCKER_BUILDKIT=1 docker build \
-f "${PACKAGING_DIR}/nodelink/Dockerfile" \
-t fluxer-nodelink:latest \
"${PACKAGING_DIR}/nodelink"
echo
echo "Images rebuilt:"
docker images --format 'table {{.Repository}}\t{{.Tag}}\t{{.ID}}\t{{.CreatedSince}}' | grep -E 'REPOSITORY|fluxer-bot|fluxer-nodelink' || true
echo
echo "If the containers are Unraid-managed:"
echo " Docker → fluxer-nodelink → Force update"
echo " Docker → fluxer-bot → Force update"
echo "MySQL and Redis use official Hub tags — Force update those when you want patch releases."