From e2503244b36281ccd7da7349727197c77dcbeb38 Mon Sep 17 00:00:00 2001 From: faumaray Date: Sun, 2 Aug 2026 01:47:23 +0300 Subject: [PATCH] Expose licensing and structured logging configuration --- include/echoion/api/config/ConfigTypes.hpp | 40 ++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/include/echoion/api/config/ConfigTypes.hpp b/include/echoion/api/config/ConfigTypes.hpp index dab5a92..df2f072 100644 --- a/include/echoion/api/config/ConfigTypes.hpp +++ b/include/echoion/api/config/ConfigTypes.hpp @@ -197,14 +197,49 @@ namespace Echoion::Api uint32_t tempCleanupInterval = 3600; // seconds }; - // Process logging. The active file is always archived at process startup, - // then rotated by size while the bot is running. + // Process logging. Split mode writes exact-level files (trace.log, + // debug.log, ...) and optionally all.log. Set splitByLevel=false to keep + // the legacy single rotating file. struct LoggingConfig { bool console = true; std::string level = "debug"; + bool splitByLevel = true; + bool combined = true; std::string fileName = "echoion.log"; uint64_t maxFileSizeBytes = 10 * 1024 * 1024; uint32_t maxFiles = 10; + // "pattern", "json" (JSON Lines), or "logfmt". + std::string format = "pattern"; + std::string pattern = + "[{time}] [{level}] [{thread}] {file} - {message}"; + // "async", "immediate", or "buffered". + std::string mode = "async"; + uint32_t queueCapacity = 2048; + // "block", "drop-newest", or "drop-oldest". + std::string overflowPolicy = "block"; + }; + + // EchoionLicensing issues short-lived signed leases. The activation token + // is read from the named environment variable and is never written to the + // configuration file. Release builds provide the root trust anchor at + // compile time; developmentKeys are accepted only by explicitly opted-in + // development builds. + struct LicensePublicKey { + std::string id; + std::string ed25519; + }; + + struct LicensingConfig { + bool required = false; + std::string serviceUrl; + std::string productId = "echoion"; + std::string activationTokenEnv = "ECHOION_LICENSE_TOKEN"; + std::chrono::milliseconds refreshInterval = std::chrono::hours(6); + std::chrono::milliseconds retryInterval = std::chrono::minutes(5); + std::chrono::milliseconds maximumLeaseLifetime = + std::chrono::hours(24); + bool developmentMode = false; + std::vector developmentKeys; }; // Component updater. Runtime means the complete relocatable daemon bundle, @@ -315,6 +350,7 @@ namespace Echoion::Api FeaturesConfig features; AdvancedConfig advanced; LoggingConfig logging; + LicensingConfig licensing; UpdatesConfig updates; UrlShorteningConfig urlShortening; PluginsConfig plugins;