Load trunk peer definitions from Redis at startup

When [REDIS] is configured, Reflector::initialize synthesizes [TRUNK_*]
sections from 'trunk:<section>:peer' hashes before the trunk discovery
loop. .conf [TRUNK_*] sections are ignored (with a warning) when Redis
is configured. The importer --import-conf-to-redis now also writes peer
definitions into 'trunk:<section>:peer' so existing configs can migrate.
This commit is contained in:
Audric committed 2026-04-15 14:41:18 +02:00
1 parent 5cab611ccd
commit 9c6f27e12b
4 files changed
+129

No files matched your search

+10
View File
@@ -32,6 +32,15 @@ class RedisStore : public sigc::trackable
std::string tls_client_key;
};
struct TrunkPeerConfig
{
std::string host;
std::string port;
std::string secret;
std::string remote_prefix;
std::string peer_id;
};
explicit RedisStore(const Config& cfg);
~RedisStore();
@@ -56,6 +65,7 @@ class RedisStore : public sigc::trackable
std::string loadTrunkFilter(const std::string& section,
const std::string& field); // "blacklist"|"allow"
std::map<uint32_t, uint32_t> loadTrunkTgMap(const std::string& section);
std::map<std::string, TrunkPeerConfig> loadTrunkPeers(void);
// Publish a config.changed scope token (sync).
void publishConfigChanged(const std::string& scope);