From nobody Sat May 04 14:53:53 2024 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VWrKF3sTFz5KhB6; Sat, 4 May 2024 14:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VWrKF3CC4z4SBy; Sat, 4 May 2024 14:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714834433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xgCvnkk2nqfpA+BKeqUs7UlxtaRBMyuQRJkBZGey6No=; b=v0tJLi2sGNR1pJKBaWzrxTMdVaSkS2X4lJvvYqILQghZafYYCKfffdzX+PhuU14FFOu3Gn FwPQ+KT2SbiWouV5DoDlneObK2bqcfJcLgE3EA5XjRtnGzND2eOoSQZhIc+5XqOZc9xcOJ D9VzSxm/p2wpaGkF+u/ghZUTcJ8eg3F7ZVg5dcH89hAM8o+oQMGvyCwn4Lp+a3SSu4IID6 9umiR4f0pMGLLMwSN/6mJ0jDzGs5glzsAsET1uZ1ypoIUtQdsSs7es0gOyjBcBJC4PLB3G 2pc0F7ypbcpI5QZveDvlAQSHetAX6MjZR0EgP7+adDSPBqzUH5iN/3kHs8OoGg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714834433; a=rsa-sha256; cv=none; b=lEpcrDeS9UootpNYzY5VTkHLx+fK3SPN31vC7/6MSGhYKlz0BFX4Nbzm43Sda1UOF0wze3 g20KStYHj1gXZC6JZdBmhvYilSbl+HMPGmN3P59Sgig/HHkM2a5O9N8QZBOwzQTdynZB1E WFNyvJIz8qYyYQylwl+1RQkMCwFn2gGBpTzcKPSfC423B2vXvgot9lq8fDDqLfaYEl7L5m LeBt3H4X+LPNpN/YCY1NbrJ1wOSTmAd309zDKpoIeMtm/pUj0i9YgzRJ5/zqHOVQJFZtTE RlDzoJpVHkGbQIDbOTOEFj7onItpnjnn/Vuc3JdU/0b5y+XGF4lqBDBQrhNX8A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714834433; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xgCvnkk2nqfpA+BKeqUs7UlxtaRBMyuQRJkBZGey6No=; b=sKhazh5lt+BgLn9COtud1k910eCNeMmYDPs/RO8DkaV8uCVJzV5WOeJZdFuGwSvNQgIVoG GLHh0oIK0a5Z6W2FrYumD7dYjDoEyZFSTHOS+FUnJiAz4rJDOl5IShtrQ+91Fv0ZdrlTtZ 7EDw4Xbq35LgJl0oXumCeYayOXqIkjoyHwLPT/2NwTOP++Fbr/wt2c7GvrGhpyvakxT4N9 YUhB8D58q2trrkqz/wSGAAhWbJIwHjBcucGrJS4Xgcn9skqrfBbk8yRuMphV4BG6P8PP8v FcJhUIn8LaahikFa4AjIMGCr2L38PqkJ2bcB4Av5spsZbOw5Euk7WzQ6Em9xBg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VWrKF2nWXzZWR; Sat, 4 May 2024 14:53:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 444Err0h011204; Sat, 4 May 2024 14:53:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444ErrQY011200; Sat, 4 May 2024 14:53:53 GMT (envelope-from git) Date: Sat, 4 May 2024 14:53:53 GMT Message-Id: <202405041453.444ErrQY011200@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dave Cottlehuber Subject: git: 7cf81ad5fe56 - main - net/zerotier: update to 1.14.0, drop upstreamed patches List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-all@freebsd.org Sender: owner-dev-commits-ports-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dch X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7cf81ad5fe566a02c3da77220648c221bdb75cd3 Auto-Submitted: auto-generated The branch main has been updated by dch: URL: https://cgit.FreeBSD.org/ports/commit/?id=7cf81ad5fe566a02c3da77220648c221bdb75cd3 commit 7cf81ad5fe566a02c3da77220648c221bdb75cd3 Author: Dave Cottlehuber AuthorDate: 2024-05-04 14:53:49 +0000 Commit: Dave Cottlehuber CommitDate: 2024-05-04 14:53:49 +0000 net/zerotier: update to 1.14.0, drop upstreamed patches - Linux I/O performance improvements under heavy load - Improvements to multipath - Fix for port rebinding "coma" bug after periods offline (some laptop users) - Fixed a rules engine quirk/ambiguity (GitHub Issue #2200) - Controller API enhancements: node names and other node meta-data --- net/zerotier/Makefile | 3 +- net/zerotier/distinfo | 6 +- net/zerotier/files/patch-README.md | 26 ---- .../patch-controller_EmbeddedNetworkController.cpp | 26 ---- net/zerotier/files/patch-node_InetAddress.cpp | 23 ---- net/zerotier/files/patch-service_OneService.cpp | 138 --------------------- 6 files changed, 4 insertions(+), 218 deletions(-) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index b66ebf553035..9e4ec1180f67 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -1,6 +1,5 @@ PORTNAME= zerotier -DISTVERSION= 1.12.2 -PORTREVISION= 1 +DISTVERSION= 1.14.0 CATEGORIES= net MAINTAINER= dch@FreeBSD.org diff --git a/net/zerotier/distinfo b/net/zerotier/distinfo index 4e33dbc4d17b..3e33cb0498a8 100644 --- a/net/zerotier/distinfo +++ b/net/zerotier/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1695881387 -SHA256 (zerotier-ZeroTierOne-1.12.2_GH0.tar.gz) = 7c6512cfc208374ea9dc9931110e35f71800c34890e0f35991ea485aae66e31c -SIZE (zerotier-ZeroTierOne-1.12.2_GH0.tar.gz) = 12431815 +TIMESTAMP = 1714832015 +SHA256 (zerotier-ZeroTierOne-1.14.0_GH0.tar.gz) = 7191623a81b0d1b552b9431e8864dd3420783ee518394ac1376cee6aaf033291 +SIZE (zerotier-ZeroTierOne-1.14.0_GH0.tar.gz) = 12453099 diff --git a/net/zerotier/files/patch-README.md b/net/zerotier/files/patch-README.md deleted file mode 100644 index 2ef84861cac6..000000000000 --- a/net/zerotier/files/patch-README.md +++ /dev/null @@ -1,26 +0,0 @@ ---- README.md.orig 2023-09-14 19:09:26 UTC -+++ README.md -@@ -169,3 +169,23 @@ If there are other metrics you'd like to see tracked, - | 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/ -+ -+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 'appA

