From 95c9c42aaa16a87879ce5b06e20b80a254a5b6a1 Mon Sep 17 00:00:00 2001 From: pvincent Date: Sun, 16 Nov 2025 12:49:38 +0400 Subject: [PATCH] install sympa from scratch --- sympa/bin/apply_auth_remote_ssh.bash | 8 +- sympa/bin/import.bash | 4 +- sympa/doc/custom_cemea.md | 11 ++- sympa/doc/install.md | 114 ++++++++++++++++----------- sympa/doc/migration.md | 27 +++++-- 5 files changed, 102 insertions(+), 62 deletions(-) diff --git a/sympa/bin/apply_auth_remote_ssh.bash b/sympa/bin/apply_auth_remote_ssh.bash index da65e87..3255b61 100644 --- a/sympa/bin/apply_auth_remote_ssh.bash +++ b/sympa/bin/apply_auth_remote_ssh.bash @@ -1,12 +1,12 @@ #!/usr/bin/env bash # changes in /etc/sympa/auth.conf -sed -i 's/.*host 192.168.1.254:389.*/ host 127.0.0.1:389 # remote connection through SSH/' /etc/sympa/auth.conf +sed -i 's/.*host 192.168.1.254:389.*/ host 127.0.0.1:3890 # remote connection through SSH/' /etc/sympa/auth.conf # start SSH port translation if needed -if ! ss -tln | grep -q 127.0.0.1:389; then - ssh -fN listes.artcode.re -L 389:192.168.1.254:389 - echo 'SSH port translation 389 is now active!' +if ! ss -tln | grep -q 127.0.0.1:3890; then + ssh -fN listes.artcode.re -L 3890:192.168.1.254:389 + echo 'SSH port translation 3890 is now active!' systemctl restart wwsympa.socket else echo 'SSH already enabled!' diff --git a/sympa/bin/import.bash b/sympa/bin/import.bash index bfe7d59..eae544d 100644 --- a/sympa/bin/import.bash +++ b/sympa/bin/import.bash @@ -39,7 +39,7 @@ function import_database { echo -n "import database $DB_NAME..." sudo -u postgres dropdb "$DB_NAME" 2>/dev/null sudo -u postgres createdb -O "$DB_USER" "$DB_NAME" 2>/dev/null - gunzip "$export_tmp"/database.psql.gz | PGPASSWORD="$DB_PASS" psql -h localhost -U "$DB_USER" "$DB_NAME" + gunzip -c "$export_tmp"/database.psql.gz | PGPASSWORD="$DB_PASS" psql -h localhost -U "$DB_USER" "$DB_NAME" echo OK } @@ -115,8 +115,8 @@ function remove_temp { function import { create_temp - uncompress_export_file + uncompress_export_file stop_services import_database import_files diff --git a/sympa/doc/custom_cemea.md b/sympa/doc/custom_cemea.md index 9db29d6..7a4a7a2 100644 --- a/sympa/doc/custom_cemea.md +++ b/sympa/doc/custom_cemea.md @@ -1,12 +1,19 @@ CUSTOM CEMEA's styling ====================== -# sed /usr/share/sympa/lib/Sympa/Config/Schema.pm +> Rq /usr/share/sympa/lib/Sympa/Config/Schema.pm !!!! FIXME: not useful anymore in latest sympa + +## /usr/share/sympa/lib/Sympa/WWW/Tools.pm + +* append_or_replace... # TODO: use append_or_replace! + +``` default =>'#ad0c78', # '#005ab2' replaced by ZOURIT-COLOR-1 default =>'#b15593', # '#004b94' replaced by ZOURIT-COLOR-2 default =>'#1f2937', # '#0090e9', replaced by ZOURIT-COLOR-3 default =>'#949ba7', # '#66aaff', replaced by ZOURIT-COLOR-4 -# systemctl restart wwsympa.socket +``` +then `systemctl restart wwsympa.socket` /usr/share/sympa/default/web_tt2/css.tt2 #line 1661 .top-bar button:hover{ diff --git a/sympa/doc/install.md b/sympa/doc/install.md index 18a3b65..6902de7 100644 --- a/sympa/doc/install.md +++ b/sympa/doc/install.md @@ -7,6 +7,74 @@ 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 $(fqdn); + 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! @@ -43,49 +111,3 @@ LISTMASTER=pvincent@artcode.re * a2ensite sympa.conf * systemctl restart apache2 sympa - -## Nginx + fastcgi (recommended!) - -* apt install -y postfix postgresql nginx fcgiwrap perl-doc - * domain: {{PUBLIC_URL}} -* apt install -y sympa -* editor /etc/sympa/sympa/sympa.conf - * listmaster: {{LISTMASTER}} - * lang: fr -* editor /etc/nginx/sites-available/sympa.conf -``` -server { - listen 80; - server_name _; - rewrite ^/$ /wws permanent; - - location /wws { - include fastcgi_params; - fastcgi_param SERVER_NAME $host; - 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; - } - -} -``` -* cd /etc/nginx/sites-enabled - * rm default - * ln -s ../sites-available/sympa.conf -* systemctl reload nginx - -## after any sympa change! - -* systemctl restart wwsympa.socket - - diff --git a/sympa/doc/migration.md b/sympa/doc/migration.md index c384f61..df55ddc 100644 --- a/sympa/doc/migration.md +++ b/sympa/doc/migration.md @@ -2,8 +2,9 @@ Migration ========= ``` -From: debian9, sympa 6.2.16 -To: debian12, sympa 6.2.70 +From: debian9, sympa 6.2.16 +To: debian12, sympa 6.2.70 +Future: debian13, sympa 6.2.76 ``` ## Documentation @@ -11,17 +12,26 @@ To: debian12, sympa 6.2.70 * https://www.sympa.community/manual/upgrade/in-place.html * https://www.sympa.community/manual/upgrade/move.html -## export + +## export/import + +* # on old machine +* ./export.bash +* + +## export (deprecated) 1. temp dir - * sympa_domain=$(grep '^domain' /etc/sympa/sympa/sympa.conf | cut -f2) - * temp_dir="$sympa_domain-$(date '+%F')" - * mkdir $temp_dir && cd $temp_dir || echo 'already exist!' && false + * sympa_domain=$(grep '^domain' /etc/sympa/sympa/sympa.conf | cut -f2) + * temp_dir="$sympa_domain-$(date '+%F')" + * mkdir $temp_dir && cd $temp_dir || echo 'already exist!' && false + 2. database backup * db_name=sympa * db_user=sympa * db_passwd=$(grep '^db_passwd' /etc/sympa/sympa/sympa.conf | cut -f2) * PGPASSWORD=$db_passwd pg_dump -h localhost -U "$db_user" "$db_name" | gzip > "$db_name.psql.gz" + 3. tar 1. /etc/sympa * cp /etc/sympa/sympa/sympa.conf . @@ -30,8 +40,9 @@ To: debian12, sympa 6.2.70 3. /var/spool/sympa * tar -czvf spool-sympa.tgz /var/spool/sympa -## import +## import (deprecated) 1. database restore 2. tar - 1. /etc/sympa/sympa/sympa.conf + * /etc/sympa/sympa/sympa.conf +3. sympa.pl --upgrade \ No newline at end of file