Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dev to main #2257

Closed
wants to merge 72 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
a6b764b
move zeroidc to rustybits folder
glimberg Aug 3, 2023
4674bb5
add smee client
glimberg Aug 4, 2023
f9af9a1
rusftormat zeroidc
glimberg Aug 4, 2023
36be14d
fix zeroidc include path
glimberg Aug 4, 2023
d2aeff6
another mac fix
glimberg Aug 4, 2023
d71d051
instantiate smee client
glimberg Aug 4, 2023
5e89d5a
fix a typo
glimberg Aug 4, 2023
581489f
this should theoretically send the new member notification
glimberg Aug 4, 2023
a9c8307
should only run this if smee is configured
glimberg Aug 4, 2023
98360d9
attempt at fixing the windows build
glimberg Aug 4, 2023
04a3206
fix rust cache in github actions
glimberg Aug 4, 2023
0dc92c2
update openidconnect rust lib
glimberg Aug 7, 2023
88b9626
look up hook URLs dynamically
glimberg Aug 7, 2023
802c990
limit to hooks with hook_type = NETWORK_JOIN enabled
glimberg Aug 8, 2023
714ef59
Merge branch 'dev' into temporal
glimberg Aug 15, 2023
5becb41
pass hook_id instead of url
glimberg Aug 15, 2023
69c590f
Merge branch 'dev' into temporal
glimberg Aug 28, 2023
d865c42
get connected to temporal
glimberg Aug 29, 2023
60fb8c9
fully wire up temporal. add startup script test to ensure temporal i…
glimberg Aug 29, 2023
d322f33
simplify hook firing
glimberg Aug 30, 2023
125257f
Merge branch 'dev' into temporal
glimberg Sep 6, 2023
e3d1565
Merge branch 'dev' into temporal
glimberg Sep 8, 2023
f03aae7
Fix test that was always true
bostick Sep 14, 2023
b7fb4ee
Merge pull request #2127 from zerotier/brenton/fix-always-true
joseph-henry Sep 14, 2023
9ae8b0b
Merge pull request #2128 from zerotier/1.12.2
adamierymenko Sep 14, 2023
e7ed1e4
Merge branch 'dev' into temporal
glimberg Oct 18, 2023
c89683f
update rust dependencies
glimberg Oct 26, 2023
f89cde8
Merge pull request #2163 from zerotier:temporal
glimberg Oct 30, 2023
85cab3d
remove some debug logging
glimberg Oct 30, 2023
0088cef
Merge pull request #2164 from zerotier/smee
glimberg Oct 30, 2023
2fd50b1
check hooks are enabled before firing
glimberg Oct 31, 2023
8b5ac93
Update SECURITY.md
glimberg Nov 1, 2023
1bd2fec
Merge pull request #2166 from zerotier/glimberg-patch-1
glimberg Nov 1, 2023
a477688
Remove extra '/'
bostick Nov 3, 2023
2e882b4
Merge branch 'dev' into network-check
glimberg Nov 16, 2023
d37dce5
don't require temporal for central controller startup
glimberg Nov 17, 2023
663ed73
Merge pull request #2165 from zerotier/network-check
glimberg Nov 20, 2023
dad33c9
fix makefile -pthread (#2182)
zjslqshqz Feb 29, 2024
3593a2d
Merge branch 'main' into main-into-dev
laduke Feb 29, 2024
57b6b79
docs: Add Contributing section to README
laduke Feb 29, 2024
99ef1e2
Merge pull request #2237 from zerotier/main-into-dev
laduke Feb 29, 2024
0bf67bf
Fix rules engine quirks
laduke Feb 1, 2024
bca650e
Printfs for rules debugging
laduke Feb 1, 2024
768c624
Add homeDir to info json
laduke Feb 21, 2024
1dff0c6
Merge pull request #2214 from zerotier/tl-tags-3
laduke Mar 1, 2024
7fb3711
Merge branch 'dev' into tl-add-homedir
glimberg Mar 1, 2024
024649c
Merge pull request #2229 from zerotier/tl-add-homedir
joseph-henry Mar 1, 2024
559e8a9
Improve full controller network list api
laduke Feb 22, 2024
6e8fcce
Fix unstable network member list endpoint
laduke Feb 22, 2024
2e6cda3
Port multipath improvements to newer version
joseph-henry Mar 1, 2024
5d8bd67
Merge pull request #2232 from zerotier/unstable-api-fixes
joseph-henry Mar 4, 2024
41cb6fb
Comment out debug traces in Rules Engine
joseph-henry Mar 5, 2024
8b15fa2
Merge pull request #2241 from zerotier/jh-comment-out-debug-traces
joseph-henry Mar 5, 2024
364ac49
Merge branch 'dev' into jh-multipath-improvements
joseph-henry Mar 5, 2024
9724e04
Improve CLI error handling when showing non-existent bond
joseph-henry Mar 5, 2024
bbe97dd
Improve CLI error handling for setmtu command
joseph-henry Mar 5, 2024
1f4c00c
Improve CLI error message for write permission failures
joseph-henry Mar 5, 2024
d658c11
Fix crash when multipath is used with forceTcpRelay
joseph-henry Mar 5, 2024
08d85d4
Merge pull request #2238 from zerotier/jh-multipath-improvements
joseph-henry Mar 5, 2024
c02ea1b
fix include + link paths for ARM64
rcoder Mar 5, 2024
72cf3f2
add Debug target fixes + README examples to run a custom binary
rcoder Mar 5, 2024
abad7d8
more project updates for win ARM64
glimberg Mar 5, 2024
6be0e67
Merge pull request #2245 from zerotier/gl/win-arm64-fix
rcoder Mar 5, 2024
b4eb39f
feat: static file server
laduke Feb 5, 2024
3ed6379
Fix condition where active-backup would fail to engage
joseph-henry Mar 14, 2024
acaebbd
Merge pull request #2252 from zerotier/jh-fix-ab-failover
joseph-henry Mar 14, 2024
9bde5b9
Consider ::ffff:127.0.0.1 as a loopback address
laduke Mar 14, 2024
9f49982
Merge pull request #2253 from zerotier/freebsd-localhost
laduke Mar 19, 2024
39e1aab
update temporal SDK version + other Rust dependencies, strip debug sy…
rcoder Mar 19, 2024
859031d
Merge branch 'dev' into ldr/update-rust-deps
rcoder Mar 19, 2024
5ae862f
Merge pull request #2255 from zerotier/ldr/update-rust-deps
rcoder Mar 19, 2024
de4ee08
add make target to build the central-controller run image
glimberg Mar 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Expand Up @@ -22,10 +22,10 @@ jobs:
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: make
run: make
Expand Down Expand Up @@ -54,10 +54,10 @@ jobs:
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: make
run: make
Expand Down Expand Up @@ -86,10 +86,10 @@ jobs:
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: setup msbuild
uses: microsoft/setup-msbuild@v1.1.3
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -138,3 +138,4 @@ __pycache__
*_source.tar.bz2
snap/.snapcraft
tcp-proxy/tcp-proxy
rustybits/target
26 changes: 26 additions & 0 deletions README.md
Expand Up @@ -44,6 +44,12 @@ The base path contains the ZeroTier One service main entry point (`one.cpp`), se
- `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/`.
Expand Down Expand Up @@ -169,3 +175,23 @@ Metrics are also available on disk in ZeroTier's working directory:
| 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).
6 changes: 3 additions & 3 deletions SECURITY.md
Expand Up @@ -9,9 +9,9 @@ The following versions of ZeroTier One receive security updates

