Compare commits

..
324 Commits
Author SHA1 Message Date
Grant Limberg ca3d17ddb0 controller: log how long each BigTable batch write took
Timed in the worker around the BulkApply call; reported on the per-batch
completion line and the exception line.  Gives a direct client-observed
latency signal to compare against Bigtable's server-side metrics.
2026-07-21 16:54:09 +02:00
Grant Limberg 2e7e4a58a8 controller: write BigTable status batches from sync worker threads; re-queue failures
Replace AsyncBulkApply with synchronous BulkApply calls fanned out to a
small worker pool (8 threads, 500-row batches).  The async client path
makes progress only on the connection's shared background event threads,
which stall for tens of seconds at a time in production (observed
2026-07-21: 26k-row flushes taking 3.5-8 minutes against a near-idle
cluster with server-side MutateRows p99 of 50-80ms, completions arriving
in window-sized bursts).  A sync call is driven entirely by its own
thread and has months of healthy history in this environment.

Batches are built and their results processed on the calling thread, so
_lastNodeInfo and the re-queue list stay lock-free; workers only perform
the RPC and record the outcome.

Also stop dropping failed mutations: re-queue them for the next cycle
(idempotent replays via deterministic cell timestamps, backlog capped by
requeuePendingStatus) unless the status is INVALID_ARGUMENT.  This
covers transient per-mutation failures the client does not retry
internally, e.g. ACCESS_TOKEN_EXPIRED and UNAVAILABLE.
2026-07-21 16:29:10 +02:00
Grant Limberg b2bd72953a smaller parallel batches of writes 2026-07-21 10:48:19 +02:00
Grant Limberg 2f0cae4447 bootstrap-deps: force WITH_API_ONLY=OFF in the full OTel build
A stale .deps-build/otel CMake cache from an API-only run kept
WITH_API_ONLY=ON even under ZT_CONTROLLER_DEPS=1, silently installing an
API-only opentelemetry-cpp; the controller configure then fails with
"Component sdk is not a built component". Pass the flag explicitly so
the full build always overrides a cached value.
2026-07-21 02:15:57 +02:00
Grant Limberg 121ce0e8b9 controller: chunk BigTable status writes under the 100k mutation limit
Bigtable's MutateRows API rejects requests with more than 100,000
mutations total, and google-cloud-cpp sends a BulkMutation as a single
request -- it never splits by mutation count. writePending() built one
batch from every pending check-in (up to 5 SetCells per row), so a cold
node_info cache after a controller restart could push a single flush far
past the limit (observed: 124582). INVALID_ARGUMENT is permanent, so the
whole batch failed and those check-ins were dropped for the cycle.

