dot

packages and services management
Log | Files | Refs | README

commit 868b32c57719e1593944add6ec7ce0e53c09612c
parent e95ddbdb46bdf07d366f6528adce13d3b3be7328
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sun,  9 Dec 2018 16:22:53 +0100

re-organize the hirarchy

Diffstat:
Ms6/.s6-rc/service-log/run | 6++++--
Ds6/baresip/iptel.org/accounts/josuah@iptel.org | 0
As6/baresip/iptel.org/accounts/sip:josuah@iptel.org/auth_user | 1+
As6/baresip/iptel.org/accounts/sip:josuah@iptel.org/medianat | 1+
As6/baresip/iptel.org/accounts/sip:josuah@iptel.org/outbound | 1+
As6/baresip/iptel.org/accounts/sip:josuah@iptel.org/stunserver | 1+
Ds6/baresip/linphone.org/accounts/josuah@sip.linphone.org | 1-
As6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/medianat | 1+
As6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/stunserver | 1+
As6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/transport | 1+
As6/baresip/x/README.accounts | 58++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
As6/baresip/x/README.config | 164+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
As6/baresip/x/README.contacts | 11+++++++++++
Rs6/baresip/x/contacts/echo@creytiv.com -> s6/baresip/x/contacts/sip:echo@creytiv.com | 0
Rs6/baresip/x/contacts/sip904@mouselike.org -> s6/baresip/x/contacts/sip:sip904@mouselike.org | 0
Ds6/baresip/x/module/x | 4----
Ds6/baresip/x/module_app/x | 3---
Ds6/baresip/x/module_tmp/x | 0
As6/baresip/x/modules/x | 11+++++++++++
Ms6/baresip/x/run | 2+-
Ms6/baresip/x/setup | 35+++++++++++++++++------------------
Ms6/host/t470s/contents | 10+++++-----
22 files changed, 278 insertions(+), 34 deletions(-)

