From nobody Fri Jul 18 06:43:06 2025 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 4bk0bt6Xy4z61tCf; Fri, 18 Jul 2025 06:43:06 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bk0bt4K84z3Lb2; Fri, 18 Jul 2025 06:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752820986; 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=3vxn5aZElV7jdS546vgvIctnqa2LqSs1yWjVTT7T4FM=; b=STFVg8O4mjNFQMXyoSaILyPRsPhrU5vTyLPMLq+N8RqlGhKv6Q/KL5mftf820l7tBXhvnH 033X236rbOSdSSKLJWYaz9goM78eDy0VthwgCOnqx8cCg8pZecEfHazkEpSTuD0bGcWMvb 4HOdjteSQlIhF4pPCTJFqy2uI77wH66swzbVK8FEAwsynz4XmX/BfVOARUVAUnC4MvZbBH OYu4NnxqVcgvvyZZCkhKGX1Dc0F6yluRjFuwpoN2SX9WQaWG17vMWe8+ZPXOjZvdNnz8yP 4/CszR7065i/SlLdnNCRbx94zT3kf86jAYOCin8O8ymyUZvJB9DL/F1rdXBDAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1752820986; 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=3vxn5aZElV7jdS546vgvIctnqa2LqSs1yWjVTT7T4FM=; b=TNlukzSep/Ys4S5RNJxAreYQ93HtckAbhJfuf2Phm5/1IEidNB7soO4LJrt4dyTzcTCjqQ nZMgFcikDfkYRKYbqhAhRZTfLe3i5Uvtkx54Z9nGSF9DcLe6MFQQU8Bz1q554jc5I2MlgC cP1M+CBYPXv+IoYr9p+MbqoldsW4KZ4ChQOrQ8TUosGf+EgkgtfqeoJF3VGg2cmQfGuxBj qlrdMMlcB79M6vvWntiSLMgmXT4jx5dNQ6XpCKc7E/47PoDewBAxDnQdlxyTCyaVJYB1LE B78mkq63EPhV1Md+SsnS8sszKOAoVfA/LHuEazk449ts2qw4KP4PGZuhp2E2Ww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1752820986; a=rsa-sha256; cv=none; b=Zdzo4Pz2GKDqVexLzOiSVWyb4AK/yTSswKpkonw/GSGFworQjuRphPLhWscfAGhjfqdVuk sbVoWRIj+1pDAOicEEcPaNQNyF5VCCkwRjAVQfjIphFFpCbXgrDhMj4bKiAkPsXtOBFEQO w6FGwCHpcKgjD4MCAs62Sw6aX4Vn+deZO64Y//em5HOOxP9q3wRfvpwlzUTSW8m1/5GQmc Dtr3fwvT/joZmcC/9pW2b0ZDQM0R3bFdX0kFPaZSHeryGEG4Yks2SIEM8u90xp/DXI8C65 s2u8dCzzMyfXjh1+N0PFjMqI4Mg4p0YHr2ylR/zrwr5+2ICPqjZxHnomg7GceQ== 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 4bk0bt3VlzzTY2; Fri, 18 Jul 2025 06:43:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56I6h6oC091004; Fri, 18 Jul 2025 06:43:06 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56I6h6tK091001; Fri, 18 Jul 2025 06:43:06 GMT (envelope-from git) Date: Fri, 18 Jul 2025 06:43:06 GMT Message-Id: <202507180643.56I6h6tK091001@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: =?utf-8?Q?Jes=C3=BAs?= Daniel Colmenares Oviedo Subject: git: 43163344cc9d - main - net/toxiproxy-{cli,server}: New port: TCP proxy to simulate network and system conditions 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: dtxdf X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 43163344cc9da5f0592a4e3cab45224b9ce2a83f Auto-Submitted: auto-generated The branch main has been updated by dtxdf: URL: https://cgit.FreeBSD.org/ports/commit/?id=43163344cc9da5f0592a4e3cab45224b9ce2a83f commit 43163344cc9da5f0592a4e3cab45224b9ce2a83f Author: Jesús Daniel Colmenares Oviedo AuthorDate: 2025-07-18 03:16:31 +0000 Commit: Jesús Daniel Colmenares Oviedo CommitDate: 2025-07-18 06:37:47 +0000 net/toxiproxy-{cli,server}: New port: TCP proxy to simulate network and system conditions Toxiproxy is a framework for simulating network conditions. It's made specifically to work in testing, CI and development environments, supporting deterministic tampering with connections, but with support for randomized chaos and customization. Toxiproxy is the tool you need to prove with tests that your application doesn't have single points of failure. Approved by: acm (mentor) --- net/Makefile | 2 ++ net/toxiproxy-cli/Makefile | 11 +++++++++ net/toxiproxy-cli/distinfo | 5 ++++ net/toxiproxy-server/Makefile | 30 +++++++++++++++++++++++ net/toxiproxy-server/distinfo | 5 ++++ net/toxiproxy-server/files/toxiproxy-server.in | 34 ++++++++++++++++++++++++++ net/toxiproxy-server/pkg-descr | 6 +++++ 7 files changed, 93 insertions(+) diff --git a/net/Makefile b/net/Makefile index 90da17c3020a..084c05fae492 100644 --- a/net/Makefile +++ b/net/Makefile @@ -1609,6 +1609,8 @@ SUBDIR += tn5250 SUBDIR += toonel SUBDIR += torsocks + SUBDIR += toxiproxy-cli + SUBDIR += toxiproxy-server SUBDIR += traefik SUBDIR += traff SUBDIR += trafshow diff --git a/net/toxiproxy-cli/Makefile b/net/toxiproxy-cli/Makefile new file mode 100644 index 000000000000..d25545da1342 --- /dev/null +++ b/net/toxiproxy-cli/Makefile @@ -0,0 +1,11 @@ +PORTNAME= toxiproxy-cli + +COMMENT= TCP proxy to simulate network and system conditions (client) + +GO_TARGET= ./cmd/cli:${PORTNAME} + +MASTERDIR= ${.CURDIR}/../toxiproxy-server + +DISTINFO_FILE= ${.CURDIR}/distinfo + +.include "${MASTERDIR}/Makefile" diff --git a/net/toxiproxy-cli/distinfo b/net/toxiproxy-cli/distinfo new file mode 100644 index 000000000000..9447408399e8 --- /dev/null +++ b/net/toxiproxy-cli/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1752818445 +SHA256 (go/net_toxiproxy-cli/shopify-toxiproxy-v2.12.0_GH0/go.mod) = efe7eee8e60cbef1c8283f1d9becf20e6abf051716e8cd1ed83e88d65d581825 +SIZE (go/net_toxiproxy-cli/shopify-toxiproxy-v2.12.0_GH0/go.mod) = 1079 +SHA256 (go/net_toxiproxy-cli/shopify-toxiproxy-v2.12.0_GH0/shopify-toxiproxy-v2.12.0_GH0.tar.gz) = 9332a884c559fbcf96cbe2c1b46312eb1e1b7191eb9a73a3d3b857d4e9789eb1 +SIZE (go/net_toxiproxy-cli/shopify-toxiproxy-v2.12.0_GH0/shopify-toxiproxy-v2.12.0_GH0.tar.gz) = 73037 diff --git a/net/toxiproxy-server/Makefile b/net/toxiproxy-server/Makefile new file mode 100644 index 000000000000..bc056daa6cb4 --- /dev/null +++ b/net/toxiproxy-server/Makefile @@ -0,0 +1,30 @@ +PORTNAME?= toxiproxy-server +DISTVERSIONPREFIX= v +DISTVERSION= 2.12.0 +CATEGORIES= net + +MAINTAINER= dtxdf@FreeBSD.org +COMMENT?= TCP proxy to simulate network and system conditions (server) +WWW= https://github.com/shopify/toxiproxy + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= go:modules +USE_GITHUB= yes +GH_ACCOUNT= shopify +GH_PROJECT= toxiproxy + +.if ${PORTNAME} == toxiproxy-server +USE_RC_SUBR= ${PORTNAME} +.endif + +GO_MOD_DIST= github +GO_MODULE= github.com/shopify/toxiproxy +GO_TARGET?= ./cmd/server:${PORTNAME} +GO_BUILDFLAGS= -ldflags "\ + -X 'github.com/Shopify/toxiproxy/v2.Version=${DISTVERSION}'" + +PLIST_FILES= bin/${PORTNAME} + +.include diff --git a/net/toxiproxy-server/distinfo b/net/toxiproxy-server/distinfo new file mode 100644 index 000000000000..8e3218b983a7 --- /dev/null +++ b/net/toxiproxy-server/distinfo @@ -0,0 +1,5 @@ +TIMESTAMP = 1752818561 +SHA256 (go/net_toxiproxy-server/shopify-toxiproxy-v2.12.0_GH0/go.mod) = efe7eee8e60cbef1c8283f1d9becf20e6abf051716e8cd1ed83e88d65d581825 +SIZE (go/net_toxiproxy-server/shopify-toxiproxy-v2.12.0_GH0/go.mod) = 1079 +SHA256 (go/net_toxiproxy-server/shopify-toxiproxy-v2.12.0_GH0/shopify-toxiproxy-v2.12.0_GH0.tar.gz) = 9332a884c559fbcf96cbe2c1b46312eb1e1b7191eb9a73a3d3b857d4e9789eb1 +SIZE (go/net_toxiproxy-server/shopify-toxiproxy-v2.12.0_GH0/shopify-toxiproxy-v2.12.0_GH0.tar.gz) = 73037 diff --git a/net/toxiproxy-server/files/toxiproxy-server.in b/net/toxiproxy-server/files/toxiproxy-server.in new file mode 100644 index 000000000000..f503424c5934 --- /dev/null +++ b/net/toxiproxy-server/files/toxiproxy-server.in @@ -0,0 +1,34 @@ +#!/bin/sh + +# PROVIDE: toxiproxy_server +# REQUIRE: LOGIN +# KEYWORD: shutdown +# +# Configuration settings for Toxiproxy in /etc/rc.conf +# +# toxiproxy_server_enable (bool): Enable Toxiproxy. +# toxiproxy_server_log (str): Log output. +# toxiproxy_server_runas (str): User to run Toxiproxy as. +# toxiproxy_server_config (str): Toxiproxy configuration file. +# toxiproxy_server_args (str): Arguments used by Toxiproxy. +# + +. /etc/rc.subr + +name="toxiproxy_server" +desc="TCP proxy to simulate network and system conditions" +rcvar="${name}_enable" + +load_rc_config $name + +: ${toxiproxy_server_enable:="NO"} +: ${toxiproxy_server_config:="%%PREFIX%%/etc/toxiproxy.json"} +: ${toxiproxy_server_log:="/var/log/toxiproxy-server.log"} +: ${toxiproxy_server_runas:="nobody"} + +pidfile="/var/run/${name}.pid" +procname="%%LOCALBASE%%/bin/toxiproxy-server" +command="/usr/sbin/daemon" +command_args="-u '${toxiproxy_server_runas}' -p '${pidfile}' -t '${desc}' -o '${toxiproxy_server_log}' '${procname}' -config '${toxiproxy_server_config}' ${toxiproxy_server_args}" + +run_rc_command "$1" diff --git a/net/toxiproxy-server/pkg-descr b/net/toxiproxy-server/pkg-descr new file mode 100644 index 000000000000..e5aab1ff5358 --- /dev/null +++ b/net/toxiproxy-server/pkg-descr @@ -0,0 +1,6 @@ +Toxiproxy is a framework for simulating network conditions. It's +made specifically to work in testing, CI and development environments, +supporting deterministic tampering with connections, but with support +for randomized chaos and customization. Toxiproxy is the tool you +need to prove with tests that your application doesn't have single +points of failure.