Investigate Unraid 8 SDK support, plugin identity, and migration from the current plugin
Context and objective
Unraid has announced a move to Fedora/uCore for Unraid 8, together with a plugin permission system and developer SDK: https://unraid.net/blog/unraid-8-announced
Investigate how Borg Backup UI can support Unraid 8 and how existing users can migrate safely. The existing plugin line is to remain scoped to Unraid < 8.0; independent Python provisioning for that line is tracked in #548.
A possible outcome is a separately identified plugin named "Borg Backup UI for Unraid 8". This is an option to evaluate, not a pre-approved new plugin, repository, codebase fork, or architecture change. Do not assume that announced SDK behavior or a usable system Python runtime is already available.
Investigation
- Establish the actual Unraid 8 plugin/SDK contract from available official documentation and a test environment. Distinguish verified behavior, announced behavior, and unresolved questions.
- Check installation/update/removal, packaging, boot persistence, service lifecycle, UI integration, permissions, scheduler integration, and supported paths.
- Verify Python availability and delivery options, supported versions/modules, and the viability of a private runtime under the new platform's rules.
- Validate the bundled Borg binary and relevant native dependencies, repository access, SSH, backup/restore operations, notifications, and existing Unraid-specific integrations.
- Compare adapting the existing plugin identity, a separate "Borg Backup UI for Unraid 8" identity, and the standalone-container proposal below. Document shared-code possibilities, maintenance cost, installation discovery, upgrade behavior, and the supported lifetime of the current plugin line.
- Identify concrete implementation issues and test requirements. Work within this repository; do not assume other services or repositories.
Architecture alternative: standalone container application (proposal only)
Evaluate a Linux container application with optional Unraid integration alongside the existing-plugin and separate-Unraid-8-plugin options. The combination of #548 and the platform changes investigated here makes this a candidate worth comparing, not an approved replacement. This section authorizes architecture investigation only: no container implementation, framework/database migration, repository split, host agent deployment, or change to the support commitment in #548.
Proposed shape and required changes
- Evaluate one application container per protected host, reusing the existing UI/API, job execution, Borg workflows, authentication, reports, restore, and migrations. Package Python, Borg, Bash, SSH, Docker CLI, libvirt client, and explicitly supported hook utilities in a reproducible image. Docker and the hypervisor continue to run on the host.
- Separate genuinely Unraid-specific integration: plugin manifest/install/update/remove, rc service management, PHP control page/dashboard widget, mdcmd array/parity checks, and native notifications. Define optional adapters and capability reporting; missing host access must not silently disable a protection configured for a job. Existing SMTP/Apprise support can remain available independently.
- Replace fixed plugin/Unraid paths with an explicit persistent storage contract. Inventory configuration, jobs, profiles, scripts, users, secrets, SSH trust/keys, Borg keys/security state/cache, reports/history, logs, migration audit, and runtime recovery state. Define source, repository, restore, and writable staging mounts and their permissions. Map existing paths and exclusion patterns without silently changing archive paths or script behavior.
- Replace the host-crontab dependency for backup jobs, restore tests, and reports with a defined container scheduling model. Compare supervised cron with an application scheduler, including timezone/DST, missed runs, startup readiness, and single-owner scheduling.
- Define image provenance, integrity verification, supported CPU architectures and host baseline, dependency/security updates, health checks, process supervision, graceful stop, and updates during active jobs. Container packaging removes the external Python dependency but does not by itself establish Unraid 8 compatibility.
Docker control: decisions and open questions
- The current DockerManager invokes the Docker CLI. Evaluate a host Unix socket, authenticated remote connection, or restricted host-side interface. Document the privilege boundary: access to a rootful Docker daemon is highly privileged; mounting its socket read-only does not make API operations read-only. Avoid an unconditional privileged-container requirement.
- Add mandatory self-protection to every selection mode (all, selected, and all except selected). Identify the backup container reliably across renames/recreation, protect any required helper or storage containers, and reject explicit self-selection. Current stop-all success checks also need to consider intended targets rather than require zero running containers.
- Preserve the original running set, restart only the intended targets, and handle partial stop/start failures. Evaluate the existing runtime-recovery journal for container restarts, replaced container IDs, PID namespaces/reuse, interrupted updates, and host reboot.
- Which endpoints/permissions are actually needed for list/inspect/stop/start and hook-driven docker exec? Would a restricted interface meet the required feature set, and how would it enforce access?
- How should jobs behave when Docker is unavailable or a selected target disappears? A configured consistency requirement must not silently become an unstopped backup.
- A backup container cannot keep executing while its own Docker daemon is stopped. Identify any workflows requiring a fully stopped Docker service (including relevant Docker data/image backups) and decide whether to exclude them or design an explicitly approved external executor.
VM control: decisions and open questions
- The current VmManager uses virsh and QEMU Guest Agent commands. Evaluate an explicit libvirt connection via host socket or authenticated remote transport. Define configurable connection URI, socket permissions, authentication, reconnect behavior, and compatibility with monolithic and modular libvirt daemons.
- Retain guest warnings where the guest agent is available, shutdown/state polling, selected/all VM handling, restart of previously running VMs, and recovery after partial failure. Distinguish a missing client from an unreachable or unauthorized host connection.
- VM control access does not expose VM disks to Borg. Specify separate filesystem access and verify backup/restore completeness for disks, domain XML, UEFI NVRAM, and applicable TPM state. Determine the supported consistency model and handling of guest-agent/shutdown failures.
- Initially assess Linux Docker hosts with libvirt/KVM; other hypervisors need separate scope. A control client does not require a hypervisor or /dev/kvm inside the application container.
- Prevent shutdown of a VM that hosts the backup application or required storage, where that dependency exists. Verify actual Unraid 8 socket/policy behavior on a target system rather than assuming current paths remain valid.
Pre/Post scripts: execution contract and open questions
- Today hooks execute Bash in the application's host environment, normally as root on Unraid. Moving the same runner into a container changes available files, commands, networking, user identity, and permissions. Existing scripts must not silently change execution context or be assumed portable.
- Evaluate explicit per-script execution targets: container-local as the portable default for new scripts, and optional host execution through a defined SSH connection or narrowly scoped host executor. A host executor would be a new component requiring a separate design/approval, not an assumed existing service.
- Container-local examples include webhooks, checks on mounted paths, and database dumps using docker exec with a writable staging mount. Unraid commands (mdcmd, notify, rc scripts), host service control, and host mount operations need a host integration or deliberate script adaptation.
- Preserve existing hook semantics: Pre runs after initial job locking and before network mounts, Docker/VM stops, and backup; Post runs after service recovery, repository maintenance/statistics, and mount cleanup according to its configured condition. Preserve script snapshots, exit-code handling, bounded/redacted output, timeouts, and the defined cancellation behavior.
- The current runner constructs a clean environment; Docker/libvirt endpoint settings would not automatically reach hooks. Define explicitly allowed connection settings and secret delivery, supported tools, working directory, UID/GID, path mapping, networking/Wake-on-LAN, and writable locations.
- For host execution, how are scripts authorized, transferred or selected, audited, and terminated at the execution site? Closing SSH or stopping the local docker exec client does not guarantee termination of the remote process. Define cancellation/timeout handling and recovery from connection loss; do not claim Post runs after a hard container/host failure.
- Inventory imported scripts during migration, flag unresolved host dependencies, and require an explicit execution-target decision before affected schedules are enabled. Preserve script contents and job references; do not automatically rewrite arbitrary Bash.
Storage, migration, and validation gates
- Compare host-managed SMB/USB mounts passed into the container with retaining UI-driven mount/unmount through scoped container privileges or a host integration. Document feature differences; moving mounts to the host changes the existing user workflow.
- Validate mount namespaces, propagation, late mounts, USB removal/replacement, source identity, access rights, and restore ownership/ACL/xattr behavior. An existing container directory or bind mount alone must not be treated as proof that the expected host filesystem is present.
- Apply all migration requirements below to plugin-to-container handover, including snapshots, structured audit, idempotency, fail-closed startup, manual recovery, and exactly one scheduler/execution owner. Cover migration when the old plugin can no longer start after an OS upgrade.
- Deliver a decision matrix comparing existing plugin adaptation, a separate Unraid 8 plugin, and a container application with optional host/Unraid integration. Compare functionality, privileges, operational burden, update ownership, migration cost, and ongoing support; identify any proposed helper as a new component.
- Define validation gates for self-exclusion, Docker/VM partial failures and recovery, client/server compatibility, missing mounts and storage hotplug, container-local and host hooks, forced termination/restart, scheduling handover, fresh installation, and migration. Runtime validation belongs to separately approved implementation work; this issue must clearly record unverified assumptions and test-environment blockers.
Migration design requirements
- Inventory and map existing configuration, jobs, profiles, schedules, reports/history, secrets, Borg security state, and other persistent user data. Preserve existing backup repositories and archives.
- Define explicit eligibility/version checks, a user-visible handover, and recovery when the old plugin cannot run after the OS upgrade.
- Ensure only one plugin/service owns scheduling and backup execution. Prevent duplicate jobs or concurrent old/new schedulers, including partial migration and failed startup cases.
- Follow the repository migration contract: stable migration ID; pending/applied/skipped/failed/blocked/not_applicable status; timestamps; affected objects; concrete actions; secret-redacted errors; structured audit log; snapshots of affected user data/configuration.
- Specify idempotent detection/application and safe failure handling. After the first migration failure, subsequent migrations remain blocked and normal operation, scheduling, and write APIs stay locked until a successful restart.
- Plan tests for the pre-migration state, successful migration, repeated execution, failures, invalid/incomplete migration results, and prevention of later migrations after failure.
- Provide a documented manual recovery path. A data snapshot is not an automatic rollback of the installed plugin or operating system.
- Plan migration status and log visibility, preferably under Settings > System health & migration, plus German/English upgrade guidance.
Deliverables and acceptance criteria
- A repository-based compatibility assessment with evidence, open questions, and explicit blockers where SDK/test-system access is unavailable.
- A reasoned recommendation on plugin identity, packaging, runtime, code reuse, and migration ownership for maintainer approval before major architectural implementation.
- A migration and recovery design meeting the requirements above, with a concrete manual/automated validation matrix for fresh installs and upgrades from the current plugin.
- Scoped follow-up implementation issues and release/test gates. No Unraid 8 compatibility claim until the target environment has been verified.
- Current Unraid < 8.0 users remain supported independently of the outcome or timing of this investigation.
User impact and release notes
This issue is investigation/design only: impact::internal and release-note::no. It creates no runtime or installation changes by itself. Follow-up implementation issues must carry user-visible release notes, migration documentation, verified test-channel candidates, and explicit stable-release approval as applicable.
Related current-operation issue: https://github.com/borgforge/borg-backup-ui/issues/548