-
[Plugin] Vault Backup Manager
I created an addon plugin that shows a Backups button in the top bar for fast access. <!DOCTYPE PLUGIN [ <!ENTITY name "vault.backups.nav"> <!ENTITY author "Bradley Hayes | AVCompute, Inc."> <!ENTITY version "2026.06.24f"> <!ENTITY pluginURL ""> <!ENTITY plugdir "/usr/local/emhttp/plugins/&name;"> ]> <PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="6.12.0"> <CHANGES> ###2026.06.24 - Initial release. </CHANGES> <FILE Run="/bin/bash"> <INLINE><![CDATA[ mkdir -p /usr/local/emhttp/plugins/vault.backups.nav/scripts ]]></INLINE> </FILE> <FILE Name="&plugdir;/scripts/unpatch_nav" Mode="0775"> <INLINE><![CDATA[ #!/bin/bash set -u NAV_FILE="/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout/Navigation/Main.php" STATUS="/var/tmp/vault.backups.nav.patch.status" [ -f "$NAV_FILE" ] || exit 0 php <<'PHPEOF' <?php $navFile = '/usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout/Navigation/Main.php'; $status = '/var/tmp/vault.backups.nav.patch.status'; $text = file_get_contents($navFile); if ($text === false) { file_put_contents($status, "failed to read nav template during unpatch\n"); exit(1); } $original = '<a href="/<?= $pageName ?>" onclick="initab(\'/<?= $pageName ?>\')">'; $pattern = '~\s*<\?php /\* vault\.backups\.nav begin \*/ \?>.*?<\?php /\* vault\.backups\.nav end \*/ \?>~s'; $new = preg_replace($pattern, "\n" . $original, $text, 1, $count); if ($new === null) { file_put_contents($status, "unpatch regex failed " . date(DATE_ATOM) . "\n"); exit(2); } if ($count > 0) { file_put_contents($navFile, $new); file_put_contents($status, "old direct-link patch removed " . date(DATE_ATOM) . "\n"); } else { file_put_contents($status, "no old direct-link patch found " . date(DATE_ATOM) . "\n"); } exit(0); ?> PHPEOF ]]></INLINE> </FILE> <FILE Name="&plugdir;/scripts/update_nav" Mode="0775"> <INLINE><![CDATA[ #!/bin/bash # Vault Backup Manager top-nav helper for Unraid. # Creates/removes a Backups top menu page based on Vault plugin presence. # The Backups page keeps the Unraid UI visible and loads Vault in an iframe. PLUGIN_DIR="/usr/local/emhttp/plugins/vault.backups.nav" PAGE_FILE="${PLUGIN_DIR}/Backups.page" VAULT_RUNTIME_DIR="/usr/local/emhttp/plugins/vault" VAULT_APP="${VAULT_RUNTIME_DIR}/include/app.php" VAULT_BOOT_PLG="/boot/config/plugins/vault.plg" VAULT_BOOT_DIR="/boot/config/plugins/vault" STATUS="/var/tmp/vault.backups.nav.status" mkdir -p "${PLUGIN_DIR}" # Always remove the old v2026.06.24d nav-template patch if present. /usr/local/emhttp/plugins/vault.backups.nav/scripts/unpatch_nav >/dev/null 2>&1 || true vault_detected() { [ -f "${VAULT_APP}" ] && return 0 [ -d "${VAULT_RUNTIME_DIR}" ] && return 0 [ -f "${VAULT_BOOT_PLG}" ] && return 0 [ -d "${VAULT_BOOT_DIR}" ] && return 0 return 1 } if vault_detected; then cat > "${PAGE_FILE}" <<'PAGEEOF' Menu="Tasks:78" Type="xmenu" Name="Backups" --- <style> .vbn-wrap { width: 100%; margin: 0; padding: 0; } .vbn-frame { display: block; width: 100%; min-height: 650px; border: 0; background: transparent; } </style> <div class="vbn-wrap"> <iframe id="vault-backups-nav-frame" class="vbn-frame" src="/plugins/vault/include/app.php#/" title="Vault Backup Manager" allow="clipboard-read; clipboard-write" ></iframe> </div> <script> (function () { function resizeVaultFrame() { var frame = document.getElementById('vault-backups-nav-frame'); if (!frame) return; var rect = frame.getBoundingClientRect(); var bottomPadding = 24; var available = window.innerHeight - rect.top - bottomPadding; frame.style.height = Math.max(650, available) + 'px'; } window.addEventListener('resize', resizeVaultFrame); document.addEventListener('DOMContentLoaded', resizeVaultFrame); setTimeout(resizeVaultFrame, 100); setTimeout(resizeVaultFrame, 750); })(); </script> PAGEEOF chmod 0644 "${PAGE_FILE}" echo "enabled iframe page $(date -Is)" > "$STATUS" 2>/dev/null || true else rm -f "${PAGE_FILE}" echo "disabled; Vault Backup Manager not detected $(date -Is)" > "$STATUS" 2>/dev/null || true fi exit 0 ]]></INLINE> </FILE> <FILE Name="&plugdir;/README.md" Mode="0644"> <INLINE><![CDATA[ Vault Backups Nav for Unraid Adds a Backups link to the Unraid top navigation bar when Vault Backup Manager is installed. The Backups page keeps the Unraid WebGUI visible and loads Vault Backup Manager in an iframe using /plugins/vault/include/app.php#/. Manual refresh from terminal: /usr/local/emhttp/plugins/vault.backups.nav/scripts/update_nav Status files: - cat /var/tmp/vault.backups.nav.status - cat /var/tmp/vault.backups.nav.patch.status ]]></INLINE> </FILE> <FILE Run="/bin/bash"> <INLINE><![CDATA[ chmod +x /usr/local/emhttp/plugins/vault.backups.nav/scripts/unpatch_nav chmod +x /usr/local/emhttp/plugins/vault.backups.nav/scripts/update_nav /usr/local/emhttp/plugins/vault.backups.nav/scripts/update_nav cat > /etc/cron.hourly/vault-backups-nav <<'CRONEOF' #!/bin/bash /usr/local/emhttp/plugins/vault.backups.nav/scripts/update_nav >/dev/null 2>&1 || true CRONEOF chmod +x /etc/cron.hourly/vault-backups-nav echo "" echo "----------------------------------------------------" echo " vault.backups.nav has been installed/updated." echo " Backups opens as an Unraid page with Vault in an iframe." echo " Refresh the WebGUI after installing/updating." echo "----------------------------------------------------" echo "" ]]></INLINE> </FILE> <FILE Run="/bin/bash" Method="remove"> <INLINE><![CDATA[ echo "Removing vault.backups.nav..." /usr/local/emhttp/plugins/vault.backups.nav/scripts/unpatch_nav >/dev/null 2>&1 || true rm -f /etc/cron.hourly/vault-backups-nav rm -rf /usr/local/emhttp/plugins/vault.backups.nav rm -f /var/tmp/vault.backups.nav.status rm -f /var/tmp/vault.backups.nav.patch.status echo "" echo "----------------------------------------------------" echo " vault.backups.nav has been removed." echo " Refresh the WebGUI if the Backups tab is still visible." echo "----------------------------------------------------" echo "" ]]></INLINE> </FILE> </PLUGIN>
-
Bradley Hayes joined the community
-
[Plugin] Docker Compose Manager
I am trying to isolate the compose containers to only use certain cores. I tried cpuset_cpus: "10,11,12,13" but when running compose up it fails saying that the property is not allowed. Most likely that's due to this plugin using a strict schema. Is there another way to set this so the containers only use those cores?
Bradley Hayes
Members
-
Joined
-
Last visited