From 0f124fe575d03af89402a692b7e7731e8002339a Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 25 Feb 2026 06:54:35 -0400 Subject: [PATCH] v1.2.40 - IP Bans page: show whitelisted IPs with star icon, hide Unban button for whitelisted IPs --- api/index.js | 9 +++++++-- src/main.h | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/api/index.js b/api/index.js index 82232ed..eea0d59 100644 --- a/api/index.js +++ b/api/index.js @@ -6267,11 +6267,16 @@ function handleIpBansResponse(responseData) { document.getElementById('ip-bans-active').textContent = currentlyBanned; document.getElementById('ip-bans-issued').textContent = totalBans; + // Get whitelist for display + const whitelistStr = (currentConfig && currentConfig.idle_ban_whitelist) || ''; + const whitelistedIPs = new Set(whitelistStr.split(',').map(s => s.trim()).filter(s => s.length > 0)); + // Render table const tbody = document.getElementById('ip-bans-tbody'); tbody.innerHTML = filteredResults.map(row => { const isBanned = row.banned_until > now; - const status = isBanned ? '🔴 Banned' : (row.ban_count > 0 ? '🟡 Expired' : '🟢 Clean'); + const isWhitelisted = whitelistedIPs.has(row.ip); + const status = isWhitelisted ? '⭐ Whitelisted' : (isBanned ? '🔴 Banned' : (row.ban_count > 0 ? '🟡 Expired' : '🟢 Clean')); const bannedUntil = row.banned_until > 0 ? new Date(row.banned_until * 1000).toLocaleString() : '-'; const failures = row.total_failures || 0; const authedSuccessfully = row.has_authed_successfully ? '✅ Yes' : '❌ No'; @@ -6285,7 +6290,7 @@ function handleIpBansResponse(responseData) { ${authedSuccessfully} ${connectionAttempts} - ${isBanned ? `` : ''} + ${isBanned && !isWhitelisted ? `` : ''} `; diff --git a/src/main.h b/src/main.h index 2fc36cc..1eaf0e1 100644 --- a/src/main.h +++ b/src/main.h @@ -13,8 +13,8 @@ // Using CRELAY_ prefix to avoid conflicts with nostr_core_lib VERSION macros #define CRELAY_VERSION_MAJOR 1 #define CRELAY_VERSION_MINOR 2 -#define CRELAY_VERSION_PATCH 39 -#define CRELAY_VERSION "v1.2.39" +#define CRELAY_VERSION_PATCH 40 +#define CRELAY_VERSION "v1.2.40" // Relay metadata (authoritative source for NIP-11 information) #define RELAY_NAME "C-Relay"