diff --git a/srcpkgs/sing-box/files/sing-box/run b/srcpkgs/sing-box/files/sing-box/run new file mode 100644 index 00000000000000..3ab6962ac8cfd9 --- /dev/null +++ b/srcpkgs/sing-box/files/sing-box/run @@ -0,0 +1,11 @@ +#!/bin/sh +exec 2>&1 +_user=_sing_box +! [ -d /run/sing-box ] && install -m 700 -g $_user -o $_user -d /run/sing-box +_caps='-all,+net_admin,+net_raw,+net_bind_service,+sys_ptrace,+dac_read_search' + +exec setpriv --reuid $_user --regid $_user --clear-groups \ + --ambient-caps $_caps \ + --inh-caps $_caps \ + --bounding-set $_caps \ + --no-new-privs -- sing-box -D /var/lib/sing-box -C /etc/sing-box run diff --git a/srcpkgs/sing-box/template b/srcpkgs/sing-box/template new file mode 100644 index 00000000000000..1575d91a055f9e --- /dev/null +++ b/srcpkgs/sing-box/template @@ -0,0 +1,23 @@ +# Template file for 'sing-box' +pkgname=sing-box +version=1.13.3 +revision=1 +build_style=go +go_import_path=github.com/sagernet/sing-box +go_package=github.com/sagernet/sing-box/cmd/sing-box +go_build_tags=with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale +go_ldflags="-X github.com/sagernet/sing-box/constant.Version=${version}" +short_desc="Universal proxy platform" +maintainer="Nizarjh " +license="GPL-3.0-or-later" +homepage="https://sing-box.sagernet.org/" +distfiles="https://github.com/SagerNet/sing-box/archive/refs/tags/v${version}.tar.gz" +checksum=bf8933cd43e2797afcffb47528282e1c1aee078bf5eeda888d80a151fef726e1 +system_accounts="_sing_box" +conf_files="/etc/sing-box/config.json" +make_dirs="/var/lib/sing-box 700 _sing_box _sing_box" + +post_install() { + vinstall release/config/config.json 644 etc/sing-box + vsv sing-box +}