diff --git a/sysutils/nginx-ui/Makefile b/sysutils/nginx-ui/Makefile index f1622f0f2f28..06299629b75b 100644 --- a/sysutils/nginx-ui/Makefile +++ b/sysutils/nginx-ui/Makefile @@ -1,65 +1,65 @@ PORTNAME= nginx-ui DISTVERSIONPREFIX= v DISTVERSION= 2.1.17 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= LOCAL/dtxdf/${PORTNAME}/ DISTFILES= ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}.frontend${EXTRACT_SUFX} \ ${PORTNAME}-${DISTVERSIONPREFIX}${DISTVERSION}.vendor${EXTRACT_SUFX} MAINTAINER= dtxdf@FreeBSD.org COMMENT= Yet another WebUI for Nginx WWW= https://nginxui.com LICENSE= AGPLv3 LICENSE_FILE= ${WRKSRC}/LICENSE USES= go:1.25,modules USE_GITHUB= yes GH_ACCOUNT= 0xJacky USE_RC_SUBR= ${PORTNAME} GO_BUILDFLAGS= -ldflags "\ -X 'github.com/0xJacky/Nginx-UI/settings.buildTime=${BUILD_DATE}'" \ -tags=jsoniter SUB_FILES= pkg-message SUB_LIST= USER=${NGINXUI_USER} PLIST_SUB= GROUP=${NGINXUI_USER} \ USER=${NGINXUI_GROUP} NGINXUI_USER= root NGINXUI_GROUP= wheel BUILD_DATE= $$(date -u +%s) # Run 'git checkout ${DISTVERSIONPREFIX}${DISTVERSION} && git rev-parse HEAD' # in the NGINX UI repository to get the value of GITID. GITID= 876213ad12449216d82520b3808b59cdaf0e1276 post-extract: @${MKDIR} ${WRKSRC}/vendor @cd ${WRKDIR}/${PORTNAME}-vendor && ${COPYTREE_SHARE} . ${WRKSRC}/vendor @${MKDIR} ${WRKSRC}/app/dist @cd ${WRKDIR}/${PORTNAME}-frontend && ${COPYTREE_SHARE} . ${WRKSRC}/app/dist post-patch: @${REINPLACE_CMD} -e 's/newLineSymbol/"\\n"/g' \ ${WRKSRC}/vendor/github.com/imega/luaformatter/formatter/writer.go @${REINPLACE_CMD} -e 's,%%GITID%%,${GITID},g' ${WRKSRC}/cmd/version/generate.go @${RM} ${WRKSRC}/vendor/github.com/shirou/gopsutil/v4/internal/common/binary.go pre-build: @${SETENV} ${MAKE_ENV} ${GO_ENV} GOPROXY=off ${GO_CMD} generate ${WRKSRC}/cmd/version/generate.go post-install: @${MKDIR} ${STAGEDIR}/var/db/${PORTNAME} ${INSTALL_DATA} ${FILESDIR}/app.ini ${STAGEDIR}/var/db/${PORTNAME}/app.ini.sample @${MKDIR} ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${FILESDIR}/nginx-ui.conf ${STAGEDIR}${DATADIR} ${INSTALL_DATA} ${FILESDIR}/nginx.conf ${STAGEDIR}${DATADIR} @${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' ${STAGEDIR}${DATADIR}/nginx.conf .include diff --git a/sysutils/nginx-ui/files/nginx-ui.in b/sysutils/nginx-ui/files/nginx-ui.in index 775365e846d0..25ab52c8bd44 100644 --- a/sysutils/nginx-ui/files/nginx-ui.in +++ b/sysutils/nginx-ui/files/nginx-ui.in @@ -1,32 +1,36 @@ #!/bin/sh # PROVIDE: nginx_ui # REQUIRE: LOGIN # KEYWORD: shutdown # # Configuration settings for NGINX UI in /etc/rc.conf # # nginx_ui_enable (bool): Enable NGINX UI. (default=NO) # nginx_ui_log (str): Log output. (default=/var/log/nginx-ui.log) # nginx_ui_runas (str): User to run NGINX UI as. (default=%%USER%%) # . /etc/rc.subr name="nginx_ui" desc="Yet another WebUI for Nginx" rcvar="${name}_enable" load_rc_config $name : ${nginx_ui_enable:="NO"} : ${nginx_ui_log:="/var/log/nginx-ui.log"} : ${nginx_ui_runas:="%%USER%%"} nginx_ui_chdir="/var/db/nginx-ui" pidfile="/var/run/nginx-ui.pid" procname="%%LOCALBASE%%/bin/nginx-ui" command="/usr/sbin/daemon" command_args="-o ${nginx_ui_log} -u ${nginx_ui_runas} -p ${pidfile} -t \"${desc}\" ${procname}" +# If, for example, there is a power failure, the UNIX socket file will be left and +# the error "connect: connection refused" will be displayed, so the best thing to +# do is to delete it before starting NGINX UI. +start_precmd="rm -f /var/db/nginx-ui/nginx-ui.sock" run_rc_command "$1"