dot

packages and services management
Log | Files | Refs | README

commit b7c37f27a1b16ec1d30256c7ec96a2b1d69106f1
parent 2d0d74d5901777d5fe474d3dd4ec56e3f09d0382
Author: Josuah Demangeon <mail@josuah.net>
Date:   Fri,  6 Apr 2018 00:21:26 +0200

large cleanup: use files to set variables

Diffstat:
Arun/ghttp/host | 2++
Arun/ghttp/port | 2++
Mrun/ghttp/run | 7++++---
Arun/git/port | 1+
Mrun/git/run | 4+++-
Arun/gproxy/host | 1+
Arun/gproxy/port | 2++
Mrun/gproxy/run | 7++++---
Arun/ngircd/ngircd.conf | 45+++++++++++++++++++++++++++++++++++++++++++++
Rskel/ngircd.motd -> run/ngircd/ngircd.motd | 0
Mrun/ngircd/run | 2+-
Mrun/ssh-fwd/run | 8++++----
Arun/tinyssh/addr | 1+
Arun/tinyssh/port | 1+
Mrun/tinyssh/run | 11+++++------
Arun/tls/port | 1+
Mrun/tls/run | 7++++---
Arun/u9fs/addr | 1+
Mrun/u9fs/run | 3++-
Dskel/inetd.conf | 8--------
Dskel/ngircd.conf | 45---------------------------------------------
Dskel/tinc.conf | 2--
22 files changed, 84 insertions(+), 77 deletions(-)

