dot

packages and services management
Log | Files | Refs | README

commit 886f86f93853f79ec25f317832178e7a51c8c6ba
parent 1196a3891febc92176b21adc726523ef7622b118
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 21 Feb 2018 23:22:35 +0100

meeting djb again

Diffstat:
M.profile | 2+-
Dbin/run | 7-------
Aman/README.7 | 146+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mman/agenda.5 | 2+-
Dman/configure.7 | 141-------------------------------------------------------------------------------
Apack/djbdns/build | 15+++++++++++++++
Apack/djbdns/tar | 1+
Drun/collectd | 8--------
Drun/crond | 6------
Drun/geomyidae | 12------------
Drun/git | 11-----------
Drun/ii | 22----------------------
Drun/inetd | 5-----
Drun/ngircd | 7-------
Drun/opentracker | 6------
Drun/quark | 10----------
Drun/ratox | 10----------
Drun/ssh-agent | 9---------
Drun/tincd | 6------
Drun/tor | 5-----
Asv/collectd/run | 4++++
Asv/crond/run | 4++++
Asv/geomyidae/run | 8++++++++
Asv/git/run | 7+++++++
Asv/ii/run | 16++++++++++++++++
Asv/inetd/run | 4++++
Asv/ngircd/run | 4++++
Asv/opentracker/run | 4++++
Asv/quark/run | 6++++++
Asv/ratox/run | 9+++++++++
Asv/ssh-agent/run | 7+++++++
Asv/tincd/run | 4++++
Asv/tor/run | 4++++
33 files changed, 245 insertions(+), 267 deletions(-)

