v0.3.0 - Complete deployment documentation and examples - Added comprehensive deployment guide, automated deployment scripts, nginx SSL proxy setup, backup automation, and monitoring tools. Includes VPS deployment, cloud platform guides, and practical examples for production deployment of event-based configuration system.
This commit is contained in:
68
src/default_config_event.h
Normal file
68
src/default_config_event.h
Normal file
@@ -0,0 +1,68 @@
|
||||
#ifndef DEFAULT_CONFIG_EVENT_H
|
||||
#define DEFAULT_CONFIG_EVENT_H
|
||||
|
||||
#include <cjson/cJSON.h>
|
||||
|
||||
/*
|
||||
* Default Configuration Event Template
|
||||
*
|
||||
* This header contains the default configuration values for the C Nostr Relay.
|
||||
* These values are used to create the initial kind 33334 configuration event
|
||||
* during first-time startup.
|
||||
*
|
||||
* IMPORTANT: These values should never be accessed directly by other parts
|
||||
* of the program. They are only used during initial configuration event creation.
|
||||
*/
|
||||
|
||||
// Default configuration key-value pairs
|
||||
static const struct {
|
||||
const char* key;
|
||||
const char* value;
|
||||
} DEFAULT_CONFIG_VALUES[] = {
|
||||
// Authentication
|
||||
{"auth_enabled", "false"},
|
||||
|
||||
// Server Core Settings
|
||||
{"relay_port", "8888"},
|
||||
{"max_connections", "100"},
|
||||
|
||||
// NIP-11 Relay Information (relay keys will be populated at runtime)
|
||||
{"relay_description", "High-performance C Nostr relay with SQLite storage"},
|
||||
{"relay_contact", ""},
|
||||
{"relay_software", "https://git.laantungir.net/laantungir/c-relay.git"},
|
||||
{"relay_version", "v1.0.0"},
|
||||
|
||||
// NIP-13 Proof of Work (pow_min_difficulty = 0 means PoW disabled)
|
||||
{"pow_min_difficulty", "0"},
|
||||
{"pow_mode", "basic"},
|
||||
|
||||
// NIP-40 Expiration Timestamp
|
||||
{"nip40_expiration_enabled", "true"},
|
||||
{"nip40_expiration_strict", "true"},
|
||||
{"nip40_expiration_filter", "true"},
|
||||
{"nip40_expiration_grace_period", "300"},
|
||||
|
||||
// Subscription Limits
|
||||
{"max_subscriptions_per_client", "25"},
|
||||
{"max_total_subscriptions", "5000"},
|
||||
{"max_filters_per_subscription", "10"},
|
||||
|
||||
// Event Processing Limits
|
||||
{"max_event_tags", "100"},
|
||||
{"max_content_length", "8196"},
|
||||
{"max_message_length", "16384"},
|
||||
|
||||
// Performance Settings
|
||||
{"default_limit", "500"},
|
||||
{"max_limit", "5000"}
|
||||
};
|
||||
|
||||
// Number of default configuration values
|
||||
#define DEFAULT_CONFIG_COUNT (sizeof(DEFAULT_CONFIG_VALUES) / sizeof(DEFAULT_CONFIG_VALUES[0]))
|
||||
|
||||
// Function to create default configuration event
|
||||
cJSON* create_default_config_event(const unsigned char* admin_privkey_bytes,
|
||||
const char* relay_privkey_hex,
|
||||
const char* relay_pubkey_hex);
|
||||
|
||||
#endif /* DEFAULT_CONFIG_EVENT_H */
|
||||
Reference in New Issue
Block a user