Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 Jun 2026 18:09:41 +0000
From:      Jochen Neumeister <joneum@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: a73cae2fd894 - main - www/code-server: Add new port
Message-ID:  <6a3828e5.24dac.fff9348@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by joneum:

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

commit a73cae2fd8948279ab7467aa82d34fdb8cd10833
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-06-21 17:58:38 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-06-21 18:07:06 +0000

    www/code-server: Add new port
    
    code-server enables running Visual Studio Code on a remote system and
    accessing it through a web browser. It provides a familiar development
    environment without requiring a local VS Code installation.
    
    WWW: https://github.com/coder/code-server
    
    Sponsored by:   Netzkommune GmbH
---
 www/Makefile                                       |     1 +
 www/code-server/Makefile                           |    55 +
 www/code-server/Makefile.build                     |    85 +
 www/code-server/Makefile.install                   |    17 +
 www/code-server/Makefile.vscode                    |    54 +
 www/code-server/distinfo                           |    11 +
 www/code-server/files/README.md                    |   137 +
 www/code-server/files/code-server-wrapper.in       |     2 +
 www/code-server/files/code-server.in               |    75 +
 .../files/patch-ci_build_build-vscode.sh           |    72 +
 .../patch-disable-agenthost-sandbox-forwarder      |    12 +
 ...64_node__modules__vscode_deviceid_dist_index.js |    13 +
 ..._node__modules__vscode_deviceid_dist_storage.js |    11 +
 .../patch-lib_vscode_build_gulpfile.extensions.ts  |    11 +
 .../patch-lib_vscode_build_gulpfile.vscode.ts      |    16 +
 .../files/patch-lib_vscode_build_lib_extensions.ts |    20 +
 .../files/patch-lib_vscode_build_lib_getVersion.ts |    11 +
 ...extensions_microsoft-authentication_esbuild.mts |    10 +
 ...de_node__modules__vscode_deviceid_dist_index.js |    12 +
 ..._node__modules__vscode_deviceid_dist_storage.js |    11 +
 ...b_vscode_node__modules_node-pty_src_unix_pty.cc |    11 +
 .../files/patch-lib_vscode_product.json            |    28 +
 ...rc_vs_platform_environment_node_userDataPath.ts |    10 +
 ...ode_src_vs_platform_sign_browser_signService.ts |    23 +
 www/code-server/pkg-descr                          |     5 +
 www/code-server/pkg-message                        |    23 +
 www/code-server/pkg-plist                          | 13704 +++++++++++++++++++
 27 files changed, 14440 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 38cc7a3f0a56..5ea848b5d776 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -124,6 +124,7 @@
     SUBDIR += closure-compiler
     SUBDIR += cntlm
     SUBDIR += cobalt
+    SUBDIR += code-server
     SUBDIR += codeberg-pages-server
     SUBDIR += codeigniter
     SUBDIR += colly