hello world A' | sudo tee app/appA/index.html -+echo 'app2

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). diff --git a/net/zerotier/files/patch-controller_EmbeddedNetworkController.cpp b/net/zerotier/files/patch-controller_EmbeddedNetworkController.cpp deleted file mode 100644 index 1f037774fcfb..000000000000 --- a/net/zerotier/files/patch-controller_EmbeddedNetworkController.cpp +++ /dev/null @@ -1,26 +0,0 @@ ---- controller/EmbeddedNetworkController.cpp.orig 2023-09-14 19:09:26 UTC -+++ controller/EmbeddedNetworkController.cpp -@@ -874,6 +874,7 @@ void EmbeddedNetworkController::configureHTTPControlPl - std::string memberListPath = "/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(); -@@ -885,11 +886,11 @@ void EmbeddedNetworkController::configureHTTPControlPl - (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); diff --git a/net/zerotier/files/patch-node_InetAddress.cpp b/net/zerotier/files/patch-node_InetAddress.cpp deleted file mode 100644 index 2b1b7a6e4b4a..000000000000 --- a/net/zerotier/files/patch-node_InetAddress.cpp +++ /dev/null @@ -1,23 +0,0 @@ ---- node/InetAddress.cpp.orig 2023-09-14 19:09:26 UTC -+++ node/InetAddress.cpp -@@ -132,7 +132,20 @@ InetAddress::IpScope InetAddress::ipScope() const - return IP_SCOPE_PRIVATE; // fc00::/7 - } - } -+ -+ // :::ffff:127.0.0.1 -+ // 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0x7f, 0, 0, 1 - unsigned int k = 0; -+ while ((!ip[k])&&(k < 9)) { -+ ++k; -+ } -+ if (k == 9) { -+ if (ip[10] == 0xff && ip[11] == 0xff && ip[12] == 0x7f) { -+ return IP_SCOPE_LOOPBACK; -+ } -+ } -+ -+ k = 0; - while ((!ip[k])&&(k < 15)) { - ++k; - } diff --git a/net/zerotier/files/patch-service_OneService.cpp b/net/zerotier/files/patch-service_OneService.cpp deleted file mode 100644 index 884b42e88a65..000000000000 --- a/net/zerotier/files/patch-service_OneService.cpp +++ /dev/null @@ -1,138 +0,0 @@ ---- service/OneService.cpp.orig 2023-09-14 19:09:26 UTC -+++ service/OneService.cpp -@@ -795,6 +795,7 @@ class OneServiceImpl : public OneService (public) - bool _allowTcpFallbackRelay; - bool _forceTcpRelay; - bool _allowSecondaryPort; -+ bool _enableWebServer; - - unsigned int _primaryPort; - unsigned int _secondaryPort; -@@ -1557,6 +1558,7 @@ class OneServiceImpl : public OneService (public) - - std::vector noAuthEndpoints { "/sso", "/health" }; - -+ - auto setContent = [=] (const httplib::Request &req, httplib::Response &res, std::string content) { - if (req.has_param("jsonp")) { - if (content.length() > 0) { -@@ -1573,8 +1575,98 @@ class OneServiceImpl : public OneService (public) - } - }; - -+ // -+ // static file server for app ui' -+ // -+ if (_enableWebServer) { -+ static std::string appUiPath = "/app"; -+ static char appUiDir[16384]; -+ sprintf(appUiDir,"%s%s",_homePath.c_str(),appUiPath.c_str()); - -- auto authCheck = [=] (const httplib::Request &req, httplib::Response &res) { -+ auto ret = _controlPlane.set_mount_point(appUiPath, appUiDir); -+ _controlPlaneV6.set_mount_point(appUiPath, appUiDir); -+ if (!ret) { -+ fprintf(stderr, "Mounting app directory failed. Creating it. Path: %s - Dir: %s\n", appUiPath.c_str(), appUiDir); -+ if (!OSUtils::mkdir(appUiDir)) { -+ fprintf(stderr, "Could not create app directory either. Path: %s - Dir: %s\n", appUiPath.c_str(), appUiDir); -+ } else { -+ ret = _controlPlane.set_mount_point(appUiPath, appUiDir); -+ _controlPlaneV6.set_mount_point(appUiPath, appUiDir); -+ if (!ret) { -+ fprintf(stderr, "Really could not create and mount directory. Path: %s - Dir: %s\nWeb apps won't work.\n", appUiPath.c_str(), appUiDir); -+ } -+ } -+ } -+ -+ if (ret) { -+ // fallback to /index.html for paths that don't exist for SPAs -+ auto indexFallbackGet = [](const httplib::Request &req, httplib::Response &res) { -+ // fprintf(stderr, "fallback \n"); -+ -+ auto match = req.matches[1]; -+ if (match.matched) { -+ -+ // fallback -+ char indexHtmlPath[16384]; -+ sprintf(indexHtmlPath,"%s/%s/%s", appUiDir, match.str().c_str(), "index.html"); -+ // fprintf(stderr, "fallback path %s\n", indexHtmlPath); -+ -+ std::string indexHtml; -+ -+ if (!OSUtils::readFile(indexHtmlPath, indexHtml)) { -+ res.status = 500; -+ return; -+ } -+ -+ res.set_content(indexHtml.c_str(), "text/html"); -+ } else { -+ res.status = 500; -+ return; -+ } -+ }; -+ -+ auto slashRedirect = [](const httplib::Request &req, httplib::Response &res) { -+ // fprintf(stderr, "redirect \n"); -+ -+ // add .html -+ std::string htmlFile; -+ char htmlPath[16384]; -+ sprintf(htmlPath,"%s%s%s", appUiDir, (req.path).substr(appUiPath.length()).c_str(), ".html"); -+ // fprintf(stderr, "path: %s\n", htmlPath); -+ if (OSUtils::readFile(htmlPath, htmlFile)) { -+ res.set_content(htmlFile.c_str(), "text/html"); -+ return; -+ } else { -+ res.status = 301; -+ res.set_header("location", req.path + "/"); -+ } -+ }; -+ -+ // auto missingAssetGet = [&, setContent](const httplib::Request &req, httplib::Response &res) { -+ // fprintf(stderr, "missing \n"); -+ // res.status = 404; -+ // std::string html = "oops"; -+ // res.set_content(html, "text/plain"); -+ // res.set_header("Content-Type", "text/plain"); -+ // return; -+ // }; -+ -+ // auto fix no trailing slash by adding .html or redirecting to path/ -+ _controlPlane.Get(appUiPath + R"((/[\w|-]+)+$)", slashRedirect); -+ _controlPlaneV6.Get(appUiPath + R"((/[\w|-]+)+$)", slashRedirect); -+ -+ // // 404 missing assets for *.ext paths -+ // s.Get(appUiPath + R"(/\.\w+$)", missingAssetGet); -+ // sv6.Get(appUiPath + R"(/\.\w+$)", missingAssetGet); -+ -+ // fallback to index.html for unknown paths/files -+ _controlPlane.Get(appUiPath + R"((/[\w|-]+)(/[\w|-]+)*/$)", indexFallbackGet); -+ _controlPlaneV6.Get(appUiPath + R"((/[\w|-]+)(/[\w|-]+)*/$)", indexFallbackGet); -+ -+ } -+ } -+ -+ auto authCheck = [=] (const httplib::Request &req, httplib::Response &res) { - if (req.path == "/metrics") { - - if (req.has_header("x-zt1-auth")) { -@@ -1624,6 +1716,11 @@ class OneServiceImpl : public OneService (public) - isAuth = true; - } - -+ // Web Apps base path -+ if (req.path.rfind("/app", 0) == 0) { //starts with /app -+ isAuth = true; -+ } -+ - if (!isAuth) { - // check auth token - if (req.has_header("x-zt1-auth")) { -@@ -2429,6 +2526,7 @@ class OneServiceImpl : public OneService (public) - // bondingPolicy cannot be used with allowTcpFallbackRelay - _allowTcpFallbackRelay = OSUtils::jsonBool(settings["allowTcpFallbackRelay"],true); - _forceTcpRelay = OSUtils::jsonBool(settings["forceTcpRelay"],false); -+ _enableWebServer = (OSUtils::jsonBool(settings["enableWebServer"],false)); - - #ifdef ZT_TCP_FALLBACK_RELAY - _fallbackRelayAddress = InetAddress(OSUtils::jsonString(settings["tcpFallbackRelay"], ZT_TCP_FALLBACK_RELAY).c_str());