| Version | Supported |
| ------- | ------------------ |
| 1.10.x | :white_check_mark: |
| 1.8.x | :white_check_mark: |
| < 1.8.0 | :x: |
| 1.12.x | :white_check_mark: |
| 1.10.x | :white_check_mark: |
| < 1.10.0 | :x: |

## Reporting a Vulnerability

Expand Down
69 changes: 37 additions & 32 deletions controller/EmbeddedNetworkController.cpp
Expand Up @@ -876,6 +876,7 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
std::string memberListPath2 = "/unstable/controller/network/([0-9a-fA-F]{16})/member";
std::string memberPath = "/controller/network/([0-9a-fA-F]{16})/member/([0-9a-fA-F]{10})";


auto controllerGet = [&, setContent](const httplib::Request &req, httplib::Response &res) {
char tmp[4096];
const bool dbOk = _db.isReady();
Expand All @@ -887,11 +888,11 @@ void EmbeddedNetworkController::configureHTTPControlPlane(
(unsigned long long)OSUtils::now(),
dbOk ? "true" : "false");

if (!dbOk) {
res.status = 503;
}
if (!dbOk) {
res.status = 503;
}

setContent(req, res, tmp);
setContent(req, res, tmp);
};
s.Get(controllerPath, controllerGet);
sv6.Get(controllerPath, controllerGet);
Expand All @@ -918,6 +919,7 @@ void EmbeddedNetworkController::configureHTTPControlPlane(

auto meta = json::object();
auto data = json::array();
uint64_t networkCount = 0;

for(std::set<uint64_t>::const_iterator nwid(networkIds.begin()); nwid != networkIds.end(); ++nwid) {
json network;
Expand All @@ -927,23 +929,26 @@ void EmbeddedNetworkController::configureHTTPControlPlane(

std::vector<json> memTmp;
if (_db.get(*nwid, network, memTmp)) {
uint64_t authorizedCount = 0;
uint64_t totalCount = memTmp.size();
if (!network.is_null()) {
uint64_t authorizedCount = 0;
uint64_t totalCount = memTmp.size();
networkCount++;

for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
bool a = OSUtils::jsonBool((*m)["authorized"], 0);
if (a) { authorizedCount++; }
}

for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
bool a = OSUtils::jsonBool((*m)["authorized"], 0);
if (a) { authorizedCount++; }
}
auto nwMeta = json::object();
nwMeta["totalMemberCount"] = totalCount;
nwMeta["authorizedMemberCount"] = authorizedCount;
network["meta"] = nwMeta;

auto nwMeta = json::object();
nwMeta["totalMemberCount"] = totalCount;
nwMeta["authorizedMemberCount"] = authorizedCount;
network["meta"] = nwMeta;
data.push_back(network);
}
}

data.push_back(network);
}
meta["networkCount"] = networkIds.size();
meta["networkCount"] = networkCount;