diff --git a/s6/.s6-rc/service-log/run b/s6/.s6-rc/service-log/run @@ -1,6 +1,8 @@ #!/usr/bin/env execlineb -fdmove -c 2 1 s6-envdir env multisubstitute { +fdmove -c 2 1 +s6-envdir env +multisubstitute { importas SERVICE SERVICE } -s6-log -bp -- t /var/log/$SERVICE +s6-log -b t /var/log/$SERVICE diff --git a/s6/baresip/iptel.org/accounts/josuah@iptel.org b/s6/baresip/iptel.org/accounts/josuah@iptel.org diff --git a/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/auth_user b/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/auth_user @@ -0,0 +1 @@ +josuah diff --git a/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/medianat b/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/medianat @@ -0,0 +1 @@ +ice diff --git a/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/outbound b/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/outbound @@ -0,0 +1 @@ +sip:iptel.org diff --git a/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/stunserver b/s6/baresip/iptel.org/accounts/sip:josuah@iptel.org/stunserver @@ -0,0 +1 @@ +stun:stun.iptel.org:3478 diff --git a/s6/baresip/linphone.org/accounts/josuah@sip.linphone.org b/s6/baresip/linphone.org/accounts/josuah@sip.linphone.org @@ -1 +0,0 @@ -transport=tls;medianat=ice;stunserver="stun:josuah@stun.linphone.org" diff --git a/s6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/medianat b/s6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/medianat @@ -0,0 +1 @@ +ice diff --git a/s6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/stunserver b/s6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/stunserver @@ -0,0 +1 @@ +stun:josuah@stun.linphone.org diff --git a/s6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/transport b/s6/baresip/linphone.org/accounts/sip:josuah@sip.linphone.org/transport @@ -0,0 +1 @@ +tls diff --git a/s6/baresip/x/README.accounts b/s6/baresip/x/README.accounts @@ -0,0 +1,58 @@ +# +# SIP accounts - one account per line -- sample configuration +# +# Displayname <sip:user:password@domain;uri-params>;addr-params +# +# uri-params: +# ;transport={udp,tcp,tls} +# +# addr-params: +# ;answermode={manual,early,auto} +# ;audio_codecs=opus/48000/2,pcma,... +# ;auth_user=username +# ;mediaenc={srtp,srtp-mand,srtp-mandf,dtls_srtp,zrtp} +# ;medianat={stun,turn,ice} +# ;outbound="sip:primary.example.com;transport=tcp" +# ;outbound2=sip:secondary.example.com +# ;ptime={10,20,30,40,...} +# ;regint=3600 +# ;pubint=0 (publishing off) +# ;regq=0.5 +# ;rtpkeep={zero,stun,dyna,rtcp} +# ;sipnat={outbound} +# ;stunserver=stun:[user:pass]@host[:port] +# ;video_codecs=h264,h263,... +# +# Examples: +# +# <sip:user:secret@domain.com;transport=tcp> +# <sip:user:secret@1.2.3.4;transport=tcp> +# <sip:user:secret@[2001:df8:0:16:216:6fff:fe91:614c]:5070;transport=tcp> +# + + +# +# A very basic example +# +<sip:user@iptel.org> + + +# +# Use SIP Outbound over TCP, with ICE for Media NAT Traversal, and DTLS-SRTP for encryption +# +<sip:user@example.com>;sipnat=outbound;outbound="sip:example.com;transport=tcp";medianat=ice;mediaenc=dtls_srtp;auth_pass=pass + + +# +# Use ICE for Media NAT Traversal, using a specific STUN-server +# +<sip:user@example.com>;medianat=ice;stunserver="stun:username:password@stunserver.org";auth_pass=pass + + +# +# Force audio-codec 'opus' and video-codec 'vp8' +# +<sip:user@example.com>;audio_codecs=opus/48000/2;video_codecs=vp8;auth_pass=pass + + +# ... more examples can be added here ... diff --git a/s6/baresip/x/README.config b/s6/baresip/x/README.config @@ -0,0 +1,164 @@ +# +# baresip configuration -- example for linux +# + +#------------------------------------------------------------------------------ + +# Core +poll_method epoll # poll, select, epoll .. + +# SIP +sip_trans_bsize 128 +#sip_listen 0.0.0.0:5060 +#sip_certificate cert.pem + +# Audio +audio_player alsa,default +audio_source alsa,default +audio_alert alsa,default +#ausrc_srate 48000 +#auplay_srate 48000 +#ausrc_channels 0 +#auplay_channels 0 + +# Video +#video_source v4l2,/dev/video0 +#video_display x11,nil +video_size 352x288 +video_bitrate 512000 +video_fps 25 + +# AVT - Audio/Video Transport +rtp_tos 184 +#rtp_ports 10000-20000 +#rtp_bandwidth 512-1024 # [kbit/s] +rtcp_enable yes +rtcp_mux no +jitter_buffer_delay 5-10 # frames +rtp_stats no + +# Network +#dns_server 10.0.0.1:53 +#net_interface wlan1 + +# BFCP +#bfcp_proto udp + +#------------------------------------------------------------------------------ +# Modules + +#module_path /usr/local/lib/baresip/modules + +# UI Modules +module stdio.so +#module cons.so +#module evdev.so +#module httpd.so + +# Audio codec Modules (in order) +module opus.so +#module silk.so +#module amr.so +#module g7221.so +#module g722.so +#module g726.so +module g711.so +#module gsm.so +#module l16.so +#module bv32.so + +# Audio filter Modules (in encoding order) +#module vumeter.so +#module sndfile.so +#module speex_aec.so +#module speex_pp.so +#module plc.so + +# Audio driver Modules +module alsa.so +#module portaudio.so + +# Video codec Modules (in order) +module avcodec.so +module vpx.so + +# Video filter Modules (in encoding order) +#module selfview.so + +# Video source modules +#module v4l.so +module v4l2.so +#module avformat.so +#module x11grab.so +#module cairo.so + +# Video display modules +module x11.so +#module sdl2.so + +# Audio/Video source modules +#module rst.so +#module gst.so + +# Media NAT modules +module stun.so +module turn.so +module ice.so +#module natpmp.so + +# Media encryption modules +#module srtp.so +module dtls_srtp.so + + +#------------------------------------------------------------------------------ +# Temporary Modules (loaded then unloaded) + +module_tmp uuid.so +module_tmp account.so + + +#------------------------------------------------------------------------------ +# Application Modules + +module_app auloop.so +module_app contact.so +module_app menu.so +#module_app mwi.so +#module_app natbd.so +#module_app presence.so +#module_app syslog.so +module_app vidloop.so +#module_app gtk.so + + +#------------------------------------------------------------------------------ +# Module parameters + + +cons_listen 0.0.0.0:5555 + +evdev_device /dev/input/event0 + +# Opus codec parameters +opus_bitrate 28000 # 6000-510000 + +# NAT Behavior Discovery +natbd_server creytiv.com +natbd_interval 600 # in seconds + +# Selfview +video_selfview window # {window,pip} +#selfview_size 64x64 + +# ICE +ice_turn no +ice_debug no +ice_nomination regular # {regular,aggressive} +ice_mode full # {full,lite} + +# ZRTP +#zrtp_hash no # Disable SDP zrtp-hash (not recommended) + +# sndfile # +snd_path /tmp/ diff --git a/s6/baresip/x/README.contacts b/s6/baresip/x/README.contacts @@ -0,0 +1,11 @@ +# +# SIP contacts +# +# Displayname <sip:user@domain>;addr-params +# +# addr-params: +# ;presence={none,p2p} +# + +"Echo Server" <sip:echo@creytiv.com> +"alfredh" <sip:alfredh@home>;presence=p2p diff --git a/s6/baresip/x/contacts/echo@creytiv.com b/s6/baresip/x/contacts/sip:echo@creytiv.com diff --git a/s6/baresip/x/contacts/sip904@mouselike.org b/s6/baresip/x/contacts/sip:sip904@mouselike.org diff --git a/s6/baresip/x/module/x b/s6/baresip/x/module/x @@ -1,4 +0,0 @@ -cons.so -stun.so -turn.so -ice.so diff --git a/s6/baresip/x/module_app/x b/s6/baresip/x/module_app/x @@ -1,3 +0,0 @@ -auloop.so -contact.so -menu.so diff --git a/s6/baresip/x/module_tmp/x b/s6/baresip/x/module_tmp/x diff --git a/s6/baresip/x/modules/x b/s6/baresip/x/modules/x @@ -0,0 +1,11 @@ +module cons.so + +module stun.so +module turn.so +module ice.so + +module account.so + +module_app auloop.so +module_app contact.so +module_app menu.so diff --git a/s6/baresip/x/run b/s6/baresip/x/run @@ -1,4 +1,4 @@ #!/usr/bin/env execlineb fdmove -c 2 1 -baresip -f data +baresip -v -f data diff --git a/s6/baresip/x/setup b/s6/baresip/x/setup @@ -9,13 +9,11 @@ if { forbacktickx -n -o 0 x { ls contacts } importas contact x - backtick -n x { sed -n "1p" contacts/${contact} } + redirfd -r 0 contacts/${contact} + withstdinas -n x importas comment x - backtick -n x { sed -n "2p" contacts/${contact} } - importas value x - - printf "\"%s\" <sip:%s>;%s\n" ${comment} ${contact} ${value} + echo "\"${comment}\" ${contact}" } # accounts @@ -25,11 +23,19 @@ if { forbacktickx -n -o 0 x { ls accounts } importas account x - redirfd -r 0 accounts/${account} - withstdinas x + if { redirfd -w 1 accounts/${account}/auth_pass pass sip/${account} } + + ifte { echo } { exit 1 } + if { printf "<%s>" ${account} } + + forbacktickx -n -o 0 x { ls accounts/${account} } + importas var x + + redirfd -r 0 accounts/${account}/${var} + withstdinas -n x importas value x - printf "<sip:%s>;%s\n" ${account} ${value} + printf ";%s=%s" ${var} ${value} } redirfd -w 1 data/config @@ -48,16 +54,9 @@ if { # modules if { - forx -o 0 x { module module_tmp module_app } - importas type x - - backtick x { ls ${type} } + backtick x { ls modules } importas -s -d "\n" lists x - if { echo } - - forbacktickx -d "\n" -o 0 x { sed "s/#.*//; s/ *$//; /^$/d" ${type}/${lists} } - importas -n module.so x - - printf "%-20s %s\n" ${type} ${module.so} + if { echo } + sed "s/#.*//; s/ *$//; /^$/d" modules/${lists} } diff --git a/s6/host/t470s/contents b/s6/host/t470s/contents @@ -1,10 +1,10 @@ dirmngr,josuah -dirmngr,root +pjsua,iptel.org gpg-agent,josuah +tor +ssh-agent,josuah +dirmngr,root +baresip,iptel.org gpg-agent,root qmail-send -ssh-agent,josuah ssh-agent,root -tinysshd -tor -vtund,client,josuah.net,glaphyrae