From 193d2e26d234bbdf9b08ebf22dc4a14d5b55e111 Mon Sep 17 00:00:00 2001 From: ipkalm Date: Wed, 22 Feb 2023 09:58:26 +0700 Subject: [PATCH] v2ray: update to 5.4.0 --- srcpkgs/v2ray/INSTALL.msg | 2 ++ srcpkgs/v2ray/REMOVE | 12 ++++++++++++ srcpkgs/v2ray/files/README.voidlinux | 17 +++++++++++++++++ srcpkgs/v2ray/files/v2ray/run | 4 +++- srcpkgs/v2ray/template | 8 ++++++-- 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 srcpkgs/v2ray/INSTALL.msg create mode 100644 srcpkgs/v2ray/REMOVE create mode 100644 srcpkgs/v2ray/files/README.voidlinux diff --git a/srcpkgs/v2ray/INSTALL.msg b/srcpkgs/v2ray/INSTALL.msg new file mode 100644 index 000000000000..09daaef1902d --- /dev/null +++ b/srcpkgs/v2ray/INSTALL.msg @@ -0,0 +1,2 @@ +Consult /usr/share/doc/v2ray/README.voidlinux for additional configuration +instructions. diff --git a/srcpkgs/v2ray/REMOVE b/srcpkgs/v2ray/REMOVE new file mode 100644 index 000000000000..c2c085849f70 --- /dev/null +++ b/srcpkgs/v2ray/REMOVE @@ -0,0 +1,12 @@ +# +# This script removes /etc/v2ray directory only if it is empty +# and not during package update +# + +if [ "$UPDATE" = "no" ]; then + case "$ACTION" in + post) + [ -d etc/v2ray ] && rmdir etc/v2ray 2>/dev/null + ;; + esac +fi diff --git a/srcpkgs/v2ray/files/README.voidlinux b/srcpkgs/v2ray/files/README.voidlinux new file mode 100644 index 000000000000..53d9cc2c5bfc --- /dev/null +++ b/srcpkgs/v2ray/files/README.voidlinux @@ -0,0 +1,17 @@ +By default `v2ray` runit service uses /etc/v2ray/config.json config file. + +For change command-line options for `v2ray` runit service, +add '/etc/sv/v2ray/conf' file with 'OPTS=' variable. +For example: + + # echo 'OPTS="-config /etc/v2ray/second_config.json"' > /etc/sv/v2ray/conf + +Now `sv start v2ray` will use '/etc/v2ray/second_config.json' config file. For more information read `v2ray help run`. + +For use environment variables add them to /etc/v2ray/env/ directory. +For example: + + # echo 'false' > /etc/v2ray/env/v2ray.vmess.aead.forced + +It adds environment variable 'v2ray.vmess.aead.forced=false' to `v2ray run` command. +For more information read about '-e dir' option in `man chpst`. diff --git a/srcpkgs/v2ray/files/v2ray/run b/srcpkgs/v2ray/files/v2ray/run index 2910b070fb90..4fcce104be3f 100644 --- a/srcpkgs/v2ray/files/v2ray/run +++ b/srcpkgs/v2ray/files/v2ray/run @@ -1,4 +1,6 @@ #!/bin/sh exec 2>&1 -exec chpst -u _v2ray v2ray run -config=/etc/v2ray/config.json 2>&1 +[ -r conf ] && . ./conf + +exec chpst -e /etc/v2ray/env -u _v2ray v2ray run ${OPTS:- -config=/etc/v2ray/config.json} 2>&1 diff --git a/srcpkgs/v2ray/template b/srcpkgs/v2ray/template index 27dee8754f7e..cf05f005fd41 100644 --- a/srcpkgs/v2ray/template +++ b/srcpkgs/v2ray/template @@ -1,6 +1,6 @@ # Template file for 'v2ray' pkgname=v2ray -version=5.3.0 +version=5.4.0 revision=1 build_style=go go_import_path="github.com/v2fly/v2ray-core/v5" @@ -12,7 +12,8 @@ maintainer="ipkalm " license="MIT" homepage="https://github.com/v2fly/v2ray-core" distfiles="https://github.com/v2fly/v2ray-core/archive/v${version}/${pkgname}-${version}.tar.gz" -checksum=8e97e2647cb1dee8aa7e71df276c56d74258b2d97bb490a362afa84bdf1b9e25 +checksum=86be35461a9dc7d037e0045771d99f1eae284fdb7aa0818a6782d18b6b003fca +make_dirs="/etc/v2ray/env 0755 root root" conf_files="/etc/v2ray/config.json" system_accounts="_v2ray" @@ -49,4 +50,7 @@ post_install() { vmkdir etc/v2ray vcopy release/config/*.json etc/v2ray/ vsv v2ray + + # Void-specific documentation. + vdoc "${FILESDIR}/README.voidlinux" }