ZeroTierOne/nonfree/controller/ControllerConfig.hpp
Grant Limberg 0753556aa3 wire up configuration.
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>
    }
  }
}
```
2025-09-02 14:06:24 -07:00

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