diff --git a/.profile b/.profile @@ -33,7 +33,7 @@ export LESS="-R~X" export LESSHISTFILE="-" export MBLAZE="$HOME/.config/mblaze" export PKG_PATH="https://ftp.fr.openbsd.org/pub/OpenBSD/" -export SSH_AUTH_SOCK="$HOME/run/ssh-agent" +export SSH_AUTH_SOCK="/tmp/ssh-agent" export PS1='$([ "$?" -gt 0 ] && printf "\033[31;1mx\033[m\n\r")' export PS1="$PS1$(printf '\033]0;%s\a' '$PWD') diff --git a/bin/run b/bin/run @@ -1,7 +0,0 @@ -#!/bin/sh -e - -mkdir -p "$HOME/log" - -[ "$#" -ge 1 ] || exec ls "$HOME/.config/run" - -exec "$HOME/.config/run/$@" diff --git a/man/README.7 b/man/README.7 @@ -0,0 +1,146 @@ +.Dd $Mdocdate: February 09 2018$ +.Dt ./CONFIGURE 7 +.Os +. +. +.Sh NAME +. +.Nm ./configure +.Nd setup symlinks for portable configuration +. +. +.Sh SYNOPSIS +. +.Bd -literal +\&./configure +\&. ~/.profile +.Ed +. +. +.Sh DESCRIPTION +. +.Nm +symlinks files from this directory into the +.Pa ~/.config +directory and symlinks everything matching +.Pa .* +into the home directory. +. +. +.Sh ENVIRONMENT +. +Path used across the configuration are setup by the following environment +variables: +. +. +.Sh FILES +. +.Ss Path on the user's home directory +. +.Bl -tag -width 6n +. +.It Pa ~/lib +Directory where original data are stored. +. +.It Pa ~/var +Sets the directory containing all +.Sy generated data , +including irc, mail, tox, torrent, qemu images... +. +.It Pa ~/sv +.Xr runit 8 +services directory, symlinked into +.Pa ~/.config/sv , +where +.Xr runsvdir 8 +is expected to run. +. +.It Pa ~/log +Logs for each program started by +.Xr run 1 . +. +.It Pa ~/etc +Source of the configuration file, symlinked into +.Pa ~/.config +. +.It Pa ~/opt +Local installation path for package, symlinked into +.Pa ~/.local +. +.It Pa ~/src +Source of packages which can be compiled and installed in ~/opt +. +.It Pa ~/.cache +Directory containing generated data cached for increasing performances. +. +.It Pa ~/.config +Local configuration directory, where software are configured to search +their configuration file. +. +.It Pa ~/.local +Alternate system root in which software are downloaded, build, and installed +.Pq via symlinks . +. +.El +. +. +.Ss Path within this project +. +.Bl -tag -width 6n +. +.It Pa ./pack/ +Contains one directory per package with all information to build it. +. +.It Pa ./daemon/ +Contains one scripts per daemon, which start it while invoked, optionnally with +arguments. +. +.It Pa ./bin/ +Contains scripts collection to maintain the configuration and more. +. +.It Pa ./man/ +Contains manual pages for utilities developed inside of +.Pa ./bin/ . +. +.It Pa ./.* +Files to be symlinked into the home directory, with exception of +.Pa .git . +. +.It Pa ./skel/ +Contains files to be manually copied in-place and then edited. +. +.El +. +. +.Sh SEE ALSO +. +.Bl -tag -width 6n +. +.It Xr pack 1 +A package manager which to fetch and install missing software and libraries, +according to rules in subdirectories of +.Pa ./pack . +. +.It Xr run 1 , Xr log 1 +A daemon management script which calls the scirpts in +.Pa ./run +to manage different software in an uniform manner. +. +.It Xr xdg-open 1 +A general-purpose piping utility which chooses the apropriate program to open +the file passed as argument. +. +.El +. +. +.Sh STANDARDS +. +This set of configurations and scripts try to comply with +.St -p1003.1 +and to keep the amount of external dependencies low. +. +. +.Sh AUTHORS +. +.An Josuah Demangeon +.Aq Mt mail@josuah.net diff --git a/man/agenda.5 b/man/agenda.5 @@ -34,7 +34,7 @@ K:value1 value2 . .Pp The key character is one of: -.Bl -tag -width 6n +.Bl -tag -width 6n -compact . .It Ql B Beginning of the event as an UNIX timestamp, seconds since Jan 1, 1970 in UTC diff --git a/man/configure.7 b/man/configure.7 @@ -1,141 +0,0 @@ -.Dd $Mdocdate: February 09 2018$ -.Dt ./CONFIGURE 7 -.Os -. -. -.Sh NAME -. -.Nm ./configure -.Nd setup symlinks for portable configuration -. -. -.Sh SYNOPSIS -. -.Bd -literal -\&./configure -\&. ~/.profile -.Ed -. -. -.Sh DESCRIPTION -. -.Nm -symlinks files from this directory into the -.Pa ~/.config -directory and symlinks everything matching -.Pa .* -into the home directory. -. -. -.Sh ENVIRONMENT -. -Path used across the configuration are setup by the following environment -variables: -. -. -.Sh FILES -. -.Ss Path on the user's home directory -. -.Bl -tag -width 6n -. -.It Pa ~/lib -Directory where original data are stored. -. -.It Pa ~/var -Sets the directory containing all -.Sy generated data , -including irc, mail, tox, torrent, qemu images... -. -.It Pa ~/run -Information and pipes for currently running programs. -. -.It Pa ~/log -Logs for each program started by -.Xr run 1 . -. -.It Pa ~/etc -Source of the configuration file, symlinked into -.Pa ~/.config -. -.It Pa ~/opt -Local installation path for package, symlinked into -.Pa ~/.local -. -.It Pa ~/src -Source of packages which can be compiled and installed in ~/opt -. -.It Pa ~/.cache -Directory containing generated data cached for increasing performances. -. -.It Pa ~/.config -Local configuration directory, where software are configured to search -their configuration file. -. -.It Pa ~/.local -Alternate system root in which software are downloaded, build, and installed -.Pq via symlinks . -. -.El -. -. -.Ss Path within this project -. -.Bl -tag -width 6n -. -.It Pa ./pack/ -Contains one directory per package with all information to build it. -. -.It Pa ./daemon/ -Contains one scripts per daemon, which start it while invoked, optionnally with -arguments. -. -.It Pa ./bin/ -Contains scripts collection to maintain the configuration and more. -. -.It Pa ./man/ -Contains manual pages for utilities developed inside of -.Pa ./bin/ . -. -.It Pa ./.* -Files to be symlinked into the home directory, with exception of -.Pa .git . -. -.It Pa ./skel/ -Contains files to be manually copied in-place and then edited. -. -.El -. -. -.Sh SEE ALSO -. -.Bl -tag -width 6n -. -.It Xr pack 1 -A package manager which to fetch and install missing software and libraries, -according to rules in subdirectories of -.Pa ./pack . -. -.It Xr run 1 , Xr log 1 -A daemon management script which calls the scirpts in -.Pa ./run -to manage different software in an uniform manner. -. -.It Xr xdg-open 1 -A general-purpose piping utility which chooses the apropriate program to open -the file passed as argument. -. -.El -. -. -.Sh STANDARDS -. -This set of configurations and scripts try to comply with -.St -p1003.1 -and to keep the amount of external dependencies low. -. -. -.Sh AUTHORS -. -.An Josuah Demangeon -.Aq Mt mail@josuah.net diff --git a/pack/djbdns/build b/pack/djbdns/build @@ -0,0 +1,15 @@ +#!/bin/sh -ex + +echo gcc -O2 -include /usr/include/errno.h > conf-cc + +mkdir -p "$OPT/bin" + +make + +cp \ + dnscache-conf dnscache walldns-conf walldns rbldns-conf rbldns \ + rbldns-data pickdns-conf pickdns pickdns-data tinydns-conf tinydns \ + tinydns-data tinydns-get tinydns-edit axfr-get axfrdns-conf axfrdns \ + dnsip dnsipq dnsname dnstxt dnsmx dnsfilter random-ip dnsqr dnsq \ + dnstrace dnstracesort cachetest utime rts \ + "$OPT/bin" diff --git a/pack/djbdns/tar b/pack/djbdns/tar @@ -0,0 +1 @@ +http://cr.yp.to/djbdns/djbdns-1.05.tar.gz diff --git a/run/collectd b/run/collectd @@ -1,8 +0,0 @@ -#!/bin/sh -e - -exec collectd \ - -f \ - -P "$HOME/var/run/collectd.pid" \ - -C "$HOME/.config/collectd.conf" \ - 1>> "$HOME/log/collectd" \ - 2>> "$HOME/log/collectd" & diff --git a/run/crond b/run/crond @@ -1,6 +0,0 @@ -#!/bin/sh -e - -exec crond \ - -f "/etc/crontab" \ - 1>> "$HOME/log/crond" \ - 2>> "$HOME/log/crond" & diff --git a/run/geomyidae b/run/geomyidae @@ -1,12 +0,0 @@ -#!/bin/sh -e - -path="${1:-$HOME/srv}" -port="${2:-70}" -host="${3:-josuah.net}" - -exec geomyidae \ - -b "$path" \ - -p "$port" \ - -h "$host" \ - 1>> "$HOME/log/geomyidae" \ - 2>> "$HOME/log/geomyidae" & diff --git a/run/git b/run/git @@ -1,11 +0,0 @@ -#!/bin/sh -e - -path="${1:-$HOME/srv/git}" -port="${2:-9418}" - -exec git daemon \ - --base-path="$path" \ - --export-all \ - --port="$port" \ - 1>> "$HOME/log/git" \ - 2>> "$HOME/log/git" & diff --git a/run/ii b/run/ii @@ -1,22 +0,0 @@ -#!/bin/sh -e - -# Connect to an irc server through ii. If there is a socket in /tmp with the -# same name as the host, assume it is an openssl s_client inetd proxy and use -# the ii -u option to connect through it, otherwise use the port argument. - -host="${1:?host required}" -port="${2:-6667}" - -[ -S "/tmp/$host" ] && p="u" port="/tmp/$host" || p="p" - -mkdir -p "$HOME/var/irc/$host" "$HOME/log/ii" - -pgrep -f "ii -s $host" || exec ii \ - -s "$host" \ - -i "$HOME/var/irc" \ - -$p "$port" \ - -n "$NICK" \ - -k "PASS" \ - -f "$NAME" \ - 1>> "$HOME/var/irc/$host/log" \ - 2>> "$HOME/log/ii/$host" & diff --git a/run/inetd b/run/inetd @@ -1,5 +0,0 @@ -#!/bin/sh -e - -exec inetd \ - 1>> "$HOME/log/inetd" \ - 2>> "$HOME/log/inetd" & diff --git a/run/ngircd b/run/ngircd @@ -1,7 +0,0 @@ -#!/bin/sh -e - -exec ngircd \ - -n \ - -f "/etc/ngircd/conf" \ - 1>> "$HOME/log/ngircd" \ - 2>> "$HOME/log/ngircd" & diff --git a/run/opentracker b/run/opentracker @@ -1,6 +0,0 @@ -#!/bin/sh -e - -exec opentracker \ - -d "$HOME/var/torrent" \ - 1>> "$HOME/log/opentracker" \ - 2>> "$HOME/log/opentracker" & diff --git a/run/quark b/run/quark @@ -1,10 +0,0 @@ -#!/bin/sh -e - -path="${1:-$HOME/srv}" - -exec quark \ - -h localhost \ - -d "$path" \ - -V \ - 1>> "$HOME/log/quark" \ - 2>> "$HOME/log/quark" & diff --git a/run/ratox b/run/ratox @@ -1,10 +0,0 @@ -#!/bin/sh -e - -path="${1:-$HOME/var/ratox}" - -mkdir -p "$path" -cd "$path" - -exec ratox \ - 1>> "$HOME/log/ratox" \ - 2>> "$HOME/log/ratox" & diff --git a/run/ssh-agent b/run/ssh-agent @@ -1,9 +0,0 @@ -#!/bin/sh -e - -mkdir -p "${SSH_AUTH_SOCK%/*}" -rm -f "$SSH_AUTH_SOCK" - -ssh-agent \ - -a "$SSH_AUTH_SOCK" \ - 1>> "$HOME/log/ssh-agent" \ - 2>> "$HOME/log/ssh-agent" & diff --git a/run/tincd b/run/tincd @@ -1,6 +0,0 @@ -#!/bin/sh -e - -mkdir -p "$HOME/var/run" - -exec tincd \ - --logfile="$HOME/log/tincd" diff --git a/run/tor b/run/tor @@ -1,5 +0,0 @@ -#!/bin/sh -e - -exec tor \ - 1>> "$HOME/log/tor" \ - 2>> "$HOME/log/tor" & diff --git a/sv/collectd/run b/sv/collectd/run @@ -0,0 +1,4 @@ +#!/bin/sh -e + +exec 2>&1 +exec collectd -f -C "$HOME/.config/collectd.conf" diff --git a/sv/crond/run b/sv/crond/run @@ -0,0 +1,4 @@ +#!/bin/sh -e + +exec 2>&1 +exec crond -f "/etc/crontab" diff --git a/sv/geomyidae/run b/sv/geomyidae/run @@ -0,0 +1,8 @@ +#!/bin/sh -e + +path="$HOME/srv" +port="70" +host="josuah.net" + +exec 2>&1 +exec geomyidae -b "$path" -p "$port" -h "$host" diff --git a/sv/git/run b/sv/git/run @@ -0,0 +1,7 @@ +#!/bin/sh -e + +path="$HOME/srv/git" +port="$9418" + +exec 2>&1 +exec git daemon --base-path="$path" --export-all --port="$port" diff --git a/sv/ii/run b/sv/ii/run @@ -0,0 +1,16 @@ +#!/bin/sh -e + +# Connect to an irc server through ii. If there is a socket in /tmp with the +# same name as the host, assume it is an openssl s_client inetd proxy and use +# the ii -u option to connect through it, otherwise use the port argument. + +host="" +port="6667" +path="$HOME/var/irc" + +[ -S "/tmp/$host" ] && p="u" port="/tmp/$host" || p="p" + +mkdir -p "$HOME/var/irc/$host" "$HOME/log/ii" + +exec 2>&1 +exec ii -s "$host" -i "$path" -$p "$port" -n "$NICK" -k "PASS" -f "$NAME" diff --git a/sv/inetd/run b/sv/inetd/run @@ -0,0 +1,4 @@ +#!/bin/sh -e + +exec 2>&1 +exec inetd diff --git a/sv/ngircd/run b/sv/ngircd/run @@ -0,0 +1,4 @@ +#!/bin/sh -e + +exec 2>&1 +exec ngircd -n -f "/etc/ngircd/conf" diff --git a/sv/opentracker/run b/sv/opentracker/run @@ -0,0 +1,4 @@ +#!/bin/sh -e + +exec 2>&1 +exec opentracker -d "$HOME/var/torrent" diff --git a/sv/quark/run b/sv/quark/run @@ -0,0 +1,6 @@ +#!/bin/sh -e + +path="$HOME/srv" + +exec 2>&1 +exec quark -V -h localhost -d "$path" diff --git a/sv/ratox/run b/sv/ratox/run @@ -0,0 +1,9 @@ +#!/bin/sh -e + +path="$HOME/var/ratox" + +mkdir -p "$path" +cd "$path" + +exec 2>&1 +exec ratox diff --git a/sv/ssh-agent/run b/sv/ssh-agent/run @@ -0,0 +1,7 @@ +#!/bin/sh -e + +mkdir -p "${SSH_AUTH_SOCK%/*}" +rm -f "$SSH_AUTH_SOCK" + +exec 2>&1 +ssh-agent -a "$SSH_AUTH_SOCK" diff --git a/sv/tincd/run b/sv/tincd/run @@ -0,0 +1,4 @@ +#!/bin/sh -e + +exec 2>&1 +exec tincd -D diff --git a/sv/tor/run b/sv/tor/run @@ -0,0 +1,4 @@ +#!/bin/sh -e + +exec 2>&1 +exec tor