update docs

This commit is contained in:
Raven Scott
2025-12-26 17:34:30 -05:00
parent 9b68e728fd
commit 4465e9aa62
4 changed files with 78 additions and 5 deletions
+10 -1
View File
@@ -1,8 +1,9 @@
const state = require('../infrastructure/state');
const { logDebug, logInfo } = require('../infrastructure/logger');
const { logDebug, logInfo, logError } = require('../infrastructure/logger');
const { getAllEntries, autoVoteForDomain, invalidateEntriesCache, parseClaimValue, safeRemoveClaim } = require('./core');
const { trackDomainEvent } = require('../maintenance/metrics');
const { getPersistentPublicKey } = require('../infrastructure/utils');
const { getInternalDomains } = require('../plugins/plugin-handler');
// Initialize reserved IPs set if not already present
if (!state.reservedIPs) {
state.reservedIPs = new Set(['127.0.0.1']);
@@ -14,6 +15,14 @@ async function addDomain(domain, hash, ssl = false) {
if (!claimant) {
throw new Error('Cannot add domain: persistent public key not available');
}
// Check if domain is internal - internal domains cannot be claimed
const internalDomains = await getInternalDomains();
if (internalDomains.includes(domain)) {
logError('Domains', `SECURITY: Attempted to claim internal domain '${domain}' by ${claimant}. Internal domains are reserved for local use only.`);
throw new Error(`Cannot claim internal domain: ${domain}. Internal domains are reserved for local use only.`);
}
const claimKey = `claim:${domain}:${claimant}`;
const timestamp = Date.now();