mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-09-08 15:52:53 +02:00
New config block in local.conf for controllers: ``` { "settings": { ...standard zt1 local.conf settings... }, "controller": { "listenMode": (pgsql|redis|pubsub), "statusMode": (pgsql|redis|bigtable), "redis": { "hostname": ..., "port": 6379, "clusterMode": true }, "pubsub": { "project_id": <gcp-project-id> }, "bigtable": { "project_id": <gcp-project-id>, "instance_id": <bigtable-instance-id>, "table_id": <bigtable-table-id> } } } ```
56 lines
No EOL
948 B
C++
56 lines
No EOL
948 B
C++
#ifndef CONTROLLER_CONFIG_HPP
|
|
#define CONTROLLER_CONFIG_HPP
|
|
|
|
#include "Redis.hpp"
|
|
|
|
#include <string>
|
|
|
|
namespace ZeroTier {
|
|
|
|
struct PubSubConfig {
|
|
std::string project_id;
|
|
};
|
|
|
|
struct BigTableConfig {
|
|
std::string project_id;
|
|
std::string instance_id;
|
|
std::string table_id;
|
|
};
|
|
|
|
struct ControllerConfig {
|
|
bool ssoEnabled;
|
|
std::string listenMode;
|
|
std::string statusMode;
|
|
RedisConfig* redisConfig;
|
|
PubSubConfig* pubSubConfig;
|
|
BigTableConfig* bigTableConfig;
|
|
|
|
ControllerConfig()
|
|
: ssoEnabled(false)
|
|
, listenMode("")
|
|
, statusMode("")
|
|
, redisConfig(nullptr)
|
|
, pubSubConfig(nullptr)
|
|
, bigTableConfig(nullptr)
|
|
{
|
|
}
|
|
|
|
~ControllerConfig()
|
|
{
|
|
if (redisConfig) {
|
|
delete redisConfig;
|
|
redisConfig = nullptr;
|
|
}
|
|
if (pubSubConfig) {
|
|
delete pubSubConfig;
|
|
pubSubConfig = nullptr;
|
|
}
|
|
if (bigTableConfig) {
|
|
delete bigTableConfig;
|
|
bigTableConfig = nullptr;
|
|
}
|
|
}
|
|
};
|
|
|
|
} // namespace ZeroTier
|
|
#endif // CONTROLLER_CONFIG_HPP
|