Support of SOAP server
This commit is contained in:
parent
f248a5c7cf
commit
c41e0eb961
10
Dockerfile
10
Dockerfile
|
@ -2,6 +2,7 @@ FROM debian:buster
|
|||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
ENV RUNLEVEL=1
|
||||
ENV PERL_MM_USE_DEFAULT=1
|
||||
|
||||
RUN echo exit 0 > /usr/sbin/policy-rc.d && \
|
||||
chmod +x /usr/sbin/policy-rc.d
|
||||
|
@ -30,6 +31,8 @@ RUN apt update && \
|
|||
sympa && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN cpan install SOAP::Lite
|
||||
|
||||
COPY rsyslog.d /etc/rsyslog.d
|
||||
|
||||
COPY sympa.conf.template /etc/sympa/sympa/sympa.conf.template
|
||||
|
@ -54,6 +57,7 @@ COPY list_aliases.tt2 /etc/sympa/list_aliases.tt2
|
|||
COPY transport.sympa.template /etc/sympa/transport.sympa.template
|
||||
COPY virtual.sympa.template /etc/sympa/virtual.sympa.template
|
||||
COPY robot.conf.template /etc/sympa/robot.conf.template
|
||||
COPY trusted_applications.conf.template /etc/sympa/trusted_applications.conf.template
|
||||
COPY nginx.conf.template /etc/nginx/site.conf.template
|
||||
|
||||
RUN mkdir /etc/sympa/transport && \
|
||||
|
@ -63,6 +67,9 @@ RUN mkdir /etc/sympa/transport && \
|
|||
COPY wwsympa /etc/init.d/wwsympa
|
||||
RUN chmod +x /etc/init.d/wwsympa
|
||||
|
||||
COPY sympasoap /etc/init.d/sympasoap
|
||||
RUN chmod +x /etc/init.d/sympasoap
|
||||
|
||||
RUN touch /etc/sympa/transport.sympa \
|
||||
/etc/sympa/virtual.sympa && \
|
||||
chown sympa:sympa /etc/sympa/*.sympa
|
||||
|
@ -81,6 +88,7 @@ EXPOSE 25 80 465
|
|||
VOLUME /var/lib/sympa \
|
||||
/var/spool/sympa \
|
||||
/etc/sympa/robots \
|
||||
/etc/sympa/transport
|
||||
/etc/sympa/transport \
|
||||
/etc/sympa/trusted_applications
|
||||
|
||||
ENV DOMAINS="localhost"
|
||||
|
|
|
@ -21,6 +21,9 @@ do
|
|||
[[ -f /etc/sympa/robots/$domain.conf ]] || cat /etc/sympa/robot.conf.template | sed "s/{{MAILING_LIST_DOMAIN}}/$domain/g" > /etc/sympa/robots/$domain.conf
|
||||
[[ -f /etc/sympa/$domain/robot.conf ]] || ln -s /etc/sympa/robots/$domain.conf /etc/sympa/$domain/robot.conf
|
||||
chown -R sympa:sympa /etc/sympa/$domain /etc/sympa/robots
|
||||
[[ -f /etc/sympa/trusted_applications/$domain.conf ]] || cat /etc/sympa/trusted_applications.conf.template | sed "s/{{MAILING_LIST_DOMAIN}}/$domain/g" > /etc/sympa/trusted_applications/$domain.conf
|
||||
[[ -f /etc/sympa/$domain/trusted_applications.conf ]] || ln -s /etc/sympa/trusted_applications/$domain.conf /etc/sympa/$domain/trusted_applications.conf
|
||||
chown -R sympa:sympa /etc/sympa/$domain /etc/sympa/robots
|
||||
[[ -d /var/lib/sympa/list_data/$domain ]] || mkdir -m 0750 -p /var/lib/sympa/list_data/$domain
|
||||
chown -R sympa:sympa /var/lib/sympa/list_data/$domain
|
||||
cat /etc/sympa/transport.sympa.template | sed "s/{{MAILING_LIST_DOMAIN}}/$domain/g" >> /etc/sympa/transport.sympa
|
||||
|
@ -47,5 +50,6 @@ service postfix reload
|
|||
/usr/lib/sympa/bin/sympa_newaliases.pl
|
||||
service sympa restart
|
||||
service wwsympa restart
|
||||
service sympasoap restart
|
||||
|
||||
nginx -g "daemon off;"
|
||||
|
|
|
@ -11,6 +11,13 @@ server {
|
|||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
|
||||
location /sympasoap {
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_pass unix:/run/sympa/sympasoap.socket;
|
||||
fastcgi_split_path_info ^(/sympasoap)(.*)$;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
}
|
||||
|
||||
location /static-sympa {
|
||||
alias /usr/share/sympa/static_content;
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
wwsympa_url https://{{MAILING_LIST_DOMAIN}}/sympa
|
||||
soap_url https://{{MAILING_LIST_DOMAIN}}/sympasoap
|
||||
|
|
|
@ -0,0 +1,170 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# sympasoap Sympa Web Interface
|
||||
#
|
||||
# Written by IKEDA Soji 2011-10-20
|
||||
#
|
||||
# chkconfig: 345 95 05
|
||||
# description: sympa is a powerful mailing lists management system.
|
||||
|
||||
if [ -f /etc/rc.d/init.d/functions ]; then
|
||||
# Source function library.
|
||||
. /etc/rc.d/init.d/functions
|
||||
|
||||
## Set a flag
|
||||
use_functions=1
|
||||
fi
|
||||
|
||||
# SympaSoap parameters
|
||||
# SympaSoap binaries directory
|
||||
sympafcgidir="/usr/lib/cgi-bin/sympa"
|
||||
|
||||
# Sympa config files directory
|
||||
sympaconf="/etc/sympa/sympa/sympa.conf"
|
||||
|
||||
FCGI_CHILDREN=5
|
||||
FCGI_USER=sympa
|
||||
FCGI_GROUP=sympa
|
||||
FCGI_PID_DIR=/var/run/sympa
|
||||
FCGI_OPTS='-s /var/run/sympa/sympasoap.socket -M 0600 -U www-data'
|
||||
if [ -e /etc/sysconfig/sympa ]; then
|
||||
. /etc/sysconfig/sympa
|
||||
fi
|
||||
|
||||
# Current state of SympaSoap
|
||||
sympasoap_status() {
|
||||
if [ ${use_functions} ]; then
|
||||
status sympasoap
|
||||
else
|
||||
if [ -f ${FCGI_PID_DIR}/sympasoap.pid ]; then
|
||||
pid=`cat ${FCGI_PID_DIR}/sympasoap.pid` # | perl -pe0777 'chomp $_; s/\s+/|/g'`
|
||||
if [ "$pid" != "" ]; then
|
||||
running=`ps -A | egrep "$pid"`
|
||||
if [ "$running" != "" ]; then
|
||||
echo "$1 (pid(s) $pid) is active..."
|
||||
return 0
|
||||
else
|
||||
echo "$1 died, pid file remains."
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
echo "$1 is stopped."
|
||||
return 3
|
||||
fi
|
||||
}
|
||||
|
||||
# Start SympaSoap
|
||||
sympasoap_start() {
|
||||
sympasoap_status > /dev/null
|
||||
rc=$?
|
||||
case "$rc" in
|
||||
3)
|
||||
echo -n "Starting sympasoap: "
|
||||
;;
|
||||
1)
|
||||
echo -n "Starting sympasoap, overwriting old pid file."
|
||||
;;
|
||||
0)
|
||||
echo "SympaSoap seems active. No action will be taken."
|
||||
echo "Try \"sympasoap status\" or \"sympasoap restart"\".
|
||||
return
|
||||
esac
|
||||
|
||||
/usr/bin/spawn-fcgi -F ${FCGI_CHILDREN} -P ${FCGI_PID_DIR}/sympasoap.pid \
|
||||
-u ${FCGI_USER} -g ${FCGI_GROUP} ${FCGI_OPTS} -- \
|
||||
${sympafcgidir}/sympa_soap_server.fcgi
|
||||
}
|
||||
|
||||
# Stop SympaSoap
|
||||
sympasoap_stop() {
|
||||
if [ -f ${FCGI_PID_DIR}/sympasoap.pid ]; then
|
||||
runcount=0
|
||||
pids=`cat ${FCGI_PID_DIR}/sympasoap.pid`
|
||||
if [ "$pids" != "" ]; then
|
||||
for pid in "$pids"; do
|
||||
killcount=0
|
||||
running=`ps -A | grep "$pid ..* sympasoap"`
|
||||
while [ "$running" != "" ]; do
|
||||
if [ $killcount -gt 10 ]; then
|
||||
if [ ${use_functions} ]; then
|
||||
failure
|
||||
else
|
||||
echo 'failure'
|
||||
fi
|
||||
return 3
|
||||
fi
|
||||
|
||||
kill -TERM $pid >/dev/null 2>&1
|
||||
running=`ps -A | grep "$pid ..* $1\\.pl"`
|
||||
if [ "$running" = "" ]; then
|
||||
runcount=`expr $runcount + 1`
|
||||
break
|
||||
fi
|
||||
sleep 2
|
||||
running=`ps -A | grep "$pid ..* $1\\.pl"`
|
||||
if [ "$running" = "" ]; then
|
||||
runcount=`expr $runcount + 1`
|
||||
break
|
||||
fi
|
||||
killcount=`expr $killcount + 1`
|
||||
done
|
||||
done
|
||||
fi
|
||||
if [ $runcount -gt 0 ]; then
|
||||
if [ ${use_functions} ]; then
|
||||
success
|
||||
else
|
||||
echo 'success'
|
||||
fi
|
||||
else
|
||||
echo 'died'
|
||||
fi
|
||||
echo
|
||||
else
|
||||
echo "Module $1.pl not running"
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
# Check config files
|
||||
[ -d $sympafcgidir ] || exit 0
|
||||
[ -f $sympaconf ] || exit 0
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start)
|
||||
if [ ! -f /var/lock/sympasoap ]; then
|
||||
echo "Starting SympaSoap: "
|
||||
sympasoap_start
|
||||
touch /var/lock/sympasoap
|
||||
echo
|
||||
else
|
||||
echo "SympaSoap seems active. No action will be taken."
|
||||
echo "Try \"sympasoap status\" or \"sympasoap restart"\".
|
||||
fi
|
||||
;;
|
||||
stop)
|
||||
echo "Stopping SympaSoap: "
|
||||
sympasoap_stop
|
||||
if [ -f /var/lock/sympasoap ]; then
|
||||
rm -f /var/lock/sympasoap
|
||||
fi
|
||||
;;
|
||||
status)
|
||||
echo "Status of SympaSoap: "
|
||||
sympasoap_status
|
||||
;;
|
||||
restart)
|
||||
echo "Restarting SympaSoap: "
|
||||
$0 stop && $0 start
|
||||
echo
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
## trusted_application
|
||||
## name example
|
||||
## md5password f80904e6cc6e2a51480c74ad44d37ec9 # sympasoap
|
||||
## proxy_for_variables user_email,remote_host
|
Loading…
Reference in New Issue