Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Jun 2026 20:57:12 +0000
From:      Yuri Victorovich <yuri@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Cc:        luxanna <l.lux@magenta.de>
Subject:   git: 04de0eac8a32 - main - www/microbin: Add rc.d script
Message-ID:  <6a2b2128.223eb.756ca58a@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=04de0eac8a320d596ba46c3808b8174cb5b4adc1

commit 04de0eac8a320d596ba46c3808b8174cb5b4adc1
Author:     luxanna <l.lux@magenta.de>
AuthorDate: 2026-06-11 20:54:14 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2026-06-11 20:56:56 +0000

    www/microbin: Add rc.d script
    
    PR:             295973
---
 GIDs                           |  2 +-
 UIDs                           |  2 +-
 www/microbin/Makefile          | 13 ++++++++++---
 www/microbin/files/microbin.in | 39 +++++++++++++++++++++++++++++++++++++++
 www/microbin/pkg-plist         |  2 ++
 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


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a2b2128.223eb.756ca58a>