You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
60 lines
1.6 KiB
60 lines
1.6 KiB
#!/usr/bin/env bash
|
|
|
|
# postfix
|
|
debconf-set-selections <<EOF
|
|
postfix postfix/mailname string $(hostname -f)
|
|
postfix postfix/main_mailer_type string 'Internet Site'
|
|
postfix postfix/mynetworks string '127.0.0.0/8'
|
|
EOF
|
|
DEBIAN_FRONTEND=noninteractive apt install -y postfix postgresql nginx fcgiwrap perl-doc micro debconf-utils
|
|
postconf -e "inet_protocols = ipv4"
|
|
systemctl restart postfix
|
|
|
|
# sympa
|
|
listmasters="pvincent@artcode.re,jnoel@mithril.re"
|
|
[[ $(hostname -d) == *.* ]] && listmasters+=",listmaster@$(hostname -d)" || true
|
|
debconf-set-selections <<EOF
|
|
sympa wwsympa/webserver_type select 'Other'
|
|
sympa sympa/database-type string pgsql
|
|
sympa sympa/db_host string localhost
|
|
sympa sympa/db_name string sympa
|
|
sympa sympa/db_user string sympa
|
|
sympa sympa/db_pass password sympa
|
|
sympa sympa/language select fr
|
|
sympa sympa/listmaster string $listmasters
|
|
EOF
|
|
DEBIAN_FRONTEND=noninteractive apt install -y sympa
|
|
systemctl disable sympasoap.{socket,service}
|
|
systemctl stop sympasoap.{socket,service}
|
|
|
|
# nginx
|
|
cat <<EOF >/etc/nginx/sites-available/sympa.conf
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
rewrite ^/$ /wws permanent;
|
|
|
|
location /wws {
|
|
include fastcgi_params;
|
|
fastcgi_param SERVER_NAME $(hostname -f);
|
|
fastcgi_pass unix:/run/sympa/wwsympa.socket;
|
|
}
|
|
|
|
location /static-sympa {
|
|
alias /usr/share/sympa/static_content;
|
|
}
|
|
|
|
location /css-sympa {
|
|
alias /var/lib/sympa/css;
|
|
}
|
|
|
|
location /pictures-sympa {
|
|
alias /var/lib/sympa/pictures;
|
|
}
|
|
}
|
|
EOF
|
|
cd /etc/nginx/sites-enabled && rm -f default && ln -sf ../sites-available/sympa.conf && cd
|
|
systemctl reload nginx
|
|
|
|
# final word
|
|
echo Sympa successfully installed!
|