Commit d34613e8 authored by Boris Korzun's avatar Boris Korzun Committed by Vladimir Druzenko
Browse files

security/xray-core: Fix runtime: remove "legacy reverse" feature

Failed to start: main: failed to load config files: [/usr/local/etc/xray-core/00_log.json /usr/local/etc/xray-core/01_api.json /usr/local/etc/xray-core/02_dns.json  /usr/local/etc/xray-core/03_routing.json /usr/local/etc/xray-core/04_policy.json /usr/local/etc/xray-core/05_inbounds.json /usr/local/etc/xray-core/06_outbounds.json /usr/local/etc/xray-core/07_transport.json /usr/local/etc/xray-cor e/08_stats.json /usr/local/etc/xray-core/09_reverse.json] > common/errors: The feature "legacy reverse" has been removed and migrated to "VLESS Reverse Proxy". Please update your config(s) according to release note and documentation.

- Add daemon syslog_output_enable feature to rc.script.
- Fix build with custom (non v2ray) USER/GROUP.

PR:		298264
Approved by:	Kirill Lebedev <kirill@drlebedev.com> (maintainer)
Sponsored by:	UNIS Labs (vvd, commit patch)
parent c9804d0d
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
PORTNAME=	xray-core
DISTVERSIONPREFIX=	v
DISTVERSION=	26.7.28
PORTREVISION=	1
CATEGORIES=	security
MASTER_SITES=	https://github.com/v2fly/geoip/releases/download/202608050239/:geoip \
		https://github.com/v2fly/domain-list-community/releases/download/20260831141734/:geosite
@@ -15,7 +16,7 @@ WWW= https://github.com/XTLS/Xray-core
LICENSE=	MPL20
LICENSE_FILE=	${WRKSRC}/LICENSE

USES=		go:1.26+,modules
USES=		go:modules
USE_GITHUB=	yes
GH_ACCOUNT=	XTLS
GH_PROJECT=	Xray-core
@@ -28,12 +29,19 @@ GO_TARGET= ./main:xray

CONFLICTS_INSTALL=	xray

SUB_FILES=	pkg-message
SUB_LIST=	GROUP="${GROUPS}" \
		USER="${USERS}"
XRAY_USER?=	v2ray
XRAY_GROUP?=	v2ray

USERS=		v2ray
GROUPS=		v2ray
SUB_FILES=	pkg-message
SUB_LIST=	GROUP="${XRAY_GROUP}" \
		USER="${XRAY_USER}"

.if ${XRAY_USER} == v2ray
USERS=		${XRAY_USER}
.endif
.if ${XRAY_GROUP} == v2ray
GROUPS=		${XRAY_GROUP}
.endif

post-install:
	${MKDIR} ${STAGEDIR}${ETCDIR} \
+0 −8
Original line number Diff line number Diff line
{
  "reverse": {
    "bridges": [
    ],
    "portals": [
    ]
  }
}
+24 −2
Original line number Diff line number Diff line
@@ -14,6 +14,14 @@
#					Set it to the directory of xray log files
# xray_env (str):			Set to "" by default.
#					Set it to the desired environment variables
# xray_syslog_output_enable (str):	Set to YES to enable syslog output
#					Default is "NO". See daemon(8).
# xray_syslog_output_tag (str):		Set syslog tag if syslog enabled.
#					Default is "xray". See daemon(8).
# xray_syslog_output_priority (str):	Set syslog priority if syslog enabled.
#					Default is "notice". See daemon(8).
# xray_syslog_output_facility (str):	Set syslog facility if syslog enabled.
#					Default is "daemon". See daemon(8).

. /etc/rc.subr

@@ -25,15 +33,29 @@ load_rc_config "$name"
: ${xray_enable="NO"}
: ${xray_config="%%PREFIX%%/etc/${name}-core"}
: ${xray_logdir="/var/log/${name}-core"}
: ${xray_env=""}
: ${xray_syslog_output_enable:="NO"}
: ${xray_user="%%USER%%"}
: ${xray_group="%%GROUP%%"}

if checkyesno xray_syslog_output_enable; then
	if [ -n "${xray_syslog_output_tag}" ]; then
		xray_syslog_output_flags="-T ${xray_syslog_output_tag}"
	else
		xray_syslog_output_flags="-T ${name}"
	fi
	if [ -n "${xray_syslog_output_priority}" ]; then
		xray_syslog_output_flags="${xray_syslog_output_flags} -s ${xray_syslog_output_priority}"
	fi
	if [ -n "${xray_syslog_output_facility}" ]; then
		xray_syslog_output_flags="${xray_syslog_output_flags} -l ${xray_syslog_output_facility}"
	fi
fi

asset_env="XRAY_LOCATION_ASSET=%%PREFIX%%/share/${name}-core"
pidfile="/var/run/$name.pid"
procname="%%PREFIX%%/bin/xray"
command="/usr/sbin/daemon"
command_args="-c -p ${pidfile} /usr/bin/env ${asset_env} ${xray_env} ${procname} -confdir ${xray_config}"
command_args="-f -t ${name} ${xray_syslog_output_flags} -p ${pidfile} /usr/bin/env ${asset_env} ${xray_env} ${procname} -confdir ${xray_config}"
required_files="${xray_config}"

start_precmd="xray_startprecmd"
+0 −1
Original line number Diff line number Diff line
@@ -8,6 +8,5 @@ bin/xray
@sample %%ETCDIR%%/06_outbounds.json.sample
@sample %%ETCDIR%%/07_transport.json.sample
@sample %%ETCDIR%%/08_stats.json.sample
@sample %%ETCDIR%%/09_reverse.json.sample
%%DATADIR%%/geoip.dat
%%DATADIR%%/geosite.dat