dot

packages and services management
Log | Files | Refs | README

commit 754c592044d3a15b73752ce458373658f8c033c5
parent 4a526ddad7cc663849030388635e3f5cde429258
Author: Josuah Demangeon <mail@josuah.net>
Date:   Sat, 15 Dec 2018 19:25:56 +0100

s6/kamailio: topological sort of molules for solving dependencies

Diffstat:
Cs6/kamailio/x/conf/define/DBURL -> s6/kamailio/mysql/conf/define/DBURL | 0
Rs6/kamailio/x/conf/modparam/presence/db_url -> s6/kamailio/presence/conf/modparam/presence/db_url | 0
Rs6/kamailio/x/conf/modparam/presence_xml/db_url -> s6/kamailio/presence/conf/modparam/presence_xml/db_url | 0
Rs6/kamailio/x/conf/modparam/presence_xml/force_active -> s6/kamailio/presence/conf/modparam/presence_xml/force_active | 0
Rs6/kamailio/x/conf/modparam/tls/config -> s6/kamailio/tls/conf/modparam/tls/config | 0
Ms6/kamailio/x/conf/define/DBURL | 2+-
Ms6/kamailio/x/conf/module/acc.so | 1+
Ds6/kamailio/x/conf/module/db_mysql.so | 0
Cs6/kamailio/x/conf/module/acc.so -> s6/kamailio/x/conf/module/db_text.so | 0
Ds6/kamailio/x/conf/module/presence.so | 0
Ds6/kamailio/x/conf/module/presence_xml.so | 0
Ds6/kamailio/x/conf/module/tls.so | 0
Ms6/kamailio/x/conf/module/tmx.so | 1+
Ds6/kamailio/x/conf/module/xmlrpc.so | 0
Ms6/kamailio/x/conf/route/failure_route/MANAGE_FAILURE | 1-
Ds6/kamailio/x/conf/route/route/XMLRPC | 15---------------
Ds6/kamailio/x/conf/variable/mpath | 1-
Ms6/kamailio/x/setup | 10+++++-----
As6/kamailio/x/setup-dep | 11+++++++++++
Rs6/kamailio/x/conf/modparam/xmlrpc/route -> s6/kamailio/xmlrpc/conf/modparam/xmlrpc/route | 0
Rs6/kamailio/x/conf/modparam/xmlrpc/url_match -> s6/kamailio/xmlrpc/conf/modparam/xmlrpc/url_match | 0
As6/kamailio/xmlrpc/conf/route/route/XMLRPC | 15+++++++++++++++
22 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/s6/kamailio/x/conf/define/DBURL b/s6/kamailio/mysql/conf/define/DBURL diff --git a/s6/kamailio/x/conf/modparam/presence/db_url b/s6/kamailio/presence/conf/modparam/presence/db_url diff --git a/s6/kamailio/x/conf/modparam/presence_xml/db_url b/s6/kamailio/presence/conf/modparam/presence_xml/db_url diff --git a/s6/kamailio/x/conf/modparam/presence_xml/force_active b/s6/kamailio/presence/conf/modparam/presence_xml/force_active diff --git a/s6/kamailio/x/conf/modparam/tls/config b/s6/kamailio/tls/conf/modparam/tls/config diff --git a/s6/kamailio/x/conf/define/DBURL b/s6/kamailio/x/conf/define/DBURL @@ -1 +1 @@ -"mysql://kamailio:kamailiorw@localhost/kamailio" +"text:///var/kamailio/db.txt" diff --git a/s6/kamailio/x/conf/module/acc.so b/s6/kamailio/x/conf/module/acc.so @@ -0,0 +1 @@ +tm.so diff --git a/s6/kamailio/x/conf/module/db_mysql.so b/s6/kamailio/x/conf/module/db_mysql.so diff --git a/s6/kamailio/x/conf/module/acc.so b/s6/kamailio/x/conf/module/db_text.so diff --git a/s6/kamailio/x/conf/module/presence.so b/s6/kamailio/x/conf/module/presence.so diff --git a/s6/kamailio/x/conf/module/presence_xml.so b/s6/kamailio/x/conf/module/presence_xml.so diff --git a/s6/kamailio/x/conf/module/tls.so b/s6/kamailio/x/conf/module/tls.so diff --git a/s6/kamailio/x/conf/module/tmx.so b/s6/kamailio/x/conf/module/tmx.so @@ -0,0 +1 @@ +tm.so diff --git a/s6/kamailio/x/conf/module/xmlrpc.so b/s6/kamailio/x/conf/module/xmlrpc.so diff --git a/s6/kamailio/x/conf/route/failure_route/MANAGE_FAILURE b/s6/kamailio/x/conf/route/failure_route/MANAGE_FAILURE @@ -29,4 +29,3 @@ if (t_check_status("486|408")) { exit; } #!endif -} diff --git a/s6/kamailio/x/conf/route/route/XMLRPC b/s6/kamailio/x/conf/route/route/XMLRPC @@ -1,15 +0,0 @@ -#!ifdef WITH_XMLRPC - -# allow XMLRPC from localhost -if ((method=="POST" || method=="GET") - && (src_ip==127.0.0.1)) { - # close connection only for xmlrpclib user agents (there is a bug in - # xmlrpclib: it waits for EOF before interpreting the response). - if ($hdr(User-Agent) =~ "xmlrpclib") - set_reply_close(); - set_reply_no_connect(); - dispatch_rpc(); - exit; -} -send_reply("403", "Forbidden"); -exit; diff --git a/s6/kamailio/x/conf/variable/mpath b/s6/kamailio/x/conf/variable/mpath @@ -1 +0,0 @@ -"/var/pack/pkg/kamailio/5.2.0/lib64/kamailio/modules/" diff --git a/s6/kamailio/x/setup b/s6/kamailio/x/setup @@ -1,5 +1,6 @@ #!/usr/bin/env execlineb +if { mkdir -p data /var/kamailio } redirfd -w 1 data/conf cd conf @@ -37,10 +38,9 @@ if { if { echo } - forbacktickx -n -o 0 x { ls } - importas module x - - if { echo "module ${module}" } + # resolve module dependency + pipeline { elglob -0 x * ../../setup-dep ${x} } + awk "! exist[$0]++ { print \"loadmodule \\\"\"$0\"\\\"\"; }" } if { @@ -72,6 +72,6 @@ if { if { echo } if { echo "${type}[\"${route}\"] {" } - if { sed "s/^/\t/" ${route} } + if { sed "/^#!/ ! s/^./\t&/" ${route} } if { echo "}" } } diff --git a/s6/kamailio/x/setup-dep b/s6/kamailio/x/setup-dep @@ -0,0 +1,11 @@ +#!/usr/bin/env execlineb +elgetpositionals + +forx -o 0 x { ${@} } +importas module x + +redirfd -r 0 ${module} +withstdinas x +importas -s -d "\n" dependencies x +if { ../../setup-dep ${dependencies} } +echo ${module} diff --git a/s6/kamailio/x/conf/modparam/xmlrpc/route b/s6/kamailio/xmlrpc/conf/modparam/xmlrpc/route diff --git a/s6/kamailio/x/conf/modparam/xmlrpc/url_match b/s6/kamailio/xmlrpc/conf/modparam/xmlrpc/url_match diff --git a/s6/kamailio/xmlrpc/conf/route/route/XMLRPC b/s6/kamailio/xmlrpc/conf/route/route/XMLRPC @@ -0,0 +1,15 @@ +# XMLRPC routing + +# allow XMLRPC from localhost +if ((method=="POST" || method=="GET") + && (src_ip==127.0.0.1)) { + # close connection only for xmlrpclib user agents (there is a bug in + # xmlrpclib: it waits for EOF before interpreting the response). + if ($hdr(User-Agent) =~ "xmlrpclib") + set_reply_close(); + set_reply_no_connect(); + dispatch_rpc(); + exit; +} +send_reply("403", "Forbidden"); +exit;