v0.2.4 - Clean up config issues

This commit is contained in:
Your Name
2025-09-06 04:40:59 -04:00
parent 7e560b4247
commit fa17aa1f78
8 changed files with 19 additions and 11 deletions

View File

@@ -721,7 +721,6 @@ cJSON* create_config_nostr_event(const char* privkey_hex) {
static const default_config_t defaults[] = {
// Administrative settings
{"admin_pubkey", ""},
{"admin_enabled", "false"},
// Server core settings
@@ -734,7 +733,7 @@ cJSON* create_config_nostr_event(const char* privkey_hex) {
{"relay_description", "High-performance C Nostr relay with SQLite storage"},
{"relay_contact", ""},
{"relay_pubkey", ""},
{"relay_software", "https://github.com/teknari/c-relay"},
{"relay_software", "https://git.laantungir.net/laantungir/c-relay.git"},
{"relay_version", "0.2.0"},
// NIP-13 Proof of Work
@@ -776,7 +775,8 @@ cJSON* create_config_nostr_event(const char* privkey_hex) {
const char* key = (const char*)sqlite3_column_text(stmt, 0);
const char* value = (const char*)sqlite3_column_text(stmt, 1);
if (key && value) {
// Skip admin_pubkey since it's redundant (already in event.pubkey)
if (key && value && strcmp(key, "admin_pubkey") != 0) {
cJSON* tag = cJSON_CreateArray();
cJSON_AddItemToArray(tag, cJSON_CreateString(key));
cJSON_AddItemToArray(tag, cJSON_CreateString(value));
@@ -978,7 +978,7 @@ int generate_config_file_if_missing(void) {
cJSON* pubkey_obj = cJSON_GetObjectItem(event, "pubkey");
if (pubkey_obj && cJSON_IsString(pubkey_obj)) {
const char* admin_pubkey = cJSON_GetStringValue(pubkey_obj);
if (set_database_config("relay_admin_pubkey", admin_pubkey, "system") == 0) {
if (set_database_config("admin_pubkey", admin_pubkey, "system") == 0) {
log_info("Stored admin public key in configuration database");
printf(" Admin Public Key: %s\n", admin_pubkey);
} else {