dot

packages and services management
Log | Files | Refs | README

commit d1640bdb54670b781cf6af7c17662f799e9bbd81
parent 9feabb66d6830c1152e1685d80668205b5e41fd6
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 17 Jun 2018 12:29:51 +0200

more uniform ./*/add scripts

Diffstat:
Muser/collectd/add | 8++++++--
Muser/dns/add | 8++++++--
Muser/git/add | 10+++++++---
Muser/irc/add | 14++++++++------
Duser/irc/attach | 16----------------
Auser/irc/shell | 14++++++++++++++
Muser/mail/add | 21++++++++++++---------
Auser/mail/bin/mfilter | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Auser/mail/bin/mread | 5+++++
Auser/mail/bin/msearch | 5+++++
Ruser/mail/mblaze -> user/mail/mblaze/profile | 0
Auser/mail/profile | 1+
Muser/qmail/add | 23+++++++++++++----------
Muser/tor/add | 8++++++--
Muser/u9fs/add | 8++++++--
Muser/venti/add | 8++++++--
16 files changed, 189 insertions(+), 54 deletions(-)

diff --git a/user/collectd/add b/user/collectd/add @@ -1,3 +1,7 @@ -#!/pack/bin/execlineb +#!/bin/sh -e +# hold the collectd stats -useradd -d /home/collectd -s /sbin/nologin collectd +mkdir -p /home/collectd +useradd -d /home/collectd -s "$(command -v true)" collectd + +chown -R collectd /home/collectd diff --git a/user/dns/add b/user/dns/add @@ -1,3 +1,7 @@ -#!/pack/bin/execlineb +#!/bin/sh -e +# data directory for djbdns -useradd dns +mkdir -p /home/dns/ +useradd -d /home/dns/ dns + +chown -R dns /home/dns/ diff --git a/user/git/add b/user/git/add @@ -1,5 +1,9 @@ -#!/pack/bin/execlineb +#!/bin/sh -e +# git repositories -useradd -d /home/git -s `{which git-shell} git +mkdir -p /home/git/ +useradd -d /home/git/ -s "$(which git-shell)" git -cp -R `{dirname $0}^/git-shell-commands /home/git +cp -R ./git-shell-commands/ /home/git/ + +chown -R /home/git/ diff --git a/user/irc/add b/user/irc/add @@ -1,8 +1,10 @@ -#!/pack/bin/execlineb -# irc client holding the logs and to connect to to start chatting +#!/bin/sh -e +# irc logs and ii working directory -useradd -s /home/irc/attach -d /home/irc irc +mkdir -p /home/irc/ +useradd -d /home/irc/ -s /home/irc/shell irc -cp `{dirname $0}^/attach /home/irc/attach -chown irc /home/irc/attach -chmod +x /home/irc/attach +cp ./shell /home/irc/shell +chmod +x /home/irc/shell + +chown -R irc /home/irc/ diff --git a/user/irc/attach b/user/irc/attach @@ -1,16 +0,0 @@ -#!/bin/sh -e -ifs=' -' -trap 'true' SIGINT - -while true -do c=$(exec ls -d ./out */out */*/out | exec sed 's,/out,,' | exec iomenu) - test "$c" && case $(exec printf '%s\n' view chat | exec iomenu) in - (view) - eel <$c/out | less - ;; - (chat) - exec tail -f -n 80 $c/out | exec eel | shuntty $c'> ' >$c/in - ;; - esac -done diff --git a/user/irc/shell b/user/irc/shell @@ -0,0 +1,14 @@ +#!/bin/sh -e +trap 'true' INT + +while true +do c=$(exec ls -d ./out */out */*/out | exec sed 's,/out,,' | exec iomenu) + test "$c" && case "$(exec printf '%s\n' view chat | exec iomenu)" in + (view) + eel <$c/out | less + ;; + (chat) + exec tail -f -n 80 "$c/out" | exec eel | shuntty "$c> " >$c/in + ;; + esac +done diff --git a/user/mail/add b/user/mail/add @@ -1,14 +1,17 @@ -#!/9/bin/rc +#!/bin/sh -e +# main maildir storage -groupadd key -useradd -g key -d /home/mail -s /home/mail/attach mail +mkdir -p /home/mail/ +useradd -g key -d /home/mail/ mail mkdir -p /home/mail/.config/enchive -ln -s /mnt/key/enchive.sec /mnt/key/enchive.pub /home/mail/.config/enchive/ +ln -sf /mnt/key/enchive.sec /mnt/key/enchive.pub /home/mail/.config/enchive/ -mkdir -p /home/mail/.ssh/ -cp -R $HOME/conf/ssh/authorized_keys /home/mail/.ssh/ +cp -R ../../ssh/ /home/mail/.ssh/ +cp ../../profile /home/mail/.profile +cp -R ./bin/ /home/mail/ +cp -R ./mblaze/ /home/mail/.mblaze/ +cp ./msmtprc /home/mail/.msmtprc + +chown -R mail /home/mail -mkdir -p /home/mail/.mblaze/ -cp mblazerc /home/mail/.mblaze/profile -cp msmtprc /home/mail/.msmtprc diff --git a/user/mail/bin/mfilter b/user/mail/bin/mfilter @@ -0,0 +1,94 @@ +#!/bin/sh -e +# read and filter mails using mblaze + +cd /home/mail + +test -z "$MBLAZE" && MBLAZE=/home/mail/.mblaze + +minc INBOX >$MBLAZE/seq.mfilter + +test "$1" = -a && mdirs . | mlist >$MBLAZE/seq.mfilter + +f() { + mkdir -p "$1/cur" "$1/new" "$1/tmp" + printf '%-35s ' "$1" >&2 + mpick -t "$2" <$MBLAZE/seq.mfilter | while IFS='' read -r file + do ! test "$file" = "$1/new" && mv "$file" "$1/new" + done +} + +f actux.eu.org '"To" ~~~ "*@actux.eu.org*"' +f amazon.com '"From" ~~~ "*@amazon.*"' +f amnesty.org '"From" ~~~ "*amnesty.*"' +f bandcamp.com '"From" ~~~ "*Cryo Chamber*"' +f bandcamp.com '"From" ~~~ "*bandcamp.com*"' +f bandcamp.com '"From" ~~~ "*makeupandvanityset.com*"' +f breizh-entropy.org '"List-Id" ~~~ "*breizh-entropy.org*"' +f coinbase.com '"From" ~~~ "*coinbase.com*"' +f crous-paris.fr '"From" ~~~ "*crous-paris.fr*"' +f crous-rennes.fr '"From" ~~~ "*crous-rennes.fr*"' +f dragonflybsd.org--hammer '"List-Id" ~~~ "*hammer.dragonflybsd.org*"' +f dragonflybsd.org--kernel '"List-Id" ~~~ "*kernel.dragonflybsd.org*"' +f dropbox.com '"From" ~~~ "*dropbox.*"' +f ebay.com '"From" ~~~ "*ebay.*"' +f epitech.eu--bde '"From" ~~~ "*bde.epitech.rennes@gmail.com*"' +f epitech.eu--intra '"From" ~~~ "*@intra.epitech.eu*"' +f epitech.eu--marvin '"From" ~~~ "*nao.marvin@epitech.eu*"' +f epitech.eu '"From" ~~~ "*@epitech.eu*"' +f epitech.eu '"From" ~~~ "*ionis-group.org*"' +f etudiant.gouv.fr '"From" ~~~ "*etudiant.gouv.fr*"' +f fosdem.org--announce '"List-Id" ~~~ "*fosdem.lists.fosdem.org*"' +f fosdem.org--distributions '"List-Id" ~~~ "*distributions-devroom.lists.fosdem.org*"' +f fosdem.org--network '"List-Id" ~~~ "*network-devroom.lists.fosdem.org*"' +f fosdem.org--security '"List-Id" ~~~ "*security-devroom.lists.fosdem.org*"' +f fosdem.org '"From" ~~~ "*fosdem.org*"' +f free.fr '"From" ~~~ "*@free-mobile.fr*"' +f freebsd.org '"From" ~~~ "*freebsd.org*"' +f freenode.net '"From" ~~~ "*freenode.net*"' +f fsf.org '"From" ~~~ "*fsf.org*"' +f gandi.net '"From" ~~~ "*gandi.net*"' +f github.com '"From" ~~~ "*github.com*"' +f gobolinux.org '"List-Id" ~~~ "*gobolinux.org*"' +f google.com '"From" ~~~ "*google.com*"' +f gopherproject.org '"List-Id" ~~~ "*gopher-project*"' +f grifon.fr '"List-Id" ~~~ "*grifon.fr*"' +f keybase.io '"From" ~~~ "*keybase.io*"' +f lobste.rs '"From" ~~~ "*@lobste.rs*"' +f meetup.com '"From" ~~~ "*meetup.com*"' +f netsukuku.freaknet.org '"List-Id" ~~~ "*netsukuku.lists.dyne.org*"' +f nixers.net '"From" ~~~ "*@nixers.net*"' +f noip.com '"From" ~~~ "*@noip.com*"' +f openbsd.org--advocacy '"List-ID" ~~~ "*advocacy.openbsd.org*"' +f openbsd.org--announce '"List-ID" ~~~ "*announce.openbsd.org*"' +f openbsd.org--tech '"List-ID" ~~~ "*tech.openbsd.org*"' +f paypal.com '"From" ~~~ "*paypal.*"' +f reddit.com '"From" ~~~ "*@reddit.*"' +f reddit.com '"From" ~~~ "*@redditmail.com*"' +f researchgate.net '"From" ~~~ "*@researchgate.*"' +f researchgate.net '"From" ~~~ "*@researchgatemail.*"' +f sabotage.tech '"Mailing-List" ~~~ "*sabotage*@lists.openwall.com*"' +f skarnet.org '"List-Post" ~~~ "*@list.skarnet.org*"' +f suckless.org '"List-Id" ~~~ "*suckless.org*"' +f tarsnap.com '"From" ~~~ "*tarsnap.com*"' +f transports '"From" ~~~ "*BlaBlaCar*"' +f transports '"From" ~~~ "*flixbus*"' +f transports '"From" ~~~ "*keolis.com*"' +f transports '"From" ~~~ "*megabus*"' +f transports '"From" ~~~ "*oui.sncf*"' +f transports '"From" ~~~ "*ouibus*"' +f transports '"From" ~~~ "*ouigo*"' +f transports '"From" ~~~ "*sncf.com*"' +f transports '"From" ~~~ "*sobus.com*"' +f transports '"From" ~~~ "*trainline.com*"' +f univ-rennes1.fr '"List-Id" ~~~ "*univ-rennes1.fr*"' +f wikimedia.org '"From" ~~~ "*wikimedia.org*"' +f wordpress.com '"From" ~~~ "*wordpress.com*"' +f yammer.com '"From" ~~~ "*yammer.com*"' +f youtube.com '"From" ~~~ "*youtube.com*"' + +mdirs . | sort | while IFS='' read -r dir +do echo "$dir" | sed 's,.*/,#,' + MAILSEQ=$dir/seq + mlist -s "$dir" | mseq -S >/dev/null + mscan -f '%6n %u %D %20f %t%2i%120S' 2>/dev/null +done >index diff --git a/user/mail/bin/mread b/user/mail/bin/mread @@ -0,0 +1,5 @@ +#!/bin/sh -e + +test $# = 1 && INBOX=$1 || INBOX=INBOX +mlist /home/mail/$INBOX | msort -dr | mseq -S +mless diff --git a/user/mail/bin/msearch b/user/mail/bin/msearch @@ -0,0 +1,5 @@ +#!/bin/sh -e + +mdirs /home/mail | mlist | mpick "$@" | msort -rd | mseq -S + +mscan diff --git a/user/mail/mblaze b/user/mail/mblaze/profile diff --git a/user/mail/profile b/user/mail/profile @@ -0,0 +1 @@ +PATH="$PATH:$HOME/bin" diff --git a/user/qmail/add b/user/qmail/add @@ -1,12 +1,15 @@ -#!/9/bin/rc +#!/bin/sh -e +# qmail control and queues -groupadd nofiles -useradd -g nofiles -d /home/qmail/alias -s `{whatis true} alias -useradd -g nofiles -d /home/qmail -s `{whatis true} qmaild -useradd -g nofiles -d /home/qmail -s `{whatis true} qmaill -useradd -g nofiles -d /home/qmail -s `{whatis true} qmailp +mkdir -p /home/qmail/ -groupadd qmail -useradd -g qmail -d /home/qmail -s `{whatis true} qmailq -useradd -g qmail -d /home/qmail -s `{whatis true} qmailr -useradd -g qmail -d /home/qmail -s `{whatis true} qmails +! groupadd nofiles +useradd -g nofiles -d /home/qmail/alias/ -s "$(command -v true)" alias +useradd -g nofiles -d /home/qmail/ -s "$(command -v true)" qmaild +useradd -g nofiles -d /home/qmail/ -s "$(command -v true)" qmaill +useradd -g nofiles -d /home/qmail/ -s "$(command -v true)" qmailp + +! groupadd qmail +useradd -g qmail -d /home/qmail/ -s "$(command -v true)" qmailq +useradd -g qmail -d /home/qmail/ -s "$(command -v true)" qmailr +useradd -g qmail -d /home/qmail/ -s "$(command -v true)" qmails diff --git a/user/tor/add b/user/tor/add @@ -1,3 +1,7 @@ -#!/pack/bin/execlineb +#!/bin/sh -e +# tor router and hidden services -useradd -d /home/tor tor +mkdir -p /home/tor/ +useradd -d /home/tor/ tor + +chown -R /home/tor/ diff --git a/user/u9fs/add b/user/u9fs/add @@ -1,3 +1,7 @@ -#!/pack/bin/execlineb +#!/bin/sh -e +# files served through 9P by u9fs -useradd -d /home/u9fs u9fs +mkdir -p /home/u9fs/ +useradd -d /home/u9fs/ u9fs + +chown -R u9fs /home/u9fs/ diff --git a/user/venti/add b/user/venti/add @@ -1,3 +1,7 @@ -#!/pack/bin/execlineb +#!/bin/sh -e +# venti storage server -useradd -d /home/venti venti +useradd -d /home/venti/ venti +mkdir -p /home/venti/ + +chown -R venti /home/venti/