www/tinyauth: New port: Simplest way to protect your apps with a login screen

Tinyauth is a simple authentication middleware that adds a simple
login screen or OAuth with Google, Github and any provider to all
of your docker apps. It supports all the popular proxies like
Traefik, Nginx and Caddy.

Approved by:    acm (mentor)
This commit is contained in:
Jesús Daniel Colmenares Oviedo 2025-06-22 16:08:54 -04:00
parent 8a7b9a26bc
commit 4108cc08b9
8 changed files with 115 additions and 2 deletions

2
GIDs
View File

@ -777,7 +777,7 @@ beehive:*:832:
# free: 833
pocket-id:*:834:
filebrowser:*:835:
# free: 836
tinyauth:*:836:
# free: 837
# free: 838
# free: 839

2
UIDs
View File

@ -783,7 +783,7 @@ beehive:*:832:832::0:0:beehive user:/nonexistent:/usr/sbin/nologin
# free: 833
pocket-id:*:834:834::0:0:OIDC provider that allows users to authenticate with their passkeys:/var/db/pocket-id:/usr/sbin/nologin
filebrowser:*:835:835::0:0:Web File Browser:/var/db/filebrowser:/usr/sbin/nologin
# free: 836
tinyauth:*:836:836::0:0:Simplest way to protect your apps with a login screen:/nonexistent:/usr/sbin/nologin
# free: 837
# free: 838
# free: 839

View File

@ -2522,6 +2522,7 @@
SUBDIR += tidy
SUBDIR += tidy-html5
SUBDIR += tikiwiki
SUBDIR += tinyauth
SUBDIR += tinymce
SUBDIR += tinyproxy
SUBDIR += tivoka

49
www/tinyauth/Makefile Normal file
View File

@ -0,0 +1,49 @@
PORTNAME= tinyauth
DISTVERSIONPREFIX= v
DISTVERSION= 3.4.1
CATEGORIES= www
MASTER_SITES= LOCAL/dtxdf/${PORTNAME}/
DISTFILES= ${PORTNAME}-${DISTVERSION}.frontend${EXTRACT_SUFX}
MAINTAINER= dtxdf@FreeBSD.org
COMMENT= Simplest way to protect your apps with a login screen
WWW= https://tinyauth.app
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= go:1.23,modules
USE_GITHUB= yes
GH_ACCOUNT= steveiliop56
USE_RC_SUBR= ${PORTNAME}
GO_MOD_DIST= github
GO_MODULE= github.com/steveiliop56/${PORTNAME}
GO_BUILDFLAGS= -ldflags "\
-X 'tinyauth/internal/constants.Version=${DISTVERSIONPREFIX}${DISTVERSION}' \
-X 'tinyauth/internal/constants.CommitHash=${GITID}' \
-X 'tinyauth/internal/constants.BuildTimestamp=${BUILD_DATE}'"
SUB_FILES= pkg-message
SUB_LIST= USER=${USERS:[1]}
USERS= ${TINYAUTH_USER}
GROUPS= ${TINYAUTH_GROUP}
PLIST_FILES= bin/${PORTNAME}
# Run 'git checkout ${DISTVERSIONPREFIX}${DISTVERSION} && git rev-parse HEAD'
# in the Tinyauth repository to get the value of GITID.
GITID= 9eb296f14644267410655122e8aff6f0db83371a
BUILD_DATE= $$(date -u '+%Y-%m-%dT%H:%M:%S')
TINYAUTH_USER= ${PORTNAME}
TINYAUTH_GROUP= ${TINYAUTH_USER}
pre-build:
@${MKDIR} ${WRKSRC}/internal/assets/dist
@cd ${WRKDIR}/tinyauth-frontend && ${COPYTREE_SHARE} . ${WRKSRC}/internal/assets/dist
.include <bsd.port.mk>

7
www/tinyauth/distinfo Normal file
View File

@ -0,0 +1,7 @@
TIMESTAMP = 1750535616
SHA256 (go/www_tinyauth/steveiliop56-tinyauth-v3.4.1_GH0/tinyauth-3.4.1.frontend.tar.gz) = 65cfc1c70e7882d1152d8391b3126f294e388af1e1dacc7fa77d8274d12d189f
SIZE (go/www_tinyauth/steveiliop56-tinyauth-v3.4.1_GH0/tinyauth-3.4.1.frontend.tar.gz) = 912295
SHA256 (go/www_tinyauth/steveiliop56-tinyauth-v3.4.1_GH0/go.mod) = 822e543197823d37d4c6718279f77e610c6bb866a9cc34689f20fcc592c1b295
SIZE (go/www_tinyauth/steveiliop56-tinyauth-v3.4.1_GH0/go.mod) = 5138
SHA256 (go/www_tinyauth/steveiliop56-tinyauth-v3.4.1_GH0/steveiliop56-tinyauth-v3.4.1_GH0.tar.gz) = 75357015d84e62eb427fca54c9782459a2779d8ea2478602b447aef875757ebc
SIZE (go/www_tinyauth/steveiliop56-tinyauth-v3.4.1_GH0/steveiliop56-tinyauth-v3.4.1_GH0.tar.gz) = 5629386

View File

@ -0,0 +1,17 @@
[
{ type: install
message: <<EOM
Tinyauth is installed
1) Configure it in %%PREFIX%%/etc/tinyauth.env
2) Enable it with
sysrc tinyauth_enable=YES
3) Start it with
service tinyauth start
EOM
}
]

View File

@ -0,0 +1,35 @@
#!/bin/sh
# PROVIDE: tinyauth
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Configuration settings for tinyauth in /etc/rc.conf
#
# tinyauth_enable (bool): Enable tinyauth. (Default=NO)
# tinyauth_env_file (str): Path containing the environment variables
# to be used by tinyauth. (Default: %%PREFIX%%/etc/tinyauth.env)
# tinyauth_logfile (str): Log file used to store the tinyauth's output. (Default: /var/log/tinyauth.log)
# tinyauth_pidfile (str): File used by tinyauth to store the process ID. (Default: /var/run/tinyauth.pid)
# tinyauth_runas (str): User to run tinyauth as. (Default: %%USER%%)
. /etc/rc.subr
name="tinyauth"
desc="Simplest way to protect your apps with a login screen"
rcvar="tinyauth_enable"
load_rc_config $name
: ${tinyauth_enable:="NO"}
: ${tinyauth_env_file:="%%PREFIX%%/etc/tinyauth.env"}
: ${tinyauth_logfile:="/var/log/tinyauth.log"}
: ${tinyauth_pidfile:="/var/run/tinyauth.pid"}
: ${tinyauth_runas:="%%USER%%"}
pidfile="${tinyauth_pidfile}"
procname="%%LOCALBASE%%/bin/tinyauth"
command="/usr/sbin/daemon"
command_args="-o '${tinyauth_logfile}' -p '${pidfile}' -u '${tinyauth_runas}' -t '${desc}' -- '${procname}'"
run_rc_command "$1"

4
www/tinyauth/pkg-descr Normal file
View File

@ -0,0 +1,4 @@
Tinyauth is a simple authentication middleware that adds a simple
login screen or OAuth with Google, Github and any provider to all
of your docker apps. It supports all the popular proxies like
Traefik, Nginx and Caddy.