v0.4.1 - Fixed startup bug
This commit is contained in:
@@ -932,7 +932,7 @@
|
||||
description: 'C-Relay instance - pubkey provided manually',
|
||||
pubkey: manualPubkey,
|
||||
contact: 'admin@manual.config.relay',
|
||||
supported_nips: [1, 2, 4, 9, 11, 12, 15, 16, 20, 22],
|
||||
supported_nips: [1, 9, 11, 13, 15, 20, 33, 40, 42],
|
||||
software: 'https://github.com/0xtrr/c-relay',
|
||||
version: '1.0.0'
|
||||
};
|
||||
@@ -958,7 +958,7 @@
|
||||
description: 'C-Relay instance - pubkey provided manually',
|
||||
pubkey: manualPubkey,
|
||||
contact: 'admin@manual.config.relay',
|
||||
supported_nips: [1, 2, 4, 9, 11, 12, 15, 16, 20, 22],
|
||||
supported_nips: [1, 9, 11, 13, 15, 20, 33, 40, 42],
|
||||
software: 'https://github.com/0xtrr/c-relay',
|
||||
version: '1.0.0'
|
||||
};
|
||||
@@ -1286,18 +1286,6 @@
|
||||
console.log('Logout event handled successfully');
|
||||
}
|
||||
|
||||
// Disconnect from relay and clean up connections
|
||||
function disconnectFromRelay() {
|
||||
if (relayPool) {
|
||||
console.log('Cleaning up relay pool connection...');
|
||||
const url = relayConnectionUrl.value.trim();
|
||||
if (url) {
|
||||
relayPool.close([url]);
|
||||
}
|
||||
relayPool = null;
|
||||
subscriptionId = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Update visibility of admin sections based on login and relay connection status
|
||||
function updateAdminSectionsVisibility() {
|
||||
@@ -2030,56 +2018,33 @@
|
||||
|
||||
configForm.innerHTML = '';
|
||||
|
||||
// Define field types and validation for different config parameters
|
||||
// Define field types and validation for different config parameters (aligned with README.md)
|
||||
const fieldTypes = {
|
||||
'auth_enabled': 'boolean',
|
||||
'nip42_auth_required_events': 'boolean',
|
||||
'nip42_auth_required_subscriptions': 'boolean',
|
||||
'nip42_auth_required': 'boolean',
|
||||
'nip40_expiration_enabled': 'boolean',
|
||||
'nip40_expiration_strict': 'boolean',
|
||||
'nip40_expiration_filter': 'boolean',
|
||||
'relay_port': 'number',
|
||||
'max_connections': 'number',
|
||||
'pow_min_difficulty': 'number',
|
||||
'nip42_challenge_expiration': 'number',
|
||||
'nip40_expiration_grace_period': 'number',
|
||||
'nip42_challenge_timeout': 'number',
|
||||
'max_subscriptions_per_client': 'number',
|
||||
'max_total_subscriptions': 'number',
|
||||
'max_filters_per_subscription': 'number',
|
||||
'max_event_tags': 'number',
|
||||
'max_content_length': 'number',
|
||||
'max_message_length': 'number',
|
||||
'default_limit': 'number',
|
||||
'max_limit': 'number'
|
||||
'max_content_length': 'number'
|
||||
};
|
||||
|
||||
const descriptions = {
|
||||
'relay_pubkey': 'Relay Public Key (Read-only)',
|
||||
'auth_enabled': 'Enable Authentication',
|
||||
'nip42_auth_required_events': 'Require Auth for Events',
|
||||
'nip42_auth_required_subscriptions': 'Require Auth for Subscriptions',
|
||||
'nip42_auth_required_kinds': 'Auth Required Event Kinds',
|
||||
'nip42_challenge_expiration': 'Auth Challenge Expiration (seconds)',
|
||||
'relay_port': 'Relay Port',
|
||||
'nip42_auth_required': 'Enable NIP-42 Cryptographic Authentication',
|
||||
'nip42_auth_required_kinds': 'Event Kinds Requiring NIP-42 Auth',
|
||||
'nip42_challenge_timeout': 'NIP-42 Challenge Expiration Seconds',
|
||||
'max_connections': 'Maximum Connections',
|
||||
'relay_description': 'Relay Description',
|
||||
'relay_contact': 'Relay Contact',
|
||||
'relay_software': 'Relay Software URL',
|
||||
'relay_version': 'Relay Version',
|
||||
'pow_min_difficulty': 'Minimum PoW Difficulty',
|
||||
'pow_mode': 'PoW Mode',
|
||||
'pow_min_difficulty': 'Minimum Proof-of-Work Difficulty',
|
||||
'nip40_expiration_enabled': 'Enable Event Expiration',
|
||||
'nip40_expiration_strict': 'Strict Expiration Mode',
|
||||
'nip40_expiration_filter': 'Filter Expired Events',
|
||||
'nip40_expiration_grace_period': 'Expiration Grace Period (seconds)',
|
||||
'max_subscriptions_per_client': 'Max Subscriptions per Client',
|
||||
'max_total_subscriptions': 'Max Total Subscriptions',
|
||||
'max_filters_per_subscription': 'Max Filters per Subscription',
|
||||
'max_event_tags': 'Max Event Tags',
|
||||
'max_content_length': 'Max Content Length',
|
||||
'max_message_length': 'Max Message Length',
|
||||
'default_limit': 'Default Query Limit',
|
||||
'max_limit': 'Maximum Query Limit'
|
||||
'max_event_tags': 'Maximum Tags per Event',
|
||||
'max_content_length': 'Maximum Event Content Length'
|
||||
};
|
||||
|
||||
// Process configuration tags (no d tag filtering for ephemeral events)
|
||||
@@ -3452,7 +3417,7 @@
|
||||
logTestEvent('SENT', `Add Whitelist event: ${JSON.stringify(signedEvent)}`, 'EVENT');
|
||||
|
||||
// Publish via SimplePool
|
||||
const url = relayUrl.value.trim();
|
||||
const url = relayConnectionUrl.value.trim();
|
||||
const publishPromises = relayPool.publish([url], signedEvent);
|
||||
|
||||
// Use Promise.allSettled to capture per-relay outcomes instead of Promise.any
|
||||
@@ -3594,7 +3559,7 @@
|
||||
logTestEvent('SENT', `Signed test event: ${JSON.stringify(signedEvent)}`, 'EVENT');
|
||||
|
||||
// Publish via SimplePool to the same relay with detailed error diagnostics
|
||||
const url = relayUrl.value.trim();
|
||||
const url = relayConnectionUrl.value.trim();
|
||||
logTestEvent('INFO', `Publishing to relay: ${url}`, 'INFO');
|
||||
|
||||
const publishPromises = relayPool.publish([url], signedEvent);
|
||||
|
||||
Reference in New Issue
Block a user