Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 04 May 2026 18:24:51 +0000
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: df3dbeed7237 - main - net/sing-box: Add default config file
Message-ID:  <69f8e473.36f75.3fa3b5f0@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=df3dbeed7237bd209f81849b9807a83bf311fe33

commit df3dbeed7237bd209f81849b9807a83bf311fe33
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2026-05-04 15:42:37 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-05-04 18:24:49 +0000

    net/sing-box: Add default config file
    
    ... running a SOCKS5 server to allow the sing-box service
    to be runnable out of the box.
---
 net/sing-box/Makefile            |  8 +++++++-
 net/sing-box/files/sing-box.json | 16 ++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/net/sing-box/Makefile b/net/sing-box/Makefile
index 6206a08e4ff8..aa64650053b2 100644
--- a/net/sing-box/Makefile
+++ b/net/sing-box/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	sing-box
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.13.11
+PORTREVISION=	1
 CATEGORIES=	net
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -16,7 +17,8 @@ USES=		go:1.24+,modules
 GO_MODULE=	github.com/sagernet/sing-box
 GO_TARGET=	./cmd/sing-box
 
-PLIST_FILES=	bin/${PORTNAME}
+PLIST_FILES=	bin/${PORTNAME} \
+		"@sample etc/sing-box.json.sample"
 
 USE_RC_SUBR=	${PORTNAME}
 
@@ -54,4 +56,8 @@ OCM_VARS=		GO_TAGS+=with_ocm
 GO_BUILDFLAGS+=	-tags "${GO_TAGS}"
 .endif
 
+post-install:
+	# install default config file
+	${INSTALL_DATA} ${FILESDIR}/sing-box.json ${STAGEDIR}${PREFIX}/etc/sing-box.json.sample
+
 .include <bsd.port.post.mk>
diff --git a/net/sing-box/files/sing-box.json b/net/sing-box/files/sing-box.json
new file mode 100644
index 000000000000..7a1bd101f0e3
--- /dev/null
+++ b/net/sing-box/files/sing-box.json
@@ -0,0 +1,16 @@
+{
+  "inbounds": [
+    {
+      "type": "socks",
+      "tag": "socks-in",
+      "listen": "::",
+      "listen_port": 1080
+    }
+  ],
+  "outbounds": [
+    {
+      "type": "direct",
+      "tag": "direct"
+    }
+  ]
+}


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69f8e473.36f75.3fa3b5f0>