From d83d281fa01ab82fe7af553719bbe6080ed8b0ad Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 15 Jul 2026 17:34:48 +0300 Subject: [PATCH] config: add [allowed_keys] allow_all=yes by default, add [gui] as valid section - node_config.cpp: add [allowed_keys] allow_all=yes to default config - config_parser.c: add SECTION_GUI to suppress 'Key outside section' warnings --- src/config_parser.c | 4 ++++ tools/chatgui/transport/node_config.cpp | 3 +++ 2 files changed, 7 insertions(+) diff --git a/src/config_parser.c b/src/config_parser.c index d3263c57..e79427db 100644 --- a/src/config_parser.c +++ b/src/config_parser.c @@ -49,6 +49,7 @@ typedef enum { SECTION_TCP_PROXY_SERVER, SECTION_MSG_TRANSPORT, SECTION_NETWORK, + SECTION_GUI, SECTION_NTP } section_type_t; @@ -765,6 +766,7 @@ static section_type_t parse_section_header(const char *line, char *name, size_t if (strcasecmp(section, "tcp_proxy_server") == 0) return SECTION_TCP_PROXY_SERVER; if (strcasecmp(section, "msg_transport") == 0) return SECTION_MSG_TRANSPORT; if (strcasecmp(section, "ntp") == 0) return SECTION_NTP; + if (strcasecmp(section, "gui") == 0) return SECTION_GUI; char *colon = strchr(section, ':'); if (!colon) return SECTION_UNKNOWN; @@ -996,6 +998,8 @@ static struct utun_config* parse_config_internal(FILE *fp, const char *filename) DEBUG_ERROR(DEBUG_CATEGORY_CONFIG, "%s:%d: Unknown ntp option '%s'. Valid: enabled, server, interval", filename, line_num, key); } break; + case SECTION_GUI: + break; default: DEBUG_WARN(DEBUG_CATEGORY_CONFIG, "%s:%d: Key outside section: %s", filename, line_num, key); break; diff --git a/tools/chatgui/transport/node_config.cpp b/tools/chatgui/transport/node_config.cpp index fc4383ca..fe2cebec 100644 --- a/tools/chatgui/transport/node_config.cpp +++ b/tools/chatgui/transport/node_config.cpp @@ -345,6 +345,9 @@ bool NodeConfig::save() { out << "debug_level=" << (m_debugLevel.isEmpty() ? "info" : m_debugLevel) << "\n"; out << "debug_categories=" << m_debugCategories << "\n\n"; + out << "[allowed_keys]\n"; + out << "allow_all=yes\n\n"; + out << "[ntp]\n"; out << "enabled=yes\n"; out << "server=pool.ntp.org\n";