dot

packages and services management
Log | Files | Refs | README

commit f507ac7a5115ddc2c4732cdf8cfdb7097c3985a4
parent 1ed2f7f028272ecf39f05fb3e1c5117b1178801e
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun, 11 Nov 2018 23:52:49 +0100

have a /etc/s6/<service>/x/setup script to generate config file

such as from:
	./conf/<directory-1>/<file-a>:<content>
	./conf/<directory-1>/<file-b>:<content>
	./conf/<directory-2>/<file-a>:<content>
	./conf/<directory-2>/<file-b>:<content>
	./conf/<directory-2>/<file-c>:<content>
	./conf/<directory-3>/<file-a>:<content>
	./conf/<directory-3>/<file-b>:<content>

- easy to parse
- stackable / mergeable

to:

	./data/conf:

	[directory-1]
		file-a = content
		file-b = content

	[directory-2]
		file-a = content
		file-b = content
		file-c = content

	[directory-3]
		file-a = content
		file-b = content

- used by the end program

Diffstat:
Mbin/service-enable | 3++-
Ds6/ngircd-tls/josuah.net/data/conf | 43-------------------------------------------
As6/ngircd/josuah.net/conf/Global/AdminEMail | 1+
As6/ngircd/josuah.net/conf/Global/AdminInfo1 | 1+
As6/ngircd/josuah.net/conf/Operator/Mask | 1+
As6/ngircd/josuah.net/conf/Operator/Name | 1+
As6/ngircd/josuah.net/conf/Operator/Password | 1+
As6/ngircd/josuah.net/conf/Options/CloakHostSalt | 1+
As6/ngircd/josuah.net/conf/SSL/CertFile | 1+
As6/ngircd/josuah.net/conf/SSL/KeyFile | 1+
Rs6/ngircd-tls/josuah.net/data/motd -> s6/ngircd/josuah.net/data/motd | 0
As6/ngircd/tls/conf/SSL/CipherList | 1+
As6/ngircd/tls/conf/SSL/DHFile | 1+
As6/ngircd/tls/conf/SSL/Ports | 1+
As6/ngircd/x/conf/Global/AdminInfo1 | 1+
As6/ngircd/x/conf/Global/AdminInfo2 | 1+
As6/ngircd/x/conf/Global/Info | 1+
As6/ngircd/x/conf/Global/MotdFile | 1+
As6/ngircd/x/conf/Global/Name | 1+
As6/ngircd/x/conf/Global/Ports | 1+
As6/ngircd/x/conf/Limits/MaxConnections | 1+
As6/ngircd/x/conf/Limits/MaxConnectionsIP | 1+
As6/ngircd/x/conf/Limits/MaxJoins | 1+
As6/ngircd/x/conf/Limits/MaxNickLength | 1+
As6/ngircd/x/conf/Limits/PingTimeout | 1+
As6/ngircd/x/conf/Limits/PongTimeout | 1+
As6/ngircd/x/conf/Options/AllowRemoteOper | 1+
As6/ngircd/x/conf/Options/AllowedChannelTypes | 1+
As6/ngircd/x/conf/Options/CloakHost | 1+
As6/ngircd/x/conf/Options/DNS | 1+
As6/ngircd/x/conf/Options/DefaultUserModes | 1+
As6/ngircd/x/conf/Options/Ident | 1+
As6/ngircd/x/conf/Options/MorePrivacy | 1+
As6/ngircd/x/conf/Options/OperCanUseMode | 1+
As6/ngircd/x/conf/Options/OperChanPAutoOp | 1+
Rs6/ngircd-tls/x/run -> s6/ngircd/x/run | 0
As6/ngircd/x/setup | 11+++++++++++
Rs6/ngircd-tls/x/type -> s6/ngircd/x/type | 0
As6/vsftpd/josuah.net/conf/rsa_cert_file | 1+
As6/vsftpd/josuah.net/conf/rsa_private_key_file | 1+
Ds6/vsftpd/josuah.net/data/rsa_cert_file | 1-
Rs6/vsftpd/x/data/allow_anon_ssl -> s6/vsftpd/tls/conf/ssl_enable | 0
Rs6/vsftpd/x/data/anonymous_enable -> s6/vsftpd/x/conf/allow_anon_ssl | 0
Rs6/vsftpd/x/data/anon_root -> s6/vsftpd/x/conf/anon_root | 0
Rs6/vsftpd/x/data/connect_from_port_20 -> s6/vsftpd/x/conf/anonymous_enable | 0
Rs6/vsftpd/x/data/listen -> s6/vsftpd/x/conf/connect_from_port_20 | 0
Rs6/vsftpd/x/data/ftp_username -> s6/vsftpd/x/conf/ftp_username | 0
Rs6/vsftpd/x/data/pasv_enable -> s6/vsftpd/x/conf/listen | 0
Rs6/vsftpd/x/data/ssl_enable -> s6/vsftpd/x/conf/pasv_enable | 0
Rs6/vsftpd/x/data/pasv_promiscuous -> s6/vsftpd/x/conf/pasv_promiscuous | 0
Rs6/vsftpd/x/env/ROOT -> s6/vsftpd/x/conf/secure_chroot_dir | 0
Rs6/vsftpd/x/data/pasv_promiscuous -> s6/vsftpd/x/conf/tcp_wrappers | 0
Rs6/vsftpd/x/data/vsftpd_log_file -> s6/vsftpd/x/conf/vsftpd_log_file | 0
Ds6/vsftpd/x/data/tcp_wrappers | 1-
Ds6/vsftpd/x/env/HOST | 1-
Ds6/vsftpd/x/env/PORT | 1-
Ms6/vsftpd/x/run | 14++------------
As6/vsftpd/x/setup | 7+++++++
58 files changed, 56 insertions(+), 60 deletions(-)