Flush in chunks of at most 25,000 mutations. Failure handling is now
per-chunk: FailedMutation::original_index() aligns against a chunk-local
row-hash vector, and if BulkApply throws, only the not-yet-written tail
is re-queued so already-applied chunks are not replayed.
2026-07-21 02:15:46 +02:00
Grant Limberg 53acb42f11 controller: erase netconf request de-dup key if enqueue throws 2026-07-02 12:29:32 -07:00
Grant Limberg 54b61f3927 set max netconf queue length to 2M requests 2026-07-02 12:28:56 -07:00
Grant Limberg 4097f646a9 cap & de-dupe netconf request queue 2026-07-02 12:22:53 -07:00
Grant Limberg 9a0f635045 Set a minimum of 8 threads for netconf request handling in the Central controllers 2026-07-02 12:21:50 -07:00
Grant Limberg 50bfed682a don't do migrations via the startup script 2026-07-01 18:47:06 -07:00
Grant Limberg cb65567de3 Fix possible UB in calling operator[] on a const json& 2026-07-01 18:45:05 -07:00
Grant Limberg 5951981622 Merge pull request #2526 from zerotier/gl/ctl-pubsub
Add PubSub and BigTable support for Central hosted network controllers
2026-06-29 11:55:55 -07:00
Grant Limberg 1f6a1fd51f Remove ZT_CONTROLLER=1 from makefile. No longer used to build central
controllers
2026-06-29 11:13:40 -07:00
Grant Limberg edcc066d25 Add a SIGSEGV handler to print a stack trace for central controllers
Only enabled in the central controller builds.  Trying to find more info
about some mystery controller restarts in prod
2026-06-26 13:33:07 -07:00
Grant Limberg 0797626b3e Fix a potential crash on central controller shutdown 2026-06-26 13:32:09 -07:00
Grant Limberg 4bcff9d3e3 Fix the sso template for errors returned by IdP
Template was looking for {{networkId}} but that hadn't been populated
yet in the case where the IdP returned an error. This caused the
template parsing to crash and return its own error, disguising the error
from the IdP
2026-06-22 09:47:24 -07:00
Grant Limberg 64cc25baf6 bump actions to get rid of node warnings 2026-06-17 16:51:08 -07:00
Grant Limberg 8304ec79fe update documentation for ConnectionPool 2026-06-17 16:39:32 -07:00
Grant Limberg fcb016b9c1 standardize log formatting across the controller 2026-06-17 16:20:17 -07:00
Grant Limberg 75b51ec229 Ensure everything in nonfree/controller has the proper header comment
pointing to LICENSE.TXT
2026-06-17 13:50:44 -07:00
Grant Limberg 5640b82252 Update build.sh with build instructions
Also add presets for the BSDs
2026-06-17 13:39:22 -07:00
Grant Limberg ab9efc722c use the checkin timestamps for the cell timestamps in BigTable 2026-06-17 13:10:23 -07:00
Grant Limberg 4706ed9682 enable metrics by default for the central controller 2026-06-17 12:45:07 -07:00
Grant Limberg bf426497b0 Conneciton pool update to a timed wait on connection pool exhaustion
More use of scoped RAII guard for connections where appropriate.
2026-06-17 10:54:57 -07:00
Grant Limberg afd8a828df fix printf, connection pool smart pointer semantics, wait for ready spin
lock -> notification, and double notify on erase
2026-06-17 10:17:51 -07:00
Grant Limberg 7192b65a2c Correcting a few things 2026-06-17 09:59:20 -07:00
Grant Limberg 7be64c6bac Concurrency hygene updates 2026-06-17 09:48:18 -07:00
Grant Limberg 4a517e2d27 status update batch delivery reliablilty 2026-06-17 09:33:07 -07:00
Grant Limberg 6f57a77c43 Better connection handling for postgres status writer 2026-06-17 09:20:44 -07:00
Grant Limberg 8271fcadf2 Pubsub devlivery reliability updates 2026-06-17 09:12:15 -07:00
Grant Limberg 111228128f bugfixes 2026-06-17 08:46:15 -07:00
Grant Limberg fd98e0baa3 Addressing comments 2026-06-17 08:08:21 -07:00
Grant Limberg b6d5fb6fce set vcpagkage baseline and remove comment with text windows doesn't like 2026-06-15 18:54:41 -07:00
Grant Limberg c02c649cd3 more build updates.
removing openssl dependency (except on Linux where it's still necessary)
upgrade cpp-httplib
new cmake-presets
2026-06-15 18:51:24 -07:00
Grant Limberg ace5352388 Bump cpp-httplib so it supports win32 2026-06-15 17:41:09 -07:00
Grant Limberg deee555fbf fix deps so that architecture is taken into account 2026-06-15 17:27:00 -07:00
Grant Limberg 404fa9b2f9 fix incompatible options on crypto files in windows 2026-06-15 16:59:49 -07:00
Grant Limberg 4988d53d0e fix linking via CMake on Windows 2026-06-15 16:54:12 -07:00
Grant Limberg 14faaaa13e update to use makefiles by default on *ix 2026-06-15 16:48:58 -07:00
Grant Limberg 8ae153b44c Set thinkgs up for Windows in CMake
Also fixed a ZT_NONFREE issue
2026-06-15 16:22:17 -07:00
Grant Limberg f1c6a64035 build fix 2026-06-15 13:46:15 -07:00
Grant Limberg 0e637a1de6 More linux/mac cmake cleanup
* Brewfile for homebrew dependencies on macos
* Pull & build google-cloud-cpp/otel via bootstrap script rather than
  keeping it all in the ext/ subfolder.
* Update controller CI build with new steps
2026-06-15 12:59:32 -07:00
Grant Limberg e09e7b5c9b Fix PIC/PIE flags 2026-06-12 17:41:45 -07:00
Grant Limberg 052ea55636 bring CMake in line with make-linux/mac/bsd 2026-06-12 17:15:30 -07:00
Grant Limberg 378dd27361 main controller cmake file cleanup 2026-06-12 16:34:26 -07:00
Grant Limberg a4904c97b0 Repo cleanup.
* Remove now dead separate CV1/CV2 implementations.  Consolidated into
  CentralDB.
* Remove smeeclient.  No longer needed.
2026-06-12 16:23:04 -07:00
Grant Limberg 407bfdfd0b fix pubsub flood on ctl startup 2026-06-10 16:45:29 -07:00
Grant Limberg 85eec45372 remove db check from onlineNotificationThread 2026-06-10 15:46:12 -07:00
Grant Limberg fede9b9afb better logging of commit thread ticks
shows whats happening on each
2026-06-10 15:44:05 -07:00
Grant Limberg a3a45a75a7 Better data handling if a db write fails 2026-06-10 14:29:07 -07:00
Grant Limberg a001eba98f better closed connection handling to postgres 2026-06-10 14:05:46 -07:00
Grant Limberg af7c882315 perf(controller): drop per-row BigTable reads in status writer
writePending() did a synchronous ReadRow per queued node to avoid
rewriting unchanged os/arch/version. With thousands of check-ins per
cycle that's thousands of sequential round-trips every 10s, and the read
was nearly pointless since last_seen and the IP cell are written every
cycle anyway.

Replace it with an in-process cache of the last-written node_info per
row (keyed by a 64-bit hash of the row key). node_info is emitted only
when changed, new, or past its refresh window; check_in is still written
every cycle. Failed rows are dropped from the cache so they're rewritten
next cycle, and stale entries are evicted (24h TTL). Net result: one
BulkApply per cycle, no read RPCs.
2026-06-10 13:28:40 -07:00
Grant Limberg eec53a5866 Add handling sso networks for both CV1 & CV2 simultaneously 2026-06-02 14:54:55 -07:00
Grant Limberg 174130c080 More sso error logging & removing a few logs as well 2026-06-02 13:43:50 -07:00
Grant Limberg f76e6b916c This workflow does need to be removed from this branch.
once finally merged it'll be irrelevant.
2026-05-28 09:25:39 -07:00
Grant Limberg 3dffacc024 cargo fix 2026-05-28 09:12:38 -07:00
Grant Limberg 29f5464dbd Merge branch 'dev' into gl/ctl-pubsub 2026-05-28 08:49:48 -07:00
Grant Limberg 346dc907a1 remove noisy log 2026-05-28 08:03:07 -07:00
Dimitriy Dade a3b1a346c4 Merge pull request #2592 from zerotier/cv1
bringing back cv1 yaml
2026-05-27 16:23:53 -04:00
dimitriy-dade 9c2d5cd74c bringing back cv1 yaml 2026-05-27 16:14:53 -04:00
Dimitriy Dade fc5c3ec220 Merge pull request #2590 from zerotier/1.16.2
Merging 1.16.2 from Private to Public
2026-05-27 14:42:28 -04:00
dimitriy-dade fe29cd8888 fixing changelogs as required by linux builds and version for Mac 2026-05-27 14:29:53 -04:00
Grant Limberg b1427153aa handle nulls for remote trace target 2026-05-27 07:52:25 -07:00
dimitriy-dade 2ed9b86852 updated workflows 2026-05-22 19:56:47 -04:00
dimitriy-dade f87d5477f6 Merging 1.16.2 from Private to Public 2026-05-22 11:39:10 -04:00
countbinoculars 544809e738 Merge pull request #2588 from zerotier/dep-updates
Update some Rust dependencies
2026-05-21 15:53:07 -07:00
Chris Spiegel d678338b28 Update some Rust dependencies 2026-05-21 15:21:38 -07:00
Grant Limberg 80f5e81d8c ensure controller doesn't change assigned frontend 2026-05-19 11:09:02 -07:00
Grant Limberg 9a9a8c09c3 fix for missing field in json 2026-05-14 15:30:44 -07:00
Grant Limberg ac20c320cf update network.proto in line with CV1 and CV2 2026-05-14 13:07:13 -07:00
Grant Limberg 1c755845f0 align JSON keys between CentralDB and PubSub listener/writer
- Default enableBroadcast to true on load (initializeNetworks and _getNetwork) to match DB::initNetwork. Networks whose JSONB lacks the field now get broadcast on instead of off, which is the documented ZeroTier default.

- Stop overwriting networks_ctl.frontend on every UPDATE. It should remain whatever was set at INSERT. The early-exit guard already prevents cross-frontend writes from applying, so dropping the SET preserves correctness. Members are unaffected — they source frontend from the network row, not the change payload.

- Add enableBroadcast, creationTime, and revision to PubSubListener's network toJson. The protobuf carries them, but the listener was dropping them on inbound, which caused revision to reset on every PubSub-delivered network update.

- Rename member version keys to vMajor/vMinor/vRev/vProto in both PubSubListener (incoming) and PubSubWriter (outgoing). CentralDB, EmbeddedNetworkController, and the rest of the codebase already use these names; the listener/writer were the only sites using versionMajor/Minor/Rev/Protocol, so member version info was being silently dropped through PubSub in both directions.

- Pass newMember by const reference in ControllerChangeNotifier::notifyMemberChange to match notifyNetworkChange. Avoids a full JSON copy on every member notify.

- Remove duplicate nlohmann::json::parse call in RedisNetworkListener.
2026-05-13 11:01:39 -07:00
Grant Limberg 7b44e0a3a5 Fix json key inconsistency in pubsub writer 2026-05-13 10:40:02 -07:00
Grant Limberg b79592c71f Bugfix pass
ssoConfig checked wrong variable
DNS missing-branch wrote to input not output
SSO fields renamed to sso* and nested under ssoConfig (across CentralDB, DB defaults, migration_models)
Member identity populated into the right field; address = memberId
noAutoAssignIPs → noAutoAssignIps casing
Member version columns now SELECTed + populated (both sites)
removeTraceLevel typo in DB.cpp defaults
8. eraseMember uninitialized tmp2 — member deletes now actually delete
9. Connection leak on continue in both commit branches
10. Unsafe (uint64_t)config["revision"] cast → OSUtils::jsonInt
11. target = "NULL" literal text → std::optional<std::string> for real SQL NULL
~13 unsafe direct json→string casts → OSUtils::jsonString; dead vars removed from save(); change_source blocks use is_string() checks.
Heartbeat zadd literal "controllerId" → variable
Network revision double-increment removed
PubSub notifier now sees actual old state (DB query moved before INSERT in both branches)
_delete_network reads config["id"] instead of config["nwid"]
ip_assignments empty-string guards added at both sites (also closes G)
ensure last_modified is set on every write to networks & members
2026-05-13 10:28:15 -07:00
Grant Limberg f0522a7cdb fix a typo in some json handling that could be affecting an issue I'm tracking down 2026-05-08 10:58:05 -07:00
Grant Limberg 8c3a777108 addressing pr comments 2026-05-04 16:27:45 -07:00
Grant Limberg 23d395d781 change sso topic names for clarity 2026-04-30 09:41:24 -07:00
Grant Limberg 7b747aff3b Merge pull request #2582 from zerotier/rust-dep-updates
Dependency update for rust deps
2026-04-27 11:54:32 -07:00
Grant Limberg 484d9e0d8c cargo update 2026-04-27 11:31:02 -07:00
Grant Limberg 55aa87c372 Merge pull request #2577 from zerotier/cv1-schema-change
Handle a few incoming CV1 schema changes
2026-04-17 14:04:29 -07:00
Grant Limberg aa586efbb5 query fix 2026-04-17 13:50:49 -07:00
Grant Limberg 0e8ec661c8 make sure subscribe pulls stay running 2026-04-11 13:42:44 -07:00
Grant Limberg d2361a9a66 logging 2026-04-11 12:39:05 -07:00
Grant Limberg 910334c2a5 Fix silent PubSub message loss in controller subscription loop
The 10-second session.cancel() loop raced with in-flight acks — when
cancel fired while the GCP client was processing messages, acks were
lost before reaching the server. With message ordering enabled, an
unacked message blocks all subsequent messages on that ordering key,
causing silent stalls with no error output.

Two fixes:
- Replace the cancel/reconnect timer with a blocking session.get(),
  storing the session future so the destructor can cancel on shutdown.
- Always ack messages even when onNotification fails — permanent errors
  (bad protobuf, missing fields) will never succeed on retry and would
  otherwise poison the ordering key indefinitely.
2026-04-11 09:30:21 -07:00
Grant Limberg 4ca5c9b820 fix poison pill blocking proccessing 2026-04-11 07:40:11 -07:00
Grant Limberg 1f3a04f303 periodic queue size logging, and fix some db connection leaks 2026-04-03 10:28:28 -07:00
Grant Limberg af7eae5d9e Added a little bit more logging for the node checkin/bigtable write process 2026-04-03 09:52:55 -07:00
Grant Limberg ea5c91b0e9 Remove smee from CentralDB.
Now handled in CV1 on new member join via pubsub integration when a new member comes through
2026-04-02 10:04:23 -07:00
Grant Limberg 20f7311622 Skip redundant nonce sending with an expiry time of 0 2026-04-01 09:48:05 -07:00
Grant Limberg dd6e69f530 sso query fix in controller 2026-03-31 14:04:30 -07:00
Grant Limberg 78b25f4ae2 update settings to enable SSO networks 2026-03-31 13:24:03 -07:00
Grant Limberg 895b06033d temporary logging 2026-03-31 10:56:04 -07:00
Grant Limberg b047038ca1 print a message when the SSO PSK is configured 2026-03-31 08:48:00 -07:00
Grant Limberg 7ec42461d8 configure assigned central version in startup script 2026-03-19 11:57:35 -07:00
Grant Limberg e49b347a8f plumb through config changes for sso pubsub 2026-03-19 11:56:17 -07:00
Grant Limberg 7faf30d0cc another fix 2026-03-18 13:51:16 -07:00
Grant Limberg d9507dd895 Undo change to old migration that shouldn't have been made 2026-03-18 13:18:03 -07:00
Grant Limberg 2c57f85e25 add assigned_central_version column to controllers_ctl
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.
2026-03-17 16:30:25 -07:00
Grant Limberg a840b94e0d add SSO nonce/auth PubSub messaging with frontend routing
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
2026-03-17 14:42:49 -07:00
Grant Limberg 03aa33bba7 set network member frontend based on the network its a member of 2026-03-12 09:20:05 -07:00
Grant Limberg a2340bf60c add --provenance false to avoid $IMAGE is a manifest list error 2026-03-04 11:58:43 -08:00
Grant Limberg e918ec44d5 one last fix 2026-03-04 11:47:09 -08:00
Grant Limberg 34777b6bb4 another fix for multi-arch builds 2026-03-04 11:35:56 -08:00
Grant Limberg 97db010112 fix multi-arch manifest 2026-03-04 11:12:19 -08:00
Grant Limberg e81053aed7 fix build 2026-03-04 10:57:46 -08:00
Grant Limberg 91428eacae add github action for creating CV1 controller images 2026-03-04 10:51:13 -08:00
Grant Limberg 936801a51b update gitignore 2026-03-02 14:08:07 -08:00
Grant Limberg 8f1b213994 still use use_redis column 2026-03-02 14:08:02 -08:00
Grant Limberg 7f47b2ba8f update dockerfile to get around go stdlib bug in controller build 2026-03-02 14:07:53 -08:00
Grant Limberg eac140aa73 Update use of ztc_controller table for changes in progress in CV1. 2026-03-02 13:14:16 -08:00
Dimitriy Dade d9a7f62a5c Merge pull request #2568 from zerotier/dimitriy-dev
Updating versions that were flagged as vulnerable by Dependabot
2026-02-26 13:44:04 -05:00
Grant Limberg 38f4d124b0 woops. out of order here 2026-02-25 15:04:40 -08:00
Grant Limberg 0ad6b19705 drop index 2026-02-25 14:37:27 -08:00
Grant Limberg ae7ee51b9d fix db migrations 2026-02-25 14:36:53 -08:00
dimitriy.dade 294af67370 Updating versions that were flagged as vulnerable by Dependabot 2026-02-25 17:00:20 -05:00
Grant Limberg 0f0e6b3b16 add a linked_id column to the oidc_config table.
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
2026-02-25 13:37:04 -08:00
Grant Limberg c653e764b8 WIP: Update sso info retrieval method 2026-02-24 14:01:33 -08:00
Grant Limberg 35f7bf2291 disable peer metrics in Central controller 2026-01-23 13:06:02 -08:00
Grant Limberg ccb9a45d21 Remove extra verbose logging from controller 2026-01-23 11:53:06 -08:00
Grant Limberg 68a96344ed Merge branch 'dev' into gl/ctl-pusub 2026-01-23 11:18:45 -08:00
Adam Ierymenko 67648579b5 Merge pull request #2549 from zerotier/1.16.1
1.16.1
2026-01-20 11:53:31 -05:00
Adam Ierymenko fa601636aa Merge branch 'dev' into 1.16.1 2025-12-22 18:20:59 -05:00
Adam Ierymenko d2b4b6e91d Add date to release notes. 2025-12-22 17:49:15 -05:00
Adam Ierymenko a77009e4f0 notes 2025-12-22 16:50:13 -05:00
Chris Spiegel 9c2bd25d86 Add a couple entries to the release notes
The date still needs to be updated when this is actually released.
2025-12-22 12:50:02 -08:00
Adam Ierymenko 22b47f851e 1.16.1 Windows bump 2025-12-12 14:43:40 -05:00
Adam Ierymenko 2342926442 All version bumps but Windows. 2025-12-12 14:17:21 -05:00
Joseph Henry 458c5c9709 Merge pull request #21 from zerotier/joseph-henry-disable-http-debug
Disable debug logging for the HTTP API library
2025-12-01 14:34:32 -08:00
Joseph Henry 4f6b9038f1 Disable debug logging for the HTTP API library
This just quiets things down a little since the HTTP library produces so much verbose text.
2025-12-01 14:32:11 -08:00
Grant Limberg 2ba50f4544 set --provenance false on docker build to try and fix docker image creation issue 2025-11-12 16:17:03 -08:00
Grant Limberg 50daf9537b controller build readme update 2025-11-11 18:40:58 -08:00
Chris Spiegel 20007a73df Merge pull request #12 from zerotier/erase-after-unique
Ensure erase() is called after std::unique()
2025-11-10 12:45:36 -08:00
Joseph Henry 7f5850a943 Merge pull request #11 from zerotier/snprintf-into-self
Avoid using the same source and destination in snprintf()
2025-11-10 09:50:22 -08:00
Joseph Henry 8e5d81728f Merge pull request #10 from zerotier/windows-bool-assign
Fix assignment vs comparison typo
2025-11-10 09:46:58 -08:00
Joseph Henry 300b05aaf0 Merge pull request #8 from zerotier/2152-disable-metrics
Allow metrics to be disabled
2025-11-10 09:39:43 -08:00
Joseph Henry 595a70c5ed Remove old multipathMode setting 2025-11-10 09:38:59 -08:00
Grant Limberg 00dca6a2c0 Merge branch 'dev' into gl/ctl-pubsub 2025-11-06 10:01:11 -08:00
Chris Spiegel 9e53fe4b12 Avoid using the same source and destination in snprintf()
It's undefined to write to a buffer you're reading from in snprintf().
On modern glibc and musl versions, this results in the string
"/zerotier_dump.txt" being generated, i.e. in the root directory. Use a
new variable to hold the string dump.

This is done for MacOS as well. On Sequoia, at least, it's not
necessary, as it handles overlapping objects fine, but this is more
future-proof.

At the same time, include a specific error message when the dumpfile
can't be opened to help users track down problems. Also, truncate the
file so that new writes don't potentially leave stale data.
2025-11-06 08:28:33 -08:00
Chris Spiegel fb162084f5 Fix assignment vs comparison typo
At the same time, ensure a newline is written after the error message.
2025-11-06 05:24:56 -08:00
Chris Spiegel 1d9f06d4ac Disable metrics by default 2025-11-06 05:18:26 -08:00
Chris Spiegel 48311896f8 Allow metrics to be disabled 2025-11-06 05:17:57 -08:00
Chris Spiegel 616698fa91 Ensure erase() is called after std::unique()
Without this the duplicates are just moved to the end of the collection,
but not actually erased.
2025-11-06 05:15:48 -08:00
Chris Spiegel b8e3ca6a2c Merge pull request #7 from zerotier/2279-prometheus-after-daemonize
Stop and restart the Prometheus worker thread when daemonizing
2025-11-05 15:11:00 -08:00
Chris Spiegel f231561276 Stop and restart the Prometheus worker thread when daemonizing
Also use _Exit() instead of returning from main() to avoid duplicate
cleanup/flusing/etc.
2025-11-05 14:15:47 -08:00
Joseph Henry ce5556a677 Merge pull request #4 from zerotier/dev-merge-from-public-repo
Dev merge from public repo
2025-11-04 15:26:05 -08:00
Joseph Henry 8d4cb1e05b Merge pull request #2535 from cspiegel/uninitialized-vars
Ensure members in PacketMultiplexer are initialized
2025-11-03 14:21:34 -08:00
Chris Spiegel 45773f0b6e Ensure members in PacketMultiplexer are initialized
_enabled is set to true by setUpPostDecodeReceiveThreads(), so disabled
until then, but the constructor wasn't initializing it. _concurrency is
not being used before being set but for safety's sake, ensure it has a
starting value as well.

Also, remove the vestigial _rxThreadCount, which is no longer used.
2025-11-03 11:20:01 -08:00
Grant Limberg 5c27068b80 Enable cross-service propagation of otel trace metadata 2025-10-30 13:47:50 +01:00
Grant Limberg 30c4484731 Set ordering key on pubsub message publishing. 2025-10-27 11:01:36 +01:00
Grant Limberg c21ff23477 Added some more logging to the ctl around deauths 2025-10-27 09:44:36 +01:00
Grant Limberg 76ba89060b ensure change source is controller if otherwise unset 2025-10-09 16:29:43 -07:00
Grant Limberg 77aa8c7bf8 missed one 2025-10-09 15:47:34 -07:00
Grant Limberg bf0fe2c09a these should be empty json arrays, not just "[]".
Actually these *should* be structs, not filling out json.  Adding this to the tech debt backlog
2025-10-09 15:39:40 -07:00
Grant Limberg 19ccc98f91 more variations on checking json 2025-10-09 15:28:48 -07:00
Grant Limberg e3f65ff359 compiler fix 2025-10-09 15:02:16 -07:00
Grant Limberg 47367673f9 more robustifying incoming messages 2025-10-09 14:47:25 -07:00
Grant Limberg 46a8cd7b67 robustify the handling of tags/capabilities/rules which are strings of encoded json 2025-10-09 14:39:46 -07:00
Grant Limberg 946d96f482 dont NACK failed messages. That gets us into a loop of failing the same messages over and over again 2025-10-09 14:34:24 -07:00
Grant Limberg b92fb93f8f Merge branch 'dev' into gl/ctl-pubsub 2025-10-06 16:55:28 -07:00
Grant Limberg 6b74bf289a fix assign mode json 2025-10-06 15:10:42 -07:00
Grant Limberg fe221b9359 debug output for IP addressing & fixing order of operations in a couple of places. Only send notification of a change to pubsub after it's been written to the DB 2025-10-06 14:24:57 -07:00
Luke Souter ab75985766 Merge pull request #2511 from zerotier/update-readme
Shorten/clean README.md. Split README into a few separate, including BUILD. Correctly references licensing information.
2025-10-02 16:05:05 -07:00
Grant Limberg 6df7366753 no need for these timeouts 2025-10-02 16:00:08 -07:00
Grant Limberg 1ef7ea0fe6 Fixing more JSON issues 2025-10-02 15:04:57 -07:00
Grant Limberg 18714c7785 add explicit nack if there's an error processing a pubsub message 2025-10-02 11:56:44 -07:00
Grant Limberg a75d06ad64 cleaning up some gross JSON code 2025-10-02 11:35:03 -07:00
Grant Limberg 4861b7df1e one last json parsing fix. but really this time 2025-10-01 17:18:31 -07:00
Grant Limberg 0d21250b62 one last json parsing fix 2025-10-01 16:33:17 -07:00
Grant Limberg 3bbf194594 pubsub writer should work now 2025-10-01 16:25:27 -07:00
Grant Limberg fb75369597 throwing stuff at the wall cuz I can't actually debug this right now 2025-10-01 16:08:06 -07:00
Grant Limberg a8b5c89efa think this is where things are crashing, but I'm not sure why yet. Comment it out to make sure 2025-10-01 15:05:34 -07:00
Grant Limberg 80f82132dd fix tags/capabilities? 2025-10-01 14:00:17 -07:00
Grant Limberg 7faf705e10 make the default an empty array here 2025-10-01 13:33:02 -07:00
Grant Limberg 1f557b516f more debug output 2025-10-01 13:30:25 -07:00
Grant Limberg aecd7fdace more logging 2025-10-01 13:13:58 -07:00
Grant Limberg dad1a1eda6 more logging 2025-10-01 13:12:45 -07:00
Grant Limberg f028213c7f debug output 2025-10-01 12:40:50 -07:00
Grant Limberg b4f018b918 debug output from parsing pubsub messages 2025-10-01 09:07:08 -07:00
Grant Limberg 20a67ab1de fix attempted null -> string conversion 2025-10-01 08:06:40 -07:00
Grant Limberg 02908e5202 stray ` got in there 2025-09-30 10:52:00 -07:00
Grant Limberg 97d20a1155 more logging for errors on pubsub listener 2025-09-30 10:32:21 -07:00
Grant Limberg 315bf240fc json field fix 2025-09-25 16:34:08 -07:00
Grant Limberg c6b7c263d2 query fix for new networks 2025-09-25 16:09:57 -07:00
Grant Limberg e51e516f85 fix subscription creation 2025-09-25 15:38:28 -07:00
Grant Limberg 069d7c1862 set objtype on messages received via PubSub 2025-09-25 15:14:30 -07:00
Luke Souter 4b9724c8fa Merge branch 'update-readme' of https://github.com/zerotier/ZeroTierOne into update-readme 2025-09-23 10:20:58 -07:00
Luke Souter f2d4a882d9 removed duplicate title, added build link, fixed controller link 2025-09-23 10:20:49 -07:00
Grant Limberg 6196e87303 only create the subscription if pubsub emulator is being used. 2025-09-22 16:32:28 -07:00
Grant Limberg d96d3b27d2 try making the controller attach to an existing pubsub subscription if it already exists 2025-09-22 10:52:06 -07:00
Luke Souter 0cf5ab9375 Merge branch 'dev' into update-readme 2025-09-18 14:29:49 -07:00
Luke Souter 4f2717c244 added build.md
Drastically shortened main readme and linked out to build notes instead. Clarified licensing info to just match license.txt.
2025-09-18 14:29:09 -07:00
Grant Limberg 6113bad61e make pubsub topics configurable
Also for pubsub trips back to CV1/CV2, rather than having 2 queues for each service (networks & members), theres now only a single queue for each change type, and `frontend = (cv1|cv2)` attribute is set on the message for filtering.
2025-09-18 09:33:04 -07:00
Adam Ierymenko 895b8211e1 Merge pull request #2514 from zerotier/fix-debian-controller-build
Fix debian controller build
2025-09-15 12:27:29 -04:00
Grant Limberg cb2de5aae1 fix migration 2025-09-13 10:29:45 -07:00
Grant Limberg ad1fc5fb3d add tables for the controller load log and sso nonces & expiry 2025-09-13 10:05:20 -07:00
Adam Ierymenko a28a6d1bf5 Build fix. 2025-09-13 11:07:36 -04:00
Adam Ierymenko 6921628610 RPM too 2025-09-12 19:17:37 -04:00
Adam Ierymenko 5d18a57518 Include controller on debian. 2025-09-12 19:17:11 -04:00
Luke Souter b62b9e28b9 Merge branch 'update-readme' of https://github.com/zerotier/ZeroTierOne into update-readme 2025-09-12 14:14:11 -07:00
Luke Souter be5baa76b9 Update README.md 2025-09-12 14:14:06 -07:00
Luke Souter a6d2e80b08 Merge branch 'dev' into update-readme 2025-09-11 12:27:03 -07:00
Luke Souter b0ba0d7227 Update README.md 2025-09-11 12:16:33 -07:00
Grant Limberg 1ce37e7770 add use_for_new_networks column in controller table 2025-09-11 10:02:45 -07:00
Grant Limberg 493cc4fe4f fix version string 2025-09-10 08:13:56 -07:00
Grant Limberg 7aa451bec1 clean up deprecation warnings in pqxx 2025-09-10 07:43:21 -07:00
Grant Limberg 012443acfa wire up pubsub notifications from controller to frontend 2025-09-08 16:01:50 -07:00
Grant Limberg ee87eb3101 removing some log output 2025-09-08 11:34:03 -07:00
Grant Limberg facca364fb only update os, architecture and client version if they've changed (or don't exist) 2025-09-08 11:00:17 -07:00
Grant Limberg 1d65c1e43e back to bulk apply for status updates in BigTable 2025-09-08 10:50:10 -07:00
Grant Limberg 1ba4ccd98d pass version info to status writer 2025-09-08 10:46:01 -07:00
Grant Limberg 934aa93ef8 forgot a ; 2025-09-08 10:32:57 -07:00
Grant Limberg 88f08fa58c append 8 random hex chars to the subscription id 2025-09-08 10:29:30 -07:00
Grant Limberg f51bfdb666 delete pubsub subscription on shutdown 2025-09-08 10:25:32 -07:00
Grant Limberg 190d836b42 alloc meatadata with new so pubsub can delete it 2025-09-08 09:49:26 -07:00
Grant Limberg 006ced2900 more fixes 2025-09-08 09:05:00 -07:00
Grant Limberg ebf66b7920 fix typo in cmake file 2025-09-08 08:53:35 -07:00
Grant Limberg 71d68e9a60 fix stack corruption in DB::get 2025-09-08 08:49:23 -07:00
Grant Limberg a78ac17d10 fix compile & link on macOS 2025-09-06 15:02:59 -07:00
Grant Limberg 36219c59ae compiler on mac doesn't like this. not really needed though 2025-09-06 15:02:48 -07:00
Grant Limberg 69efa924e2 apply patch to libnatpmp repo so we can compile on macOS with CMake 2025-09-06 15:01:48 -07:00
Grant Limberg 3d72a43a19 misc bugfixes 2025-09-06 12:37:28 -07:00
Grant Limberg 7ad264df92 whoops. mesed up the migrate naming convention 2025-09-05 15:20:33 -07:00
Grant Limberg 024824c2fe wire up pubsub outgoing status changes from controller -> CV2 2025-09-05 14:52:16 -07:00
Grant Limberg 74f0525470 Add frontend column to networks & network_memberships tables so the controller knows which system owns the networks & members 2025-09-05 08:43:06 -07:00
Grant Limberg ba6200fb96 add a ChangeSource enum to the change protobuf messages 2025-09-05 08:19:32 -07:00
Grant Limberg 282d7c7f9d another fix 2025-09-04 17:45:38 -07:00
Grant Limberg 48ff61b392 fix 2025-09-04 17:28:14 -07:00
Grant Limberg a061c86594 fix 2025-09-04 17:00:15 -07:00
Grant Limberg a18e370d48 another query fix 2025-09-04 16:31:16 -07:00
Grant Limberg e9565cf97c another query fix 2025-09-04 16:12:21 -07:00
Grant Limberg 3b7958aec1 another query fix 2025-09-04 16:07:28 -07:00
Grant Limberg 20746b2754 query fix 2025-09-04 15:41:33 -07:00
Grant Limberg b16d9372b8 fix otel exporting 2025-09-04 15:11:57 -07:00
Grant Limberg f208007226 enable otel exporter 2025-09-04 14:48:04 -07:00
Grant Limberg dcd583f62b cleanup controller github action 2025-09-04 14:47:58 -07:00
Grant Limberg 3616c4026b move up the gcp auth step 2025-09-04 14:23:49 -07:00
Grant Limberg 67526d494a move up docker auth 2025-09-04 14:15:51 -07:00
Grant Limberg 8bd96d360f build in containers 2025-09-04 14:14:59 -07:00
Grant Limberg 70d24fc7eb trying to build in a docker container 2025-09-04 14:02:58 -07:00
Grant Limberg 40f6508717 add conda builder dockerfile 2025-09-04 13:50:11 -07:00
Grant Limberg 7d5a60b44e will this make arm64 containers work? 2025-09-04 13:08:27 -07:00
Grant Limberg 2264452ad8 try to make this work on both x64 & arm64 2025-09-04 12:19:53 -07:00
Grant Limberg 73e3287fd6 debugging runtime link issues on arm64 2025-09-04 12:14:32 -07:00
Grant Limberg f33e706887 get a running controller in docker 2025-09-04 11:42:53 -07:00
Grant Limberg 686653509a debug printf 2025-09-04 11:27:59 -07:00
Grant Limberg ce84de605d and instead of or in postgres check 2025-09-04 11:24:01 -07:00
Grant Limberg 7e4e7ef753 fix case for redis: null 2025-09-04 11:19:22 -07:00
Grant Limberg b94fa2d95d . 2025-09-04 11:18:08 -07:00
Grant Limberg c9c8e95d60 debug output of main script 2025-09-04 11:16:48 -07:00
Grant Limberg d216a3739f run process in conda env directly from docker 2025-09-04 11:14:34 -07:00
Grant Limberg 092fc268d3 ok back to full path 2025-09-04 11:11:14 -07:00
Grant Limberg 1da9e24905 no absolute path for pg_isready 2025-09-04 11:03:30 -07:00
Grant Limberg 158d24545a also have to add postgres to the container for pg_isready 2025-09-04 10:30:08 -07:00
Grant Limberg 96aa893df4 stray backtick 2025-09-04 09:50:19 -07:00
Grant Limberg 4516e6a340 need a conda init here first apparently 2025-09-04 09:27:08 -07:00
Grant Limberg 2416c42df7 change tag to match existing 2025-09-04 08:48:54 -07:00
Grant Limberg 4f07599992 add jemalloc 2025-09-03 15:04:51 -07:00
Grant Limberg 6ceb8eac97 text alignment 2025-09-03 13:56:32 -07:00
Grant Limberg 3ad352c08e no trailing comma on bigtable block 2025-09-03 13:56:04 -07:00
Grant Limberg 9d73c346b7 new modified startup script for central controller docker images with support for configuring bigtable, pubsub, redis 2025-09-03 13:48:38 -07:00
Grant Limberg 4abf90247d update ld.so.conf for paths to libraries 2025-09-03 13:22:21 -07:00
Grant Limberg 594d227f92 fix multi-arch manifest creation 2025-09-03 12:18:21 -07:00
Grant Limberg 7fd112eb4f fix short hash 2025-09-03 11:50:09 -07:00
Grant Limberg 000f3d5a8c let's build a docker image 2025-09-03 11:37:26 -07:00
Grant Limberg 3f3e684811 only update conda env if cache was not hit 2025-09-03 10:42:22 -07:00
Grant Limberg a841e96bd2 put git branch ref into cache key name 2025-09-03 10:40:31 -07:00
Grant Limberg 3ff4d67d21 bump 2025-09-03 10:29:53 -07:00
Grant Limberg b09956ae59 fix run arg 2025-09-03 10:28:42 -07:00
Grant Limberg 4395574706 cache conda environment 2025-09-03 10:27:06 -07:00
Grant Limberg 1dae4c4c5f cache conda environment 2025-09-03 10:23:33 -07:00
Grant Limberg d31b3a08db set ZT_AES_NEON for arm64 2025-09-03 10:08:16 -07:00
Grant Limberg 0f3a5148b1 fix deps for selftest 2025-09-03 09:29:33 -07:00
Grant Limberg d3f1ec74ba fix arm64 build flag 2025-09-03 09:20:13 -07:00
Grant Limberg 3470ceb13d cmake --build args 2025-09-03 09:12:04 -07:00
Grant Limberg 648f0915e5 skip cmake action 2025-09-03 09:09:17 -07:00
Grant Limberg 21e20f2104 more conda 2025-09-03 09:04:40 -07:00
Grant Limberg f43bc3d10c more conda 2025-09-03 09:00:36 -07:00
Grant Limberg 3ad36c773d fix cmake options 2025-09-03 08:55:29 -07:00
Grant Limberg 22484c708f dependency juggling 2025-09-03 08:51:21 -07:00
Grant Limberg cab33dfc89 no linux/arm64 build available for google-cloud-cpp 2.39 :/. Downgrade to 2.38 2025-09-03 08:45:33 -07:00
Grant Limberg e1db40d932 test 2025-09-03 08:39:02 -07:00
Grant Limberg 97681b589e trying to get this working 2025-09-03 08:37:30 -07:00
Grant Limberg 09f1ee77e1 skip caching until this all works 2025-09-03 08:26:08 -07:00
Grant Limberg 0f13363895 runs-on matrix 2025-09-03 08:22:47 -07:00
Grant Limberg 7c1bfc97c4 setup github action for building 2025-09-03 08:18:56 -07:00
Grant Limberg 2a647d497a remove otel warning 2025-09-02 16:25:16 -07:00
Grant Limberg 70f9fe0412 update central controller readme with config block 2025-09-02 14:15:28 -07:00
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
Grant Limberg a5bd262b3a Wiring through initialization of the CentralDB version of the controller
Still need to do the actual configuration from local.conf
2025-09-02 13:30:08 -07:00
Grant Limberg 4ddb1fbe58 Create the pubsub topic if it doesn't exist 2025-09-02 07:49:41 -07:00
Grant Limberg 195d5b47f0 Merge branch 'adam/1.16' into gl/ctl-pubsub 2025-09-01 16:47:55 -07:00
Grant Limberg 496e69e666 add def for new style controllers 2025-09-01 15:29:27 -07:00
Grant Limberg 0f63783592 remove rust-based pubsub 2025-09-01 14:55:16 -07:00
Grant Limberg db6e698245 rework the pubsub listener again so the subscription is set up on its own thread 2025-09-01 14:40:18 -07:00
Grant Limberg b114896e7b PubSub to gcloud-cpp library for simplicity's sake 2025-09-01 14:25:15 -07:00
Grant Limberg 17b48d78cb Merge branch 'dev' into gl/ctl-pubsub 2025-09-01 09:50:15 -07:00
Grant Limberg e347f895b8 add sleep at end of online notificaiton loop 2025-09-01 09:44:39 -07:00
Grant Limberg d119547a95 wire up status writers 2025-09-01 09:18:01 -07:00
Grant Limberg 85f23356a3 add a StatusWriter class hierarchy for writing member status updates
* Postgres Direct
* Redis
* BigTable
2025-08-28 17:03:59 -07:00
Grant Limberg 3187c2ffce clang format change (not applied project-wide yet) 2025-08-28 17:00:06 -07:00
Grant Limberg 9bdd564bdc spacing 2025-08-27 16:23:55 -07:00
Grant Limberg 7f3b15011e Update central controller build to use CMake + conda
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
2025-08-27 16:23:02 -07:00
Grant Limberg f8a4a5d6af rework protobuf messages
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
2025-08-25 15:09:10 -07:00
Grant Limberg 2833d0e4f4 make whether SSO is enabled a switchable config value 2025-08-20 17:07:56 -07:00
Grant Limberg 95224379aa Refactor Redis & Posgres notification listeners into listener subclass in new CentralDB class
This allows us to interchangeably use different listeners (pgsql, redis, pubsub) depending on configuration values passed into the constructor.
2025-08-20 17:04:28 -07:00
Grant Limberg ebe8fdb08e rename classes 2025-08-20 10:07:13 -07:00
Grant Limberg 650fc0c74b Add C++ wrapper around pubsub listeners 2025-08-15 16:53:58 -07:00
Grant Limberg b90ad51723 more calling async from non-async changes 2025-08-15 08:22:55 -07:00
Grant Limberg 4237830a97 revert default feature list once again 2025-08-14 14:25:19 -07:00
Grant Limberg 4fab227c23 fix calling into async functions from non-async via the FFI 2025-08-14 14:20:34 -07:00
Grant Limberg e4147f7b80 fix build script 2025-08-14 13:00:11 -07:00
Grant Limberg d4ee95e445 feature cleanup 2025-08-14 12:51:22 -07:00
Grant Limberg a842ad8b61 remove ztcontroller from default feature list 2025-08-14 12:43:42 -07:00
Grant Limberg 3a209e2930 expose change_handler to C via FFI 2025-08-14 12:43:00 -07:00
Grant Limberg ccb0fa748f updates & tests.
Tests currently need to be run with --test-threads=1.  Seems like the instances of the pubsub emulator stomp on each other without that
2025-08-14 12:31:42 -07:00
Grant Limberg bf8c9d0124 function naming cleanup.
match other things already written
2025-08-13 12:25:36 -07:00
Grant Limberg 0e94891e5b plumb through callbacks 2025-08-13 12:17:03 -07:00
Grant Limberg 06b2ce9f30 WIP: pubsub wrapper in Rust 2025-08-12 10:42:07 -07:00
Grant Limberg f079f8bc82 cleanup warnings 2025-08-11 11:31:15 -07:00
Grant Limberg 837f15d01b tokio is needed by both temporal & gcloud pubsub, so make just one instance for the whole library, add init/shutdown functions for it exposed to C 2025-08-07 11:28:22 -07:00
Grant Limberg 4b3b847c7f fix windows bui ld 2025-08-05 16:38:57 -07:00
Grant Limberg a55216310a fix macos build 2025-08-05 16:18:21 -07:00
Grant Limberg 44d0e81572 gcloud-pubsub only if ztcontroller is flagged 2025-08-05 16:07:26 -07:00
Grant Limberg f9500ca5ff fix dependencies when temporal isn't needed 2025-08-05 16:05:51 -07:00
Grant Limberg e822811f29 reorganize rustybits into a single library with smeeclient behind the ztcontroller feature flag 2025-08-05 15:52:58 -07:00
1435 changed files with 11603 additions and 193215 deletions

No files matched your search

+46 -47
View File
@@ -4,72 +4,71 @@ BreakBeforeBraces: Stroustrup
IndentWidth: 4
TabWidth: 4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveMacros: 'true'
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignConsecutiveMacros: "true"
AlignConsecutiveAssignments: "false"
AlignConsecutiveDeclarations: "false"
AlignEscapedNewlines: Right
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllArgumentsOnNextLine: 'false'
AllowAllConstructorInitializersOnNextLine: 'false'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'true'
AllowShortCaseLabelsOnASingleLine: 'false'
AlignOperands: "true"
AlignTrailingComments: "true"
AllowAllArgumentsOnNextLine: "false"
AllowAllConstructorInitializersOnNextLine: "false"
AllowAllParametersOfDeclarationOnNextLine: "false"
AllowShortBlocksOnASingleLine: "true"
AllowShortCaseLabelsOnASingleLine: "false"
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: Never
AlwaysBreakAfterReturnType: None
BinPackArguments: 'false'
BinPackParameters: 'false'
BinPackArguments: "true"
BinPackParameters: OnePerLine
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: 'true'
BreakBeforeTernaryOperators: "true"
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
CompactNamespaces: 'false'
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
ConstructorInitializerIndentWidth: '4'
ContinuationIndentWidth: '4'
Cpp11BracedListStyle: 'false'
FixNamespaceComments: 'true'
CompactNamespaces: "false"
ConstructorInitializerAllOnOneLineOrOnePerLine: "true"
ConstructorInitializerIndentWidth: "4"
ContinuationIndentWidth: "4"
Cpp11BracedListStyle: "false"
FixNamespaceComments: "true"
IncludeBlocks: Regroup
IndentCaseLabels: 'true'
IndentCaseLabels: "true"
IndentPPDirectives: None
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
MaxEmptyLinesToKeep: '1'
IndentWrappedFunctionNames: "false"
KeepEmptyLinesAtTheStartOfBlocks: "false"
MaxEmptyLinesToKeep: "1"
NamespaceIndentation: None
PointerAlignment: Left
ReflowComments: 'true'
SortIncludes: 'true'
SortUsingDeclarations: 'true'
SpaceAfterCStyleCast: 'false'
SpaceAfterLogicalNot: 'true'
SpaceAfterTemplateKeyword: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeCpp11BracedList: 'true'
SpaceBeforeCtorInitializerColon: 'true'
SpaceBeforeInheritanceColon: 'true'
ReflowComments: "true"
SortIncludes: "true"
SortUsingDeclarations: "true"
SpaceAfterCStyleCast: "false"
SpaceAfterLogicalNot: "true"
SpaceAfterTemplateKeyword: "true"
SpaceBeforeAssignmentOperators: "true"
SpaceBeforeCpp11BracedList: "true"
SpaceBeforeCtorInitializerColon: "true"
SpaceBeforeInheritanceColon: "true"
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: 'true'
SpaceInEmptyParentheses: 'false'
SpacesBeforeTrailingComments: '3'
SpacesInAngles: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInContainerLiterals: 'true'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
UseTab: 'Always'
SpaceBeforeRangeBasedForLoopColon: "true"
SpaceInEmptyParentheses: "false"
SpacesBeforeTrailingComments: "3"
SpacesInAngles: "false"
SpacesInCStyleCastParentheses: "false"
SpacesInContainerLiterals: "true"
SpacesInParentheses: "false"
SpacesInSquareBrackets: "false"
UseTab: "Always"
---
Language: Cpp
Standard: Cpp03
ColumnLimit: '240'
ColumnLimit: "120"
---
Language: ObjC
ColumnLimit: '240'
ColumnLimit: "120"
---
Language: Java
ColumnLimit: '240'
ColumnLimit: "120"
---
Language: CSharp
ColumnLimit: '240'
...
ColumnLimit: "120"
+10
View File
@@ -1,2 +1,12 @@
.git/
workspace/
# Local from-source dependency builds (scripts/bootstrap-deps.sh) and CMake output;
# never ship these into an image -- they are host-specific and large.
.deps/
.deps-build/
build/
build-*/
out/
# Dockerfiles are supplied via -f; keeping them out of the context means editing
# them does not invalidate the COPY layers (and the heavy build cache).
ext/central-controller-docker/Dockerfile*
+2 -2
View File
@@ -90,7 +90,7 @@ jobs:
build_windows:
runs-on: windows-latest
runs-on: windows-2022
steps:
- name: gitconfig
run: |
@@ -102,7 +102,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: aarch64-apple-darwin
targets: x86_64-pc-windows-msvc
components: rustfmt, clippy
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
+104
View File
@@ -0,0 +1,104 @@
# on:
# workflow_dispatch:
on:
push:
workflow_dispatch:
jobs:
central_controller:
name: Central Controller Build
strategy:
matrix:
runner: [gha-runner-x64, gha-runner-arm64]
runs-on: ${{ matrix.runner }}
steps:
- name: checkout
uses: actions/checkout@v6
- name: GCP Auth
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.DOCKER_REGISTRY_WRITER}}
- name: Set up GCloud CLI
uses: google-github-actions/setup-gcloud@v3
with:
# v3 no longer uses the tool cache by default; restore the prior caching
# behavior on these self-hosted runners (perf: avoids re-fetching the SDK).
cache: true
- name: Docker Auth
run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
- name: Get branch name and sanitize
id: branch
run: |
BRANCH_NAME="${GITHUB_REF##*/}"
SANITIZED_BRANCH="${BRANCH_NAME//\//-}"
echo "branch_name=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT
- name: Get short git commit SHA
id: sha
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build & Push Docker Image
# Registry layer cache (mode=max) so the expensive builder stage -- which
# builds opentelemetry-cpp + google-cloud-cpp from source -- is reused across
# runs and fresh runners. The cache invalidates automatically when the
# bootstrap inputs change. Cache is per-arch (the deps layer is arch-specific).
run: |
CACHE=us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller-buildcache:${{ runner.arch }}
docker buildx build \
-t us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}-${{ runner.arch }} \
-f ext/central-controller-docker/Dockerfile \
--cache-from type=registry,ref=$CACHE \
--cache-to type=registry,ref=$CACHE,mode=max \
--provenance false \
--push .
multi-arch-docker:
runs-on: gha-runner-x64
needs: central_controller
steps:
- name: Checkout
uses: actions/checkout@v6
- name: GCP Auth
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.DOCKER_REGISTRY_WRITER}}
- name: Set up GCloud CLI
uses: google-github-actions/setup-gcloud@v3
with:
# v3 no longer uses the tool cache by default; restore the prior caching
# behavior on these self-hosted runners (perf: avoids re-fetching the SDK).
cache: true
- name: Docker Auth
run: gcloud auth configure-docker us-central1-docker.pkg.dev --quiet
- name: Get branch name and sanitize
id: branch
run: |
BRANCH_NAME="${GITHUB_REF##*/}"
SANITIZED_BRANCH="${BRANCH_NAME//\//-}"
echo "branch_name=$SANITIZED_BRANCH" >> $GITHUB_OUTPUT
- name: Get short git commit SHA
id: sha
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Create and push multi-arch manifest
run: |
docker manifest create us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }} \
--amend us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}-X64 \
--amend us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}-ARM64
docker manifest push us-central1-docker.pkg.dev/zerotier-421eb9/docker-images/ztcentral-controller:${{ env.COMMIT_SHORT_SHA }}-${{ steps.branch.outputs.branch_name }}
+5 -6
View File
@@ -12,26 +12,25 @@ jobs:
git config --global core.autocrlf input
- name: checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
override: true
targets: x86_64-unknown-linux-gnu
components: rustfmt, clippy
- name: Set up cargo cache
uses: Swatinem/rust-cache@v2
continue-on-error: false
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('zeroidc//Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
shared-key: ${{ runner.os }}-cargo-
workspaces: |
zeroidc/
rustybits/
- name: validate-1m-linux
env:
+10
View File
@@ -91,6 +91,7 @@ debian/zerotier-one*.debhelper
debian/*.log
debian/zerotier-one.substvars
root-watcher/config.json
build/
# Java/Android/JNI build droppings
java/obj/
@@ -106,6 +107,7 @@ windows/WinUI/bin/
windows/ZeroTierOne/Debug/
/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg
# Miscellaneous mac/Xcode droppings
.Trashes
*.swp
@@ -141,3 +143,11 @@ __pycache__
*.pyc
*_source.tar.bz2
snap/.snapcraft
build/
# Local dependency bootstrap output (scripts/bootstrap-deps.sh): the install
# prefix and the build/clone scratch dir. Large + host-specific; never commit.
.deps/
.deps-build/
.claude/*.local.*
+28
View File
@@ -0,0 +1,28 @@
# Central Controller build dependencies for macOS development.
#
# brew bundle # install the deps below
# ZT_CONTROLLER_DEPS=1 scripts/bootstrap-deps.sh # build the two pinned controller deps (full OTel + google-cloud-cpp)
#
# The two version-sensitive C++ libraries (opentelemetry-cpp, google-cloud-cpp)
# are NOT taken from Homebrew -- they are pinned and built from source by
# scripts/bootstrap-deps.sh so every dev/CI machine uses the same versions
# (the role conda previously filled). Everything below is stable enough to take
# from Homebrew.
brew "cmake"
brew "ninja"
brew "pkg-config"
brew "rustup-init" # then: rustup-init -y && rustup default stable
brew "libpqxx"
brew "libpq" # keg-only; add $(brew --prefix libpq) to CMAKE_PREFIX_PATH so find_package(PostgreSQL) resolves
brew "hiredis"
brew "jemalloc"
brew "nlohmann-json"
brew "openssl@3"
brew "abseil"
brew "protobuf"
brew "grpc"
brew "googletest" # google-cloud-cpp requires GTest/GMock at configure (builds its *_mocks libs)
brew "curl"
brew "inja"
+676 -7
View File
File diff suppressed because it is too large. Load diff
+167
View File
@@ -0,0 +1,167 @@
{
"version": 3,
"cmakeMinimumRequired": { "major": 3, "minor": 21, "patch": 0 },
"configurePresets": [
{
"name": "unix-base",
"hidden": true,
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build-${presetName}",
"cacheVariables": {
"CMAKE_PREFIX_PATH": "${sourceDir}/.deps",
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "linux-base",
"hidden": true,
"inherits": "unix-base",
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" }
},
{
"name": "macos-base",
"hidden": true,
"inherits": "unix-base",
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Darwin" },
"cacheVariables": {
"CMAKE_PREFIX_PATH": "${sourceDir}/.deps;$env{HOMEBREW_PREFIX};$env{HOMEBREW_PREFIX}/opt/openssl@3;$env{HOMEBREW_PREFIX}/opt/libpq"
}
},
{ "name": "linux-release", "inherits": "linux-base", "displayName": "Linux daemon (Release)" },
{ "name": "linux-debug", "inherits": "linux-base", "displayName": "Linux daemon (Debug)", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "linux-controller-release", "inherits": "linux-base", "displayName": "Linux Central Controller (Release)", "cacheVariables": { "ZT1_CENTRAL_CONTROLLER": "ON" } },
{ "name": "linux-controller-debug", "inherits": "linux-base", "displayName": "Linux Central Controller (Debug)", "cacheVariables": { "ZT1_CENTRAL_CONTROLLER": "ON", "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "linux-free-release", "inherits": "linux-base", "displayName": "Linux daemon, free / no controller (Release)", "cacheVariables": { "ZT_NONFREE": "OFF" } },
{ "name": "linux-free-debug", "inherits": "linux-base", "displayName": "Linux daemon, free / no controller (Debug)", "cacheVariables": { "ZT_NONFREE": "OFF", "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "macos-release", "inherits": "macos-base", "displayName": "macOS daemon (Release)" },
{ "name": "macos-debug", "inherits": "macos-base", "displayName": "macOS daemon (Debug)", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "macos-controller-release", "inherits": "macos-base", "displayName": "macOS Central Controller (Release)", "cacheVariables": { "ZT1_CENTRAL_CONTROLLER": "ON" } },
{ "name": "macos-controller-debug", "inherits": "macos-base", "displayName": "macOS Central Controller (Debug)", "cacheVariables": { "ZT1_CENTRAL_CONTROLLER": "ON", "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "macos-free-release", "inherits": "macos-base", "displayName": "macOS daemon, free / no controller (Release)", "cacheVariables": { "ZT_NONFREE": "OFF" } },
{ "name": "macos-free-debug", "inherits": "macos-base", "displayName": "macOS daemon, free / no controller (Debug)", "cacheVariables": { "ZT_NONFREE": "OFF", "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "macos-universal-release", "inherits": "macos-base", "displayName": "macOS universal daemon (arm64 + x86_64, Release)", "cacheVariables": { "CMAKE_OSX_ARCHITECTURES": "arm64;x86_64" } },
{ "name": "macos-universal-debug", "inherits": "macos-base", "displayName": "macOS universal daemon (arm64 + x86_64, Debug)", "cacheVariables": { "CMAKE_OSX_ARCHITECTURES": "arm64;x86_64", "CMAKE_BUILD_TYPE": "Debug" } },
{
"name": "freebsd-base",
"hidden": true,
"inherits": "unix-base",
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "FreeBSD" }
},
{
"name": "openbsd-base",
"hidden": true,
"inherits": "unix-base",
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "OpenBSD" }
},
{
"name": "netbsd-base",
"hidden": true,
"inherits": "unix-base",
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "NetBSD" }
},
{ "name": "freebsd-release", "inherits": "freebsd-base", "displayName": "FreeBSD daemon (Release)" },
{ "name": "freebsd-debug", "inherits": "freebsd-base", "displayName": "FreeBSD daemon (Debug)", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "freebsd-free-release", "inherits": "freebsd-base", "displayName": "FreeBSD daemon, free / no controller (Release)", "cacheVariables": { "ZT_NONFREE": "OFF" } },
{ "name": "freebsd-free-debug", "inherits": "freebsd-base", "displayName": "FreeBSD daemon, free / no controller (Debug)", "cacheVariables": { "ZT_NONFREE": "OFF", "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "openbsd-release", "inherits": "openbsd-base", "displayName": "OpenBSD daemon (Release)" },
{ "name": "openbsd-debug", "inherits": "openbsd-base", "displayName": "OpenBSD daemon (Debug)", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "openbsd-free-release", "inherits": "openbsd-base", "displayName": "OpenBSD daemon, free / no controller (Release)", "cacheVariables": { "ZT_NONFREE": "OFF" } },
{ "name": "openbsd-free-debug", "inherits": "openbsd-base", "displayName": "OpenBSD daemon, free / no controller (Debug)", "cacheVariables": { "ZT_NONFREE": "OFF", "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "netbsd-release", "inherits": "netbsd-base", "displayName": "NetBSD daemon (Release)" },
{ "name": "netbsd-debug", "inherits": "netbsd-base", "displayName": "NetBSD daemon (Debug)", "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } },
{ "name": "netbsd-free-release", "inherits": "netbsd-base", "displayName": "NetBSD daemon, free / no controller (Release)", "cacheVariables": { "ZT_NONFREE": "OFF" } },
{ "name": "netbsd-free-debug", "inherits": "netbsd-base", "displayName": "NetBSD daemon, free / no controller (Debug)", "cacheVariables": { "ZT_NONFREE": "OFF", "CMAKE_BUILD_TYPE": "Debug" } },
{
"name": "windows-x64",
"displayName": "Windows x64 daemon (MSVC + vcpkg)",
"generator": "Visual Studio 17 2022",
"architecture": "x64",
"binaryDir": "${sourceDir}/build-${presetName}",
"condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" },
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"CMAKE_PREFIX_PATH": "${sourceDir}/.deps/x64"
}
},
{
"name": "windows-arm64",
"inherits": "windows-x64",
"displayName": "Windows ARM64 daemon (MSVC + vcpkg)",
"architecture": "ARM64",
"cacheVariables": { "VCPKG_TARGET_TRIPLET": "arm64-windows-static", "CMAKE_PREFIX_PATH": "${sourceDir}/.deps/ARM64" }
},
{
"name": "windows-x86",
"inherits": "windows-x64",
"displayName": "Windows x86 daemon (MSVC + vcpkg)",
"architecture": "Win32",
"cacheVariables": { "VCPKG_TARGET_TRIPLET": "x86-windows-static", "CMAKE_PREFIX_PATH": "${sourceDir}/.deps/Win32" }
},
{
"name": "windows-x64-free",
"inherits": "windows-x64",
"displayName": "Windows x64 daemon (free / ZT_NONFREE=OFF, no bundled controller)",
"cacheVariables": { "ZT_NONFREE": "OFF" }
},
{
"name": "windows-arm64-free",
"inherits": "windows-arm64",
"displayName": "Windows ARM64 daemon (free / ZT_NONFREE=OFF, no bundled controller)",
"cacheVariables": { "ZT_NONFREE": "OFF" }
},
{
"name": "windows-x86-free",
"inherits": "windows-x86",
"displayName": "Windows x86 daemon (free / ZT_NONFREE=OFF, no bundled controller)",
"cacheVariables": { "ZT_NONFREE": "OFF" }
}
],
"buildPresets": [
{ "name": "linux-release", "configurePreset": "linux-release" },
{ "name": "linux-debug", "configurePreset": "linux-debug" },
{ "name": "linux-controller-release", "configurePreset": "linux-controller-release" },
{ "name": "linux-controller-debug", "configurePreset": "linux-controller-debug" },
{ "name": "linux-free-release", "configurePreset": "linux-free-release" },
{ "name": "linux-free-debug", "configurePreset": "linux-free-debug" },
{ "name": "macos-release", "configurePreset": "macos-release" },
{ "name": "macos-debug", "configurePreset": "macos-debug" },
{ "name": "macos-controller-release", "configurePreset": "macos-controller-release" },
{ "name": "macos-controller-debug", "configurePreset": "macos-controller-debug" },
{ "name": "macos-free-release", "configurePreset": "macos-free-release" },
{ "name": "macos-free-debug", "configurePreset": "macos-free-debug" },
{ "name": "macos-universal-release", "configurePreset": "macos-universal-release" },
{ "name": "macos-universal-debug", "configurePreset": "macos-universal-debug" },
{ "name": "freebsd-release", "configurePreset": "freebsd-release" },
{ "name": "freebsd-debug", "configurePreset": "freebsd-debug" },
{ "name": "freebsd-free-release", "configurePreset": "freebsd-free-release" },
{ "name": "freebsd-free-debug", "configurePreset": "freebsd-free-debug" },
{ "name": "openbsd-release", "configurePreset": "openbsd-release" },
{ "name": "openbsd-debug", "configurePreset": "openbsd-debug" },
{ "name": "openbsd-free-release", "configurePreset": "openbsd-free-release" },
{ "name": "openbsd-free-debug", "configurePreset": "openbsd-free-debug" },
{ "name": "netbsd-release", "configurePreset": "netbsd-release" },
{ "name": "netbsd-debug", "configurePreset": "netbsd-debug" },
{ "name": "netbsd-free-release", "configurePreset": "netbsd-free-release" },
{ "name": "netbsd-free-debug", "configurePreset": "netbsd-free-debug" },
{ "name": "windows-x64-release", "configurePreset": "windows-x64", "configuration": "Release" },
{ "name": "windows-x64-debug", "configurePreset": "windows-x64", "configuration": "Debug" },
{ "name": "windows-arm64-release", "configurePreset": "windows-arm64", "configuration": "Release" },
{ "name": "windows-arm64-debug", "configurePreset": "windows-arm64", "configuration": "Debug" },
{ "name": "windows-x86-release", "configurePreset": "windows-x86", "configuration": "Release" },
{ "name": "windows-x86-debug", "configurePreset": "windows-x86", "configuration": "Debug" },
{ "name": "windows-x64-free-release", "configurePreset": "windows-x64-free", "configuration": "Release" },
{ "name": "windows-x64-free-debug", "configurePreset": "windows-x64-free", "configuration": "Debug" },
{ "name": "windows-arm64-free-release", "configurePreset": "windows-arm64-free", "configuration": "Release" },
{ "name": "windows-arm64-free-debug", "configurePreset": "windows-arm64-free", "configuration": "Debug" },
{ "name": "windows-x86-free-release", "configurePreset": "windows-x86-free", "configuration": "Release" },
{ "name": "windows-x86-free-debug", "configurePreset": "windows-x86-free", "configuration": "Debug" }
]
}
+21 -186
View File
@@ -1,197 +1,32 @@
ZeroTier - Global Area Networking
======
# ZeroTier - Global Area Networking
*This document is written for a software developer audience. For information on using ZeroTier, see the: [Website](https://www.zerotier.com), [Documentation Site](https://docs.zerotier.com), and [Discussion Forum](https://discuss.zerotier.com).*
## Quick Links
* [ZeroTier Documentation](https://docs.zerotier.com) - **Start here for downloads, installation, and usage**
* [How to build](build.md) - **Build instructions and platform requirements**
* [Corporate Site](https://www.zerotier.com/)
* [Downloads](https://www.zerotier.com/download/)
* [Service API Reference](service/README.md)
* [Network Controller](nonfree/controller/README.md)
* [Commercial Support](https://www.zerotier.com/contact)
* [License Information](#license)
## About
ZeroTier is a smart programmable Ethernet switch for planet Earth. It allows all networked devices, VMs, containers, and applications to communicate as if they all reside in the same physical data center or cloud region.
This is accomplished by combining a cryptographically addressed and secure peer to peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.
This is accomplished by combining a cryptographically addressed and secure peer-to-peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.
All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer to peer, though we offer free (but slow) relaying for users who cannot establish peer to peer connections.
All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer-to-peer, though we offer free (but slow) relaying for users who cannot establish peer-to-peer connections.
The goals and design principles of ZeroTier are inspired by among other things the original [Google BeyondCorp](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43231.pdf) paper and the [Jericho Forum](https://en.wikipedia.org/wiki/Jericho_Forum) with its notion of "deperimeterization."
Apps for Android and iOS are available for free in the Google Play and Apple app stores.
Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download/). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
For repository layout, build instructions, platform requirements, and information about running ZeroTier, see [build.md](build.md).
ZeroTier is licensed under the [BSL version 1.1](https://mariadb.com/bsl11/). See [LICENSE.txt](LICENSE.txt) and the [ZeroTier pricing page](https://www.zerotier.com/pricing) for details. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license.
## License
A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See [AUTHORS.md](AUTHORS.md) for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.).
See [LICENSE-MPL.txt](LICENSE-MPL.txt) for all code in node/, osdep/. service/, and everywhere else except ext/ and nonfree/.
### Getting Started
See [nonfree/LICENSE.md](nonfree/LICENSE.md) for all non-free ("source available") portions of this repository.
Everything in the ZeroTier world is controlled by two types of identifier: 40-bit/10-digit *ZeroTier addresses* and 64-bit/16-digit *network IDs*. These identifiers are easily distinguished by their length. A ZeroTier address identifies a node or "device" (laptop, phone, server, VM, app, etc.) while a network ID identifies a virtual Ethernet network that can be joined by devices.
ZeroTier addresses can be thought of as port numbers on an enormous planet-wide enterprise Ethernet smart switch supporting VLANs. Network IDs are VLAN IDs to which these ports may be assigned. A single port can be assigned to more than one VLAN.
A ZeroTier address looks like `8056c2e21c` and a network ID looks like `8056c2e21c000001`. Network IDs are composed of the ZeroTier address of that network's primary controller and an arbitrary 24-bit ID that identifies the network on this controller. Network controllers are roughly analogous to SDN controllers in SDN protocols like [OpenFlow](https://en.wikipedia.org/wiki/OpenFlow), though as with the analogy between VXLAN and VL2 this should not be read to imply that the protocols or design are the same. You can use our convenient and inexpensive SaaS hosted controllers at [my.zerotier.com](https://my.zerotier.com/) or [run your own controller](controller/) if you don't mind messing around with JSON configuration files or writing scripts to do so.
### Project Layout
The base path contains the ZeroTier One service main entry point (`one.cpp`), self test code, makefiles, etc.
- `artwork/`: icons, logos, etc.
- `attic/`: old stuff and experimental code that we want to keep around for reference.
- `controller/`: the reference network controller implementation, which is built and included by default on desktop and server build targets.
- `debian/`: files for building Debian packages on Linux.
- `doc/`: manual pages and other documentation.
- `ext/`: third party libraries, binaries that we ship for convenience on some platforms (Mac and Windows), and installation support files.
- `include/`: include files for the ZeroTier core.
- `java/`: a JNI wrapper used with our Android mobile app. (The whole Android app is not open source but may be made so in the future.)
- `node/`: the ZeroTier virtual Ethernet switch core, which is designed to be entirely separate from the rest of the code and able to be built as a stand-alone OS-independent library. Note to developers: do not use C++11 features in here, since we want this to build on old embedded platforms that lack C++11 support. C++11 can be used elsewhere.
- `osdep/`: code to support and integrate with OSes, including platform-specific stuff only built for certain targets.
- `rule-compiler/`: JavaScript rules language compiler for defining network-level rules.
- `service/`: the ZeroTier One service, which wraps the ZeroTier core and provides VPN-like connectivity to virtual networks for desktops, laptops, servers, VMs, and containers.
- `windows/`: Visual Studio solution files, Windows service code, and the Windows task bar app UI.
- `zeroidc/`: OIDC implementation used by ZeroTier service to log into SSO-enabled networks. (This part is written in Rust, and more Rust will be appearing in this repository in the future.)
### Contributing
Please do pull requests off of the `dev` branch.
Releases are done by merging `dev` into `main` and then tagging and doing builds.
### Build and Platform Notes
To build on Mac and Linux just type `make`. On FreeBSD and OpenBSD `gmake` (GNU make) is required and can be installed from packages or ports. For Windows there is a Visual Studio solution in `windows/`.
- **Mac**
- Xcode command line tools for macOS 10.13 or newer are required.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
- **Linux**
- The minimum compiler versions required are GCC/G++ 8.x or CLANG/CLANG++ 5.x.
- Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
- **Windows**
- Visual Studio 2022 on Windows 10 or newer.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
- **FreeBSD**
- GNU make is required. Type `gmake` to build.
- `binutils` is required. Type `pkg install binutils` to install.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
- **OpenBSD**
- There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`).
- GNU make is required. Type `gmake` to build.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
Typing `make selftest` will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
### Running
Running *zerotier-one* with `-h` option will show help.
On Linux and BSD, if you built from source, you can start the service with:
sudo ./zerotier-one -d
On most distributions, macOS, and Windows, the installer will start the service and set it up to start on boot.
A home folder for your system will automatically be created.
The service is controlled via the JSON API, which by default is available at `127.0.0.1:9993`. It also listens on `0.0.0.0:9993` which is only usable if `allowManagementFrom` is properly configured in `local.conf`. We include a *zerotier-cli* command line utility to make API calls for standard things like joining and leaving networks. The *authtoken.secret* file in the home folder contains the secret token for accessing this API. See [service/README.md](service/README.md) for API documentation.
Here's where home folders live (by default) on each OS:
* **Linux**: `/var/lib/zerotier-one`
* **FreeBSD** / **OpenBSD**: `/var/db/zerotier-one`
* **Mac**: `/Library/Application Support/ZeroTier/One`
* **Windows**: `\ProgramData\ZeroTier\One` (That's the default. The base 'shared app data' folder might be different if Windows is installed with a non-standard drive letter assignment or layout.)
### Basic Troubleshooting
For most users, it just works.
If you are running a local system firewall, we recommend adding a rules permitting zerotier. If you installed binaries for Windows this should be done automatically. Other platforms might require manual editing of local firewall rules depending on your configuration.
See the [documentation site](https://docs.zerotier.com/zerotier/troubleshooting) for more information.
The Mac firewall can be found under "Security" in System Preferences. Linux has a variety of firewall configuration systems and tools.
On CentOS check `/etc/sysconfig/iptables` for IPTables rules. For other distributions consult your distribution's documentation. You'll also have to check the UIs or documentation for commercial third party firewall applications like Little Snitch (Mac), McAfee Firewall Enterprise (Windows), etc. if you are running any of those. Some corporate environments might have centrally managed firewall software, so you might also have to contact IT.
ZeroTier One peers will automatically locate each other and communicate directly over a local wired LAN *if UDP port 9993 inbound is open*. If that port is filtered, they won't be able to see each others' LAN announcement packets. If you're experiencing poor performance between devices on the same physical network, check their firewall settings. Without LAN auto-location peers must attempt "loopback" NAT traversal, which sometimes fails and in any case requires that every packet traverse your external router twice.
Users behind certain types of firewalls and "symmetric" NAT devices may not be able to connect to external peers directly at all. ZeroTier has limited support for port prediction and will *attempt* to traverse symmetric NATs, but this doesn't always work. If P2P connectivity fails you'll be bouncing UDP packets off our relay servers resulting in slower performance. Some NAT router(s) have a configurable NAT mode, and setting this to "full cone" will eliminate this problem. If you do this you may also see a magical improvement for things like VoIP phones, Skype, BitTorrent, WebRTC, certain games, etc., since all of these use NAT traversal techniques similar to ours.
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
Additional help can be found in our [knowledge base](https://zerotier.atlassian.net/wiki/spaces/SD/overview).
### Prometheus Metrics
Prometheus Metrics are available at the `/metrics` API endpoint. This endpoint is protected by an API key stored in `metricstoken.secret` to prevent unwanted information leakage. Information that could be gleaned from the metrics include joined networks and peers your instance is talking to.
Access control is via the ZeroTier control interface itself and `metricstoken.secret`. This can be sent as a bearer auth token, via the `X-ZT1-Auth` HTTP header field, or appended to the URL as `?auth=<token>`. You can see the current metrics via `cURL` with the following command:
// Linux
curl -H "X-ZT1-Auth: $(sudo cat /var/lib/zerotier-one/metricstoken.secret)" http://localhost:9993/metrics
// macOS
curl -H "X-ZT1-Auth: $(sudo cat /Library/Application\ Support/ZeroTier/One/metricstoken.secret)" http://localhost:9993/metrics
// Windows PowerShell (Admin)
Invoke-RestMethod -Headers @{'X-ZT1-Auth' = "$(Get-Content C:\ProgramData\ZeroTier\One\metricstoken.secret)"; } -Uri http://localhost:9993/metrics
To configure a scrape job in Prometheus on the machine ZeroTier is running on, add this to your Prometheus `scrape_config`:
- job_name: zerotier-one
honor_labels: true
scrape_interval: 15s
metrics_path: /metrics
static_configs:
- targets:
- 127.0.0.1:9993
labels:
group: zerotier-one
node_id: $YOUR_10_CHARACTER_NODE_ID
authorization:
credentials: $YOUR_METRICS_TOKEN_SECRET
If neither of these methods are desirable, it is probably possible to distribute metrics via [Prometheus Proxy](https://github.com/pambrose/prometheus-proxy) or some other tool. Note: We have not tested this internally, but will probably work with the correct configuration.
Metrics are also available on disk in ZeroTier's working directory:
// Linux
/var/lib/zerotier-one/metrics.prom
// macOS
/Library/Application\ Support/ZeroTier/One/metrics.prom
//Windows
C:\ProgramData\ZeroTier\One\metrics.prom
#### Available Metrics
| Metric Name | Labels | Metric Type | Description |
| --- | --- | --- | --- |
| zt_packet | packet_type, direction | Counter | ZeroTier packet type counts |
| zt_packet_error | error_type, direction | Counter | ZeroTier packet errors|
| zt_data | protocol, direction | Counter | number of bytes ZeroTier has transmitted or received |
| zt_num_networks | | Gauge | number of networks this instance is joined to |
| zt_network_multicast_groups_subscribed | network_id | Gauge | number of multicast groups networks are subscribed to |
| zt_network_packets | network_id, direction | Counter | number of incoming/outgoing packets per network |
| zt_peer_latency | node_id | Histogram | peer latency (ms) |
| zt_peer_path_count | node_id, status | Gauge | number of paths to peer |
| zt_peer_packets | node_id, direction | Counter | number of packets to/from a peer |
| zt_peer_packet_errors | node_id | Counter | number of incoming packet errors from a peer |
If there are other metrics you'd like to see tracked, ask us in an Issue or send us a Pull Request!
### HTTP / App server
There is a static http file server suitable for hosting Single Page Apps at http://localhost:9993/app/<app-path>
Use `zerotier-cli info -j` to find your zerotier-one service's homeDir
``` sh
cd $ZT_HOME
sudo mkdir -p app/app1
sudo mkdir -p app/appB
echo '<html><meta charset=utf-8><title>appA</title><body><h1>hello world A' | sudo tee app/appA/index.html
echo '<html><meta charset=utf-8><title>app2</title><body><h1>hello world 2' | sudo tee app/app2/index.html
curl -sL http://localhost:9993/app/appA http://localhost:9993/app/app2
```
Then visit [http://localhost:9993/app/app1/](http://localhost:9993/app/app1/) and [http://localhost:9993/app/appB/](http://localhost:9993/app/appB/)
Requests to paths don't exist return the app root index.html, as is customary for SPAs.
If you want, you can write some javascript that talks to the service or controller [api](https://docs.zerotier.com/service/v1).
Code in ext/ is external code included for build convenience or backward compatibility and retains its original license.
+15
View File
@@ -1,6 +1,21 @@
ZeroTier Release Notes
======
## 2026-05-20 -- Version 1.16.2
* Fixed line endings for the zttap300.inf for the Windows ARM x64 install.
* Internal updates to the central controller (CV1) including schema changes and a multi-architecture Docker build pipeline.
* Increased `ZT_MAX_NETWORK_SPECIALISTS` from 256 to 512 to accommodate users with large networks that exceeded the previous limit. The network config dictionary capacity was raised correspondingly.
* Resolved intermittent multi-minute delays when leaving one network and joining another under Windows.
* Compiler warning cleanup across the codebase, covering GCC 14, Clang 18, and Clang 21.
## 2025-12-22 -- Version 1.16.1
* Metrics collection is now disabled by default. It can be enabled via the `enableMetrics` setting in `local.conf`.
* Fix for an issue where metrics were not being recorded while running in daemon mode.
* Fix debug dumpfile being written to the root directory.
* Minor bug fixes in Mac and BSD tun/tap code.
## 2025-08-21 -- Version 1.16.0
* License Changes
+161
View File
@@ -0,0 +1,161 @@
# ZeroTier Build and Project Information
## Build and Platform Notes
### Basic Build Instructions
To build on Mac and Linux just type `make`. On FreeBSD and OpenBSD `gmake` (GNU make) is required and can be installed from packages or ports. For Windows there is a Visual Studio solution in `windows/`.
### Platform Requirements
#### Mac
- Xcode command line tools for macOS 10.13 or newer are required.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
#### Linux
- The minimum compiler versions required are GCC/G++ 8.x or CLANG/CLANG++ 5.x.
- Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
#### Windows
- Visual Studio 2022 on Windows 10 or newer.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
#### FreeBSD
- GNU make is required. Type `gmake` to build.
- `binutils` is required. Type `pkg install binutils` to install.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
#### OpenBSD
- There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`).
- GNU make is required. Type `gmake` to build.
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
### Building with CMake (optional)
> **Note:** CMake is an *alternative* build path, offered as a convenience. The official
> builds are still produced by the platform makefiles (above) and the Visual Studio solution
> in `windows/`.
#### Prerequisites
- **CMake** 3.15 or newer.
- The same compiler/toolchain (and Rust, if SSO is enabled) as the makefile build for your
platform — see *Platform Requirements* above.
- The header-only **OpenTelemetry API** must be present on `CMAKE_PREFIX_PATH`. Populate it
into `./.deps` by running the bootstrap script once, in its **default** (quick, header-only)
mode — i.e. *without* `ZT_CONTROLLER_DEPS=1`, which is the heavyweight controller-only path:
```bash
scripts/bootstrap-deps.sh # default mode: header-only OTel API into ./.deps
```
The script prints the exact `-DCMAKE_PREFIX_PATH` to use when it finishes.
#### Free vs. default (non-free) builds
By default the daemon is built **with the bundled FileDB network controller**, which lives
under `nonfree/` and is "source available" (non-free) — this matches what ships in official
builds (`ZT_NONFREE=ON`). To produce a **purely free** daemon (MPL-2.0 `node/`, `osdep/`,
`service/` only, with no `nonfree/` code compiled or linked), set **`-DZT_NONFREE=OFF`** — or
use one of the `*-free-*` presets, which set it for you.
#### Using presets (recommended)
`cmake --list-presets` shows the presets for your OS. The daemon presets are:
| Preset | Build |
| --- | --- |
| `macos-release` / `linux-release` | Default daemon (**includes** the non-free bundled controller) |
| `macos-free-release` / `linux-free-release` | **Free** daemon (`ZT_NONFREE=OFF`, no non-free code) |
| `macos-debug` / `linux-debug` (and `*-free-debug`) | Debug variants of the above |
| `macos-universal-release` | macOS universal (arm64 + x86_64) daemon |
| `freebsd-release` / `openbsd-release` / `netbsd-release` (and `*-free-release`, `*-debug`) | BSD daemon / free variant |
| `windows-x64-release` (and `windows-x64-free`) | Windows daemon / free variant |
```bash
# Default (non-free) daemon:
cmake --preset macos-release
cmake --build --preset macos-release
# Purely free daemon:
cmake --preset macos-free-release
cmake --build --preset macos-free-release
```
Each preset builds into its own directory, `build-<presetName>/`, so the binary lands at e.g.
`build-macos-free-release/zerotier-one`. (macOS/Linux presets use single-config Unix Makefiles,
so the build type is baked into the preset name — there's no `Release/` subdirectory.)
#### Manual invocation
The equivalent without presets:
```bash
# Default (non-free) daemon — .deps holds the OTel API from bootstrap-deps.sh:
cmake -DCMAKE_PREFIX_PATH="$PWD/.deps" -S . -B build
cmake --build build -j8
# Purely free daemon:
cmake -DZT_NONFREE=OFF -DCMAKE_PREFIX_PATH="$PWD/.deps" -S . -B build
cmake --build build -j8
```
The binary is `build/zerotier-one`. (On macOS, append the Homebrew prefixes to
`CMAKE_PREFIX_PATH` if your dependencies come from Homebrew, as the presets do.)
### Testing
Typing `make selftest` will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
## Running ZeroTier
Running *zerotier-one* with `-h` option will show help.
On Linux and BSD, if you built from source, you can start the service with:
sudo ./zerotier-one -d
On most distributions, macOS, and Windows, the installer will start the service and set it up to start on boot.
A home folder for your system will automatically be created.
The service is controlled via the JSON API, which by default is available at `127.0.0.1:9993`. It also listens on `0.0.0.0:9993` which is only usable if `allowManagementFrom` is properly configured in `local.conf`. We include a *zerotier-cli* command line utility to make API calls for standard things like joining and leaving networks. The *authtoken.secret* file in the home folder contains the secret token for accessing this API. See [service/README.md](service/README.md) for API documentation.
## Directory Structure
### Home Folder Locations
ZeroTier stores its configuration and state files in platform-specific locations:
* **Linux**: `/var/lib/zerotier-one`
* **FreeBSD** / **OpenBSD**: `/var/db/zerotier-one`
* **Mac**: `/Library/Application Support/ZeroTier/One`
* **Windows**: `\ProgramData\ZeroTier\One` (That's the default. The base 'shared app data' folder might be different if Windows is installed with a non-standard drive letter assignment or layout.)
### Project Structure
The repository is organized as follows:
- **node/** - Core ZeroTier networking code
- **osdep/** - Operating system dependent code
- **service/** - Service implementation and API
- **controller/** - Network controller implementation
- **ext/** - External code included for build convenience (retains original licenses)
- **nonfree/** - Source available (non-free) portions
- **windows/** - Windows-specific Visual Studio solution files
### Build System
The project supports various build targets and platforms:
- Standard build: `make`
- Self-test build: `make selftest`
- Platform-specific requirements:
- FreeBSD/OpenBSD: Use `gmake` (GNU make)
- Windows: Visual Studio solution in `windows/`
### License Structure
- **node/**, **osdep/**, **service/**: Licensed under MPL-2.0 (see LICENSE-MPL.txt)
- **nonfree/**: Non-free "source available" code (see nonfree/LICENSE.md)
- **ext/**: External code with original licenses retained
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e
cmake -DCMAKE_BUILD_TYPE=Release -DZT1_CENTRAL_CONTROLLER=1 -DCMAKE_INSTALL_PREFIX=$PWD -S . -B build/ -DCMAKE_INSTALL_PREFIX=$(shell pwd)/build-out
cmake --build build/ --target all -j4 --verbose
ARCH=$(uname -m)
if [ "$ARCH" = "x86_64" ]; then
ARCH="amd64"
elif [ "$ARCH" = "aarch64" ]; then
ARCH="arm64"
fi
if [ -z "$TARGET_DOCKER_REPO" ]; then
TARGET_DOCKER_REPO="us-central1-docker.pkg.dev/zerotier-421eb9/docker-images"
fi
docker build -platform linux/$ARCH -t $TARGET_DOCKER_REPO/ztcentral-controller:$(git rev-parse --short HEAD)-$ARCH -f ext/central-controller/docker/Dockerfile.central-controller . --load --push
+28
View File
@@ -0,0 +1,28 @@
set(FETCHCONTENT_QUIET OFF)
FetchContent_Declare(
cpp-httplib
GIT_REPOSITORY https://github.com/yhirose/cpp-httplib.git
# v0.47.0+: supports 32-bit Windows. v0.25.0 had a `#warning` refusing 32-bit
# Windows that MSVC's default preprocessor escalates to a fatal C1021 (breaks
# the windows-x86 build).
GIT_TAG v0.47.0
GIT_SHALLOW ON
)
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
set(HTTPLIB_COMPILE OFF CACHE INTERNAL "")
set(HTTPLIB_USE_ZLIB_IF_AVAILABLE ON CACHE INTERNAL "Use zlib if available")
set(HTTPLIB_USE_BROTLI_IF_AVAILABLE ON CACHE INTERNAL "Use brotli if available")
# The ZeroTier control plane is plain HTTP on localhost (no httplib SSLServer/SSLClient
# anywhere), and outbound SSO/OIDC TLS lives in rustybits (native-tls), so httplib never
# needs OpenSSL. Keeping this ON would link OpenSSL purely as dead weight -- which also
# blocks universal macOS builds (Homebrew OpenSSL is single-arch).
set(HTTPLIB_USE_OPENSSL_IF_AVAILABLE OFF CACHE INTERNAL "ZeroTier uses httplib for plain HTTP only")
set(HTTPLIB_USE_ZSTD_IF_AVAILABLE ON CACHE INTERNAL "Use zstd if available")
FetchContent_MakeAvailable(cpp-httplib)
if (NOT TARGET httplib::httplib)
message(FATAL_ERROR "A required cpp-httplib target (cpp-httplib) was not imported")
endif()
+18
View File
@@ -0,0 +1,18 @@
# inja -- header-only C++ templating engine used by service/OneService.cpp
# (`#include <inja/inja.hpp>`). Homebrew ships no usable CMake config and Debian
# has no package, so we vendor the headers via FetchContent. We populate the
# source only and skip inja's own CMakeLists (its build/test/json machinery) by
# pointing SOURCE_SUBDIR at a non-existent directory. inja consumes
# nlohmann::json, which the build already provides via find_package(nlohmann_json)
# and links into the targets that use inja; we only need inja's headers on the
# include path here (header-only, no link), matching the previous conda setup.
include(FetchContent)
FetchContent_Declare(inja
GIT_REPOSITORY https://github.com/pantor/inja.git
GIT_TAG v3.4.0
GIT_SHALLOW ON
SOURCE_SUBDIR _skip_inja_cmakelists_) # populate only; no add_subdirectory
FetchContent_MakeAvailable(inja)
# inja ships an amalgamated header under single_include/inja/inja.hpp.
include_directories("${inja_SOURCE_DIR}/single_include")
+32
View File
@@ -0,0 +1,32 @@
set(FETCHCONTENT_QUIET OFF)
FetchContent_Declare(
miniupnpc
URL https://github.com/miniupnp/miniupnp/releases/download/miniupnpc_2_3_3/miniupnpc-2.3.3.tar.gz
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
set(UPNPC_BUILD_TESTS FALSE CACHE INTERNAL "Build tests" FORCE)
set(UPNPC_BUILD_SHARED FALSE CACHE INTERNAL "Build shared library" FORCE)
set(UPNPC_BUILD_STATIC TRUE CACHE INTERNAL "Build static library" FORCE)
set(UPNPC_BUILD_SAMPLE FALSE CACHE INTERNAL "Build sample" FORCE)
FetchContent_MakeAvailable(miniupnpc)
if (NOT TARGET miniupnpc::miniupnpc)
message(FATAL_ERROR "A required miniupnpc target (miniupnpc::miniupnpc) was not imported")
endif()
add_definitions(-DZT_USE_MINIUPNPC)
FetchContent_Declare(
libnatpmp
GIT_REPOSITORY https://github.com/miniupnp/libnatpmp.git
GIT_TAG master
GIT_SHALLOW ON
PATCH_COMMAND git apply ${CMAKE_SOURCE_DIR}/ext/cmake-patches/libnatpmp.patch
UPDATE_DISCONNECTED TRUE
)
FetchContent_MakeAvailable(libnatpmp)
if (NOT TARGET natpmp)
message(FATAL_ERROR "A required libnatpmp target (natpmp) was not imported")
endif()
+28
View File
@@ -0,0 +1,28 @@
set(FETCHCONTENT_QUIET OFF)
FetchContent_Declare(
redis-plus-plus
GIT_REPOSITORY https://github.com/sewenew/redis-plus-plus.git
GIT_TAG 1.3.15
GIT_SHALLOW ON
)
set(REDIS_PLUS_PLUS_BUILD_STATIC ON CACHE INTERNAL "Build static library" FORCE)
# We only link redis++::redis++_static, so skip the unused shared library.
set(REDIS_PLUS_PLUS_BUILD_SHARED OFF CACHE INTERNAL "Build shared library" FORCE)
set(REDIS_PLUS_PLUS_BUILD_TEST OFF CACHE INTERNAL "Build tests" FORCE)
set(REDIS_PLUS_PLUS_BUILD_STATIC_WITH_PIC ON CACHE INTERNAL "Build static library with PIC" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "Build shared libraries" FORCE)
FetchContent_MakeAvailable(redis-plus-plus)
if(NOT TARGET redis++::redis++_static)
message(FATAL_ERROR "A required redis-plus-plus target (redis++::redis++_static) was not imported")
endif()
# redis++'s static library calls into hiredis but does not propagate that
# dependency to consumers, so the final link fails with undefined hiredis
# symbols (redisAppendCommand, redisFree, freeReplyObject, ...). Attach hiredis
# to the static target's interface. find_library (not find_package(hiredis))
# because Debian's libhiredis-dev ships no CMake config.
find_library(HIREDIS_LIB hiredis REQUIRED)
target_link_libraries(redis++_static INTERFACE ${HIREDIS_LIB})
message(STATUS "redis-plus-plus imported (hiredis: ${HIREDIS_LIB})")
+12
View File
@@ -1,3 +1,15 @@
zerotier-one (1.16.2) unstable; urgency=medium
* See RELEASE-NOTES.md for release notes.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Wed, 27 May 2026 01:00:00 -0700
zerotier-one (1.16.0-2) unstable; urgency=medium
* Fix build settings to include controller.
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 12 Sep 2025 01:00:00 -0700
zerotier-one (1.16.0) unstable; urgency=medium
* See RELEASE-NOTES.md for release notes.
+1 -1
View File
@@ -7,7 +7,7 @@ CXXFLAGS=-O3 -fstack-protector-strong
dh $@ --with systemd
override_dh_auto_build:
make
make ZT_OFFICIAL=1 ZT_NONFREE=1 all
override_dh_systemd_start:
dh_systemd_start --restart-after-upgrade
+1 -1
View File
@@ -7,5 +7,5 @@ CXXFLAGS=-O3 -fstack-protector
dh $@
override_dh_auto_build:
make -j 2
make -j 2 ZT_OFFICIAL=1 ZT_NONFREE=1 all
Loaded 20 of 1435 files, more files were not shown because too many files have changed in this diff. Show more