Skip to content

Commit

Permalink
WIP mailman3 setup
Browse files Browse the repository at this point in the history
  • Loading branch information
foolip committed Dec 17, 2017
1 parent 9924c01 commit 213da82
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 0 deletions.
12 changes: 12 additions & 0 deletions debian/listing/00-nginx-conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash -e

apt-get install nginx
rm -f /etc/nginx/sites-enabled/*
cp nginx/conf/* /etc/nginx/conf.d/

mkdir -p /var/www/http/.well-known/acme-challenge/
chown -R deploy:deploy /var/www
rm -rf /var/www/html

nginx -t
nginx -s reload
9 changes: 9 additions & 0 deletions debian/listing/01-certbot
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash -e

apt-get install certbot

for domain in `cat DOMAINS`; do
certbot certonly -n --agree-tos --webroot -m admin@whatwg.org -d $domain -w /var/www/http
done

# TODO: reload nginx when certs are updated
7 changes: 7 additions & 0 deletions debian/listing/02-nginx-sites
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash -e

rm -f /etc/nginx/sites-enabled/*
cp nginx/sites/* /etc/nginx/sites-enabled/

nginx -t
nginx -s reload
20 changes: 20 additions & 0 deletions debian/listing/03-mailman
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash -e

# http://docs.mailman3.org/en/latest/prodsetup.html

apt-get install python-pip python3-pip
apt-get install ruby-sass
pip2 install whoosh # Django's settings.py changes not needed
pip3 install mailman
pip2 install postorius
pip2 install hyperkitty
pip2 install django

#adduser --gecos "" --disabled-password mailmanuser
#touch /etc/mailman.cfg
#adduser --gecos "" --disabled-password djangouser
cd /home/djangouser
sudo -u djangouser git clone https://gitlab.com/mailman/mailman-suite.git
cd mailman-suite/mailman-suite_project/
sudo -u djangouser python2 manage.py migrate
sudo -u djangouser python2 manage.py collectstatic
1 change: 1 addition & 0 deletions debian/listing/DOMAINS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lists.whatwg.org
11 changes: 11 additions & 0 deletions debian/listing/nginx/conf/http.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
server {
root /var/www/http;

location ^~ /.well-known/acme-challenge/ {
default_type application/jose+json;
}

location / {
return 301 https://$host$request_uri;
}
}
17 changes: 17 additions & 0 deletions debian/listing/nginx/sites/listing.whatwg.org.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
server {
listen 443 ssl http2 default_server;
ssl_certificate /etc/letsencrypt/live/lists.foolip.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/lists.foolip.org/privkey.pem;

add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";

server_name lists.foolip.org;

location / {
proxy_pass http://localhost:8000;
}

location /static/ {
alias /home/djangouser/mailman-suite/mailman-suite_project/static/;
}
}

0 comments on commit 213da82

Please sign in to comment.