dot

packages and services management
Log | Files | Refs | README

commit e27ee9bdc7068d570d5f60b4421984b90fbb6dc2
parent 9fb4ef1f23183241a443371330019854dba2b2cf
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 27 Mar 2018 10:47:23 +0200

add authsrv9 config as a script

Diffstat:
Mpack/authsrv9/build | 4++--
Mrunit/authsrv9/run | 49++++++++++++++++++++++++++++++++++++++++++++-----
2 files changed, 46 insertions(+), 7 deletions(-)

diff --git a/pack/authsrv9/build b/pack/authsrv9/build @@ -4,6 +4,6 @@ touch authsrv9.0 authsrv9.8 make -mkdir -p "$PREFIX/man/man8" "$PREFIX/bin" -cp ./man/8/authsrv9 "$PREFIX/man/man8/authsrv9.8" +mkdir -p "$PREFIX/share/man/man8" "$PREFIX/bin" +cp ./man/8/authsrv9 "$PREFIX/share/man/man8/authsrv9.8" cp passtokey authsrv9 "$PREFIX/bin" diff --git a/runit/authsrv9/run b/runit/authsrv9/run @@ -2,15 +2,54 @@ # Plan 9 authentification server +# users: +# bootes - authid username, used by authsrv9 +# sys - system administrator with access to most things system files +# adm - system administrator with accest to most critical files +# $user - regular user with restricted permission + # https://www.ueber.net/who/mjl/plan9/plan9-obsd.html port="567" +user="josuah" exec 2>&1 -mkdir -p /var/authsrv9/dev # for /dev/log, for syslog -mkdir -p /var/authsrv9/bin # for the binary -mkdir -p /var/authsrv9/auth # holding all configuration files -mkdir -p /var/authsrv9/auth/users # holding info about users +mkdir -p dev # for /dev/log, for syslog + +mkdir -p bin # for the binary + +mkdir -p auth # holding all configuration files +printf 'bootes' >auth/authid +printf 'local' >auth/authdom +printf 'adm' >auth/badusers + +mkdir -p auth/users # holding info about users + +mkdir -p auth/users/bootes +[ -f auth/users/sys/key ] || +passtokey >auth/users/bootes/key +printf 'ok' >auth/users/bootes/status +printf 'never' >auth/users/bootes/expire + +mkdir -p auth/users/"$user" +[ -f auth/users/"$user"/key ] || +passtokey >auth/users/"$user"/key +printf 'ok' >auth/users/"$user"/status +printf 'never' >auth/users/"$user"/expire + +[ -f auth/users/sys/key ] || +passtokey >auth/users/sys/key +printf 'ok' >auth/users/sys/status +printf 'never' >auth/users/sys/expire + +authsrv="$(command -v authsrv9)" +tcpserver="$(command -v tcpserver)" + +[ -h "$authsrv" ] && tcpserver="$(readlink "$authsrv")" +[ -h "$tcpserver" ] && tcpserver="$(readlink "$tcpserver")" + +ln -f "$authsrv" bin +ln -f "$tcpserver" bin -exec tcpserver 0.0.0.0 "$port" authsrv0 +exec tcpserver 0.0.0.0 "$port" chroot "$(dirname "$0")" authsrv0