Support browsers without crypto randomUUID

This commit is contained in:
Mikei386
2026-06-15 12:03:17 +02:00
parent 3327f21881
commit 1cdacbcb67
7 changed files with 31 additions and 9 deletions
-1
View File
@@ -1 +0,0 @@
2cb10896997b03d476b52275aebe077114c77b14ac796c7ba6e608f85b324536 urbm-2026.06.15.r014-x86_64-1.txz
+1
View File
@@ -0,0 +1 @@
cdee29f4fd8fbd713fb78378f3c6531a46f3a1fb26c50e74f59fe6f1e437b76f urbm-2026.06.15.r015-x86_64-1.txz
+6 -2
View File
@@ -2,13 +2,17 @@
<!DOCTYPE PLUGIN [ <!DOCTYPE PLUGIN [
<!ENTITY name "urbm"> <!ENTITY name "urbm">
<!ENTITY author "Michael Roll"> <!ENTITY author "Michael Roll">
<!ENTITY version "2026.06.15.r014"> <!ENTITY version "2026.06.15.r015">
<!ENTITY pluginURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm.plg"> <!ENTITY pluginURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm.plg">
<!ENTITY packageURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm-&version;-x86_64-1.txz"> <!ENTITY packageURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm-&version;-x86_64-1.txz">
<!ENTITY packageSHA256 "2cb10896997b03d476b52275aebe077114c77b14ac796c7ba6e608f85b324536"> <!ENTITY packageSHA256 "cdee29f4fd8fbd713fb78378f3c6531a46f3a1fb26c50e74f59fe6f1e437b76f">
]> ]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/URBM/issues" icon="urbm.png"> <PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/URBM/issues" icon="urbm.png">
<CHANGES> <CHANGES>
### 2026.06.15.r015
- Generate compatible UUIDs on browsers and Unraid WebViews that do not provide `crypto.randomUUID()`.
- Prefer cryptographic random bytes when available and retain a schema-compatible last-resort fallback.
### 2026.06.15.r014 ### 2026.06.15.r014
- Add a dedicated workflow for attaching and immediately testing an existing Restic repository without initialization. - Add a dedicated workflow for attaching and immediately testing an existing Restic repository without initialization.
- Detect a missing Restic config at local and mounted paths and suggest direct child directories that contain a repository. - Detect a missing Restic config at local and mounted paths and suggest direct child directories that contain a repository.
+5 -1
View File
@@ -2,13 +2,17 @@
<!DOCTYPE PLUGIN [ <!DOCTYPE PLUGIN [
<!ENTITY name "urbm"> <!ENTITY name "urbm">
<!ENTITY author "Michael Roll"> <!ENTITY author "Michael Roll">
<!ENTITY version "2026.06.15.r014"> <!ENTITY version "2026.06.15.r015">
<!ENTITY pluginURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm.plg"> <!ENTITY pluginURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm.plg">
<!ENTITY packageURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm-&version;-x86_64-1.txz"> <!ENTITY packageURL "https://git.casaderoll.de/michael/URBM/raw/branch/main/dist/urbm-&version;-x86_64-1.txz">
<!ENTITY packageSHA256 "REPLACE_DURING_RELEASE"> <!ENTITY packageSHA256 "REPLACE_DURING_RELEASE">
]> ]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/URBM/issues" icon="urbm.png"> <PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/URBM/issues" icon="urbm.png">
<CHANGES> <CHANGES>
### 2026.06.15.r015
- Generate compatible UUIDs on browsers and Unraid WebViews that do not provide `crypto.randomUUID()`.
- Prefer cryptographic random bytes when available and retain a schema-compatible last-resort fallback.
### 2026.06.15.r014 ### 2026.06.15.r014
- Add a dedicated workflow for attaching and immediately testing an existing Restic repository without initialization. - Add a dedicated workflow for attaching and immediately testing an existing Restic repository without initialization.
- Detect a missing Restic config at local and mounted paths and suggest direct child directories that contain a repository. - Detect a missing Restic config at local and mounted paths and suggest direct child directories that contain a repository.
+4 -4
View File
@@ -9,12 +9,12 @@ Tag="URBM Unraid Restic Backup Manager backup snapshots restore"
<?php <?php
$pluginRoot = '/plugins/urbm'; $pluginRoot = '/plugins/urbm';
?> ?>
<link rel="stylesheet" href="<?= $pluginRoot ?>/assets/urbm.css?v=20260615r014"> <link rel="stylesheet" href="<?= $pluginRoot ?>/assets/urbm.css?v=20260615r015">
<div id="urbm-app" data-api="<?= $pluginRoot ?>/api.php"> <div id="urbm-app" data-api="<?= $pluginRoot ?>/api.php">
<header class="bu-header"> <header class="bu-header">
<div class="bu-brand"> <div class="bu-brand">
<img class="bu-logo" src="<?= $pluginRoot ?>/images/urbm.png?v=20260615r014" alt="URBM-Logo"> <img class="bu-logo" src="<?= $pluginRoot ?>/images/urbm.png?v=20260615r015" alt="URBM-Logo">
<div><h1>URBM <span class="bu-version">2026.06.15.r014</span></h1><p>Restic Backup Manager für Unraid</p></div> <div><h1>URBM <span class="bu-version">2026.06.15.r015</span></h1><p>Restic Backup Manager für Unraid</p></div>
</div> </div>
<div id="bu-health" class="bu-health" tabindex="0" data-tooltip="Zeigt, ob die URBM-Hintergrundkomponente erreichbar ist. Beispiel: 'Daemon online' bedeutet, dass Jobs gestartet werden können.">Verbindung wird hergestellt...</div> <div id="bu-health" class="bu-health" tabindex="0" data-tooltip="Zeigt, ob die URBM-Hintergrundkomponente erreichbar ist. Beispiel: 'Daemon online' bedeutet, dass Jobs gestartet werden können.">Verbindung wird hergestellt...</div>
</header> </header>
@@ -32,4 +32,4 @@ $pluginRoot = '/plugins/urbm';
<div id="bu-tooltip" role="tooltip" aria-hidden="true"></div> <div id="bu-tooltip" role="tooltip" aria-hidden="true"></div>
</div> </div>
<script>window.URBM_CSRF = <?= json_encode($var['csrf_token'] ?? '') ?>;</script> <script>window.URBM_CSRF = <?= json_encode($var['csrf_token'] ?? '') ?>;</script>
<script src="<?= $pluginRoot ?>/assets/urbm-2026.06.15.r014.js"></script> <script src="<?= $pluginRoot ?>/assets/urbm-2026.06.15.r015.js"></script>
+15 -1
View File
@@ -118,7 +118,21 @@
toast.textContent = message; toast.className = `show${error ? ' error' : ''}`; toast.textContent = message; toast.className = `show${error ? ' error' : ''}`;
clearTimeout(notify.timer); notify.timer = setTimeout(() => toast.className = '', 4500); clearTimeout(notify.timer); notify.timer = setTimeout(() => toast.className = '', 4500);
}; };
const id = (prefix) => `${prefix}-${crypto.randomUUID()}`; const uuid = () => {
if (window.crypto && typeof window.crypto.randomUUID === 'function') return window.crypto.randomUUID();
const bytes = new Uint8Array(16);
if (window.crypto && typeof window.crypto.getRandomValues === 'function') {
window.crypto.getRandomValues(bytes);
} else {
for (let i=0; i<bytes.length; i++) bytes[i]=Math.floor(Math.random()*256);
const time=Date.now();
for (let i=0; i<6; i++) bytes[i]^=(time/(2**(i*8)))&255;
}
bytes[6]=(bytes[6]&15)|64; bytes[8]=(bytes[8]&63)|128;
const hex=Array.from(bytes, value=>value.toString(16).padStart(2,'0')).join('');
return `${hex.slice(0,8)}-${hex.slice(8,12)}-${hex.slice(12,16)}-${hex.slice(16,20)}-${hex.slice(20)}`;
};
const id = (prefix) => `${prefix}-${uuid()}`;
const repoName = (repoId) => state.config.repositories.find(r => r.id === repoId)?.name || repoId; const repoName = (repoId) => state.config.repositories.find(r => r.id === repoId)?.name || repoId;
const volatileLocation = (repo) => repo.type === 'local' && (/^\/tmp(?:\/|$)/.test(repo.location) || /^\/run(?:\/|$)/.test(repo.location)); const volatileLocation = (repo) => repo.type === 'local' && (/^\/tmp(?:\/|$)/.test(repo.location) || /^\/run(?:\/|$)/.test(repo.location));
const tipAttr = (text) => text ? ` data-tooltip="${esc(text)}"` : ''; const tipAttr = (text) => text ? ` data-tooltip="${esc(text)}"` : '';