Skip to content

Add PubSub and BigTable support for Central hosted network controllers#2526

Open
glimberg wants to merge 181 commits intodevfrom
gl/ctl-pubsub
Open

Add PubSub and BigTable support for Central hosted network controllers#2526
glimberg wants to merge 181 commits intodevfrom
gl/ctl-pubsub

Conversation

@glimberg
Copy link
Contributor

@glimberg glimberg commented Oct 6, 2025

This is a big one that goes along with other internal upcoming changes.

  • Refactors existing Redis & Postgres NOTIFY message passing systems into the NotificationListener interface, and adds a 3rd method for message passing via GCP PubSub. Which one to use is configurable by local.conf controller settings
  • Adds GCP BigTable as a 3rd option for writing member status updates along side Postgres and Redis. Also configurable via local.conf
  • Set up CMake for building Central controllers. This can (and hopefully will) be extended for general builds of ZeroTier One in the future. More work will be needed to finish all that out however.
  • Use miniconda + CMake for external dependency management instead of dumping everything in ext/. This is likely more useful for Central controller builds than end user builds for the time being.

glimberg added 30 commits August 5, 2025 15:52
…stance for the whole library, add init/shutdown functions for it exposed to C
match other things already written
Tests currently need to be run with --test-threads=1.  Seems like the instances of the pubsub emulator stomp on each other without that
…s in new CentralDB class

This allows us to interchangeably use different listeners (pgsql, redis, pubsub) depending on configuration values passed into the constructor.
PubSub allows us to do schema validation, however it only allows one top level message at a time.  Move other sub-message declarations under the main message declaration so that we can enable schema validation in the pubsub stream directly
Muuuuch easier to use external dependencies now

Also tried out conan and vcpkg.   Ran into dependency issues when solving for packages to install with conan.

vcpkg is just obtuse as all hell to install and not easy to integrate
@joseph-henry
Copy link
Contributor

@glimberg I'm only just noticing this. Do you still want it merged in? I see it is still a draft.

@glimberg
Copy link
Contributor Author

glimberg commented Nov 6, 2025

Eventually yes. Just making sure everything is stable over in the new environment before doing so

@glimberg glimberg marked this pull request as ready for review November 12, 2025 02:39
@glimberg
Copy link
Contributor Author

@joseph-henry ready for your review. I know this is a huge one. Don't hesitate to reach out if you have any questions

@glimberg
Copy link
Contributor Author

OK not sure why the github action is failing now but I'll look at it tomorrow

Required to get the list of configs  for a particular org that the controller has.  Named it `linked_id` rather than `org_id` since we don't know what it will be linked to in CV2
Publish CTL_NONCE_UPDATE to PubSub when nonces are created or reused in
getSSOAuthInfo(), with the network's frontend as a message attribute so
only the correct CV frontend receives it. Listen for ZT1_AUTH_UPDATE
messages and update sso_expiry.authentication_expiry_time accordingly,
with a network existence check before applying.

- Add sso_send_topic/sso_recv_topic to PubSubConfig
- Add PubSubWriter::publishSSONonceUpdate() with frontend param
- Add PubSubSSOListener class for inbound auth updates
- Rename CV1_AUTH_UPDATE to ZT1_AUTH_UPDATE in sso.proto
- Fix pre-existing connection pool leak in getSSOAuthInfo() catch block
Allow controllers to advertise which central version (cv1, cv2, or all)
they are assigned to handle via a new configurable field. The value is
persisted to the database on each heartbeat and validated at startup
against the DB CHECK constraint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants