feat: add QR code generation support and rate limiting for known device probes

This commit is contained in:
shuaiplus
2026-02-27 22:07:37 +08:00
committed by Shuai
parent ceb4bef9e4
commit 930f4f86cc
8 changed files with 81 additions and 5 deletions
+13 -1
View File
@@ -1,5 +1,17 @@
import { startNodewardenApp } from './app.js';
async function ensureQrLibrary() {
if (typeof window.qrcode === 'function') return;
await new Promise((resolve) => {
const s = document.createElement('script');
s.src = '/web/vendor/qrcode-generator.min.js';
s.async = true;
s.onload = () => resolve(null);
s.onerror = () => resolve(null);
document.head.appendChild(s);
});
}
async function loadRuntimeConfig() {
try {
const resp = await fetch('/api/web/config', { method: 'GET' });
@@ -10,6 +22,6 @@ async function loadRuntimeConfig() {
}
}
await ensureQrLibrary();
const cfg = await loadRuntimeConfig();
startNodewardenApp(cfg || { defaultKdfIterations: 600000 });