git: 20a8f6675565 - main - net/rustdesk-server: Correct location of runtime database files

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Mon, 24 Jul 2023 15:30:46 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=20a8f667556567f3392f08c539f20bef64ab6098

commit 20a8f667556567f3392f08c539f20bef64ab6098
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-07-24 15:29:18 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-07-24 15:29:18 +0000

    net/rustdesk-server: Correct location of runtime database files
    
    Fix rustdesk-server startup scripts to use /var/db/rustdesk-server
    by default to store its files. These files need to be preserved
    across reboots, so /var/run is the wrong place.
    
    Added pkg-message to inform users.
    
    While here, fix some issues with comments referencing a different
    software and update the declared defaults.
    
    Reported by:    Victor Tschetter <tschetter.victor@gmail.com>
                    https://github.com/rustdesk/rustdesk-server/issues/288
    MFH:            2023Q3
---
 net/rustdesk-server/Makefile               |  2 +-
 net/rustdesk-server/files/rustdesk-hbbr.in |  8 ++++----
 net/rustdesk-server/files/rustdesk-hbbs.in |  8 ++++----
 net/rustdesk-server/pkg-message            | 13 +++++++++++++
 4 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/net/rustdesk-server/Makefile b/net/rustdesk-server/Makefile
index ccbaf593523e..6dc797eb282a 100644
--- a/net/rustdesk-server/Makefile
+++ b/net/rustdesk-server/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	rustdesk-server
 DISTVERSION=	1.1.8
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	net
 
 MAINTAINER=	madpilot@FreeBSD.org
diff --git a/net/rustdesk-server/files/rustdesk-hbbr.in b/net/rustdesk-server/files/rustdesk-hbbr.in
index 434f93c8f814..a04a4849e949 100644
--- a/net/rustdesk-server/files/rustdesk-hbbr.in
+++ b/net/rustdesk-server/files/rustdesk-hbbr.in
@@ -8,9 +8,9 @@
 # to enable this service:
 #
 # rustdesk_hbbr_enable (bool):            Set to NO by default.
-#               Set it to YES to enable nfs-exporter.
-# rustdesk_hbbr_args (string):            Set extra arguments to pass to nfs-exporter
-#               Default is "".
+#               Set it to YES to enable rustdesk_hbbr.
+# rustdesk_hbbr_args (string):            Set extra arguments to pass to rustdesk_hbbr
+#               Default is "-k _".
 # rustdesk_hbbr_user (string):            Set user that rustdesk_hbbr will run under
 #               Default is "rustdesk".
 # rustdesk_hbbr_group (string):           Set group that rustdesk_hbbr will run under
@@ -32,7 +32,7 @@ load_rc_config $name
 pidfile=/var/run/rustdesk_hbbr.pid
 command=/usr/sbin/daemon
 procname=%%PREFIX%%/bin/hbbr
-rustdesk_hbbr_chdir=/var/run/rustdesk-server
+rustdesk_hbbr_chdir=/var/db/rustdesk-server
 command_args="-p ${pidfile} -T ${name} ${procname} ${rustdesk_hbbr_args}"
 # Command to log directly to file
 #command_args="-P ${pidfile} -H -o /var/log/rustdesk-hbbr.log ${procname} ${rustdesk_hbbr_args}"
diff --git a/net/rustdesk-server/files/rustdesk-hbbs.in b/net/rustdesk-server/files/rustdesk-hbbs.in
index f11215a644dd..0838f2708ad8 100644
--- a/net/rustdesk-server/files/rustdesk-hbbs.in
+++ b/net/rustdesk-server/files/rustdesk-hbbs.in
@@ -8,11 +8,11 @@
 # to enable this service:
 #
 # rustdesk_hbbs_enable (bool):            Set to NO by default.
-#               Set it to YES to enable nfs-exporter.
+#               Set it to YES to enable rustdesk_hbbs.
 # rustdesk_hbbs_ip (string):              Set server IP address
 #               Default is "127.0.0.1".
-# rustdesk_hbbs_args (string):            Set extra arguments to pass to nfs-exporter
-#               Default is "".
+# rustdesk_hbbs_args (string):            Set extra arguments to pass to rustdesk_hbbs
+#               Default is "-r ${rustdesk_hbbs_ip} -k _".
 # rustdesk_hbbs_user (string):            Set user that rustdesk_hbbs will run under
 #               Default is "rustdesk".
 # rustdesk_hbbs_group (string):           Set group that rustdesk_hbbs will run under
@@ -35,7 +35,7 @@ load_rc_config $name
 pidfile=/var/run/rustdesk_hbbs.pid
 command=/usr/sbin/daemon
 procname=%%PREFIX%%/bin/hbbs
-rustdesk_hbbs_chdir=/var/run/rustdesk-server
+rustdesk_hbbs_chdir=/var/db/rustdesk-server
 command_args="-p ${pidfile} -T ${name} ${procname} ${rustdesk_hbbs_args}"
 # Command to log directly to file
 #command_args="-P ${pidfile} -H -o /var/log/rustdesk-hbbs.log ${procname} ${rustdesk_hbbs_args}"
diff --git a/net/rustdesk-server/pkg-message b/net/rustdesk-server/pkg-message
new file mode 100644
index 000000000000..b2fd8f491105
--- /dev/null
+++ b/net/rustdesk-server/pkg-message
@@ -0,0 +1,13 @@
+[
+{ type: upgrade
+  maximum_version: "1.1.8_3"
+  message: <<EOM
+Default location for runtime data files has been changed from
+/var/run/rustdesk-server to /var/db/rustedesk-server.
+
+If you want to preserve the old data, please move it over.
+
+The old /var/run/rustdesk-server should be removed afterwards.
+EOM
+}
+]