auto out = json::object();
out["data"] = data;
Expand Down Expand Up @@ -1090,26 +1095,26 @@ void EmbeddedNetworkController::configureHTTPControlPlane(

auto out = nlohmann::json::object();
auto meta = nlohmann::json::object();
auto members = nlohmann::json::array();
std::vector<json> memTmp;
if (_db.get(nwid, network, memTmp)) {
members.push_back(memTmp);
}

uint64_t authorizedCount = 0;
uint64_t totalCount = memTmp.size();
for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
bool a = OSUtils::jsonBool((*m)["authorized"], 0);
if (a) { authorizedCount++; }
}
uint64_t authorizedCount = 0;
uint64_t totalCount = memTmp.size();
for (auto m = memTmp.begin(); m != memTmp.end(); ++m) {
bool a = OSUtils::jsonBool((*m)["authorized"], 0);
if (a) { authorizedCount++; }
}

meta["totalCount"] = totalCount;
meta["authorizedCount"] = authorizedCount;
meta["totalCount"] = totalCount;
meta["authorizedCount"] = authorizedCount;

out["data"] = members;
out["meta"] = meta;
out["data"] = memTmp;
out["meta"] = meta;

setContent(req, res, out.dump());
setContent(req, res, out.dump());
} else {
res.status = 404;
return;
}
};
s.Get(memberListPath2, memberListGet2);
sv6.Get(memberListPath2, memberListGet2);
Expand Down