Exempt DNS logs from rate limiting and hide Tokens button when no DNS configured

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-17 19:31:12 -07:00
parent f2f33b4b40
commit 6d098fd96f
2 changed files with 4 additions and 1 deletions

View File

@@ -384,7 +384,7 @@ module.exports = function configureMiddleware(app, {
...RATE_LIMITS.GENERAL, ...RATE_LIMITS.GENERAL,
standardHeaders: true, standardHeaders: true,
legacyHeaders: false, legacyHeaders: false,
skip: (req) => isTest || req.path === '/health' || req.path === '/api/health' || req.path.startsWith('/probe/') || req.path.startsWith('/api/auth/gate/') || req.path === '/api/totp/check-session' || req.path.endsWith('/health-checks/status') || req.path.endsWith('/csrf-token'), skip: (req) => isTest || req.path === '/health' || req.path === '/api/health' || req.path.startsWith('/probe/') || req.path.startsWith('/api/auth/gate/') || req.path === '/api/totp/check-session' || req.path.endsWith('/health-checks/status') || req.path.endsWith('/csrf-token') || req.path === '/api/v1/dns/logs',
message: { success: false, error: 'Too many requests, please try again later' } message: { success: false, error: 'Too many requests, please try again later' }
}); });

View File

@@ -66,6 +66,9 @@ window.__dashcaddySiteConfigLoaded = (async function loadSiteConfig() {
})); }));
// Render DNS cards dynamically based on configured servers // Render DNS cards dynamically based on configured servers
renderDnsCards(); renderDnsCards();
// Hide Tokens button if no DNS servers configured
const tokensBtn = document.getElementById('manage-tokens');
if (tokensBtn) tokensBtn.style.display = Object.keys(SITE.dnsServers).length ? '' : 'none';
} }
} catch (_) {} } catch (_) {}
// Update static HTML elements with configured TLD // Update static HTML elements with configured TLD