diff --git a/bin/service-enable b/bin/service-enable @@ -6,7 +6,8 @@ backtick -n x { dollarat -n -d - } importas name x if { rm -rf ${name} ${name}-log } if { export 1 x forbacktickx -n x { dollarat } importas x x - s6-hiercopy /etc/s6/${base}/${x} ${name} + if { s6-hiercopy /etc/s6/${base}/${x} $name } + cd $name if { test -f setup } ./setup } if { grep -qFx longrun /etc/s6/${base}/x/type } if { s6-hiercopy /etc/s6/.s6-rc/service-log ${name}-log } diff --git a/s6/ngircd-tls/josuah.net/data/conf b/s6/ngircd-tls/josuah.net/data/conf @@ -1,43 +0,0 @@ -[Global] - Name = josuah.net - AdminInfo1 = josuah - AdminInfo2 = XXX - AdminEMail = mail@josuah.net - Info = XXX - MotdFile = data/motd - Ports = 6697 - -[Limits] - MaxConnections = 128 - MaxConnectionsIP = 20 - MaxJoins = 50 - MaxNickLength = 10 - PingTimeout = 120 - PongTimeout = 120 - -[Options] - AllowedChannelTypes = #&+ - AllowRemoteOper = yes - CloakHost = %x - #CloakHostSalt = XXX - DefaultUserModes = iC - DNS = no - Ident = no - MorePrivacy = yes - OperCanUseMode = yes - OperChanPAutoOp = yes - -[SSL] - Ports = 6697 - CertFile = /etc/ssl/josuah.net/cert.pem - DHFile = /etc/ssl/dhparam.pem - KeyFile = /etc/ssl/josuah.net/privkey.pem - CipherList = AES+RSA:!SSLv3 - -[Operator] - Name = josuah - Password = XXX - Mask = josuah!XXX - -[Server] - #XXX diff --git a/s6/ngircd/josuah.net/conf/Global/AdminEMail b/s6/ngircd/josuah.net/conf/Global/AdminEMail @@ -0,0 +1 @@ +mail@josuah.net diff --git a/s6/ngircd/josuah.net/conf/Global/AdminInfo1 b/s6/ngircd/josuah.net/conf/Global/AdminInfo1 @@ -0,0 +1 @@ +josuah diff --git a/s6/ngircd/josuah.net/conf/Operator/Mask b/s6/ngircd/josuah.net/conf/Operator/Mask @@ -0,0 +1 @@ +josuah!XXX diff --git a/s6/ngircd/josuah.net/conf/Operator/Name b/s6/ngircd/josuah.net/conf/Operator/Name @@ -0,0 +1 @@ +josuah diff --git a/s6/ngircd/josuah.net/conf/Operator/Password b/s6/ngircd/josuah.net/conf/Operator/Password @@ -0,0 +1 @@ +XXX diff --git a/s6/ngircd/josuah.net/conf/Options/CloakHostSalt b/s6/ngircd/josuah.net/conf/Options/CloakHostSalt @@ -0,0 +1 @@ +XXX diff --git a/s6/ngircd/josuah.net/conf/SSL/CertFile b/s6/ngircd/josuah.net/conf/SSL/CertFile @@ -0,0 +1 @@ +/etc/ssl/josuah.net/cert.pem diff --git a/s6/ngircd/josuah.net/conf/SSL/KeyFile b/s6/ngircd/josuah.net/conf/SSL/KeyFile @@ -0,0 +1 @@ +/etc/ssl/josuah.net/privkey.pem diff --git a/s6/ngircd-tls/josuah.net/data/motd b/s6/ngircd/josuah.net/data/motd diff --git a/s6/ngircd/tls/conf/SSL/CipherList b/s6/ngircd/tls/conf/SSL/CipherList @@ -0,0 +1 @@ +ECDH+AESGCM:ECDH+CHACHA20:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS diff --git a/s6/ngircd/tls/conf/SSL/DHFile b/s6/ngircd/tls/conf/SSL/DHFile @@ -0,0 +1 @@ +/etc/ssl/dhparam.pem diff --git a/s6/ngircd/tls/conf/SSL/Ports b/s6/ngircd/tls/conf/SSL/Ports @@ -0,0 +1 @@ +6697 diff --git a/s6/ngircd/x/conf/Global/AdminInfo1 b/s6/ngircd/x/conf/Global/AdminInfo1 @@ -0,0 +1 @@ +XXX diff --git a/s6/ngircd/x/conf/Global/AdminInfo2 b/s6/ngircd/x/conf/Global/AdminInfo2 @@ -0,0 +1 @@ +XXX diff --git a/s6/ngircd/x/conf/Global/Info b/s6/ngircd/x/conf/Global/Info @@ -0,0 +1 @@ +XXX diff --git a/s6/ngircd/x/conf/Global/MotdFile b/s6/ngircd/x/conf/Global/MotdFile @@ -0,0 +1 @@ +data/motd diff --git a/s6/ngircd/x/conf/Global/Name b/s6/ngircd/x/conf/Global/Name @@ -0,0 +1 @@ +josuah.net diff --git a/s6/ngircd/x/conf/Global/Ports b/s6/ngircd/x/conf/Global/Ports @@ -0,0 +1 @@ +6697 diff --git a/s6/ngircd/x/conf/Limits/MaxConnections b/s6/ngircd/x/conf/Limits/MaxConnections @@ -0,0 +1 @@ +128 diff --git a/s6/ngircd/x/conf/Limits/MaxConnectionsIP b/s6/ngircd/x/conf/Limits/MaxConnectionsIP @@ -0,0 +1 @@ +20 diff --git a/s6/ngircd/x/conf/Limits/MaxJoins b/s6/ngircd/x/conf/Limits/MaxJoins @@ -0,0 +1 @@ +50 diff --git a/s6/ngircd/x/conf/Limits/MaxNickLength b/s6/ngircd/x/conf/Limits/MaxNickLength @@ -0,0 +1 @@ +10 diff --git a/s6/ngircd/x/conf/Limits/PingTimeout b/s6/ngircd/x/conf/Limits/PingTimeout @@ -0,0 +1 @@ +120 diff --git a/s6/ngircd/x/conf/Limits/PongTimeout b/s6/ngircd/x/conf/Limits/PongTimeout @@ -0,0 +1 @@ +120 diff --git a/s6/ngircd/x/conf/Options/AllowRemoteOper b/s6/ngircd/x/conf/Options/AllowRemoteOper @@ -0,0 +1 @@ +yes diff --git a/s6/ngircd/x/conf/Options/AllowedChannelTypes b/s6/ngircd/x/conf/Options/AllowedChannelTypes @@ -0,0 +1 @@ +#&+ diff --git a/s6/ngircd/x/conf/Options/CloakHost b/s6/ngircd/x/conf/Options/CloakHost @@ -0,0 +1 @@ +%x diff --git a/s6/ngircd/x/conf/Options/DNS b/s6/ngircd/x/conf/Options/DNS @@ -0,0 +1 @@ +no diff --git a/s6/ngircd/x/conf/Options/DefaultUserModes b/s6/ngircd/x/conf/Options/DefaultUserModes @@ -0,0 +1 @@ +iC diff --git a/s6/ngircd/x/conf/Options/Ident b/s6/ngircd/x/conf/Options/Ident @@ -0,0 +1 @@ +no diff --git a/s6/ngircd/x/conf/Options/MorePrivacy b/s6/ngircd/x/conf/Options/MorePrivacy @@ -0,0 +1 @@ +yes diff --git a/s6/ngircd/x/conf/Options/OperCanUseMode b/s6/ngircd/x/conf/Options/OperCanUseMode @@ -0,0 +1 @@ +yes diff --git a/s6/ngircd/x/conf/Options/OperChanPAutoOp b/s6/ngircd/x/conf/Options/OperChanPAutoOp @@ -0,0 +1 @@ +yes diff --git a/s6/ngircd-tls/x/run b/s6/ngircd/x/run diff --git a/s6/ngircd/x/setup b/s6/ngircd/x/setup @@ -0,0 +1,11 @@ +#!/usr/bin/env execlineb + +if { mkdir -p data } +redirfd -w 1 data/conf cd conf + +forbacktickx dir { ls } importas dir dir +if { printf "\n[%s]\n" $dir } + +forbacktickx file { ls $dir } importas file file +if { printf "\t%-20s = " $file } +cat ${dir}/${file} diff --git a/s6/ngircd-tls/x/type b/s6/ngircd/x/type diff --git a/s6/vsftpd/josuah.net/conf/rsa_cert_file b/s6/vsftpd/josuah.net/conf/rsa_cert_file @@ -0,0 +1 @@ +/etc/ssl/josuah.net/fullchain.pem diff --git a/s6/vsftpd/josuah.net/conf/rsa_private_key_file b/s6/vsftpd/josuah.net/conf/rsa_private_key_file @@ -0,0 +1 @@ +/etc/ssl/josuah.net/privkey.pem diff --git a/s6/vsftpd/josuah.net/data/rsa_cert_file b/s6/vsftpd/josuah.net/data/rsa_cert_file @@ -1 +0,0 @@ -/etc/ssl/josuah.net/chain.pem diff --git a/s6/vsftpd/x/data/allow_anon_ssl b/s6/vsftpd/tls/conf/ssl_enable diff --git a/s6/vsftpd/x/data/anonymous_enable b/s6/vsftpd/x/conf/allow_anon_ssl diff --git a/s6/vsftpd/x/data/anon_root b/s6/vsftpd/x/conf/anon_root diff --git a/s6/vsftpd/x/data/connect_from_port_20 b/s6/vsftpd/x/conf/anonymous_enable diff --git a/s6/vsftpd/x/data/listen b/s6/vsftpd/x/conf/connect_from_port_20 diff --git a/s6/vsftpd/x/data/ftp_username b/s6/vsftpd/x/conf/ftp_username diff --git a/s6/vsftpd/x/data/pasv_enable b/s6/vsftpd/x/conf/listen diff --git a/s6/vsftpd/x/data/ssl_enable b/s6/vsftpd/x/conf/pasv_enable diff --git a/s6/vsftpd/x/data/pasv_promiscuous b/s6/vsftpd/x/conf/pasv_promiscuous diff --git a/s6/vsftpd/x/env/ROOT b/s6/vsftpd/x/conf/secure_chroot_dir diff --git a/s6/vsftpd/x/data/pasv_promiscuous b/s6/vsftpd/x/conf/tcp_wrappers diff --git a/s6/vsftpd/x/data/vsftpd_log_file b/s6/vsftpd/x/conf/vsftpd_log_file diff --git a/s6/vsftpd/x/data/tcp_wrappers b/s6/vsftpd/x/data/tcp_wrappers @@ -1 +0,0 @@ -YES diff --git a/s6/vsftpd/x/env/HOST b/s6/vsftpd/x/env/HOST @@ -1 +0,0 @@ -0.0.0.0 diff --git a/s6/vsftpd/x/env/PORT b/s6/vsftpd/x/env/PORT @@ -1 +0,0 @@ -21 diff --git a/s6/vsftpd/x/run b/s6/vsftpd/x/run @@ -1,14 +1,4 @@ #!/usr/bin/env execlineb -fdmove -c 2 1 s6-envdir env multisubstitute { - importas HOST HOST - importas PORT PORT -} +fdmove -c 2 1 -# convert from data/file:content to conf:file=content -if { redirfd -w 1 conf cd data - forbacktickx x { ls } importas x x - if { printf "%s=" $x } cat $x -} - -s6-tcpserver $HOST $PORT -vsftpd conf +vsftpd data/conf diff --git a/s6/vsftpd/x/setup b/s6/vsftpd/x/setup @@ -0,0 +1,7 @@ +#!/usr/bin/env execlineb + +if { mkdir -p data } +if { redirfd -w 1 data/conf cd conf + forbacktickx x { ls } importas x x + if { printf "%s=" $x } cat $x +}