diff --git a/sympa/doc/installation.md b/sympa/doc/installation.md index cd4253a..7299f27 100644 --- a/sympa/doc/installation.md +++ b/sympa/doc/installation.md @@ -1,113 +1,8 @@ -sympa on debian 12 +sympa on debian 13 ================== -DOC: -https://www.sympa.community/manual/install/install-sympa-distribution-debian.html -https://wiki.evolix.org/HowtaptoSympa - -USE OF: postfix + postgresql + ... - -## Nginx + fastcgi (recommended!) + NON-INTERACTIVE - -```bash -# postfix -debconf-set-selections < /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! -``` - -## after any sympa change! - -* systemctl restart wwsympa.socket - - -## Apache2 + fcgi (deprecated, see nginx below) - -Rk: replace {{PUBLIC_URL}} and {{LISTMASTER}} according to your needs! -``` -PUBLIC_URL=listes.artcode.re -LISTMASTER=pvincent@artcode.re -``` - -* apt install -y postfix postgresql apache2 libapache2-mod-fcgid spawn-fcgi - * domain: {{PUBLIC_URL}} -* apt install -y sympa - * db: postgresql - * pass: sympa - * web: apache2 - * setuid: no -* editor /etc/sympa/sympa/sympa.conf - * listmaster: {{LISTMASTER}} - * lang: fr - * wwsympa_url: http://{{PUBLIC_URL}}/wws -* a2enmod rewrite proxy_fcgi -* editor /etc/apache2/sites-available/sympa.conf - ``` - - ServerName {{PUBLIC_URL}} - RewriteEngine On - RewriteRule ^/$ /wws [R] - - SetHandler "proxy:unix:/run/sympa/wwsympa.socket|fcgi://localhost" - Require all granted - - - ``` -* a2dissite 000-default.conf -* a2ensite sympa.conf -* systemctl restart apache2 sympa +TODO: build script install_sympa_for_domain +* hostname: listes.rdq43.fr +* net0: name=eth0,bridge=vmbr0,firewall=1,gw=51.89.25.254,hwaddr=02:00:00:49:ea:6d,ip=51.89.25.216/32,type=veth +* listes2.artcode.re diff --git a/sympa/miaou/miaou-install-from-import-sympa b/sympa/miaou/miaou-install-from-import-sympa index 97c36f4..d132649 100755 --- a/sympa/miaou/miaou-install-from-import-sympa +++ b/sympa/miaou/miaou-install-from-import-sympa @@ -47,10 +47,11 @@ function install_fake_additional { miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_ldap_auth_remote.recipe } -function fix_entries { - echo 'fix entries global on...' +function fix_configuration_entries { + echo 'fix configuration entries...' miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_fix_dkim_dmarc.recipe miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_fix_external_origin.recipe + miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_fix_personalization.recipe } function import { @@ -75,6 +76,6 @@ parse_options $* install import -fix_entries +fix_configuration_entries install_fake_additional diff --git a/sympa/recipe/sympa_fix_personalization.recipe b/sympa/recipe/sympa_fix_personalization.recipe new file mode 100644 index 0000000..0fe4278 --- /dev/null +++ b/sympa/recipe/sympa_fix_personalization.recipe @@ -0,0 +1,30 @@ +#!/usr/bin/env miaou-recipe + +# CONSTANTS + +GLOBAL_CONF=/etc/sympa/sympa/sympa.conf +LIST_DATA_DIR=/var/lib/sympa/list_data +FOUND=false + +# FUNCTIONS + +function fix_personalization { + if ! grep -q "^personalization_feature.*\*$" $GLOBAL_CONF; then + /opt/miaou-bash/tools/append_or_replace '^personalization_feature.*$' 'personalization_feature on' $GLOBAL_CONF + /opt/miaou-bash/tools/append_or_replace '^personalization.mail_apply_on.*$' 'personalization.mail_apply_on footer' $GLOBAL_CONF + echo 'personalization now enabled' + FOUND=true + else + echo 'personalization already enabled globally!' + fi +} + +function restart_services { + $FOUND && systemctl restart sympa wwsympa.socket || true +} + +# MAIN + +set -Eue +fix_personalization +restart_services