diff --git a/security/xray-core/Makefile b/security/xray-core/Makefile index 8874c68da3a4..744509ed5a3c 100644 --- a/security/xray-core/Makefile +++ b/security/xray-core/Makefile @@ -1,43 +1,44 @@ PORTNAME= xray-core DISTVERSIONPREFIX= v DISTVERSION= 25.12.8 +PORTREVISION= 1 CATEGORIES= security MASTER_SITES= https://github.com/v2fly/geoip/releases/download/202512050148/:geoip \ https://github.com/v2fly/domain-list-community/releases/download/20251212112114/:geosite DISTFILES= geoip.dat:geoip \ dlc.dat:geosite EXTRACT_ONLY= XTLS-Xray-core-v${DISTVERSION}_GH0.tar.gz MAINTAINER= kirill@drlebedev.com COMMENT= Set of network penetration tools WWW= https://github.com/XTLS/Xray-core LICENSE= MPL20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:1.25+,modules USE_GITHUB= yes GH_ACCOUNT= XTLS GH_PROJECT= Xray-core USE_RC_SUBR= xray GO_MOD_DIST= github GO_MODULE= github.com/${GH_ACCOUNT}/${PORTNAME} GO_PKGNAME= github.com/${GH_ACCOUNT}/${PORTNAME} GO_TARGET= ./main:xray SUB_FILES= pkg-message SUB_LIST= GROUP="${GROUPS}" \ USER="${USERS}" USERS= v2ray GROUPS= v2ray post-install: ${MKDIR} ${STAGEDIR}${ETCDIR} \ ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/geoip.dat ${STAGEDIR}${DATADIR}/geoip.dat ${INSTALL_DATA} ${DISTDIR}/${DIST_SUBDIR}/dlc.dat ${STAGEDIR}${DATADIR}/geosite.dat ${INSTALL_DATA} ${FILESDIR}/*.json.sample ${STAGEDIR}${ETCDIR}/ .include diff --git a/security/xray-core/files/xray.in b/security/xray-core/files/xray.in index 87516c9759d0..18c9beeb4f5c 100644 --- a/security/xray-core/files/xray.in +++ b/security/xray-core/files/xray.in @@ -1,47 +1,48 @@ #!/bin/sh # PROVIDE: xray-core # REQUIRE: LOGIN # KEYWORD: shutdown # Add these lines to /etc/rc.conf.local or /etc/rc.conf to enable `xray': # # xray_enable (bool): Set to "NO" by default. # Set it to "YES" to enable xray # xray_config (path): Set to "%%PREFIX%%/etc/xray-core" by default # Set it to the xray server config # xray_logdir (path): Set to "/var/log/xray-core" by default. # Set it to the directory of xray log files # xray_env (str): Set to "" by default. # Set it to the desired environment variables . /etc/rc.subr name="xray" rcvar="xray_enable" +load_rc_config "$name" + : ${xray_enable="NO"} : ${xray_config="%%PREFIX%%/etc/${name}-core"} : ${xray_logdir="/var/log/${name}-core"} : ${xray_env=""} : ${xray_user="%%USER%%"} : ${xray_group="%%GROUP%%"} 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}" required_files="${xray_config}" start_precmd="xray_startprecmd" xray_startprecmd() { touch "${pidfile}" chown ${xray_user}:${xray_group} "${pidfile}" mkdir -p "${xray_logdir}" chown -R ${xray_user}:${xray_group} "${xray_logdir}" } -load_rc_config "$name" run_rc_command "$1"