Browse Source

install sympa from scratch

main
pvincent 2 weeks ago
parent
commit
95c9c42aaa
  1. 8
      sympa/bin/apply_auth_remote_ssh.bash
  2. 4
      sympa/bin/import.bash
  3. 11
      sympa/doc/custom_cemea.md
  4. 114
      sympa/doc/install.md
  5. 17
      sympa/doc/migration.md

8
sympa/bin/apply_auth_remote_ssh.bash

@ -1,12 +1,12 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# changes in /etc/sympa/auth.conf # 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 # 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 systemctl restart wwsympa.socket
else else
echo 'SSH already enabled!' echo 'SSH already enabled!'

4
sympa/bin/import.bash

@ -39,7 +39,7 @@ function import_database {
echo -n "import database $DB_NAME..." echo -n "import database $DB_NAME..."
sudo -u postgres dropdb "$DB_NAME" 2>/dev/null sudo -u postgres dropdb "$DB_NAME" 2>/dev/null
sudo -u postgres createdb -O "$DB_USER" "$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 echo OK
} }
@ -115,8 +115,8 @@ function remove_temp {
function import { function import {
create_temp create_temp
uncompress_export_file
uncompress_export_file
stop_services stop_services
import_database import_database
import_files import_files

11
sympa/doc/custom_cemea.md

@ -1,12 +1,19 @@
CUSTOM CEMEA's styling 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 =>'#ad0c78', # '#005ab2' replaced by ZOURIT-COLOR-1
default =>'#b15593', # '#004b94' replaced by ZOURIT-COLOR-2 default =>'#b15593', # '#004b94' replaced by ZOURIT-COLOR-2
default =>'#1f2937', # '#0090e9', replaced by ZOURIT-COLOR-3 default =>'#1f2937', # '#0090e9', replaced by ZOURIT-COLOR-3
default =>'#949ba7', # '#66aaff', replaced by ZOURIT-COLOR-4 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 /usr/share/sympa/default/web_tt2/css.tt2 #line 1661
.top-bar button:hover{ .top-bar button:hover{

114
sympa/doc/install.md

@ -7,6 +7,74 @@ https://wiki.evolix.org/HowtaptoSympa
USE OF: postfix + postgresql + ... USE OF: postfix + postgresql + ...
## Nginx + fastcgi (recommended!) + NON-INTERACTIVE
```bash
# postfix
debconf-set-selections <<EOF
postfix postfix/mailname string $(fqdn)
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 $(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) ## Apache2 + fcgi (deprecated, see nginx below)
Rk: replace {{PUBLIC_URL}} and {{LISTMASTER}} according to your needs! Rk: replace {{PUBLIC_URL}} and {{LISTMASTER}} according to your needs!
@ -43,49 +111,3 @@ LISTMASTER=pvincent@artcode.re
* a2ensite sympa.conf * a2ensite sympa.conf
* systemctl restart apache2 sympa * 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

17
sympa/doc/migration.md

@ -4,6 +4,7 @@ Migration
``` ```
From: debian9, sympa 6.2.16 From: debian9, sympa 6.2.16
To: debian12, sympa 6.2.70 To: debian12, sympa 6.2.70
Future: debian13, sympa 6.2.76
``` ```
## Documentation ## 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/in-place.html
* https://www.sympa.community/manual/upgrade/move.html * https://www.sympa.community/manual/upgrade/move.html
## export
## export/import
* # on old machine
* ./export.bash
*
## export (deprecated)
1. temp dir 1. temp dir
* sympa_domain=$(grep '^domain' /etc/sympa/sympa/sympa.conf | cut -f2) * sympa_domain=$(grep '^domain' /etc/sympa/sympa/sympa.conf | cut -f2)
* temp_dir="$sympa_domain-$(date '+%F')" * temp_dir="$sympa_domain-$(date '+%F')"
* mkdir $temp_dir && cd $temp_dir || echo 'already exist!' && false * mkdir $temp_dir && cd $temp_dir || echo 'already exist!' && false
2. database backup 2. database backup
* db_name=sympa * db_name=sympa
* db_user=sympa * db_user=sympa
* db_passwd=$(grep '^db_passwd' /etc/sympa/sympa/sympa.conf | cut -f2) * 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" * PGPASSWORD=$db_passwd pg_dump -h localhost -U "$db_user" "$db_name" | gzip > "$db_name.psql.gz"
3. tar 3. tar
1. /etc/sympa 1. /etc/sympa
* cp /etc/sympa/sympa/sympa.conf . * cp /etc/sympa/sympa/sympa.conf .
@ -30,8 +40,9 @@ To: debian12, sympa 6.2.70
3. /var/spool/sympa 3. /var/spool/sympa
* tar -czvf spool-sympa.tgz /var/spool/sympa * tar -czvf spool-sympa.tgz /var/spool/sympa
## import
## import (deprecated)
1. database restore 1. database restore
2. tar 2. tar
1. /etc/sympa/sympa/sympa.conf
* /etc/sympa/sympa/sympa.conf
3. sympa.pl --upgrade
Loading…
Cancel
Save