Skip to content
Snippets Groups Projects
Verified Commit 7e110550 authored by David Beniamine's avatar David Beniamine
Browse files

Initial commit

parents
No related branches found
No related tags found
No related merge requests found
SYMPA_DOMAIN=localhost
SYMPA_LISTMASTER=user@example.org
SYMPA_LANG=fr
SYMPA_DB_TYPE=PostgreSQL
SYMPA_DB_HOST=pgsql
SYMPA_DB_PORT=5432
SYMPA_DB_NAME=sympa
SYMPA_DB_USER=sympa
SYMPA_DB_PASSWD=random
SYMPA_WWSYMPA_URL=http://localhost/wws
.sw?
# Sympa docker
## WIP notice
This image is a Work In Progress and should only be used for testing purposes.
For now only the web interface and SOAP API have been tested.
This image should be combined with a postfix container to actually send mail, this part and the list_configuration have not been tested / documented yet
# Installation
1. Copy `.env.sample` to `.env` and adapt
2. `docker-compose up --build`
3. Go to `localhost:8081/wws` try to login and click first_login
4. If you have not configured the sendmail part of postfix, you can find a mail with your login informations in `/var/spool/sympa/bulk/msg`
version: "3"
services:
sympa:
build: ./docker
restart: always
volumes:
- "sympaetc:/etc/sympa"
links:
- pgsql
environment:
SYMPA_DOMAIN:
SYMPA_LISTMASTER:
SYMPA_LANG:
SYMPA_WWSYMPA_URL:
SYMPA_DB_TYPE:
SYMPA_DB_HOST:
SYMPA_DB_PORT:
SYMPA_DB_NAME:
SYMPA_DB_USER:
SYMPA_DB_PASSWD:
ports:
- '8081:80'
pgsql:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: ${SYMPA_DB_PASSWD}
POSTGRES_USER: ${SYMPA_DB_USER}
volumes:
- "pgdata:/var/lib/postgresql/data"
volumes:
pgdata:
sympaetc:
FROM debian:buster
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get -y update && apt-get -y upgrade
RUN apt-get -y install \
apache2 \
inetutils-syslogd \
libapache2-mod-fcgid \
libdbd-pg-perl \
libfcgi-perl \
sudo
RUN apt-get -y install --no-install-recommends sympa
RUN a2enconf sympa-soap
RUN a2enconf sympa
RUN touch /var/log/sympa.log && chown sympa:sympa /var/log/sympa.log && chmod 640 /var/log/sympa.log
RUN echo "local1.* -/var/log/sympa.log" >> /etc/syslog.conf
RUN cp -r /etc/sympa /etc/sympa.sample
COPY entrypoint.sh /entrypoint
ENTRYPOINT /entrypoint
#!/bin/bash
# Populate volume
if [ -z "$(ls /etc/sympa/)" ]; then
cp -pr /etc/sympa.sample/* /etc/sympa/
fi
# Replace configurations by env
conf_file=/etc/sympa/sympa/sympa.conf
for var in $(env | grep '^SYMPA'); do
config=$(echo $var | sed 's/^SYMPA_\([^=]*\).*/\L\1/')
value=$(echo $var | sed 's/^[^=]*=\(.*\)/\1/')
sed -i -e "s#^$config\t.*#$config\t$value#" $conf_file
if [ -z "$(grep "^$config" $conf_file)" ];
then
echo -e "$config\t$value" >> $conf_file
fi
done
# Fix permissions
chown -R sympa:sympa /etc/sympa/
/bin/mkdir -p /run/sympa
/bin/chown sympa:sympa /run/sympa
# Launch services
syslogd
sudo -u sympa /usr/lib/sympa/bin/sympa_msg.pl
/usr/bin/sympa --health_check
exec apache2ctl -DFOREGROUND
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment