dot

packages and services management
Log | Files | Refs | README

commit 958f2685aa0e400125410b41d414e013133c0a87
parent 08d7c4c85a2b5e5526c1bedfdac02fd70eb4a3df
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 23 Dec 2018 02:23:27 +0100

well, no need for a password feature: just use the host name :D

Diffstat:
Mbin/git-hook-stagit | 25++++++++++++++++++-------
Mbin/git-newrepo | 15++++++---------
Mbin/git-newrepo-stagit | 2++
Abin/service-enable | 5+++++
Mbin/service-list | 8+++++---
Mbin/service-status | 10+++++-----
Mconf/git | 1+
Retc/s6/httpfile/h-o.st/env/CERTFILE -> etc/s6/httpd/h-o.st/env/CERTFILE | 0
Retc/s6/httpfile/h-o.st/env/KEYFILE -> etc/s6/httpd/h-o.st/env/KEYFILE | 0
Retc/s6/httpfile/tcp/env/PORT -> etc/s6/httpd/tcp/env/PORT | 0
Aetc/s6/httpd/tcp/run | 13+++++++++++++
Retc/s6/httpfile/tls/env/CERTFILE -> etc/s6/httpd/tls/env/CERTFILE | 0
Retc/s6/httpfile/tls/env/KEYFILE -> etc/s6/httpd/tls/env/KEYFILE | 0
Retc/s6/httpfile/tls/env/PORT -> etc/s6/httpd/tls/env/PORT | 0
Aetc/s6/httpd/tls/run | 13+++++++++++++
Retc/s6/httpfile/x/env/BIND -> etc/s6/httpd/x/env/BIND | 0
Aetc/s6/httpd/x/env/ROOT | 1+
Retc/s6/httpfile/x/env/USER -> etc/s6/httpd/x/env/USER | 0
Retc/s6/httpfile/x/type -> etc/s6/httpd/x/type | 0
Detc/s6/httpfile/tcp/run | 13-------------
Detc/s6/httpfile/tls/run | 16----------------
Detc/s6/httpfile/x/env/ACCESSFILE | 1-
Detc/s6/httpfile/x/env/ROOT | 1-
Detc/s6/httpfile/x/setup | 7-------
Metc/s6/transmission/x/conf/s-rpc-bind-address | 2+-
25 files changed, 70 insertions(+), 63 deletions(-)

diff --git a/bin/git-hook-stagit b/bin/git-hook-stagit @@ -12,18 +12,29 @@ importas gitdir x backtick -n x { heredoc 0 ${gitdir} sed -r "s,.*/,," } importas repo x -if { mkdir -p ${target}/${repo} } -if { cd ${target}/${repo} stagit ${gitdir} } -if { cd ${target}/${repo} stagit-gopher -b /git/${repo} ${gitdir} } +if { echo "stagit: ${repo}" } + +if { mkdir -p ${target}/${repo} stagit } +if { + cd ${target}/${repo} + stagit-gopher -b /git/${repo} -c ${gitdir}/stagit/cache-gopher ${gitdir} +} +if { + cd ${target}/${repo} + stagit ${gitdir} -c ${gitdir}/stagit/cache +} +if { ln -sf ../style.css ${target}/${repo}/style.css } + +elglob -0 x ../*/git-daemon-export-ok +backtick x { pipeline { printf "%s\n" ${x} } sed "s/[^/]*$//" } +importas -s -d "\n" repolist x if { - elglob -0 x ../*/ redirfd -w 1 ${target}/index.html - stagit-index ${x} + stagit-index ${repolist} } if { - elglob -0 x ../*/ redirfd -w 1 ${target}/index.gph - stagit-gopher-index -b /git/${repo} ${x} + stagit-gopher-index -b /git/${repo} ${repolist} } diff --git a/bin/git-newrepo b/bin/git-newrepo @@ -3,18 +3,13 @@ importas -i repo 1 define domain git.josuah.net -define path_git /var/git -define path_www /var/www/plain - -backtick -n x { dirname ${repo} } -importas repo_dir x # the repo may already exist -if { git init --bare ${repo} } +if { git init --bare /var/git/${repo} } # configuration if { mkdir -p ${repo}/env } -if { redirfd -w 1 ${repo}/env/PATH_WWW echo ${path_www}/${domain} } +if { redirfd -w 1 ${repo}/env/PATH_WWW echo /var/www/${domain} } # hooks forx x { pre-receive update post-receive } @@ -22,6 +17,8 @@ importas hook x if { mkdir -p ${repo}/hooks/${hook}.d } if { redirfd -w 1 ${repo}/hooks/${hook} printf "%s\n" "#!/usr/bin/env execlineb" - "elglob -0 x hooks/${hook}.d/*" "forx x { ${x} }" - "importas script x" "${script}" } + "elglob -0 x hooks/${hook}.d/*" + "forx x { ${x} }" + "importas script x" + "${script}" } if { chmod +x ${repo}/hooks/${hook} } diff --git a/bin/git-newrepo-stagit b/bin/git-newrepo-stagit @@ -3,6 +3,7 @@ importas -i repo 1 importas -i desc 2 +if { git-newrepo ${repo} } cd /var/git/${repo} backtick -n x { which git-hook-stagit } @@ -10,3 +11,4 @@ importas path x if { cp ${path} hooks/update.d } if { redirfd -w 1 description echo "${desc}" } +if { touch git-daemon-export-ok } diff --git a/bin/service-enable b/bin/service-enable @@ -0,0 +1,5 @@ +#!/usr/bin/env execlineb +elgetpositionals + +if { service-build ${@} } +if { service-compile } diff --git a/bin/service-list b/bin/service-list @@ -19,6 +19,8 @@ pipeline { backtick -n x { s6-svstat -o updownfor /run/s6/${service},x } importas since x - if { printf "%10ds %s %s\n" ${since} ${up} ${service} } -} -sed "s/true true/ up /; s/true false/kill/g; s/false true/down/; s/false false/fail/g;" + if { printf "%8ds %s %s\n" ${since} ${up} ${service} } +} sed " + s/true true/ up /; s/true false/kill/g; + s/false true/fail/; s/false false/down/g; +" diff --git a/bin/service-status b/bin/service-status @@ -4,18 +4,18 @@ elgetpositionals -P 1 if { printf "\n" } fdmove -c 2 1 -forbacktickx x { pipeline { s6-rc list $@ } grep -v ",log$" } +forbacktickx x { pipeline { s6-rc list $@ } sed -n "s/,x$// p" } importas -n -d "\n" sv x if { heredoc 0 ${sv} sed -r "s/([^,]*),?(.*)/ \033[1m\\1\033[m (\\2)/; s/\\(\\)/(x)/" } if { printf " " } -if { s6-svstat /var/s6/scandir/${sv} } +if { s6-svstat /run/s6/${sv},x } if { printf "\n" } if { - backtick -n x { s6-svstat -o pid /var/s6/scandir/${sv} } - importas x x + backtick -n x { s6-svstat -o pid /run/s6/${sv},x } + importas pid x pipeline { ps -ax -o ppid,user,pid,stat,comm,args } - ptree -- ${x} + ptree -- ${pid} } if { printf "\n" } if { pipeline { tail /var/log/${sv}/current } s6-tai64nlocal } diff --git a/conf/git b/conf/git @@ -9,3 +9,4 @@ if { git-newrepo-stagit miniwi "tiny 4x8 bitmapped font" } if { git-newrepo-stagit ploot "plot images or real-time plain text from a .csv file" } if { git-newrepo-stagit plstree "display ls or ps output as directory or process trees" } if { git-newrepo-stagit tttml "tools for formatting a very basic markdown-like format" } +if { git-newrepo-stagit sites "mirror of git://git.suckless.org/sites" } diff --git a/etc/s6/httpfile/h-o.st/env/CERTFILE b/etc/s6/httpd/h-o.st/env/CERTFILE diff --git a/etc/s6/httpfile/h-o.st/env/KEYFILE b/etc/s6/httpd/h-o.st/env/KEYFILE diff --git a/etc/s6/httpfile/tcp/env/PORT b/etc/s6/httpd/tcp/env/PORT diff --git a/etc/s6/httpd/tcp/run b/etc/s6/httpd/tcp/run @@ -0,0 +1,13 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 +s6-envdir env + +multisubstitute { + importas BIND BIND + importas PORT PORT + importas USER USER +} + +s6-envuidgid ${USER} +s6-tcpserver -vD -b50 -c100 ${BIND} ${PORT} +httpd diff --git a/etc/s6/httpfile/tls/env/CERTFILE b/etc/s6/httpd/tls/env/CERTFILE diff --git a/etc/s6/httpfile/tls/env/KEYFILE b/etc/s6/httpd/tls/env/KEYFILE diff --git a/etc/s6/httpfile/tls/env/PORT b/etc/s6/httpd/tls/env/PORT diff --git a/etc/s6/httpd/tls/run b/etc/s6/httpd/tls/run @@ -0,0 +1,13 @@ +#!/usr/bin/env execlineb +fdmove -c 2 1 +s6-envdir env + +multisubstitute { + importas BIND BIND + importas PORT PORT + importas USER USER +} + +s6-envuidgid ${USER} +s6-tlsserver -vD -b50 -c100 ${BIND} ${PORT} +httpd diff --git a/etc/s6/httpfile/x/env/BIND b/etc/s6/httpd/x/env/BIND diff --git a/etc/s6/httpd/x/env/ROOT b/etc/s6/httpd/x/env/ROOT @@ -0,0 +1 @@ +/var/www diff --git a/etc/s6/httpfile/x/env/USER b/etc/s6/httpd/x/env/USER diff --git a/etc/s6/httpfile/x/type b/etc/s6/httpd/x/type diff --git a/etc/s6/httpfile/tcp/run b/etc/s6/httpfile/tcp/run @@ -1,13 +0,0 @@ -#!/usr/bin/env execlineb -fdmove -c 2 1 -s6-envdir env - -multisubstitute { - importas BIND BIND - importas PORT PORT - importas USER USER -} - -s6-envuidgid $USER -s6-tcpserver -vD -b50 -c100 $BIND $PORT -httpfile-httpd diff --git a/etc/s6/httpfile/tls/run b/etc/s6/httpfile/tls/run @@ -1,16 +0,0 @@ -#!/usr/bin/env execlineb -fdmove -c 2 1 -s6-envdir env - -multisubstitute { - importas ACCESSFILE ACCESSFILE - importas BIND BIND - importas PORT PORT - importas USER USER -} - -s6-envuidgid $USER -unexport ACCESSFILE -s6-tlsserver -vD -b50 -c100 $BIND $PORT -export ACCESSFILE $ACCESSFILE -httpfile-httpd diff --git a/etc/s6/httpfile/x/env/ACCESSFILE b/etc/s6/httpfile/x/env/ACCESSFILE @@ -1 +0,0 @@ -/var/www/access.cdb diff --git a/etc/s6/httpfile/x/env/ROOT b/etc/s6/httpfile/x/env/ROOT @@ -1 +0,0 @@ -/var/httpfile diff --git a/etc/s6/httpfile/x/setup b/etc/s6/httpfile/x/setup @@ -1,7 +0,0 @@ -#!/usr/bin/env execlineb -s6-envdir env multisubstitute { - importas ROOT ROOT -} - -redirfd -r 0 ${ROOT}/access.txt -httpfile-access ${ROOT}/access.cdb ${ROOT}/access.tmp diff --git a/etc/s6/transmission/x/conf/s-rpc-bind-address b/etc/s6/transmission/x/conf/s-rpc-bind-address @@ -1 +1 @@ -::1 +127.0.0.1