diff --git a/www/code-server/Makefile b/www/code-server/Makefile
new file mode 100644
index 000000000000..3634aeac4ab3
--- /dev/null
+++ b/www/code-server/Makefile
@@ -0,0 +1,55 @@
+PORTNAME=	code-server
+DISTVERSION=	4.123.0
+CATEGORIES=	www
+MASTER_SITES=	https://github.com/joneum/FreeBSD-CodeServer/releases/download/code-server-${DISTVERSION}/:code_server
+DISTFILES=	vscode-node-modules-${VSCODE_VERSION}${EXTRACT_SUFX}:code_server \
+		vscode-reh-web-linux-x64-${DISTVERSION}${EXTRACT_SUFX}:code_server
+.if !defined(BOOTSTRAP_NODE_MODULES)
+DISTFILES+=	code-server-node-modules-${DISTVERSION}${EXTRACT_SUFX}:code_server
+.endif
+
+MAINTAINER=	joneum@FreeBSD.org
+COMMENT=	Run VS Code on a remote server and access it through a browser
+WWW=		https://github.com/coder/code-server
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+EXTRACT_DEPENDS=	jq:textproc/jq
+BUILD_DEPENDS=	npm-node22>0:www/npm-node22 \
+		bash:shells/bash \
+		pkgconf:devel/pkgconf
+LIB_DEPENDS=	libinotify.so:devel/libinotify \
+		libsecret-1.so:security/libsecret \
+		libuv.so:devel/libuv \
+		libxkbfile.so:x11/libxkbfile \
+		libX11.so:x11/libX11
+RUN_DEPENDS=	node:www/node22
+
+USES=		nodejs:22 perl5 pkgconfig python:build ssl
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	coder
+GH_PROJECT=	code-server
+GH_TAGNAME=	v${DISTVERSION}
+GH_TUPLE=	microsoft:vscode:${VSCODE_VERSION}:vscode
+
+USE_RC_SUBR=	code-server
+
+SUB_FILES=	code-server-wrapper
+
+OPTIONS_DEFINE=	DOCS
+PORTDOCS=	README.md
+
+NO_CCACHE=	yes
+
+VSCODE_VERSION=		1.122.1
+
+MAKE_ENV+=	NODE_OPTIONS=--max-old-space-size=6144 \
+		ESBUILD_WORKER_THREADS=1
+
+.include "${.CURDIR}/Makefile.vscode"
+.include "${.CURDIR}/Makefile.build"
+.include "${.CURDIR}/Makefile.install"
+
+.include <bsd.port.mk>
diff --git a/www/code-server/Makefile.build b/www/code-server/Makefile.build
new file mode 100644
index 000000000000..17dd48bc8474
--- /dev/null
+++ b/www/code-server/Makefile.build
@@ -0,0 +1,85 @@
+post-extract:
+	${RM} -r ${WRKSRC}/lib/vscode
+	${MV} ${WRKDIR}/vscode-${VSCODE_VERSION} ${WRKSRC}/lib/vscode
+.if !defined(BOOTSTRAP_NODE_MODULES)
+	${TAR} -xzf ${DISTDIR}/code-server-node-modules-${DISTVERSION}${EXTRACT_SUFX} \
+		-C ${WRKSRC}
+.endif
+	${TAR} -xzf ${DISTDIR}/vscode-reh-web-linux-x64-${DISTVERSION}${EXTRACT_SUFX} \
+		-C ${WRKSRC}
+.for dir in ${VSCODE_NODE_MODULES}
+	${MKDIR} ${WRKSRC}/lib/vscode/${dir}
+	${TAR} -xzf ${WRKDIR}/vscode-${dir:S|/|_|g}-node-modules${EXTRACT_SUFX} \
+		-C ${WRKSRC}/lib/vscode/${dir}
+.endfor
+
+post-patch:
+	cd ${WRKSRC} && while read patchfile; do \
+		${PATCH} -p1 < ${WRKSRC}/patches/$${patchfile}; \
+	done < ${WRKSRC}/patches/series
+	${CP} ${WRKSRC}/lib/vscode/build/.moduleignore.linux \
+		${WRKSRC}/lib/vscode/build/.moduleignore.freebsd
+	${REINPLACE_CMD} -e '/"typeRoots": \[/,+2d' \
+		${WRKSRC}/lib/vscode/extensions/configuration-editing/tsconfig.json
+	${LOCALBASE}/bin/jq \
+		'.version = "${DISTVERSION}" | .commit = "${DISTVERSION}"' \
+		${WRKSRC}/package.json > ${WRKSRC}/package.json.tmp
+	${MV} ${WRKSRC}/package.json.tmp ${WRKSRC}/package.json
+
+do-build:
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+		npm run build
+	cd ${WRKSRC}/lib/vscode/node_modules/node-pty && \
+		${SETENV} ${MAKE_ENV} PYTHON=${PYTHON_CMD} \
+		node ${LOCALBASE}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js \
+		rebuild --nodedir=${LOCALBASE}
+	${MKDIR} ${WRKSRC}/lib/vscode/node_modules/node-pty/prebuilds/freebsd-x64
+	${CP} ${WRKSRC}/lib/vscode/node_modules/node-pty/build/Release/pty.node \
+		${WRKSRC}/lib/vscode/node_modules/node-pty/prebuilds/freebsd-x64/pty.node
+	cd ${WRKSRC}/lib/vscode/node_modules/@vscode/spdlog && \
+		${SETENV} ${MAKE_ENV} PYTHON=${PYTHON_CMD} \
+		node ${LOCALBASE}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js \
+		rebuild --nodedir=${LOCALBASE}
+	cd ${WRKSRC}/lib/vscode/node_modules/@vscode/native-watchdog && \
+		${SETENV} ${MAKE_ENV} PYTHON=${PYTHON_CMD} \
+		CXXFLAGS="${CXXFLAGS} -I${LOCALBASE}/include" \
+		node ${LOCALBASE}/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js \
+		rebuild --nodedir=${LOCALBASE}
+	cd ${WRKSRC}/lib/vscode && \
+		VSCODE_NODE_VERSION=$$(${AWK} \
+			'/node-v[0-9.]+-linux-x64\.tar\.gz/ { \
+				sub(/^.*node-v/, "", $$2); \
+				sub(/-linux-x64\.tar\.gz$$/, "", $$2); \
+				print $$2; \
+				exit \
+			}' build/checksums/nodejs.txt) && \
+		${MKDIR} .build/node/v$${VSCODE_NODE_VERSION}/linux-x64 && \
+		${CP} ${LOCALBASE}/bin/node \
+			.build/node/v$${VSCODE_NODE_VERSION}/linux-x64/node
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} VERSION=${DISTVERSION} \
+		npm run build:vscode
+	${PERL} -0pi \
+		-e 's#process\.platform !== "linux"\) \{#process.platform !== "linux" \&\&\n    process.platform !== "freebsd") {#' \
+		${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/@vscode/deviceid/dist/index.js
+	${PERL} -0pi \
+		-e 's#process\.platform === "linux"#process.platform === "linux" || process.platform === "freebsd"#' \
+		${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/@vscode/deviceid/dist/storage.js
+	${MKDIR} ${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/node-pty/prebuilds/freebsd-x64
+	${CP} ${WRKSRC}/lib/vscode/node_modules/node-pty/build/Release/pty.node \
+		${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/node-pty/prebuilds/freebsd-x64/pty.node
+	${MKDIR} ${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/@vscode/spdlog/build/Release
+	${CP} ${WRKSRC}/lib/vscode/node_modules/@vscode/spdlog/build/Release/spdlog.node \
+		${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/@vscode/spdlog/build/Release/spdlog.node
+	${MKDIR} ${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/@vscode/native-watchdog/build/Release
+	${CP} ${WRKSRC}/lib/vscode/node_modules/@vscode/native-watchdog/build/Release/watchdog.node \
+		${WRKSRC}/lib/vscode-reh-web-linux-x64/node_modules/@vscode/native-watchdog/build/Release/watchdog.node
+	${RM} ${WRKSRC}/lib/vscode-reh-web-linux-x64/node
+
+make-node-modules-archive:
+	${MAKE} BOOTSTRAP_NODE_MODULES=yes clean extract
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+		npm ci --ignore-scripts --no-progress --no-audit \
+		--no-fund --no-update-notifier
+	cd ${WRKSRC} && ${TAR} -czf \
+		${WRKDIR}/code-server-node-modules-${DISTVERSION}${EXTRACT_SUFX} \
+		node_modules
diff --git a/www/code-server/Makefile.install b/www/code-server/Makefile.install
new file mode 100644
index 000000000000..aae9061c5ebb
--- /dev/null
+++ b/www/code-server/Makefile.install
@@ -0,0 +1,17 @@
+do-install:
+	${MKDIR} ${STAGEDIR}${DATADIR}
+	cd ${WRKSRC} && ${COPYTREE_SHARE} "out node_modules package.json src" \
+		${STAGEDIR}${DATADIR}
+	${MKDIR} ${STAGEDIR}${DATADIR}/lib/vscode
+	cd ${WRKSRC}/lib/vscode-reh-web-linux-x64 && ${COPYTREE_SHARE} "." \
+		${STAGEDIR}${DATADIR}/lib/vscode
+	${INSTALL_SCRIPT} ${WRKDIR}/code-server-wrapper \
+		${STAGEDIR}${PREFIX}/bin/code-server
+	${CHMOD} 755 ${STAGEDIR}${DATADIR}/lib/vscode/bin/code-server-oss
+	${CHMOD} 755 ${STAGEDIR}${DATADIR}/lib/vscode/bin/helpers/*.sh
+	${CHMOD} 755 ${STAGEDIR}${DATADIR}/lib/vscode/bin/remote-cli/code-server
+
+do-install-DOCS-on:
+	${MKDIR} ${STAGEDIR}${DOCSDIR}
+	${INSTALL_DATA} ${FILESDIR}/README.md \
+		${STAGEDIR}${DOCSDIR}
diff --git a/www/code-server/Makefile.vscode b/www/code-server/Makefile.vscode
new file mode 100644
index 000000000000..c53eb37e59fa
--- /dev/null
+++ b/www/code-server/Makefile.vscode
@@ -0,0 +1,54 @@
+VSCODE_NODE_MODULES=	. \
+			.vscode/extensions/vscode-pr-pinger \
+			.vscode/extensions/vscode-selfhost-import-aid \
+			.vscode/extensions/vscode-selfhost-test-provider \
+			build \
+			build/rspack \
+			build/vite \
+			extensions \
+			extensions/configuration-editing \
+			extensions/copilot \
+			extensions/css-language-features \
+			extensions/css-language-features/server \
+			extensions/debug-auto-launch \
+			extensions/debug-server-ready \
+			extensions/emmet \
+			extensions/extension-editing \
+			extensions/git \
+			extensions/git-base \
+			extensions/github \
+			extensions/github-authentication \
+			extensions/grunt \
+			extensions/gulp \
+			extensions/html-language-features \
+			extensions/html-language-features/server \
+			extensions/ipynb \
+			extensions/jake \
+			extensions/json-language-features \
+			extensions/json-language-features/server \
+			extensions/markdown-language-features \
+			extensions/markdown-math \
+			extensions/media-preview \
+			extensions/merge-conflict \
+			extensions/mermaid-markdown-features \
+			extensions/microsoft-authentication \
+			extensions/notebook-renderers \
+			extensions/npm \
+			extensions/php-language-features \
+			extensions/references-view \
+			extensions/search-result \
+			extensions/simple-browser \
+			extensions/terminal-suggest \
+			extensions/tunnel-forwarding \
+			extensions/typescript-language-features \
+			extensions/vscode-api-tests \
+			extensions/vscode-colorize-perf-tests \
+			extensions/vscode-colorize-tests \
+			extensions/vscode-test-resolver \
+			remote \
+			remote/web \
+			test/automation \
+			test/integration/browser \
+			test/mcp \
+			test/monaco \
+			test/smoke
diff --git a/www/code-server/distinfo b/www/code-server/distinfo
new file mode 100644
index 000000000000..aa3ddf7e1cec
--- /dev/null
+++ b/www/code-server/distinfo
@@ -0,0 +1,11 @@
+TIMESTAMP = 1781371123
+SHA256 (vscode-node-modules-1.122.1.tar.gz) = 808d60c65ae2c01ed2c5fdf7fb4917c6e106f67d519c16626c8061fbb99fe2d7
+SIZE (vscode-node-modules-1.122.1.tar.gz) = 1122690861
+SHA256 (vscode-reh-web-linux-x64-4.123.0.tar.gz) = ae0a305471fcfb552178f950f56f64a91afb56b7a5932315a013cb805cdca654
+SIZE (vscode-reh-web-linux-x64-4.123.0.tar.gz) = 150548740
+SHA256 (code-server-node-modules-4.123.0.tar.gz) = c2e136a59272086708e5be58784926335adc2ec42f7afb79e1f5b425c11198da
+SIZE (code-server-node-modules-4.123.0.tar.gz) = 18703344
+SHA256 (coder-code-server-4.123.0-v4.123.0_GH0.tar.gz) = 72953516411cc96054f78f386c29adf537ae93c3cc84ac53e6a84cf0609c8124
+SIZE (coder-code-server-4.123.0-v4.123.0_GH0.tar.gz) = 779115
+SHA256 (microsoft-vscode-1.122.1_GH0.tar.gz) = d7dc639c5c10aafa41b735c48d4b9347a19afb03ef6af3277a6d6af8b711aa7e
+SIZE (microsoft-vscode-1.122.1_GH0.tar.gz) = 42706904
diff --git a/www/code-server/files/README.md b/www/code-server/files/README.md
new file mode 100644
index 000000000000..a91f0e348267
--- /dev/null
+++ b/www/code-server/files/README.md
@@ -0,0 +1,137 @@
+code-server on FreeBSD
+======================
+
+Overview
+--------
+
+code-server allows Visual Studio Code to run on a remote FreeBSD system and
+be accessed through a web browser.
+
+After installation, code-server can be started either manually or through
+the provided rc.d service.
+
+
+Service Management
+------------------
+
+Enable automatic startup at boot:
+
+    sysrc code_server_enable=YES
+
+Start the service:
+
+    service code-server start
+
+Stop the service:
+
+    service code-server stop
+
+Restart the service:
+
+    service code-server restart
+
+Check service status:
+
+    service code-server status
+
+
+Accessing code-server
+---------------------
+
+By default, code-server listens on TCP port 8080.
+
+Open the following URL in a web browser:
+
+    http://<server>:8080/
+
+Replace <server> with the hostname or IP address of your FreeBSD system.
+
+If a firewall is enabled, ensure that the configured port is reachable from
+the client system.
+
+
+Configuration
+-------------
+
+When code-server is started manually, it uses the configuration file of the
+current user, usually:
+
+    ~/.config/code-server/config.yaml
+
+When code-server is started through the rc.d service, the configuration file
+is created and used at:
+
+    /usr/local/etc/code-server/config.yaml
+
+The configuration file contains settings such as:
+
+    - listen address
+    - TCP port
+    - authentication settings
+    - password
+
+Example:
+
+    bind-addr: 0.0.0.0:8080
+    auth: password
+    password: my-secret-password
+
+
+Password
+--------
+
+During the first startup, code-server generates a configuration file and a
+random password.
+
+When running as a service, the password can be displayed using:
+
+    grep '^password:' /usr/local/etc/code-server/config.yaml
+
+When started manually, the password can be displayed using:
+
+    grep '^password:' ~/.config/code-server/config.yaml
+
+
+Changing the Listening Address
+------------------------------
+
+The listening address and port can be changed in the configuration file.
+
+Example:
+
+    bind-addr: 0.0.0.0:8443
+
+After changing the configuration, restart the service:
+
+    service code-server restart
+
+
+Extensions
+
+----------
+
+code-server supports many Visual Studio Code extensions.
+
+Extension availability and compatibility depend on the individual extension,
+the extension marketplace used, and whether the extension relies on features
+that are not available in code-server.
+
+Not all Visual Studio Code extensions are compatible with code-server.
+
+For information about extension compatibility and limitations, see:
+
+    https://coder.com/docs/code-server/FAQ
+    https://code.visualstudio.com/api/advanced-topics/remote-extensions
+
+
+Resource Requirements
+---------------------
+
+Building code-server requires substantially more memory than typical FreeBSD
+ports.
+
+Systems with insufficient RAM or swap may fail during the build process.
+
+Running code-server generally requires significantly less memory than building
+it, but available RAM should still be considered when hosting multiple users
+or large development workloads.
diff --git a/www/code-server/files/code-server-wrapper.in b/www/code-server/files/code-server-wrapper.in
new file mode 100644
index 000000000000..7f1090044744
--- /dev/null
+++ b/www/code-server/files/code-server-wrapper.in
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec %%LOCALBASE%%/bin/node %%DATADIR%%/out/node/entry.js "$@"
diff --git a/www/code-server/files/code-server.in b/www/code-server/files/code-server.in
new file mode 100644
index 000000000000..2b146f4128b9
--- /dev/null
+++ b/www/code-server/files/code-server.in
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# PROVIDE: code_server
+# REQUIRE: LOGIN NETWORKING DAEMON
+# KEYWORD: shutdown
+#
+# Add the following line to /etc/rc.conf to enable code-server:
+#
+# code_server_enable="YES"
+#
+# Optional settings:
+#
+# code_server_run_user="nobody"
+# code_server_run_group="nobody"
+# code_server_config="%%PREFIX%%/etc/code-server/config.yaml"
+# code_server_host="127.0.0.1"
+# code_server_port="8080"
+# code_server_auth="password"
+# code_server_user_data_dir="/var/db/code-server/user-data"
+# code_server_extensions_dir="/var/db/code-server/extensions"
+# code_server_extra_args=""
+
+. /etc/rc.subr
+
+name="code_server"
+rcvar="code_server_enable"
+
+load_rc_config "${name}"
+
+: ${code_server_enable:="NO"}
+: ${code_server_run_user:="nobody"}
+: ${code_server_run_group:="nobody"}
+: ${code_server_config:="%%PREFIX%%/etc/code-server/config.yaml"}
+: ${code_server_host:="127.0.0.1"}
+: ${code_server_port:="8080"}
+: ${code_server_auth:="password"}
+: ${code_server_user_data_dir:="/var/db/code-server/user-data"}
+: ${code_server_extensions_dir:="/var/db/code-server/extensions"}
+: ${code_server_extra_args:=""}
+
+pidfile="/var/run/code-server/${name}.pid"
+
+command="/usr/sbin/daemon"
+procname="%%LOCALBASE%%/bin/node"
+
+command_args="-f \
+-p ${pidfile} \
+-u ${code_server_run_user} \
+/usr/bin/env \
+HOME=/var/db/code-server \
+XDG_DATA_HOME=${code_server_user_data_dir} \
+XDG_CONFIG_HOME=$(dirname ${code_server_config}) \
+XDG_CACHE_HOME=/var/db/code-server/cache \
+%%PREFIX%%/bin/code-server \
+--config ${code_server_config} \
+--host ${code_server_host} \
+--port ${code_server_port} \
+--auth ${code_server_auth} \
+--user-data-dir ${code_server_user_data_dir} \
+--extensions-dir ${code_server_extensions_dir} \
+${code_server_extra_args}"
+
+start_precmd="${name}_prestart"
+
+code_server_prestart()
+{
+	install -d -o ${code_server_run_user} -g ${code_server_run_group} -m 0750 /var/run/code-server
+	install -d -o ${code_server_run_user} -g ${code_server_run_group} -m 0750 /var/db/code-server
+	install -d -o ${code_server_run_user} -g ${code_server_run_group} -m 0750 /var/db/code-server/cache
+	install -d -o ${code_server_run_user} -g ${code_server_run_group} -m 0750 ${code_server_user_data_dir}
+	install -d -o ${code_server_run_user} -g ${code_server_run_group} -m 0750 ${code_server_extensions_dir}
+	install -d -o ${code_server_run_user} -g ${code_server_run_group} -m 0750 "$(dirname "${code_server_config}")"
+}
+
+run_rc_command "$1"
diff --git a/www/code-server/files/patch-ci_build_build-vscode.sh b/www/code-server/files/patch-ci_build_build-vscode.sh
new file mode 100644
index 000000000000..e2bfed590ee5
--- /dev/null
+++ b/www/code-server/files/patch-ci_build_build-vscode.sh
@@ -0,0 +1,72 @@
+--- ci/build/build-vscode.sh.orig
++++ ci/build/build-vscode.sh
+@@ -7,7 +7,7 @@
+ MINIFY=${MINIFY-true}
+ 
+ fix-bin-script() {
+-  local script="lib/vscode-reh-web-$VSCODE_TARGET/bin/$1"
++  local script="lib/vscode-reh-web-$GULP_VSCODE_TARGET/bin/$1"
+   sed -i.bak "s/@@VERSION@@/$(vscode_version)/g" "$script"
+   sed -i.bak "s/@@COMMIT@@/$BUILD_SOURCEVERSION/g" "$script"
+   sed -i.bak "s/@@APPNAME@@/code-server/g" "$script"
+@@ -30,7 +30,7 @@
+ }
+ 
+ copy-bin-script() {
+-  cp "lib/vscode/resources/server/bin/$1" "lib/vscode-reh-web-$VSCODE_TARGET/bin/$1"
++  cp "lib/vscode/resources/server/bin/$1" "lib/vscode-reh-web-$GULP_VSCODE_TARGET/bin/$1"
+   fix-bin-script "$1"
+ }
+ 
+@@ -47,7 +47,7 @@
+   # not update when only our patch files change, and that will cause caching
+   # issues where the browser keeps using outdated code.
+   export BUILD_SOURCEVERSION
+-  BUILD_SOURCEVERSION=$(git rev-parse HEAD)
++  BUILD_SOURCEVERSION="${BUILD_SOURCEVERSION:-4.123.0}"
+ 
+   pushd lib/vscode
+ 
+@@ -64,13 +64,13 @@
+   #
+   # This needs to be done before building as Code will read this file and embed
+   # it into the client-side code.
+-  git checkout product.json             # Reset in case the script exited early.
+   cp product.json product.original.json # Since jq has no inline edit.
+   jq --slurp '.[0] * .[1]' product.original.json <(
+     cat << EOF
+   {
+     "enableTelemetry": true,
+     "quality": "stable",
++    "commit": "$BUILD_SOURCEVERSION",
+     "codeServerVersion": "$VERSION",
+     "nameShort": "code-server",
+     "nameLong": "code-server",
+@@ -111,16 +111,24 @@
+   VSCODE_QUALITY=stable npm run gulp compile-copilot-extension-full-build
+ 
+   npm run gulp core-ci
+-  npm run gulp "vscode-reh-web-$VSCODE_TARGET${MINIFY:+-min}-ci"
++  GULP_VSCODE_TARGET="$VSCODE_TARGET"
++  if [[ "$GULP_VSCODE_TARGET" == freebsd-* ]]; then
++    GULP_VSCODE_TARGET="linux-${GULP_VSCODE_TARGET#freebsd-}"
++  fi
++  npm run gulp "vscode-reh-web-$GULP_VSCODE_TARGET${MINIFY:+-min}-ci"
+ 
++  pushd "../vscode-reh-web-$GULP_VSCODE_TARGET"
++  cp product.json product.original.json
++  jq --arg commit "$BUILD_SOURCEVERSION" '.commit = $commit' product.original.json > product.json
++  popd
++
+   # Reset so if you develop after building you will not be stuck with the wrong
+   # commit (the dev client will use `oss-dev` but the dev server will still use
+   # product.json which will have `stable-$commit`).
+-  git checkout product.json
+ 
+   popd
+ 
+-  pushd "lib/vscode-reh-web-$VSCODE_TARGET"
++  pushd "lib/vscode-reh-web-$GULP_VSCODE_TARGET"
+   # Make sure Code took the version we set in the environment variable.  Not
+   # having a version will break display languages.
+   if ! jq -e .commit product.json; then
diff --git a/www/code-server/files/patch-disable-agenthost-sandbox-forwarder b/www/code-server/files/patch-disable-agenthost-sandbox-forwarder
new file mode 100644
index 000000000000..12e9e4f84b6e
--- /dev/null
+++ b/www/code-server/files/patch-disable-agenthost-sandbox-forwarder
@@ -0,0 +1,12 @@
+--- lib/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.ts.orig
++++ lib/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.ts
+@@ -193,7 +193,8 @@
+ 	}
+ }
+ registerWorkbenchContribution2(ChatAgentToolsContribution.ID, ChatAgentToolsContribution, WorkbenchPhase.AfterRestored);
+-registerWorkbenchContribution2(AgentHostSandboxForwarder.ID, AgentHostSandboxForwarder, WorkbenchPhase.AfterRestored);
++// Disabled for code-server web runtime: agent host is not available.
++// registerWorkbenchContribution2(AgentHostSandboxForwarder.ID, AgentHostSandboxForwarder, WorkbenchPhase.AfterRestored);
+ 
+ // #endregion Contributions
+ 
diff --git a/www/code-server/files/patch-lib_vscode-reh-web-linux-x64_node__modules__vscode_deviceid_dist_index.js b/www/code-server/files/patch-lib_vscode-reh-web-linux-x64_node__modules__vscode_deviceid_dist_index.js
new file mode 100644
index 000000000000..086f08aa120f
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode-reh-web-linux-x64_node__modules__vscode_deviceid_dist_index.js
@@ -0,0 +1,13 @@
+--- lib/vscode-reh-web-linux-x64/node_modules/@vscode/deviceid/dist/index.js.orig
++++ lib/vscode-reh-web-linux-x64/node_modules/@vscode/deviceid/dist/index.js
+@@ -20,7 +20,8 @@
+ Object.defineProperty(exports, "__esModule", { value: true });
+ if (process.platform !== "win32" &&
+     process.platform !== "darwin" &&
+-    process.platform !== "linux") {
++    process.platform !== "linux" &&
++    process.platform !== "freebsd") {
+     throw new Error("Unsupported platform");
+ }
+ __exportStar(require("./devdeviceid.js"), exports);
+\ No newline at end of file
diff --git a/www/code-server/files/patch-lib_vscode-reh-web-linux-x64_node__modules__vscode_deviceid_dist_storage.js b/www/code-server/files/patch-lib_vscode-reh-web-linux-x64_node__modules__vscode_deviceid_dist_storage.js
new file mode 100644
index 000000000000..5ba223054365
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode-reh-web-linux-x64_node__modules__vscode_deviceid_dist_storage.js
@@ -0,0 +1,11 @@
+--- lib/vscode-reh-web-linux-x64/node_modules/@vscode/deviceid/dist/storage.js.orig
++++ lib/vscode-reh-web-linux-x64/node_modules/@vscode/deviceid/dist/storage.js
+@@ -42,7 +42,7 @@
+     if (process.platform === "darwin") {
+         folder = path.join(process.env.HOME, "Library", "Application Support");
+     }
+-    else if (process.platform === "linux") {
++    else if (process.platform === "linux" || process.platform === "freebsd") {
+         folder =
+             process.env.XDG_CACHE_HOME ?? path.join(process.env.HOME, ".cache");
+     }
diff --git a/www/code-server/files/patch-lib_vscode_build_gulpfile.extensions.ts b/www/code-server/files/patch-lib_vscode_build_gulpfile.extensions.ts
new file mode 100644
index 000000000000..cf50531b5db1
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_build_gulpfile.extensions.ts
@@ -0,0 +1,11 @@
+--- lib/vscode/build/gulpfile.extensions.ts.orig
++++ lib/vscode/build/gulpfile.extensions.ts
+@@ -264,7 +264,7 @@
+ /**
+  * brings in the marketplace extensions for the build
+  */
+-const bundleMarketplaceExtensionsBuildTask = task.define('bundle-marketplace-extensions-build', () => ext.packageMarketplaceExtensionsStream(false).pipe(gulp.dest('.build')));
++const bundleMarketplaceExtensionsBuildTask = task.define('bundle-marketplace-extensions-build', () => process.platform === 'freebsd' ? es.readArray([]) : ext.packageMarketplaceExtensionsStream(false).pipe(gulp.dest('.build')));
+ 
+ /**
+  * Compiles the non-native extensions for the build
diff --git a/www/code-server/files/patch-lib_vscode_build_gulpfile.vscode.ts b/www/code-server/files/patch-lib_vscode_build_gulpfile.vscode.ts
new file mode 100644
index 000000000000..68a5dfd794ce
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_build_gulpfile.vscode.ts
@@ -0,0 +1,16 @@
+--- lib/vscode/build/gulpfile.vscode.ts.orig
++++ lib/vscode/build/gulpfile.vscode.ts
+@@ -188,11 +188,11 @@
+ 	compileExtensionMediaBuildTask,
+ 	writeISODate('out-build'),
+ 	// Type-check with tsgo (no emit)
+-	task.define('tsgo-typecheck', () => spawnTsgo(path.join(root, 'src', 'tsconfig.json'), { taskName: 'tsgo-typecheck', noEmit: true })),
++	task.define('tsgo-typecheck', () => process.platform === 'freebsd' ? Promise.resolve() : spawnTsgo(path.join(root, 'src', 'tsconfig.json'), { taskName: 'tsgo-typecheck', noEmit: true })),
+ 	// Transpile individual files to out-build first (for unit tests)
+ 	task.define('esbuild-out-build', () => runEsbuildTranspile('out-build', false)),
+ 	// Then bundle for shipping (bundles also write NLS files to out-build)
+-	task.parallel(
++	(process.platform === 'freebsd' ? task.series : task.parallel)(
+ 		task.define('esbuild-vscode-min', () => runEsbuildBundle('out-vscode-min', true, true, 'desktop', `${sourceMappingURLBase}/core`)),
+ 		task.define('esbuild-vscode-reh-min', () => runEsbuildBundle('out-vscode-reh-min', true, true, 'server', `${sourceMappingURLBase}/core`)),
+ 		task.define('esbuild-vscode-reh-web-min', () => runEsbuildBundle('out-vscode-reh-web-min', true, true, 'server-web', `${sourceMappingURLBase}/core`)),
diff --git a/www/code-server/files/patch-lib_vscode_build_lib_extensions.ts b/www/code-server/files/patch-lib_vscode_build_lib_extensions.ts
new file mode 100644
index 000000000000..9c6b6a1fa8c3
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_build_lib_extensions.ts
@@ -0,0 +1,20 @@
+--- lib/vscode/build/lib/extensions.ts.orig
++++ lib/vscode/build/lib/extensions.ts
+@@ -89,7 +89,7 @@
+ 			? es.merge(
+ 				fromLocalEsbuild(extensionPath, esbuildConfigFileName),
+ 				// Standard esbuild extensions need a separate type check step
+-				...getBuildRootsForExtension(extensionPath).map(root => typeCheckExtensionStream(root, forWeb)),
++				...(process.platform === 'freebsd' ? [] : getBuildRootsForExtension(extensionPath).map(root => typeCheckExtensionStream(root, forWeb))),
+ 			)
+ 			// Extensions with their own build system (e.g. .esbuild.mts) handle type checking internally
+ 			: fromLocalEsbuild(extensionPath, esbuildConfigFileName);
+@@ -745,7 +745,7 @@
+ 		outputRoot: outputRoot ? path.join(root, outputRoot, path.dirname(script)) : undefined
+ 	})));
+ 
+-	const typeCheckTasks = esbuildMediaScripts.map(({ tsconfig }) => {
++	const typeCheckTasks = process.platform === 'freebsd' ? [] : esbuildMediaScripts.map(({ tsconfig }) => {
+ 		const tsconfigPath = path.join(extensionsPath, tsconfig);
+ 		const config = { taskName: 'typechecking extension media (tsgo)', noEmit: true };
+ 		if (!isWatch) {
diff --git a/www/code-server/files/patch-lib_vscode_build_lib_getVersion.ts b/www/code-server/files/patch-lib_vscode_build_lib_getVersion.ts
new file mode 100644
index 000000000000..de402af82102
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_build_lib_getVersion.ts
@@ -0,0 +1,11 @@
+--- lib/vscode/build/lib/getVersion.ts.orig
++++ lib/vscode/build/lib/getVersion.ts
+@@ -8,7 +8,7 @@
+ export function getVersion(root: string): string | undefined {
+ 	let version = process.env['BUILD_SOURCEVERSION'];
+ 
+-	if (!version || !/^[0-9a-f]{40}$/i.test(version.trim())) {
++	if (!version || (!/^[0-9a-f]{40}$/i.test(version.trim()) && !/^[0-9]+(\.[0-9]+){1,3}$/i.test(version.trim()))) {
+ 		version = git.getVersion(root);
+ 	}
+ 
diff --git a/www/code-server/files/patch-lib_vscode_extensions_microsoft-authentication_esbuild.mts b/www/code-server/files/patch-lib_vscode_extensions_microsoft-authentication_esbuild.mts
new file mode 100644
index 000000000000..2a5645348a13
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_extensions_microsoft-authentication_esbuild.mts
@@ -0,0 +1,10 @@
+--- lib/vscode/extensions/microsoft-authentication/esbuild.mts.orig
++++ lib/vscode/extensions/microsoft-authentication/esbuild.mts
+@@ -21,6 +21,7 @@
+ 	case 'win32': platformFolder = 'windows'; break;
+ 	case 'darwin': platformFolder = 'macos'; break;
+ 	case 'linux': platformFolder = 'linux'; break;
++	case 'freebsd': platformFolder = 'linux'; break;
+ 	default: throw new Error(`Unsupported platform: ${process.platform}`);
+ }
+ 
diff --git a/www/code-server/files/patch-lib_vscode_node__modules__vscode_deviceid_dist_index.js b/www/code-server/files/patch-lib_vscode_node__modules__vscode_deviceid_dist_index.js
new file mode 100644
index 000000000000..9ab21611d640
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_node__modules__vscode_deviceid_dist_index.js
@@ -0,0 +1,12 @@
+--- lib/vscode/node_modules/@vscode/deviceid/dist/index.js.orig
++++ lib/vscode/node_modules/@vscode/deviceid/dist/index.js
+@@ -19,7 +19,8 @@
+ Object.defineProperty(exports, "__esModule", { value: true });
+ if (process.platform !== "win32" &&
+     process.platform !== "darwin" &&
+-    process.platform !== "linux") {
++    process.platform !== "linux" &&
++    process.platform !== "freebsd") {
+     throw new Error("Unsupported platform");
+ }
+ __exportStar(require("./devdeviceid.js"), exports);
diff --git a/www/code-server/files/patch-lib_vscode_node__modules__vscode_deviceid_dist_storage.js b/www/code-server/files/patch-lib_vscode_node__modules__vscode_deviceid_dist_storage.js
new file mode 100644
index 000000000000..c983db8744d3
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_node__modules__vscode_deviceid_dist_storage.js
@@ -0,0 +1,11 @@
+--- lib/vscode/node_modules/@vscode/deviceid/dist/storage.js.orig
++++ lib/vscode/node_modules/@vscode/deviceid/dist/storage.js
+@@ -42,7 +42,7 @@
+     if (process.platform === "darwin") {
+         folder = path.join(process.env.HOME, "Library", "Application Support");
+     }
+-    else if (process.platform === "linux") {
++    else if (process.platform === "linux" || process.platform === "freebsd") {
+         folder =
+             process.env.XDG_CACHE_HOME ?? path.join(process.env.HOME, ".cache");
+     }
diff --git a/www/code-server/files/patch-lib_vscode_node__modules_node-pty_src_unix_pty.cc b/www/code-server/files/patch-lib_vscode_node__modules_node-pty_src_unix_pty.cc
new file mode 100644
index 000000000000..28465ee324bc
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_node__modules_node-pty_src_unix_pty.cc
@@ -0,0 +1,11 @@
+--- lib/vscode/node_modules/node-pty/src/unix/pty.cc.orig
++++ lib/vscode/node_modules/node-pty/src/unix/pty.cc
+@@ -112,7 +112,7 @@
+   int exit_code = 0, signal_code = 0;
+ };
+ 
+-#if defined(__linux__)
++#if defined(__linux__) || defined(__FreeBSD__)
+ 
+ static int
+ SetCloseOnExec(int fd) {
diff --git a/www/code-server/files/patch-lib_vscode_product.json b/www/code-server/files/patch-lib_vscode_product.json
new file mode 100644
index 000000000000..7674a6d06a36
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_product.json
@@ -0,0 +1,28 @@
+--- lib/vscode/product.json.orig
++++ lib/vscode/product.json
+@@ -147,14 +147,7 @@
+ 		"tokenEntitlementUrl": "https://api.github.com/copilot_internal/v2/token",
+ 		"mcpRegistryDataUrl": "https://api.github.com/copilot/mcp_registry"
+ 	},
+-	"trustedExtensionAuthAccess": {
+-		"github": [
+-			"GitHub.copilot-chat"
+-		],
+-		"github-enterprise": [
+-			"GitHub.copilot-chat"
+-		]
+-	},
++	"trustedExtensionAuthAccess": {},
+ 	"onboardingKeymaps": [
+ 		{
+ 			"id": "vscode",
+@@ -230,8 +223,6 @@
+ 			"type": "light"
+ 		}
+ 	],
+-	"builtInExtensionsEnabledWithAutoUpdates": [
+-		"GitHub.copilot-chat"
+-	],
++	"builtInExtensionsEnabledWithAutoUpdates": [],
+ 	"sessionsWindowAllowedExtensions": []
+ }
diff --git a/www/code-server/files/patch-lib_vscode_src_vs_platform_environment_node_userDataPath.ts b/www/code-server/files/patch-lib_vscode_src_vs_platform_environment_node_userDataPath.ts
new file mode 100644
index 000000000000..82330a01ee87
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_src_vs_platform_environment_node_userDataPath.ts
@@ -0,0 +1,10 @@
+--- lib/vscode/src/vs/platform/environment/node/userDataPath.ts.orig
++++ lib/vscode/src/vs/platform/environment/node/userDataPath.ts
+@@ -96,6 +96,7 @@
+ 			appDataPath = join(homedir(), 'Library', 'Application Support');
+ 			break;
+ 		case 'linux':
++		case 'freebsd':
+ 			appDataPath = process.env['XDG_CONFIG_HOME'] || join(homedir(), '.config');
+ 			break;
+ 		default:
diff --git a/www/code-server/files/patch-lib_vscode_src_vs_platform_sign_browser_signService.ts b/www/code-server/files/patch-lib_vscode_src_vs_platform_sign_browser_signService.ts
new file mode 100644
index 000000000000..4204214c2197
--- /dev/null
+++ b/www/code-server/files/patch-lib_vscode_src_vs_platform_sign_browser_signService.ts
@@ -0,0 +1,23 @@
+--- lib/vscode/src/vs/platform/sign/browser/signService.ts.orig
++++ lib/vscode/src/vs/platform/sign/browser/signService.ts
+@@ -42,18 +42,11 @@
+ 		super();
+ 	}
+ 	protected override getValidator(): Promise<IVsdaValidator> {
+-		return this.vsda().then(vsda => {
+-			const v = new vsda.validator();
+-			return {
+-				createNewMessage: arg => v.createNewMessage(arg),
+-				validate: arg => v.validate(arg),
+-				dispose: () => v.free(),
+-			};
+-		});
++		return Promise.reject(new Error("VSDA is not available"));
+ 	}
+ 
+ 	protected override signValue(arg: string): Promise<string> {
+-		return this.vsda().then(vsda => vsda.sign(arg));
++		return Promise.reject(new Error("VSDA is not available"));
+ 	}
+ 
+ 	@memoize
diff --git a/www/code-server/pkg-descr b/www/code-server/pkg-descr
new file mode 100644
index 000000000000..d34bc8ec0757
--- /dev/null
+++ b/www/code-server/pkg-descr
@@ -0,0 +1,5 @@
+code-server runs Visual Studio Code in a web browser and allows remote
+development through a web-based interface.
+
+The service provides access to a full VS Code environment from any modern
+browser without requiring a local VS Code installation.
diff --git a/www/code-server/pkg-message b/www/code-server/pkg-message
new file mode 100644
index 000000000000..f0e9f93ff937
--- /dev/null
+++ b/www/code-server/pkg-message
@@ -0,0 +1,23 @@
+[
+{ type: install
+  message: <<EOM
+code-server has been installed.
+
+Enable the service:
+
+  sysrc code_server_enable=YES
+
+Start the service:
+
+  service code-server start
+
+By default, code-server listens on:
+
+  http://<server>:8080/
+
+See:
+
+  %%PREFIX%%/share/doc/code-server/README.md
+EOM
+}
+]
diff --git a/www/code-server/pkg-plist b/www/code-server/pkg-plist
new file mode 100644
index 000000000000..0a035fcd8c01
--- /dev/null
+++ b/www/code-server/pkg-plist
@@ -0,0 +1,13704 @@
+%%DATADIR%%/lib/vscode/bin/code-server-oss
+%%DATADIR%%/lib/vscode/bin/helpers/browser-darwin.sh
+%%DATADIR%%/lib/vscode/bin/helpers/browser-linux.sh
+%%DATADIR%%/lib/vscode/bin/helpers/browser.cmd
+%%DATADIR%%/lib/vscode/bin/helpers/browser.sh
+%%DATADIR%%/lib/vscode/bin/helpers/check-requirements.sh
+%%DATADIR%%/lib/vscode/bin/remote-cli/code-darwin.sh
+%%DATADIR%%/lib/vscode/bin/remote-cli/code-linux.sh
+%%DATADIR%%/lib/vscode/bin/remote-cli/code-server
+%%DATADIR%%/lib/vscode/bin/remote-cli/code.cmd
+%%DATADIR%%/lib/vscode/extensions/bat/language-configuration.json
+%%DATADIR%%/lib/vscode/extensions/bat/package.json
+%%DATADIR%%/lib/vscode/extensions/bat/package.nls.json
+%%DATADIR%%/lib/vscode/extensions/bat/snippets/batchfile.code-snippets
+%%DATADIR%%/lib/vscode/extensions/bat/syntaxes/batchfile.tmLanguage.json
+%%DATADIR%%/lib/vscode/extensions/clojure/language-configuration.json
+%%DATADIR%%/lib/vscode/extensions/clojure/package.json
+%%DATADIR%%/lib/vscode/extensions/clojure/package.nls.json
+%%DATADIR%%/lib/vscode/extensions/clojure/syntaxes/clojure.tmLanguage.json
+%%DATADIR%%/lib/vscode/extensions/coffeescript/language-configuration.json
+%%DATADIR%%/lib/vscode/extensions/coffeescript/package.json
+%%DATADIR%%/lib/vscode/extensions/coffeescript/package.nls.json
+%%DATADIR%%/lib/vscode/extensions/coffeescript/snippets/coffeescript.code-snippets
+%%DATADIR%%/lib/vscode/extensions/coffeescript/syntaxes/coffeescript.tmLanguage.json
+%%DATADIR%%/lib/vscode/extensions/configuration-editing/dist/configurationEditingMain.js
+%%DATADIR%%/lib/vscode/extensions/configuration-editing/images/icon.png
+%%DATADIR%%/lib/vscode/extensions/configuration-editing/package.json
+%%DATADIR%%/lib/vscode/extensions/configuration-editing/package.nls.json
+%%DATADIR%%/lib/vscode/extensions/configuration-editing/schemas/attachContainer.schema.json
+%%DATADIR%%/lib/vscode/extensions/configuration-editing/tsconfig.json.bak
+%%DATADIR%%/lib/vscode/extensions/copilot/CHANGELOG.md
+%%DATADIR%%/lib/vscode/extensions/copilot/LICENSE.txt
+%%DATADIR%%/lib/vscode/extensions/copilot/README.md
+%%DATADIR%%/lib/vscode/extensions/copilot/assets/copilot.png
+%%DATADIR%%/lib/vscode/extensions/copilot/assets/copilot.woff
*** 13669 LINES SKIPPED ***


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a3828e5.24dac.fff9348>