diff --git a/run/ghttp/host b/run/ghttp/host @@ -0,0 +1 @@ +josuah.net+ \ No newline at end of file diff --git a/run/ghttp/port b/run/ghttp/port @@ -0,0 +1 @@ +80+ \ No newline at end of file diff --git a/run/ghttp/run b/run/ghttp/run @@ -1,7 +1,8 @@ #!/bin/sh -port="80" -host="josuah.net" - exec 2>&1 + +IFS='' read -r host <host +IFS='' read -r port <port + exec tcpserver 0.0.0.0 "$port" ghttpd "$host" diff --git a/run/git/port b/run/git/port @@ -0,0 +1 @@ +9418 diff --git a/run/git/run b/run/git/run @@ -1,8 +1,10 @@ #!/bin/sh -e path="$HOME/var/git" -port="9418" exec 2>&1 + +IFS='' read -r port <port + exec tcpserver 0.0.0.0 "$port" \ git daemon --inetd --export-all --base-path="$path" diff --git a/run/gproxy/host b/run/gproxy/host @@ -0,0 +1 @@ +nas.josuah.net diff --git a/run/gproxy/port b/run/gproxy/port @@ -0,0 +1 @@ +80+ \ No newline at end of file diff --git a/run/gproxy/run b/run/gproxy/run @@ -1,7 +1,8 @@ #!/bin/sh -port="80" -host="nas.josuah.net" - exec 2>&1 + +IFS='' read -r host <host +IFS='' read -r port <port + exec tcpserver 0.0.0.0 "$port" gproxy "$host" diff --git a/run/ngircd/ngircd.conf b/run/ngircd/ngircd.conf @@ -0,0 +1,45 @@ +[Global] + Name = XXX + AdminInfo1 = josuah + AdminInfo2 = XXX + AdminEMail = mail@josuah.net + Info = XXX + MotdFile = ngircd.motd + Network = XXX + Ports = 6697 + +[Limits] + MaxConnections = 128 + MaxConnectionsIP = 20 + MaxJoins = 50 + MaxNickLength = 10 + PingTimeout = 120 + PongTimeout = 120 + +[Options] + AllowedChannelTypes = #&+ + AllowRemoteOper = yes + CloakHost = %x%x + CloakHostSalt = XXX + DefaultUserModes = iC + DNS = no + Ident = no + MorePrivacy = yes + OperCanUseMode = yes + OperChanPAutoOp = yes + +[SSL] + Ports = 6697 + CertFile = pem + DHFile = dhp + KeyFile = key + KeyFilePassword = XXX + CipherList = AES+RSA + +[Operator] + Name = josuah + Password = XXX + Mask = josuah!XXX + +[Server] + XXX diff --git a/skel/ngircd.motd b/run/ngircd/ngircd.motd diff --git a/run/ngircd/run b/run/ngircd/run @@ -1,4 +1,4 @@ #!/bin/sh -e exec 2>&1 -exec ngircd -n -f "/etc/ngircd.conf" +exec ngircd -n -f "$PWD/ngircd.conf" diff --git a/run/ssh-fwd/run b/run/ssh-fwd/run @@ -1,9 +1,9 @@ #!/bin/sh -e -user="${1?}" -host="${2?}" -port_local="${3?}" -port_remote="${4?}" +IFS='' read -r user <user +IFS='' read -r host <host +IFS='' read -r port_local <port-local +IFS='' read -r port_remote <port-remote exec 2>&1 exec ssh -L "$port_local:$host:$port_remote" -N "$user@$host" diff --git a/run/tinyssh/addr b/run/tinyssh/addr @@ -0,0 +1 @@ +0.0.0.0 diff --git a/run/tinyssh/port b/run/tinyssh/port @@ -0,0 +1 @@ +22 diff --git a/run/tinyssh/run b/run/tinyssh/run @@ -6,13 +6,12 @@ port="2222" # SSHv2 only server with minimal footprint # based off recipe at https://tinyssh.org/ -keydir="$HOME/.config/tinyssh" -port="22" - exec 2>&1 -[ -d "$keydir" ] || tinysshd-makekey "$keydir" +IFS='' read -r port <port +IFS='' read -r addr <addr -chmod 500 "$keydir" +[ -d key ] || tinysshd-makekey key +chmod 500 key -exec tcpserver -HRDl0 0.0.0.0 "$port" tinysshd -sovv "$keydir" +exec tcpserver -HRDl0 "$addr" "$port" tinysshd -sovv key diff --git a/run/tls/port b/run/tls/port @@ -0,0 +1 @@ +6667 diff --git a/run/tls/run b/run/tls/run @@ -1,8 +1,9 @@ #!/bin/sh -e host="$(cd "$(dirname "$0")" && pwd | sed 's:.*/tls-::')" -port="6697" -path="/tmp" exec 2>&1 -exec unixserver "$path/$host" brssl client "$host:$port" + +IFS='' read -r port <port + +exec unixserver "/tmp/$host" brssl client "$host:$port" diff --git a/run/u9fs/addr b/run/u9fs/addr @@ -0,0 +1 @@ +172.16.55.1 diff --git a/run/u9fs/run b/run/u9fs/run @@ -6,6 +6,7 @@ exec 2>&1 IFS='' read -r user <user IFS='' read -r path <path +IFS='' read -r addr <addr -exec tcpserver 0.0.0.0 564 \ +exec tcpserver "$addr" 564 \ u9fs -a none -u "$user" -A key "'$path'" diff --git a/skel/inetd.conf b/skel/inetd.conf @@ -1,8 +0,0 @@ -#service #type #conn #wait #user #path #argv - -#u9fs stream tcp nowait nobody /XXX/bin/u9fs u9fs -u XXX -a none /XXX/ -#/tmp/u9fs stream unix nowait nobody /XXX/bin/u9fs u9fs -u XXX -a none /XXX/ - -#http stream tcp nowait nobody /XXX/bin/gproxy gproxy nas.josuah.net - -#rsync stream tcp nowait nobody /XXX/bin/rsyncd rsyncd --daemon diff --git a/skel/ngircd.conf b/skel/ngircd.conf @@ -1,45 +0,0 @@ -[Global] - Name = XXX - AdminInfo1 = josuah - AdminInfo2 = XXX - AdminEMail = mail@josuah.net - Info = XXX - MotdFile = /etc/ngircd.motd - Network = XXX - Ports = 6697 - -[Limits] - MaxConnections = 128 - MaxConnectionsIP = 20 - MaxJoins = 50 - MaxNickLength = 10 - PingTimeout = 120 - PongTimeout = 120 - -[Options] - AllowedChannelTypes = #&+ - AllowRemoteOper = yes - CloakHost = %x%x - CloakHostSalt = XXX - DefaultUserModes = iC - DNS = no - Ident = no - MorePrivacy = yes - OperCanUseMode = yes - OperChanPAutoOp = yes - -[SSL] - Ports = 6697 - CertFile = /var/tls/ngircd.pem - DHFile = /var/tls/ngircd.dhp - KeyFile = /var/tls/ngircd.key - KeyFilePassword = XXX - CipherList = AES+RSA - -[Operator] - Name = josuah - Password = XXX - Mask = josuah!XXX - -[Server] - XXX diff --git a/skel/tinc.conf b/skel/tinc.conf @@ -1,2 +0,0 @@ -Name = XXX -ConnectTo = XXX