aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Victorovich <yuri@FreeBSD.org>2021-04-25 20:51:02 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2021-04-25 22:41:21 +0000
commitd8cfb1d029da2fd56d4e6d41229496fd4aa43421 (patch)
tree3d5b0c789eedd82224a1f039535ac0f35ab510f0
parent59e3137d1d54cc18a61b11461d4cc65cd38b0427 (diff)
downloadports-d8cfb1d029da2fd56d4e6d41229496fd4aa43421.tar.gz
ports-d8cfb1d029da2fd56d4e6d41229496fd4aa43421.zip
www/adguardhome: Add rc script and pkg-message
-rw-r--r--www/adguardhome/Makefile6
-rw-r--r--www/adguardhome/files/adguardhome.in25
-rw-r--r--www/adguardhome/pkg-message11
3 files changed, 41 insertions, 1 deletions
diff --git a/www/adguardhome/Makefile b/www/adguardhome/Makefile
index 77f3e49d4b3c..3ec025b1cf10 100644
--- a/www/adguardhome/Makefile
+++ b/www/adguardhome/Makefile
@@ -1,7 +1,7 @@
PORTNAME= adguardhome
DISTVERSIONPREFIX= v
DISTVERSION= 0.105.2
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www
MAINTAINER= yuri@FreeBSD.org
@@ -23,6 +23,10 @@ GO_MODULE= github.com/AdguardTeam/AdGuardHome
DEV_UPDATE_MODE= no
+USER= root # it has to run as root because it listens on the privileged DNS port
+SUB_LIST= USER=${USER}
+USE_RC_SUBR= ${PORTNAME}
+
.if (${DEV_UPDATE_MODE} == "yes")
BUILD_DEPENDS= npm:www/npm \
yarn:www/yarn
diff --git a/www/adguardhome/files/adguardhome.in b/www/adguardhome/files/adguardhome.in
new file mode 100644
index 000000000000..902745da6a35
--- /dev/null
+++ b/www/adguardhome/files/adguardhome.in
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# PROVIDE: adguardhome
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable adguardhome:
+# adguardhome_enable : set to "YES" to enable the daemon, default is "NO"
+
+. /etc/rc.subr
+
+name=adguardhome
+rcvar=adguardhome_enable
+
+load_rc_config $name
+
+adguardhome_enable=${adguardhome_enable:-"NO"}
+
+logfile="/var/log/${name}.log"
+
+procname=%%PREFIX%%/bin/adguardhome
+command="/usr/sbin/daemon"
+command_args="-u %%USER%% -o ${logfile} -t ${name} %%PREFIX%%/bin/adguardhome"
+
+run_rc_command "$1"
diff --git a/www/adguardhome/pkg-message b/www/adguardhome/pkg-message
new file mode 100644
index 000000000000..1a789dcbcb7b
--- /dev/null
+++ b/www/adguardhome/pkg-message
@@ -0,0 +1,11 @@
+[
+{ type: install
+ message: <<EOM
+You installed AdGuardHome: Network-wide ads & trackers blocking DNS server.
+
+In order to use it please start the service 'adguardhome' and
+then access the URL http://0.0.0.0:3010/ in your favorite browser.
+
+EOM
+}
+]