Skip to content

Add Unraid updater script for mc-webui#24

Open
Rafik89 wants to merge 2 commits into
MarekWo:mainfrom
Rafik89:main
Open

Add Unraid updater script for mc-webui#24
Rafik89 wants to merge 2 commits into
MarekWo:mainfrom
Rafik89:main

Conversation

@Rafik89
Copy link
Copy Markdown

@Rafik89 Rafik89 commented Feb 27, 2026

📦 Unraid Automated Updater (User Scripts / cron)

This updater is designed for fully automated deployments on Unraid,
with safe branch switching and Docker cache protection.

It supports:
Sticky branch behavior (main / dev)
Safe rebuild when switching branches
Host-side version freeze before build
Runtime version verification from inside the container
Healthcheck waiting
Lock protection against concurrent runs
Designed for User Scripts plugin and cron automation

🔧 Usage with Unraid User Scripts
1️⃣ Install User Scripts plugin

Go to Plugins
Install User Scripts
Open Settings → User Scripts

2️⃣ Create a new script

Click Add New Script
Example name:
mc-webui-auto-update
Click Edit Script

3️⃣ Edit Script

#!/bin/bash
/mnt/user/appdata/mc-webui/scripts/updater/unraid-updater.sh

4️⃣ Force update on specific branch
Always run on main

#!/bin/bash
TARGET_BRANCH=main /mnt/user/appdata/mc-webui/scripts/updater/unraid-updater.sh

Always run on dev

**#!/bin/bash
TARGET_BRANCH=dev /mnt/user/appdata/mc-webui/scripts/updater/unraid-updater.sh**

Force rebuild (even without git changes)

**#!/bin/bash
TARGET_BRANCH=dev FORCE_REBUILD=1 /mnt/user/appdata/mc-webui/scripts/updater/unraid-updater.sh**

5️⃣ Schedule execution

Inside User Scripts → Schedule:

Example: Run every night at 03:00
0 3 * * *

🕒 Alternative: Use native cron (advanced)

Edit root crontab:

crontab -e

Add:

**0 3 * * * /mnt/user/appdata/mc-webui/scripts/updater/unraid-updater.sh >> /mnt/user/appdata/mc-webui/cron.log 2>&1**

🧠 Notes

If you switch to dev, it will remain on dev until you explicitly switch back to main.
When switching branches, the script forces a clean rebuild of mc-webui
to prevent stale Docker build cache issues.
The script verifies the actual running version from inside the container.
Safe for unattended automated execution.

This script updates the mc-webui application on Unraid by pulling the latest git changes and managing Docker containers accordingly.
Enhance mc-webui Unraid updater script with detailed comments and improved logging.
@MarekWo
Copy link
Copy Markdown
Owner

MarekWo commented Apr 1, 2026

Hi @Rafik89, first of all — I'm sorry for the late response. I've been deep in a major v2 migration effort over the past weeks, which consumed all my bandwidth. Thank you for your patience!

I also want to say that the script itself is well-written, with solid practices like set -euo pipefail, lock file protection, health checks, and ground truth version verification from inside the container. I really appreciate the effort you put into this!

However, after reviewing the PR I've decided not to merge it in its current form. Here's my reasoning:

1. Outdated base branch
This PR was created against main back in February, before a major v2 migration that landed on March 28th. The main branch has changed significantly since then, so this PR is based on an outdated codebase and would need a rebase at minimum.

2. Overlap with existing update tooling
The project already ships scripts/update.sh (a simple, universal updater) and scripts/updater/ (a Python-based updater with systemd service). Adding a third update mechanism for a single platform increases maintenance overhead.

3. Unraid-specific hardcoded paths
The script assumes APPDIR="/mnt/user/appdata/mc-webui" and other Unraid-specific paths. While this is expected for an Unraid-targeted tool, it limits the usefulness for the broader user base and makes it harder to maintain as part of the core project.

4. Help text path mismatch
The --help output references /mnt/user/appdata/mc-webui/scripts/unraid-updater.sh, but the actual file location in the repo would be scripts/updater/unraid-updater.sh.

That said, if you'd like to pursue getting this merged, here's what would be needed:

  • Rebase onto the current main branch
  • Verify compatibility with the v2 architecture (the python3 -m app.version freeze and from app import version calls still exist, but it's worth testing end-to-end)
  • Fix the path references in the help text to match the actual file location
  • Consider whether this could live as a standalone guide/gist rather than part of the core repo — that way Unraid users can still benefit without adding maintenance burden to the project

Thank you again for the contribution — it's clear you put real thought into this. Let me know if you'd like to rework it and I'm happy to take another look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants