aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluxanna <l.lux@magenta.de>2026-06-11 20:54:14 +0000
committerYuri Victorovich <yuri@FreeBSD.org>2026-06-11 20:56:56 +0000
commit04de0eac8a320d596ba46c3808b8174cb5b4adc1 (patch)
tree8667255f0f086116da16a3711c708786a256f961
parent0cb27b2e7a88a3b67e4dacd9dcaf6ae87c20cd2b (diff)
www/microbin: Add rc.d script
PR: 295973
-rw-r--r--GIDs2
-rw-r--r--UIDs2
-rw-r--r--www/microbin/Makefile13
-rw-r--r--www/microbin/files/microbin.in39
-rw-r--r--www/microbin/pkg-plist2
5 files changed, 53 insertions, 5 deletions
diff --git a/GIDs b/GIDs
index 7b6c6549dac3..31accb8716a2 100644
--- a/GIDs
+++ b/GIDs
@@ -440,7 +440,7 @@ stalwart:*:484:
# free: 496
# free: 497
rustypaste:*:498:
-# free: 499
+microbin:*:499:
qw:*:500:
qwfwd:*:501:
birdvty:*:502:
diff --git a/UIDs b/UIDs
index d234423bb97f..ddfeb2f110dd 100644
--- a/UIDs
+++ b/UIDs
@@ -445,7 +445,7 @@ stalwart:*:484:484::0:0:stalwart Mail Server Daemon:/nonexistent:/usr/sbin/nolog
# free: 496
# free: 497
rustypaste:*:498:498::0:0:Minimal file upload/pastebin service:/nonexistent:/usr/sbin/nologin
-# free: 499
+microbin:*:499:499::0:0:Tiny, self-contained, configurable paste bin and URL shortener:/nonexistent:/usr/sbin/nologin
qw:*:500:500::0:0:QuakeWorld Server:/nonexistent:/usr/sbin/nologin
qwfwd:*:501:501::0:0:QuakeWorld Proxy:/nonexistent:/usr/sbin/nologin
# free: 502
diff --git a/www/microbin/Makefile b/www/microbin/Makefile
index 9c454eaea817..5ada89937df0 100644
--- a/www/microbin/Makefile
+++ b/www/microbin/Makefile
@@ -1,7 +1,7 @@
PORTNAME= microbin
DISTVERSIONPREFIX= v
DISTVERSION= 2.1.4
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= www
MAINTAINER= yuri@FreeBSD.org
@@ -16,7 +16,8 @@ BROKEN_i386= link fails: ld: error: undefined symbol: __atomic_load
BUILD_DEPENDS= bash:shells/bash \
gmake:devel/gmake
-LIB_DEPENDS= libonig.so:devel/oniguruma
+LIB_DEPENDS= libonig.so:devel/oniguruma \
+ libzstd.so:archivers/zstd
USES= cargo perl5
USE_PERL5= build
@@ -24,6 +25,9 @@ USE_PERL5= build
USE_GITHUB= yes
GH_ACCOUNT= szabodanika
+USERS= microbin
+GROUPS= microbin
+
CARGO_CRATES= actix-codec-0.5.2 \
actix-files-0.6.6 \
actix-http-3.9.0 \
@@ -434,6 +438,9 @@ CARGO_CRATES= actix-codec-0.5.2 \
zstd-safe-7.2.1 \
zstd-sys-2.0.13+zstd.1.5.6
-PLIST_FILES= bin/${PORTNAME}
+USE_RC_SUBR= microbin
+
+post-install:
+ ${MKDIR} ${STAGEDIR}/var/db/microbin
.include <bsd.port.mk>
diff --git a/www/microbin/files/microbin.in b/www/microbin/files/microbin.in
new file mode 100644
index 000000000000..80ead2b2758f
--- /dev/null
+++ b/www/microbin/files/microbin.in
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# PROVIDE: microbin
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Configuration settings for microbin in /etc/rc.conf
+#
+# microbin_enable (bool): Enable microbin. (Default=NO)
+# microbin_env_file (str): Path containing the environment variables
+# to be used by microbin. (Default: %%ETCDIR%%/microbin.env)
+# microbin_logfile (str): Log file used to store the microbin's output. (Default: /var/log/microbin.log)
+# microbin_pidfile (str): File used by microbin to store the process ID. (Default: /var/run/microbin.pid)
+# microbin_username (str): User to run microbin as. (Default: microbin)
+# microbin_port (int): Port to run the webserver on. (Default: 8080)
+# microbin_datadir (str): Path to save the uploads inside. (Default: /var/db/microbin)
+
+. /etc/rc.subr
+
+name="microbin"
+desc="Tiny, self-contained, configurable paste bin and URL shortener"
+rcvar="microbin_enable"
+
+load_rc_config $name
+
+: ${microbin_enable:="NO"}
+: ${microbin_datadir:="/var/db/microbin"}
+: ${microbin_env_file:="%%ETCDIR%%/microbin.env"}
+: ${microbin_logfile:="/var/log/microbin.log"}
+: ${microbin_pidfile:="/var/run/microbin.pid"}
+: ${microbin_port:="8080"}
+: ${microbin_username:="microbin"}
+
+pidfile="${microbin_pidfile}"
+procname="%%PREFIX%%/bin/microbin"
+command="/usr/sbin/daemon"
+command_args="-o '${microbin_logfile}' -p '${pidfile}' -u '${microbin_username}' -t '${desc}' -- ${procname} -p ${microbin_port} --data-dir ${microbin_datadir}"
+
+run_rc_command "$1"
diff --git a/www/microbin/pkg-plist b/www/microbin/pkg-plist
new file mode 100644
index 000000000000..1b45fe1f3e69
--- /dev/null
+++ b/www/microbin/pkg-plist
@@ -0,0 +1,2 @@
+bin/microbin
+@dir /var/db/microbin