#!/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."