From 315f303956b94d97c2e20658d6e7dab96ef2092c Mon Sep 17 00:00:00 2001 From: Michal Konecny Date: Wed, 3 Jul 2024 14:46:53 +0200 Subject: [PATCH] [mailman] Remove the mailman role from ansible repository The mailman is no longer running and the new one is deployed by new mailman3 role. Let's do some cleaning. Signed-off-by: Michal Konecny --- roles/mailman/defaults/main.yml | 12 - roles/mailman/files/django_fedora.py | 15 - roles/mailman/files/django_fedora_nosignup.py | 14 - roles/mailman/files/favicon.ico | Bin 32038 -> 0 bytes roles/mailman/files/fedmsg-plugin-conf.py | 11 - roles/mailman/files/headers.html | 9 - roles/mailman/files/hyperkitty-delete-list.py | 56 -- roles/mailman/files/hyperkitty.Fedora.repo | 31 - roles/mailman/files/hyperkitty.RedHat.repo | 31 - roles/mailman/files/hyperkitty.logrotate.conf | 6 - roles/mailman/files/import-mm2.py | 148 ---- roles/mailman/files/login_extra_top.html | 6 - .../mailman/files/logo-hyperkitty-fedora.png | Bin 4650 -> 0 bytes roles/mailman/files/mailman-hyperkitty.cfg | 20 - roles/mailman/files/mailman-sar.py | 118 --- ...ailman-template-list-admin-action-post.txt | 15 - ...an-template-list-member-generic-footer.txt | 8 - ...n-template-users-list-user-notice-hold.txt | 25 - .../files/mailman3-fedmsg-plugin.RedHat.repo | 17 - .../mailman/files/mailman3_navbar-brand.html | 5 - .../mailman/files/mailman3_pg-give-rights.py | 85 --- roles/mailman/files/mailman3_urls.py | 17 - roles/mailman/files/mailman3_yamlget | 110 --- roles/mailman/files/memcached.sysconfig | 5 - roles/mailman/files/navbar-brand.html | 5 - roles/mailman/files/periodic.py | 23 - roles/mailman/files/pg-give-rights.py | 86 --- roles/mailman/files/post-update.sh | 43 -- roles/mailman/files/prod-to-stg.py | 211 ------ roles/mailman/files/robots.txt | 4 - roles/mailman/files/settings_test.py | 85 --- roles/mailman/files/signup_closed.html | 21 - roles/mailman/files/syslog-logrotate | 20 - roles/mailman/files/top.html | 10 - roles/mailman/files/urls.py | 18 - roles/mailman/files/webui.wsgi | 44 -- roles/mailman/files/yamlget | 110 --- roles/mailman/handlers/main.yml | 12 - roles/mailman/tasks/main.yml | 717 ------------------ roles/mailman/templates/apache-dummy.conf.j2 | 1 - roles/mailman/templates/apache.conf.j2 | 43 -- roles/mailman/templates/bottom.html | 15 - roles/mailman/templates/crontab-mailman3.j2 | 1 - roles/mailman/templates/crontab-webui.j2 | 26 - roles/mailman/templates/initial-data.json.j2 | 30 - .../templates/mailman-migration-path.sh.j2 | 3 - .../templates/mailman-migration.conf.j2 | 2 - roles/mailman/templates/mailman.cfg.j2 | 187 ----- roles/mailman/templates/manage.py.j2 | 10 - .../templates/post-transaction.action.j2 | 8 - roles/mailman/templates/settings.py.j2 | 432 ----------- roles/mailman/templates/settings_admin.py.j2 | 23 - .../templates/webui-qcluster.service.j2 | 11 - .../templates/webui-warm-up-cache.service.j2 | 12 - 54 files changed, 2977 deletions(-) delete mode 100644 roles/mailman/defaults/main.yml delete mode 100644 roles/mailman/files/django_fedora.py delete mode 100644 roles/mailman/files/django_fedora_nosignup.py delete mode 100644 roles/mailman/files/favicon.ico delete mode 100644 roles/mailman/files/fedmsg-plugin-conf.py delete mode 100644 roles/mailman/files/headers.html delete mode 100755 roles/mailman/files/hyperkitty-delete-list.py delete mode 100644 roles/mailman/files/hyperkitty.Fedora.repo delete mode 100644 roles/mailman/files/hyperkitty.RedHat.repo delete mode 100644 roles/mailman/files/hyperkitty.logrotate.conf delete mode 100755 roles/mailman/files/import-mm2.py delete mode 100644 roles/mailman/files/login_extra_top.html delete mode 100644 roles/mailman/files/logo-hyperkitty-fedora.png delete mode 100644 roles/mailman/files/mailman-hyperkitty.cfg delete mode 100644 roles/mailman/files/mailman-sar.py delete mode 100644 roles/mailman/files/mailman-template-list-admin-action-post.txt delete mode 100644 roles/mailman/files/mailman-template-list-member-generic-footer.txt delete mode 100644 roles/mailman/files/mailman-template-users-list-user-notice-hold.txt delete mode 100644 roles/mailman/files/mailman3-fedmsg-plugin.RedHat.repo delete mode 100644 roles/mailman/files/mailman3_navbar-brand.html delete mode 100755 roles/mailman/files/mailman3_pg-give-rights.py delete mode 100644 roles/mailman/files/mailman3_urls.py delete mode 100755 roles/mailman/files/mailman3_yamlget delete mode 100644 roles/mailman/files/memcached.sysconfig delete mode 100644 roles/mailman/files/navbar-brand.html delete mode 100755 roles/mailman/files/periodic.py delete mode 100755 roles/mailman/files/pg-give-rights.py delete mode 100755 roles/mailman/files/post-update.sh delete mode 100755 roles/mailman/files/prod-to-stg.py delete mode 100644 roles/mailman/files/robots.txt delete mode 100644 roles/mailman/files/settings_test.py delete mode 100644 roles/mailman/files/signup_closed.html delete mode 100644 roles/mailman/files/syslog-logrotate delete mode 100644 roles/mailman/files/top.html delete mode 100644 roles/mailman/files/urls.py delete mode 100644 roles/mailman/files/webui.wsgi delete mode 100755 roles/mailman/files/yamlget delete mode 100644 roles/mailman/handlers/main.yml delete mode 100644 roles/mailman/tasks/main.yml delete mode 100644 roles/mailman/templates/apache-dummy.conf.j2 delete mode 100644 roles/mailman/templates/apache.conf.j2 delete mode 100644 roles/mailman/templates/bottom.html delete mode 100644 roles/mailman/templates/crontab-mailman3.j2 delete mode 100644 roles/mailman/templates/crontab-webui.j2 delete mode 100644 roles/mailman/templates/initial-data.json.j2 delete mode 100644 roles/mailman/templates/mailman-migration-path.sh.j2 delete mode 100644 roles/mailman/templates/mailman-migration.conf.j2 delete mode 100644 roles/mailman/templates/mailman.cfg.j2 delete mode 100644 roles/mailman/templates/manage.py.j2 delete mode 100644 roles/mailman/templates/post-transaction.action.j2 delete mode 100644 roles/mailman/templates/settings.py.j2 delete mode 100644 roles/mailman/templates/settings_admin.py.j2 delete mode 100644 roles/mailman/templates/webui-qcluster.service.j2 delete mode 100644 roles/mailman/templates/webui-warm-up-cache.service.j2 diff --git a/roles/mailman/defaults/main.yml b/roles/mailman/defaults/main.yml deleted file mode 100644 index ac6cf2ada7..0000000000 --- a/roles/mailman/defaults/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -mailman_webui_basedir: /srv/webui -mailman_webui_confdir: "{{ mailman_webui_basedir }}/config" -mailman_db_server: localhost -mailman_mailman_db_pass: changeme -mailman_hyperkitty_admin_db_pass: changeme -mailman_hyperkitty_db_pass: changeme -mailman_hyperkitty_cookie_key: changeme -mailman_domains: -- lists.example.com -- lists.example.org -mailman_social_login: [] diff --git a/roles/mailman/files/django_fedora.py b/roles/mailman/files/django_fedora.py deleted file mode 100644 index b8cda8a077..0000000000 --- a/roles/mailman/files/django_fedora.py +++ /dev/null @@ -1,15 +0,0 @@ -from django.http import UnreadablePostError -from pylibmc import Error as MemcachedError - -EXCLUDED = ( - UnreadablePostError, - MemcachedError, -) - -def exclude_useless_errors(record): - if record.exc_info: - exc_type, exc_value = record.exc_info[:2] - for excluded_class in EXCLUDED: - if isinstance(exc_value, excluded_class): - return False - return True diff --git a/roles/mailman/files/django_fedora_nosignup.py b/roles/mailman/files/django_fedora_nosignup.py deleted file mode 100644 index 22a2df04c4..0000000000 --- a/roles/mailman/files/django_fedora_nosignup.py +++ /dev/null @@ -1,14 +0,0 @@ -# Disable local signup - -from allauth.account.adapter import DefaultAccountAdapter -from allauth.socialaccount.adapter import DefaultSocialAccountAdapter - -class NoLocalSignUpAdapter(DefaultAccountAdapter): - - def is_open_for_signup(self, request): - return False - -class SignUpEnabledSocialAdapter(DefaultSocialAccountAdapter): - - def is_open_for_signup(self, request, sociallogin): - return True diff --git a/roles/mailman/files/favicon.ico b/roles/mailman/files/favicon.ico deleted file mode 100644 index 05567e14242709a5330bf535a7c1aeaa6650f5bf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 32038 zcmdU&33wDm+JKuFuE;M)vbu8XYBsn&i2fQ5FBVVmfCNN9Wf50UNCFDt#X<7Gu2 zgqv`MD}?(>!hIMJAwUEKL{tQXh+HBfMmB5x&s#G!bS5*C383p=&(lv;S66*UonL+R zRkfy7(n7UbwKT1g)<}CjRMVc&G_6r1*L!v?ONqC zqDAZ3*>j5a?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d zD>Os9!a;jx|HF&_{p!wi70;P!^gPf2END>Y9MFk#_bcb))m`u8b6Dmfhs!>`7#n`r`aN^~yt-IKC-d}l5AvQQ+Sb$=)0KVyMcrv^)t$y6 zaH~7&p$Xcckun1gw5#$!4{pD+Nb>76xAGrE#XJ7)J-g*T8}tH;^ZL~1j!z2Zzco0w z&K)RjeJc0dXTQ>`XZxo2-t*vqci-ke1^kbo1lbGu105=5QMhZDtV8zIu%l)#SDoW0 zOgqMI7ah~iU7yJF46L;|^Jb>XbD_*tg>SzzFrn!^_p}5jxLxNBElCr!anC2TLbKvQ zl?VS@RlK^-`LES2W08vE96o8Wec8Qdk65v0m4ulwb&5Lkukv%Yb4gNaO83a9zutb+ zpZ_d%i47YyyrIPdEnDhl@>}k6zEZZPO<;dR|G*xR{~yqHxr=~j?!x&pj&G!4{B@t@ zppRa3IE}TsX(Y6Gpk;K!h7F}1D>%WOl$zR|^QQ8QsQbSx+yem3l*h`|tE4`RyBpw* z|1FSC@-KNe(EG|b{tc2fZ>~H;z?^xR2KoK8ga0`=je#$|^wPui8`N)9uR(({_LQ7e zu3x|Y4fPt-zrFu}0sIG(vyrSb<#||z3!gE=k8DEPe1~P2{oZ`Db-nuaZ?9j!ehpve zprN5&{rZidNjJ@bl1A4(2NDN7a5o_12LDuYpO0|UVT>@GW@~Kxp@;F&Mo+POY)E#b zINLw+*ke)Q5#e>h!^3OX{^tNVU?m^+Sdp}y+5A`V)i87$3Pw76m0_HDQ6meEbO%z5s1_@yI7?*Z>ZaB%>R zzscas3mS;#f(9X67c&U%aNsrvlF5Xw3mF9WIA~hU%f9Qv1i`%y-0VPhZg%kayt@8f zgBv2jx&C8=dqje@`SP9zO>5}wOSGDYTB~nH5(v8F+qPU^>wbI8_sSw}%AAjz`*#H0l diff --git a/roles/mailman/files/fedmsg-plugin-conf.py b/roles/mailman/files/fedmsg-plugin-conf.py deleted file mode 100644 index 92793a5261..0000000000 --- a/roles/mailman/files/fedmsg-plugin-conf.py +++ /dev/null @@ -1,11 +0,0 @@ -config = { - # These are mailing lists that we don't publish to fedmsg (because spam or privacy) - 'mailman.excluded_lists': [ - 'scm-commits', # too much traffic - 'council-private', # private list - 'cwg-private', # private list - 'fesco', # private list - 'security-private', # private list - 'diversity-private', # private list - ], -} diff --git a/roles/mailman/files/headers.html b/roles/mailman/files/headers.html deleted file mode 100644 index fbea0abee4..0000000000 --- a/roles/mailman/files/headers.html +++ /dev/null @@ -1,9 +0,0 @@ - diff --git a/roles/mailman/files/hyperkitty-delete-list.py b/roles/mailman/files/hyperkitty-delete-list.py deleted file mode 100755 index 64f3b566c5..0000000000 --- a/roles/mailman/files/hyperkitty-delete-list.py +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env python2 - -""" -Delete lists from HyperKitty - -Author: Aurelien Bompard -""" - -from __future__ import ( - absolute_import, print_function, unicode_literals, division) - -import os -import logging -import readline -import sys -from argparse import ArgumentParser - -sys.path.insert(0, "/srv/webui/config") -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") -from django import setup - -from hyperkitty.models import MailingList - - -def delete_list(address): - try: - ml = MailingList.objects.get(name=address) - except MailingList.DoesNotExist: - print("Could not find a list with address \"{}\".".format(address)) - return - print("The mailing-list \"{}\" ({}) will be entirely deleted.".format(ml.name, ml.list_id)) - print("It contains {} threads and {} emails.".format(ml.threads.count(), ml.emails.count())) - prompt = "Are you sure? [y/N] ".format(ml.name, ml.list_id) - response = raw_input(prompt) - if response != "y": - print("Not deleted.") - return - ml.delete() - print("Mailing-list successfully deleted.") - -def parse_args(): - parser = ArgumentParser() - parser.add_argument("list_address", nargs="+", help="The mailing-list address") - return parser.parse_args() - - -def main(): - args = parse_args() - setup() - logging.basicConfig(level=logging.INFO, format="%(message)s") - for address in args.list_address: - delete_list(address) - - -if __name__ == "__main__": - main() diff --git a/roles/mailman/files/hyperkitty.Fedora.repo b/roles/mailman/files/hyperkitty.Fedora.repo deleted file mode 100644 index 39c339da3b..0000000000 --- a/roles/mailman/files/hyperkitty.Fedora.repo +++ /dev/null @@ -1,31 +0,0 @@ -[hyperkitty] -name=HyperKitty archiver and its dependencies -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/stable/fedora-$releasever/$basearch/ -enabled=1 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc - -[hyperkitty-source] -name=HyperKitty archiver and its dependencies - Source -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/stable/fedora-$releasever/SRPMS -enabled=0 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc - -[hyperkitty-devel] -name=HyperKitty archiver and its dependencies (devel versions) -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/devel/fedora-$releasever/$basearch/ -enabled=0 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc - -[hyperkitty-devel-source] -name=HyperKitty archiver and its dependencies (devel versions) - Source -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/devel/fedora-$releasever/SRPMS -enabled=0 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc diff --git a/roles/mailman/files/hyperkitty.RedHat.repo b/roles/mailman/files/hyperkitty.RedHat.repo deleted file mode 100644 index 0debff4807..0000000000 --- a/roles/mailman/files/hyperkitty.RedHat.repo +++ /dev/null @@ -1,31 +0,0 @@ -[hyperkitty] -name=HyperKitty archiver and its dependencies -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/stable/el-$releasever/$basearch/ -enabled=1 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc - -[hyperkitty-source] -name=HyperKitty archiver and its dependencies - Source -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/stable/el-$releasever/SRPMS -enabled=0 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc - -[hyperkitty-devel] -name=HyperKitty archiver and its dependencies (devel versions) -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/devel/el-$releasever/$basearch/ -enabled=0 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc - -[hyperkitty-devel-source] -name=HyperKitty archiver and its dependencies (devel versions) - Source -baseurl=https://repos.fedorapeople.org/repos/abompard/hyperkitty/devel/el-$releasever/SRPMS -enabled=0 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://repos.fedorapeople.org/repos/abompard/abompard.asc diff --git a/roles/mailman/files/hyperkitty.logrotate.conf b/roles/mailman/files/hyperkitty.logrotate.conf deleted file mode 100644 index 05c9113988..0000000000 --- a/roles/mailman/files/hyperkitty.logrotate.conf +++ /dev/null @@ -1,6 +0,0 @@ -/var/log/hyperkitty/*.log { - missingok - notifempty - delaycompress - su root apache -} diff --git a/roles/mailman/files/import-mm2.py b/roles/mailman/files/import-mm2.py deleted file mode 100755 index fa88df4a5f..0000000000 --- a/roles/mailman/files/import-mm2.py +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env python3 - -from __future__ import unicode_literals, absolute_import, print_function - -import os -import sys -import subprocess -import pickle -from optparse import OptionParser -from locale import getpreferredencoding -import yaml - -MAILMAN_BIN = subprocess.check_output(["which", "mailman3"]).decode("ascii").strip() - -from mailman.commands.cli_import import Bouncer -sys.modules["Mailman.Bouncer"] = Bouncer - -def call(command): - print(" ".join(command)) - subprocess.check_call(command, env=os.environ) - -def cmdget(command): - print(" ".join(command)) - out = subprocess.check_output(command, env=os.environ) - return out.decode(getpreferredencoding()).strip() - - -class Importer(object): - - def __init__(self, opts, config): - self.opts = opts - self.config = config - self.index_path = self._get_index_path() - self.existing_lists = [ l.strip() for l in - cmdget(["sudo", "-u", "mailman", - MAILMAN_BIN, "lists", "-q"]).split("\n") ] - if opts.exclude: - self.excluded = opts.exclude.strip().split(",") - else: - self.excluded = [] - if opts.include: - self.included = opts.include.strip().split(",") - else: - self.included = [] - - def _get_index_path(self): - return None - sys.path.append(self.config["confdir"]) - settings = __import__("settings") - sys.path.pop() - return settings.KITTYSTORE_SEARCH_INDEX - - def import_dir(self, mm2libdir): - all_listnames = [ d for d in os.listdir( - os.path.join(mm2libdir, 'lists')) - if not d.startswith(".") ] - all_listnames.sort() - for index, listname in enumerate(all_listnames): - listaddr = "%s@%s" % (listname, self.opts.domain.strip()) - if listname in self.excluded or listaddr in self.excluded: - print("Skipping excluded list %s" % listaddr) - continue - if self.included and ( - listname not in self.included and - listaddr not in self.included): - print("Skipping not included list %s" % listaddr) - continue - print(listaddr, "(%d/%d)" % (index+1, len(all_listnames))) - confpickle = os.path.join(mm2libdir, 'lists', listname, - 'config.pck') - if not os.path.exists(confpickle): - print("Missing configuration pickle:", confpickle) - continue - list_is_new = bool(listaddr not in self.existing_lists) - if self.opts.recreate and not list_is_new: - call(["sudo", "-u", "mailman", MAILMAN_BIN, "remove", - listaddr]) - list_is_new = True - if list_is_new: - call(["sudo", "-u", "mailman", MAILMAN_BIN, "create", "-d", - listaddr]) - call(["sudo", "-u", "mailman", MAILMAN_BIN, "import21", - listaddr, confpickle]) - if not self.opts.no_archives: - archivefile = os.path.join( - mm2libdir, "archives", "private", - "%s.mbox" % listname, "%s.mbox" % listname) - archive_policy = bool(pickle.load(open(confpickle, "rb"), - encoding="utf-8", errors="ignore").get('archive')) - if not archive_policy: - print("List %s wants no archiving" % listname) - continue - if os.path.exists(archivefile) and \ - (list_is_new or not self.opts.new_only): - call(["sudo", "django-admin", "hyperkitty_import", - "--pythonpath", self.config["confdir"], - "--settings", "settings", "-l", listaddr, - "--no-sync-mailman", archivefile]) - if self.index_path: - call(["sudo", "chown", "mailman:apache", "-R", self.index_path]) - call(["sudo", "chmod", "g+w", self.index_path]) - if not self.opts.no_sync: - call(["sudo", "django-admin", "mailman_sync", - "--pythonpath", self.config["confdir"], - "--settings", "settings"]) - - - -def main(): - parser = OptionParser() - parser.add_option("-n", "--new-only", action="store_true", - help="Only import the archives when the list is new") - parser.add_option("-A", "--no-archives", action="store_true", - help="Don't import the archives, only import the list config") - parser.add_option("-c", "--config", default="/etc/mailman-migration.conf", - help="Configuration file (default: %defaults)") - parser.add_option("-d", "--domain", - help="Domain for the mailing-lists") - parser.add_option("-x", "--exclude", default="", - help="Comma-separated list of lists to exclude") - parser.add_option("-i", "--include", default="", - help="Comma-separated list of lists to include, no other " - "list will be imported") - parser.add_option("-R", "--recreate", action="store_true", - help="Recreate the lists and re-import their configuration") - parser.add_option("-S", "--no-sync", action="store_true", - help="Don't run the mailman_sync admin command") - opts, args = parser.parse_args() - if len(args) != 1: - parser.error("Only one arg: the Mailman 2.1 lib dir to import") - if opts.include and opts.exclude: - parser.error("Only one of 'include' or 'exclude' may be used") - if not opts.domain: - parser.error("You must provide a domain name for the lists (--domain)") - - mm2libdir = args[0] - if not os.path.exists(mm2libdir): - parser.error("No such directory: %s" % mm2libdir) - - with open(opts.config) as conffile: - config = yaml.safe_load(conffile) - - importer = Importer(opts, config) - importer.import_dir(mm2libdir) - - -if __name__ == "__main__": - main() diff --git a/roles/mailman/files/login_extra_top.html b/roles/mailman/files/login_extra_top.html deleted file mode 100644 index e1713c0450..0000000000 --- a/roles/mailman/files/login_extra_top.html +++ /dev/null @@ -1,6 +0,0 @@ -

-By subscribing or posting to these mailing lists, you agree that any email -to the list is public and viewable worldwide (unless it's one of the few private mailing-lists). -For more details, see our -Privacy policy. -

diff --git a/roles/mailman/files/logo-hyperkitty-fedora.png b/roles/mailman/files/logo-hyperkitty-fedora.png deleted file mode 100644 index 2806ade093a1defae29f5da7b7680c1ccc1ad031..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4650 zcmV+_64mXAP)p0?Ij z&`T-e8C&;&eGT;M5-^b&FhK5K{Fc=KARCwyCr~H)%E6>EUX9InVkOW$bH5ICn zzc)14&B0(W(o!cF3??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&4nyJ=r<4xFi#Ac?$7|(+b{%Vwpc@7u{kd)Me;lqY=+KAIhOG_s)F_DCX1R5F| zsH?AI-@Y=oZv7|QcWjIOPe9=vJag@wIdgV&TF`F(ZRs?asH*bd!}m=>b7tT5R_D^){JV2hm*D5kn>WHZ-sP(DHAIJ^^an{r`5d$qBiq&LO23cSZ@X>o gk=JRv`H$uQ0MakfdfNMrZ2$lO07*qoM6N<$f?3fLUH||9 diff --git a/roles/mailman/files/mailman-hyperkitty.cfg b/roles/mailman/files/mailman-hyperkitty.cfg deleted file mode 100644 index ad9d6b1ec7..0000000000 --- a/roles/mailman/files/mailman-hyperkitty.cfg +++ /dev/null @@ -1,20 +0,0 @@ -# This is the mailman extension configuration file to enable HyperKitty as an -# archiver. Remember to add the following lines in the mailman.cfg file: -# -# [archiver.hyperkitty] -# class: mailman_hyperkitty.Archiver -# enable: yes -# configuration: /path/to/here/hyperkitty.cfg -# - -[general] - -# This is your HyperKitty installation, preferably on the localhost. This -# address will be used by Mailman to forward incoming emails to HyperKitty -# for archiving. It does not need to be publicly available, in fact it's -# better if it is not. -base_url: http://localhost/archives/ - -# Shared API key, must be the identical to the value in HyperKitty's -# settings. -api_key: SecretArchiverAPIKey diff --git a/roles/mailman/files/mailman-sar.py b/roles/mailman/files/mailman-sar.py deleted file mode 100644 index 980b6dcfcd..0000000000 --- a/roles/mailman/files/mailman-sar.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env python -""" -GDPR SAR script for HyperKitty. - -Extract all emails from a selected address and prints them in JSON to the -standard output. -""" - -from __future__ import absolute_import, unicode_literals, print_function - -import argparse -import json -import logging -import os -import sys - -import requests -from six.moves.urllib.parse import urljoin - - -ENV_EMAIL = "SAR_EMAIL" -HYPERKITTY_INSTANCE = "http://localhost/archives/" -MAILMAN_INSTANCE = "http://localhost:8001/" -MAILMAN_AUTH = ("restadmin", "restpass") - -log = logging.getLogger() - - -def get_emails(address): - url = urljoin(HYPERKITTY_INSTANCE, "api/sender/{}/emails/".format(address)) - result = {"next": url} - count = None - email_urls = [] - while result.get("next"): - url = result["next"] - response = requests.get(url) - if response.status_code >= 300: - log.error("Could not get URL %s: %d %s", - url, response.status_code, response.reason) - break - result = response.json() - if count is None: - count = result["count"] - email_urls.extend([e["url"] for e in result["results"]]) - if count != len(email_urls): - log.error("Mismatch in the number of emails: got %s but there are " - "%s in total.", len(email_urls), count) - raise ValueError - emails = [] - for url in email_urls: - response = requests.get(url) - result = response.json() - emails.append(result) - return emails - - -def get_subscriptions(address): - url = urljoin(MAILMAN_INSTANCE, - "3.1/members/find?subscriber={}".format(address)) - response = requests.get(url, auth=MAILMAN_AUTH) - if response.status_code >= 300: - log.error("Could not get URL %s: %d %s", - url, response.status_code, response.reason) - return [] - result = response.json() - subscriptions = [] - for entry in result.get("entries", []): - subscription = { - "list_id": entry["list_id"], - "role": entry["role"], - "delivery_mode": entry["delivery_mode"], - } - # Get the subscription's preferences - member_id = entry["member_id"] - pref_url = urljoin(MAILMAN_INSTANCE, - "3.1/members/{}/preferences".format(member_id)) - pref_response = requests.get(pref_url, auth=MAILMAN_AUTH) - pref_result = pref_response.json() - if pref_response.status_code >= 300: - log.error("Could not get URL %s: %d %s", - pref_url, pref_response.status_code, - pref_response.reason) - else: - subscription["preferences"] = dict([ - (key, pref_result[key]) for key in pref_result - if key not in ("http_etag", "self_link") - ]) - subscriptions.append(subscription) - return subscriptions - - -def parse_args(): - parser = argparse.ArgumentParser() - parser.add_argument("--debug", action="store_true") - return parser.parse_args() - - -def main(): - args = parse_args() - try: - email = os.environ[ENV_EMAIL] - except KeyError as e: - print("Missing environment variable. {}".format(e), file=sys.stderr) - sys.exit(1) - logging.basicConfig( - level=logging.DEBUG if args.debug else logging.WARNING, - stream=sys.stderr, - ) - emails = get_emails(email) - subscriptions = get_subscriptions(email) - print(json.dumps(dict( - emails=emails, - subscriptions=subscriptions, - ), indent=2)) - - -if __name__ == "__main__": - main() diff --git a/roles/mailman/files/mailman-template-list-admin-action-post.txt b/roles/mailman/files/mailman-template-list-admin-action-post.txt deleted file mode 100644 index 1c7d64f788..0000000000 --- a/roles/mailman/files/mailman-template-list-admin-action-post.txt +++ /dev/null @@ -1,15 +0,0 @@ -As list administrator, your authorization is requested for the -following mailing list posting: - - List: $listname - From: $sender_email - Subject: $subject - -The message is being held because: - -$reasons - -At your convenience, visit your dashboard to approve or deny the -request: - -https://lists.fedoraproject.org/admin/lists/$list_id/held_messages diff --git a/roles/mailman/files/mailman-template-list-member-generic-footer.txt b/roles/mailman/files/mailman-template-list-member-generic-footer.txt deleted file mode 100644 index 5ced9904aa..0000000000 --- a/roles/mailman/files/mailman-template-list-member-generic-footer.txt +++ /dev/null @@ -1,8 +0,0 @@ --- -_______________________________________________ -$display_name mailing list -- $listname -To unsubscribe send an email to ${short_listname}-leave@${domain} -Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ -List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines -List Archives: https://${domain}/archives/list/${listname} -Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue diff --git a/roles/mailman/files/mailman-template-users-list-user-notice-hold.txt b/roles/mailman/files/mailman-template-users-list-user-notice-hold.txt deleted file mode 100644 index eadc4a7216..0000000000 --- a/roles/mailman/files/mailman-template-users-list-user-notice-hold.txt +++ /dev/null @@ -1,25 +0,0 @@ -Your mail to '$listname' with the subject - - $subject - -Is being held until the list moderator can review it for approval. - -The message is being held because: - -$reasons - -Either the message will get posted to the list, or you will receive -notification of the moderator's decision. - -NOTE: If your message has been held due to size, please consider -this a rejection and a friendly request to reduce the size and -resend. The list moderators will not approve such messages. - -If you are attaching logs or command output, please trim it to a -minimal amount (we can ask for more context, if needed). - -If you are attaching an image, please crop it to reduce their size. - -Also keep in mind that attachments will be encoded by your mail -client (usually via base64) and this encoding increases the size by -as much as 33%. diff --git a/roles/mailman/files/mailman3-fedmsg-plugin.RedHat.repo b/roles/mailman/files/mailman3-fedmsg-plugin.RedHat.repo deleted file mode 100644 index 2f0bad0fae..0000000000 --- a/roles/mailman/files/mailman3-fedmsg-plugin.RedHat.repo +++ /dev/null @@ -1,17 +0,0 @@ -[mailman3-fedmsg-plugin] -name=fedmsg plugin for mailman3, and its deps -baseurl=https://copr-be.cloud.fedoraproject.org/results/ralph/fedmsg-python34/epel-7-$basearch/ -enabled=1 -skip_if_unavailable=1 -gpgcheck=1 -gpgkey=https://copr-be.cloud.fedoraproject.org/results/ralph/fedmsg-python34/pubkey.gpg - -## COPR doesn't provide a source repo as far as I can tell. -## Please fix this file if I'm wrong. -#[mailman3-fedmsg-plugin-source] -#name=fedmsg plugin for mailman3, and its deps - Source -#baseurl=https://copr-be.cloud.fedoraproject.org/results/ralph/fedmsg-python34/epel-7-source/ -#enabled=0 -#skip_if_unavailable=1 -#gpgcheck=1 -#gpgkey=https://copr-be.cloud.fedoraproject.org/results/ralph/fedmsg-python34/pubkey.gpg diff --git a/roles/mailman/files/mailman3_navbar-brand.html b/roles/mailman/files/mailman3_navbar-brand.html deleted file mode 100644 index d44999aadd..0000000000 --- a/roles/mailman/files/mailman3_navbar-brand.html +++ /dev/null @@ -1,5 +0,0 @@ -{% load static %} - - {{ site_name|title }} - diff --git a/roles/mailman/files/mailman3_pg-give-rights.py b/roles/mailman/files/mailman3_pg-give-rights.py deleted file mode 100755 index 88b9ad6951..0000000000 --- a/roles/mailman/files/mailman3_pg-give-rights.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python3 -# vim: et ts=4 sw=4 fileencoding=utf-8 - -""" -Give non-admin rights to the database app user. -""" - -CONFFILE = "/etc/mailman-migration.conf" - - -import site -import yaml -import psycopg2 - - -def give_rights(dbhost, dbuser, dbpasswd, dbname, dbreguser=None): - if dbreguser is None: - dbreguser = dbname + "app" - conn = psycopg2.connect(host=dbhost, user=dbuser, password=dbpasswd, - database=dbname) - cur = conn.cursor() - # Database permissions - dbrightsquery = "GRANT CONNECT,TEMP ON DATABASE %s TO %s;" % (dbname, dbreguser) - print(dbrightsquery) - cur.execute(dbrightsquery) - # Table permissions - cur.execute(""" - SELECT 'GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON "' || relname || '" TO %s;' - FROM pg_class - JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace - WHERE nspname = 'public' AND relkind IN ('r', 'v'); - """ % dbreguser) - queries = [q[0] for q in cur] - for query in queries: - print(query) - cur.execute(query) - # Sequence permissions - cur.execute(""" - SELECT 'GRANT USAGE,SELECT,UPDATE ON ' || relname || ' TO %s;' - FROM pg_class - JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace - WHERE nspname = 'public' AND relkind = 'S'; - """ % dbreguser) - queries = [q[0] for q in cur] - for query in queries: - print(query) - cur.execute(query) - conn.commit() - cur.close() - conn.close() - - -def main(): - with open(CONFFILE) as conffile: - conf = yaml.safe_load(conffile) - site.addsitedir(conf["confdir"]) - import settings_admin - - ## KittyStore - #dbspec = re.match(""" - # postgresql:// - # (?P[a-z]+) - # : - # (?P[^@]+) - # @ - # (?P[^/]+) - # / - # (?P[^/?]+) - # """, settings_admin.KITTYSTORE_URL, re.X) - #give_rights(dbspec.group("host"), - # dbspec.group("user"), - # dbspec.group("password"), - # dbspec.group("database") - # ) - - # HyperKitty - give_rights( - settings_admin.DATABASES["default"]["HOST"], - settings_admin.DATABASES["default"]["USER"], - settings_admin.DATABASES["default"]["PASSWORD"], - settings_admin.DATABASES["default"]["NAME"], - ) - - -if __name__ == "__main__": main() diff --git a/roles/mailman/files/mailman3_urls.py b/roles/mailman/files/mailman3_urls.py deleted file mode 100644 index 3859278a16..0000000000 --- a/roles/mailman/files/mailman3_urls.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: utf-8 -*- - -from django.urls import include, re_path, reverse_lazy -from django.contrib import admin - -from django.views.generic import RedirectView - -urlpatterns = [ - re_path(r'^$', RedirectView.as_view( - url=reverse_lazy('list_index'), - permanent=True)), - re_path(r'^admin/', include('postorius.urls')), - re_path(r'^archives/', include('hyperkitty.urls')), - re_path(r'', include('django_mailman3.urls')), - re_path(r'^accounts/', include('allauth.urls')), - re_path(r'^django-admin/', admin.site.urls), -] diff --git a/roles/mailman/files/mailman3_yamlget b/roles/mailman/files/mailman3_yamlget deleted file mode 100755 index 41d1929ec3..0000000000 --- a/roles/mailman/files/mailman3_yamlget +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 tabstop=4 shiftwidth=4 expandtab smartindent: - -u""" -yamlget -------- - -Output any key in a YAML-formatted file. The aim is to make such a -configuration file accessible to shell scripts. - -.. :Authors: - Aurélien Bompard - -.. :License: - GNU GPL v3 or later -""" - -from __future__ import print_function - -import os -import sys -from optparse import OptionParser - -import yaml - - -def get_key(fullkey, data): - """ - Get the requested key from the parsed data. - :param fullkey: the key to get, nested values can be accessed by using a - colon (":") as the separator - :param data: the parsed data, from yaml.load() - - Examples: - - >>> data = { - ... 'bool': [True, False, True, False], - ... 'dict': {'hp': 13, 'sp': 5}, - ... 'float': 3.14159, - ... 'int': 42, - ... 'list': ['LITE', 'RES_ACID', 'SUS_DEXT'], - ... 'none': [None, None], - ... 'text': "The Set of Gauntlets 'Pauraegen'", - ... } - >>> get_key('bool', data) - [True, False, True, False] - >>> get_key('bool:2', data) - False - >>> get_key('dict', data) - {'hp': 13, 'sp': 5} - >>> get_key('dict:hp', data) - 13 - >>> get_key('float', data) - 3.14159 - >>> get_key('int', data) - 42 - >>> get_key('list', data) - ['LITE', 'RES_ACID', 'SUS_DEXT'] - >>> get_key('list:2', data) - 'RES_ACID' - >>> get_key('list:2:5', data) - 'RES_ACID' - >>> get_key('none', data) - [None, None] - >>> get_key('none:1', data) - >>> get_key('text', data) - "The Set of Gauntlets 'Pauraegen'" - >>> get_key('2', ['item1', 'item2', 'item3']) - 'item2' - """ - - value = data - while value is not None: - key, _sep, fullkey = fullkey.partition(":") - if isinstance(value, list): - try: - key = int(key) - except TypeError: - print("Wrong key format: %s, it should be an integer" % key, - file=sys.stderr) - sys.exit(1) - value = value[key - 1] # start at 1, not 0 - elif isinstance(value, dict): - value = value.get(key) - else: - break # we've got the value now - if not fullkey: - break # can't go any further - return value - -def main(): - parser = OptionParser(usage="%prog ") - args = parser.parse_args()[1] - if len(args) != 2: - parser.error("wrong number of arguments") - fullkey, filepath = args - if not os.path.exists(filepath): - parser.error("no such file: %s" % filepath) - - with open(filepath) as yamlfile: - data = next(yaml.safe_load_all(yamlfile)) - - #from pprint import pprint; pprint(data) - value = get_key(fullkey, data) - if value is not None: - print(value) - - -if __name__ == "__main__": - main() diff --git a/roles/mailman/files/memcached.sysconfig b/roles/mailman/files/memcached.sysconfig deleted file mode 100644 index 4482f6e76c..0000000000 --- a/roles/mailman/files/memcached.sysconfig +++ /dev/null @@ -1,5 +0,0 @@ -PORT="11211" -USER="memcached" -MAXCONN="1024" -CACHESIZE="655350" -OPTIONS="" diff --git a/roles/mailman/files/navbar-brand.html b/roles/mailman/files/navbar-brand.html deleted file mode 100644 index c7d67ea0d2..0000000000 --- a/roles/mailman/files/navbar-brand.html +++ /dev/null @@ -1,5 +0,0 @@ -{% load staticfiles %} - - {{ site_name|title }} - diff --git a/roles/mailman/files/periodic.py b/roles/mailman/files/periodic.py deleted file mode 100755 index 73dcee08cb..0000000000 --- a/roles/mailman/files/periodic.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/python3 - -import os -import sys - -from mailman.core.initialize import initialize -from mailman.config import config -from mailman.interfaces.pending import IPendings -from mailman.interfaces.requests import IListRequests, RequestType -from zope.component import getUtility - - -def clean_pended(): - getUtility(IPendings).evict() - - -if __name__ == '__main__': - if os.getuid() == 0: - print("This script must be run as the mailman user", file=sys.stderr) - sys.exit(1) - initialize(config_path="/etc/mailman.cfg") - clean_pended() - config.db.commit() diff --git a/roles/mailman/files/pg-give-rights.py b/roles/mailman/files/pg-give-rights.py deleted file mode 100755 index 48fd2202c8..0000000000 --- a/roles/mailman/files/pg-give-rights.py +++ /dev/null @@ -1,86 +0,0 @@ -#!/usr/bin/env python2 -# vim: et ts=4 sw=4 fileencoding=utf-8 - -""" -Give non-admin rights to the database app user. -""" - -CONFFILE = "/etc/mailman-migration.conf" - - -import site -import re -import yaml -import psycopg2 - - -def give_rights(dbhost, dbuser, dbpasswd, dbname, dbreguser=None): - if dbreguser is None: - dbreguser = dbname + "app" - conn = psycopg2.connect(host=dbhost, user=dbuser, password=dbpasswd, - database=dbname) - cur = conn.cursor() - # Database permissions - dbrightsquery = "GRANT CONNECT,TEMP ON DATABASE %s TO %s;" % (dbname, dbreguser) - print dbrightsquery - cur.execute(dbrightsquery) - # Table permissions - cur.execute(""" - SELECT 'GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON "' || relname || '" TO %s;' - FROM pg_class - JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace - WHERE nspname = 'public' AND relkind IN ('r', 'v'); - """ % dbreguser) - queries = [ q[0] for q in cur ] - for query in queries: - print query - cur.execute(query) - # Sequence permissions - cur.execute(""" - SELECT 'GRANT USAGE,SELECT,UPDATE ON ' || relname || ' TO %s;' - FROM pg_class - JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace - WHERE nspname = 'public' AND relkind = 'S'; - """ % dbreguser) - queries = [ q[0] for q in cur ] - for query in queries: - print query - cur.execute(query) - conn.commit() - cur.close() - conn.close() - - -def main(): - with open(CONFFILE) as conffile: - conf = yaml.safe_load(conffile) - site.addsitedir(conf["confdir"]) - import settings_admin - - ## KittyStore - #dbspec = re.match(""" - # postgresql:// - # (?P[a-z]+) - # : - # (?P[^@]+) - # @ - # (?P[^/]+) - # / - # (?P[^/?]+) - # """, settings_admin.KITTYSTORE_URL, re.X) - #give_rights(dbspec.group("host"), - # dbspec.group("user"), - # dbspec.group("password"), - # dbspec.group("database") - # ) - - # HyperKitty - give_rights( - settings_admin.DATABASES["default"]["HOST"], - settings_admin.DATABASES["default"]["USER"], - settings_admin.DATABASES["default"]["PASSWORD"], - settings_admin.DATABASES["default"]["NAME"], - ) - - -if __name__ == "__main__": main() diff --git a/roles/mailman/files/post-update.sh b/roles/mailman/files/post-update.sh deleted file mode 100755 index 2dbdfc9a3c..0000000000 --- a/roles/mailman/files/post-update.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -CONFFILE=/etc/mailman-migration.conf - -set -e - -export PATH=$PATH:$(dirname $(realpath $0)) # make yamlget available - -BASEDIR=`yamlget basedir $CONFFILE` -CONFDIR=`yamlget confdir $CONFFILE` -INDEXDIR=$BASEDIR/fulltext_index - -sleep $[ ( $RANDOM % 10 ) + 1 ]s # avoid simultaneous lockups on parallel servers. Yes, this is dirty. - -echo "Stop services" -systemctl stop webui-qcluster crond httpd - -echo "static files" -django-admin collectstatic --clear --noinput --verbosity 0 --pythonpath $CONFDIR --settings settings -django-admin compress --pythonpath $CONFDIR --settings settings -echo "db migration" -django-admin migrate --pythonpath $CONFDIR --settings settings_admin --noinput - -echo "give database rights to the non-admin user" -# this must be done before loading initial data -$BASEDIR/bin/pg-give-rights.py > /dev/null - -echo "load initial data" -django-admin loaddata $CONFDIR/initial-data.json --pythonpath $CONFDIR --settings settings -mkdir -p $INDEXDIR -chown apache:apache -R $INDEXDIR - -# SELinux contexts -echo "SELinux contexts" -restorecon -r $BASEDIR/{bin,config,fulltext_index,static,templates} - -# Run unit tests -echo "unit tests" -#django-admin test --pythonpath $CONFDIR --settings settings_test django_mailman3 hyperkitty postorius - -# Restart services -echo "Start services" -systemctl start httpd crond webui-qcluster diff --git a/roles/mailman/files/prod-to-stg.py b/roles/mailman/files/prod-to-stg.py deleted file mode 100755 index fc3356cf96..0000000000 --- a/roles/mailman/files/prod-to-stg.py +++ /dev/null @@ -1,211 +0,0 @@ -#!/usr/bin/python2 - -from __future__ import unicode_literals, print_function - -import os -import sys -import psycopg2 - -from ConfigParser import ConfigParser -from subprocess import call -from urlparse import urlparse - -if not os.getenv("DJANGO_SETTINGS_MODULE"): - os.environ["DJANGO_SETTINGS_MODULE"] = "settings_admin" -sys.path.insert(0, "/srv/webui/config") - -import django -django.setup() - - -MAILMAN_TABLES_TO_REPLACE = [ - ("domain", "mail_host"), - ("mailinglist", "mail_host"), - ("mailinglist", "list_id"), - #("ban", "list_id"), - #("bounceevent", "list_id"), - #("member", "list_id"), - ("template", "context"), - ("acceptablealias", "alias"), -] -DJANGO_TABLES_TO_EMPTY = [ - "account_emailconfirmation", - "openid_openidnonce", - "openid_openidstore", - "social_auth_association", - "social_auth_nonce", - "social_auth_usersocialauth", - "socialaccount_socialtoken", -] -DJANGO_INDICES_TO_RECREATE = [ - ("hyperkitty_thread", "hyperkitty_thread_mailinglist_id", "(mailinglist_id)"), - ("hyperkitty_thread", "hyperkitty_thread_mailinglist_id_like", "(mailinglist_id varchar_pattern_ops)"), - ("hyperkitty_email", "hyperkitty_email_mailinglist_id", "(mailinglist_id)"), - ("hyperkitty_email", "hyperkitty_email_mailinglist_id_like", "(mailinglist_id varchar_pattern_ops)"), -] -DJANGO_CONSTRAINTS_TO_RECREATE = [ - ("hyperkitty_thread", "hyperkitty_thread_mailinglist_id_371b52d98485a593_uniq", "UNIQUE (mailinglist_id, thread_id)"), - ("hyperkitty_thread", "mailinglist_id_refs_name_3725eec2", "FOREIGN KEY (mailinglist_id) REFERENCES hyperkitty_mailinglist(name) DEFERRABLE INITIALLY DEFERRED"), - ("hyperkitty_email", "hyperkitty_email_mailinglist_id_57f04aace3f8ee5e_uniq", "UNIQUE (mailinglist_id, message_id)"), - ("hyperkitty_email", "mailinglist_id_refs_name_654506d3", "FOREIGN KEY (mailinglist_id) REFERENCES hyperkitty_mailinglist(name) DEFERRABLE INITIALLY DEFERRED"), -] - - -def get_mapping(cursor, table, column): - ml_mapping = {} - query = "SELECT {c} FROM {t}".format(c=column, t=table) - print(query) - cursor.execute(query) - for row in cursor: - value = row[0] - orig_value = value.replace( - "lists.stg.fedoraproject.org", "lists.fedoraproject.org" - ).replace( - "lists.stg.fedorahosted.org", "lists.fedorahosted.org") - changed_value = value.replace( - "lists.fedoraproject.org", "lists.stg.fedoraproject.org" - ).replace( - "lists.fedorahosted.org", "lists.stg.fedorahosted.org") - if orig_value == changed_value: - continue - ml_mapping[orig_value] = changed_value - return ml_mapping - - -def update_col_1(connection, table, column, where=None, pk="id"): - cursor = connection.cursor() - cursor_2 = connection.cursor() - where = " WHERE {}".format(where) if where is not None else "" - #query = "SELECT COUNT(*) FROM {t} {w}".format(t=table, w=where) - #cursor.execute(query) - #count = cursor.fetchone()[0] - query = "SELECT {pk}, {c} FROM {t} {w}".format( - t=table, c=column, pk=pk, w=where) - #query += " LIMIT 10000" - print(query) - #print("{} lines".format(count)) - updates = [] - cursor.execute(query) - print(cursor.query) - for record_id, value in cursor: - changed_value = value.replace( - "lists.fedoraproject.org", "lists.stg.fedoraproject.org" - ).replace( - "lists.fedorahosted.org", "lists.stg.fedorahosted.org") - if value == changed_value: - continue - if column == pk: - # Resilience: if the process is halted, there may be old and new - # values in the same table. - cursor_2.execute( - "SELECT 1 FROM {t} WHERE {pk} = %s".format(t=table, pk=pk), - [changed_value]) - if cursor_2.fetchone(): - print("Skipping {v} in {t}".format(t=table, v=changed_value)) - continue - updates.append([changed_value, record_id]) - cursor_2.close() - print("Doing {} updates now".format(len(updates))) - query = "UPDATE {t} SET {c} = %s WHERE {pk} = %s".format( - t=table, c=column, pk=pk) - print(query, "with %d params" % len(updates)) - cursor.executemany(query, updates) - - -def update_col_2(ml_mapping, cursor, table, column, where=None): - query_where = " AND {}".format(where) if where is not None else "" - query = "SELECT COUNT(*) FROM {t} {w}".format(t=table, w=where) - cursor.execute(query) - count = cursor.fetchone()[0] - print("Updating {} rows.".format(count)) - for name_orig, name_new in ml_mapping.items(): - query = "UPDATE {t} SET {c} = %s WHERE {c} = %s {w}".format( - t=table, c=column, w=query_where) - params = (name_new, name_orig) - print(query % params) - cursor.execute(query, params) - - -def do_mailman(): - config = ConfigParser() - config.read("/etc/mailman.cfg") - conn = psycopg2.connect(config.get("database", "url")) - #db_url = urlparse(config.get("database", "url")) - #conn = psycopg2.connect( - # "dbname={scheme} user={username} password={password} host={hostname}".format(db_url) - # ) - - with conn.cursor() as cursor: - ml_mapping = get_mapping(cursor, "mailinglist", "list_id") - for table, column in MAILMAN_TABLES_TO_REPLACE: - update_col_1(conn, table, column) - update_col_2(ml_mapping, cursor, "ban", "list_id") - update_col_2(ml_mapping, cursor, "member", "list_id") - update_col_2(ml_mapping, cursor, "bounceevent", "list_id") - update_col_1(conn, "pendedkeyvalue", "value", - """ "key" = 'list_id' OR "key" = '_mod_listid' """ - """ OR "key" = 'envsender'""") - - cursor.execute("UPDATE \"user\" SET password = 'INVALID'") - print(cursor.query) - cursor.execute("UPDATE \"mailinglist\" SET digests_enabled = FALSE") - print(cursor.query) - conn.commit() - conn.close() - call(["sudo", "-u", "mailman", "mailman3", "aliases"]) - - -def do_django(): - from django.db import connection, transaction - from django.core.management import call_command - with connection.cursor() as cursor: - cursor.execute("UPDATE auth_user SET password = '!INVALID'") - print(cursor.query) - # Empty tables that contain sensitive data - for table in DJANGO_TABLES_TO_EMPTY: - cursor.execute("DELETE FROM %s" % table) - print(cursor.query) - #for table, name, create in DJANGO_CONSTRAINTS_TO_RECREATE: - # cursor.execute( - # "ALTER TABLE {t} DROP CONSTRAINT IF EXISTS {n}".format( - # t=table, n=name)) - # print(cursor.query) - for table, name, column in DJANGO_INDICES_TO_RECREATE: - cursor.execute("DROP INDEX IF EXISTS {n}".format(t=table, n=name)) - print(cursor.query) - with transaction.atomic(): - cursor.execute("SET CONSTRAINTS ALL DEFERRED") - ml_mapping = get_mapping(cursor, "hyperkitty_mailinglist", "name") - # Replace in tables with prod domains: - update_col_1(connection, "django_mailman3_maildomain", "mail_domain") - update_col_1(connection, "hyperkitty_mailinglist", "name", pk="name") - update_col_2(ml_mapping, cursor, "hyperkitty_thread", "mailinglist_id") - update_col_2(ml_mapping, cursor, "hyperkitty_email", "mailinglist_id") - cursor.execute("SET CONSTRAINTS ALL IMMEDIATE") - for table, name, column in DJANGO_INDICES_TO_RECREATE: - cursor.execute("CREATE INDEX {n} ON {t} {c}".format( - n=name, t=table, c=column)) - print(cursor.query) - #for table, name, create in DJANGO_CONSTRAINTS_TO_RECREATE: - # cursor.execute("ALTER TABLE {t} ADD CONSTRAINT {n} {c}".format( - # n=name, t=table, c=create)) - # print(cursor.query) - connection.commit() - call_command("loaddata", "/srv/webui/config/initial-data.json") - - -def main(): - call(["systemctl", "stop", "webui-qcluster"]) - call(["systemctl", "stop", "mailman3"]) - call(["systemctl", "stop", "httpd"]) - call(["systemctl", "stop", "crond"]) - do_mailman() - do_django() - call(["systemctl", "start", "crond"]) - call(["systemctl", "start", "httpd"]) - call(["systemctl", "start", "mailman3"]) - call(["systemctl", "start", "webui-qcluster"]) - - -if __name__ == "__main__": - main() diff --git a/roles/mailman/files/robots.txt b/roles/mailman/files/robots.txt deleted file mode 100644 index e97727942b..0000000000 --- a/roles/mailman/files/robots.txt +++ /dev/null @@ -1,4 +0,0 @@ -User-agent: * -Disallow: /accounts/ -Disallow: /django-admin/ -Disallow: /archives/*/vote$ diff --git a/roles/mailman/files/settings_test.py b/roles/mailman/files/settings_test.py deleted file mode 100644 index f2e2af9417..0000000000 --- a/roles/mailman/files/settings_test.py +++ /dev/null @@ -1,85 +0,0 @@ -#-*- coding: utf-8 -*- - -""" -Copy of the Django settings file, but with the database set for unit tests. -""" - -from settings import * -try: - from settings_local import * -except ImportError: - pass - -TESTING = True - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': ':memory:', - } -} - -# Mailman API credentials for testing Postorius -MAILMAN_REST_API_URL = 'http://localhost:9001' -MAILMAN_REST_API_USER = 'restadmin' -MAILMAN_REST_API_PASS = 'restpass' - -VCR_RECORD_MODE = 'once' -USE_SSL = False - -COMPRESS_ENABLED = False -# Empty the precompilers mapping for testing: django-compressor will run them -# even if compress_enabled is false, no idea why -COMPRESS_PRECOMPILERS = () - -# -# Full-text search engine -# -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine', - 'PATH': ':memory:', - 'STORAGE': 'ram', - }, -} -HAYSTACK_SIGNAL_PROCESSOR = 'haystack.signals.RealtimeSignalProcessor' - -# -# Asynchronous tasks -# -Q_CLUSTER = { - 'orm': 'default', - 'sync': True, -} - -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'handlers': { - 'console': { - 'class': 'logging.StreamHandler', - }, - }, - 'loggers': { - 'hyperkitty': { - 'handlers': ['console'], - 'level': 'INFO', - 'propagate': True, - }, - 'django_mailman3.lib.mailman': { - 'handlers': ['console'], - 'level': 'ERROR', - }, - 'django-q': { - 'handlers': ['console'], - 'level': 'WARNING', - }, - }, -} - -# Disable caching -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - } -} diff --git a/roles/mailman/files/signup_closed.html b/roles/mailman/files/signup_closed.html deleted file mode 100644 index ac1e89a9cf..0000000000 --- a/roles/mailman/files/signup_closed.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "account/base.html" %} - -{% load i18n %} - -{% block head_title %}{% trans "Signup" %}{% endblock %} - -{% block content %} -

{% trans "Sign Up" %}

- -

-{% blocktrans %} -Account creation for the Fedora mailing-lists is done by -creating an account in FAS. -{% endblocktrans %} -

- -{% url LOGIN_URL as login_url %} -

{% blocktrans %}Already have an account? Then please sign in.{% endblocktrans %}

- - -{% endblock %} diff --git a/roles/mailman/files/syslog-logrotate b/roles/mailman/files/syslog-logrotate deleted file mode 100644 index 7028290a18..0000000000 --- a/roles/mailman/files/syslog-logrotate +++ /dev/null @@ -1,20 +0,0 @@ -/var/log/cron -/var/log/maillog -/var/log/messages -/var/log/secure -/var/log/spooler -{ - sharedscripts - postrotate - /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true - endscript - daily - rotate 7 - missingok - ifempty - compress - compresscmd /usr/bin/xz - uncompresscmd /usr/bin/xz - compressext .xz - dateext -} diff --git a/roles/mailman/files/top.html b/roles/mailman/files/top.html deleted file mode 100644 index b607d331c3..0000000000 --- a/roles/mailman/files/top.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - diff --git a/roles/mailman/files/urls.py b/roles/mailman/files/urls.py deleted file mode 100644 index 5e4b4055d5..0000000000 --- a/roles/mailman/files/urls.py +++ /dev/null @@ -1,18 +0,0 @@ -# -*- coding: utf-8 -*- - -from django.conf.urls import include, url -from django.contrib import admin - -from django.core.urlresolvers import reverse_lazy -from django.views.generic import RedirectView - -urlpatterns = [ - url(r'^$', RedirectView.as_view( - url=reverse_lazy('hyperkitty.views.index.index'), - permanent=True)), - url(r'^admin/', include('postorius.urls')), - url(r'^archives/', include('hyperkitty.urls')), - url(r'', include('django_mailman3.urls')), - url(r'^accounts/', include('allauth.urls')), - url(r'^django-admin/', include(admin.site.urls)), -] diff --git a/roles/mailman/files/webui.wsgi b/roles/mailman/files/webui.wsgi deleted file mode 100644 index f9a875ea8c..0000000000 --- a/roles/mailman/files/webui.wsgi +++ /dev/null @@ -1,44 +0,0 @@ -""" -WSGI config for hyperkitty_standalone project. - -This module contains the WSGI application used by Django's development server -and any production WSGI deployments. It should expose a module-level variable -named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover -this application via the ``WSGI_APPLICATION`` setting. - -Usually you will have the standard Django WSGI application here, but it also -might make sense to replace the whole Django WSGI application with a custom one -that later delegates to the Django one. For example, you could introduce WSGI -middleware here, or combine a Django application with an application of another -framework. - -""" -import os -import sys -import site - - -## For some unknown reason, sometimes mod_wsgi fails to set the python paths to -## the virtualenv, with the 'python-path' option. You can do it here too. -## -## Remember original sys.path. -#prev_sys_path = list(sys.path) -## Add here, for the settings module -#site.addsitedir(os.path.abspath(os.path.dirname(__file__))) -## Add the virtualenv -#venv = os.path.join(os.path.abspath(os.path.dirname(__file__)), '..', 'lib', 'python2.6', 'site-packages') -#site.addsitedir(venv) -# Reorder sys.path so new directories at the front. -#new_sys_path = [] -#for item in list(sys.path): -# if item not in prev_sys_path: -# new_sys_path.append(item) -# sys.path.remove(item) -# sys.path[:0] = new_sys_path - -site.addsitedir(os.path.abspath(os.path.dirname(__file__))) - -os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' - -from django.core.wsgi import get_wsgi_application -application = get_wsgi_application() diff --git a/roles/mailman/files/yamlget b/roles/mailman/files/yamlget deleted file mode 100755 index 68a5876bf9..0000000000 --- a/roles/mailman/files/yamlget +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# vim: set fileencoding=utf-8 tabstop=4 shiftwidth=4 expandtab smartindent: - -u""" -yamlget -------- - -Output any key in a YAML-formatted file. The aim is to make such a -configuration file accessible to shell scripts. - -.. :Authors: - Aurélien Bompard - -.. :License: - GNU GPL v3 or later -""" - -from __future__ import print_function - -import os -import sys -from optparse import OptionParser - -import yaml - - -def get_key(fullkey, data): - """ - Get the requested key from the parsed data. - :param fullkey: the key to get, nested values can be accessed by using a - colon (":") as the separator - :param data: the parsed data, from yaml.load() - - Examples: - - >>> data = { - ... 'bool': [True, False, True, False], - ... 'dict': {'hp': 13, 'sp': 5}, - ... 'float': 3.14159, - ... 'int': 42, - ... 'list': ['LITE', 'RES_ACID', 'SUS_DEXT'], - ... 'none': [None, None], - ... 'text': "The Set of Gauntlets 'Pauraegen'", - ... } - >>> get_key('bool', data) - [True, False, True, False] - >>> get_key('bool:2', data) - False - >>> get_key('dict', data) - {'hp': 13, 'sp': 5} - >>> get_key('dict:hp', data) - 13 - >>> get_key('float', data) - 3.14159 - >>> get_key('int', data) - 42 - >>> get_key('list', data) - ['LITE', 'RES_ACID', 'SUS_DEXT'] - >>> get_key('list:2', data) - 'RES_ACID' - >>> get_key('list:2:5', data) - 'RES_ACID' - >>> get_key('none', data) - [None, None] - >>> get_key('none:1', data) - >>> get_key('text', data) - "The Set of Gauntlets 'Pauraegen'" - >>> get_key('2', ['item1', 'item2', 'item3']) - 'item2' - """ - - value = data - while value is not None: - key, _sep, fullkey = fullkey.partition(":") - if isinstance(value, list): - try: - key = int(key) - except TypeError: - print("Wrong key format: %s, it should be an integer" % key, - file=sys.stderr) - sys.exit(1) - value = value[key - 1] # start at 1, not 0 - elif isinstance(value, dict): - value = value.get(key) - else: - break # we've got the value now - if not fullkey: - break # can't go any further - return value - -def main(): - parser = OptionParser(usage="%prog ") - args = parser.parse_args()[1] - if len(args) != 2: - parser.error("wrong number of arguments") - fullkey, filepath = args - if not os.path.exists(filepath): - parser.error("no such file: %s" % filepath) - - with open(filepath) as yamlfile: - data = yaml.safe_load_all(yamlfile).next() - - #from pprint import pprint; pprint(data) - value = get_key(fullkey, data) - if value is not None: - print(value) - - -if __name__ == "__main__": - main() diff --git a/roles/mailman/handlers/main.yml b/roles/mailman/handlers/main.yml deleted file mode 100644 index 685b5fc917..0000000000 --- a/roles/mailman/handlers/main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- name: restart mailman3 - service: name=mailman3 state=restarted - -- name: reload apache - service: name=httpd state=reloaded - -- name: restart memcached - service: name=memcached state=restarted - -- name: systemctl daemon-reload - command: /usr/bin/systemctl daemon-reload diff --git a/roles/mailman/tasks/main.yml b/roles/mailman/tasks/main.yml deleted file mode 100644 index 5461be2153..0000000000 --- a/roles/mailman/tasks/main.yml +++ /dev/null @@ -1,717 +0,0 @@ ---- -# Configuration for Mailman 3 -# PostgreSQL initialization must have been done already - -# -# SELinux -# -- name: set the SELinux policy for the configuration directory - sefcontext: - target: "{{ mailman_webui_confdir }}(/.*)?" - setype: etc_t - state: present - tags: - - mailman - - selinux - -- name: set the SELinux policy for the fulltext index - sefcontext: - target: "{{ mailman_webui_basedir }}/fulltext_index(/.*)?" - setype: httpd_sys_rw_content_t - state: present - tags: - - mailman - - selinux - -- name: set the SELinux policy for the static files directory - sefcontext: - target: "{{ mailman_webui_basedir }}/static(/.*)?" - setype: httpd_sys_content_t - state: present - tags: - - mailman - - selinux - -- name: set the SELinux policy for the templates override directory - sefcontext: - target: "{{ mailman_webui_basedir }}/templates(/.*)?" - setype: httpd_sys_content_t - state: present - tags: - - mailman - - selinux - -- name: set the SELinux policy for the log directory - sefcontext: - target: "/var/log/hyperkitty(/.*)?" - setype: httpd_log_t - state: present - tags: - - mailman - - selinux - -- name: set the SELinux policy for the generated postfix databases - sefcontext: - target: "{{ mailman_webui_basedir }}/var/data/postfix_.*" - setype: etc_aliases_t - state: present - tags: - - mailman - - selinux - -- name: set the SELinux policy for the old static archives - sefcontext: - target: "{{ mailman_webui_basedir }}/old-archives/pipermail(/.*)?" - setype: httpd_sys_content_t - state: present - tags: - - mailman - - selinux - -- name: allow Apache to remotely connect to PostgreSQL - seboolean: name=httpd_can_network_connect_db state=yes persistent=yes - tags: - - mailman - - selinux - -- name: allow Apache to remotely connect to Mailman - seboolean: name=httpd_can_network_connect state=yes persistent=yes - tags: - - mailman - - selinux - -- name: allow Apache to remotely connect to Memcached - seboolean: name=httpd_can_network_memcache state=yes persistent=yes - tags: - - mailman - - selinux - when: env == 'production' - - -# -# Packages -# -- name: setup the hyperkitty repo - copy: src={{item}} dest=/etc/yum.repos.d/hyperkitty.repo - with_first_found: - - hyperkitty.{{ansible_hostname}}.repo - - hyperkitty.{{ansible_distribution}}.repo - - hyperkitty.repo - tags: mailman - when: env == 'production' - -- name: install GPG to validate the key - package: state=present name=gnupg - tags: mailman - when: env == 'production' - -- name: add the GPG key - rpm_key: state=present key=https://repos.fedorapeople.org/repos/abompard/abompard.asc - tags: mailman - when: env == 'production' - -- name: install needed packages - package: name={{ item }} state=present - with_items: - - python-psycopg2 - - python34-psycopg2 - - hyperkitty - - hyperkitty-selinux - - postorius - - memcached - - python-pylibmc - - python-django-haystack-xapian - - yum-plugin-post-transaction-actions - # to run the test suite: - - python-beautifulsoup4 - - python-mock - - python-whoosh - - python-tox - - python-vcrpy - # scripts - - python34-PyYAML - # mailman soft dep to convert html to plaintext - - lynx - - fedora-messaging - tags: - - packages - - mailman - when: env == 'production' - -- name: install needed packages - package: name={{ item }} state=present - with_items: - - mailman3 - # - mailman3-hyperkitty - - hyperkitty - - postorius - - memcached - - fedora-messaging - - httpd - - python3-pylibmc - - python3-dnf-plugin-post-transaction-actions - - python3-psycopg2 - - python3-mod_wsgi - - sassc - # to run the test suite: - - python-beautifulsoup4 - - python3-whoosh - tags: - - packages - - mailman - when: env == 'staging' - -- name: setup the mailman3-fedmsg repo - copy: src=mailman3-fedmsg-plugin.RedHat.repo - dest=/etc/yum.repos.d/mailman3-fedmsg-plugin.repo - when: ansible_distribution == 'RedHat' and env == 'production' - tags: mailman - -- name: add the GPG key for the mailman3-fedmsg-plugin repo - rpm_key: state=present - key=https://copr-be.cloud.fedoraproject.org/results/ralph/fedmsg-python34/pubkey.gpg - when: ansible_distribution == 'RedHat' and env == 'production' - tags: mailman - -- name: install the mailman3 fedmsg plugin rpm - package: name=mailman3-fedmsg-plugin - notify: restart mailman3 - when: ansible_distribution == 'RedHat' and env == 'production' - tags: mailman - -- name: copy in our fedmsg-plugin conf file - copy: src=fedmsg-plugin-conf.py dest=/etc/fedmsg.d/fedmsg-plugin-conf.py - tags: - - fedmsgdconfig - - mailman - notify: restart mailman3 - when: env == 'production' - -- name: install packages when not using source extracts - package: name={{ item }} state=present - with_items: - - mailman3 - - mailman3-selinux - - mailman3-hyperkitty - tags: - - packages - - mailman - when: env == 'production' - -## install hotfix for e-mails containing broken unicode -## see issue https://pagure.io/fedora-infrastructure/issue/8824 -## see upstream merge request https://gitlab.com/mailman/mailman/-/merge_requests/350 -- name: hotfix - let mailman cope with e-mails containing broken unicode - patch: src={{ files }}/hotfix/mailman3/mailman3-broken-unicode-emails.patch - dest=/usr/lib/python3.4/site-packages/mailman/email/message.py - notify: - - restart mailman3 - - reload apache - tags: - - mailman - - hotfix - - patches - when: env == 'production' - -# -# Initialize mailman (must be done after settings up the DBs) -# -# - name: add mailman to the apache group -# user: name=mailman groups=apache append=yes -# tags: -# - config -# - mailman -# #notify: -# # - restart mailman3 - -# access to the aliases files generated by mailman -- name: add postfix to the mailman group - user: name=postfix groups=mailman append=yes - tags: - - config - - mailman - notify: - - restart postfix - -## for access to the full-text index -# - name: add apache to the mailman group -# user: name=apache groups=mailman append=yes -# tags: -# - config -# - mailman -# notify: -# - reload httpd - -- name: set the mailman conffile - template: src={{ item }} dest=/etc/mailman.cfg - owner=root group=mailman mode=0640 - with_first_found: - - mailman.cfg.{{ ansible_hostname }}.j2 - - mailman.cfg.j2 - tags: - - config - - mailman - notify: - - restart mailman3 - -- name: Create site/en dir - file: state=directory path=/var/lib/mailman3/templates/site/en - tags: - - config - - mailman - -- name: set default list footer - copy: src=mailman-template-list-member-generic-footer.txt - dest=/var/lib/mailman3/templates/site/en/list:member:generic:footer.txt - owner=mailman group=mailman mode=0644 - tags: - - config - - mailman - -- name: set default list:admin:action:post template - copy: src=mailman-template-list-admin-action-post.txt - dest=/var/lib/mailman3/templates/site/en/list:admin:action:post.txt - owner=mailman group=mailman mode=0644 - tags: - - config - - mailman - -- name: Create lists/users.lists.fedoraproject.org/en template dir - file: state=directory path=/var/lib/mailman3/templates/lists/users.lists.fedoraproject.org/en - tags: - - config - - mailman - -- name: set list:user:notice:hold template for users list - copy: src=mailman-template-users-list-user-notice-hold.txt - dest=/var/lib/mailman3/templates/lists/users.lists.fedoraproject.org/en/list:user:notice:hold.txt - owner=mailman group=mailman mode=0644 - tags: - - config - - mailman - -# -# Crontab -# -- name: set the hyperkitty crontab - template: src=crontab-webui.j2 dest=/etc/cron.d/hyperkitty - tags: - - config - - mailman -- name: set the mailman crontab - template: src=crontab-mailman3.j2 dest=/etc/cron.d/mailman3 - tags: - - config - - mailman - -# -# Logging -# -- name: hyperkitty logging -- directory - file: path=/var/log/hyperkitty state=directory - owner=root group=apache mode=2775 - tags: mailman -- name: hyperkitty logging -- file creation - copy: content="" dest=/var/log/hyperkitty/hyperkitty.log - force=no - tags: mailman -- name: hyperkitty logging -- file permissions - file: path=/var/log/hyperkitty/hyperkitty.log state=file - owner=root group=apache mode=664 - tags: mailman -- name: hyperkitty logging -- rotation - copy: src=hyperkitty.logrotate.conf - dest=/etc/logrotate.d/hyperkitty - tags: mailman - - -# -# HyperKitty + Postorius setup -# - -- name: create the configuration directory - file: path={{ mailman_webui_confdir }} state=directory - tags: mailman - -- name: install the hyperkitty settings file - template: src=settings.py.j2 - dest="{{ mailman_webui_confdir }}/settings.py" - owner=root group=apache mode=0640 - tags: - - config - - mailman - notify: - - reload apache - # - restart mailman3 - -- name: install the hyperkitty settings admin file - template: src=settings_admin.py.j2 - dest="{{ mailman_webui_confdir }}/settings_admin.py" - owner=root group=root mode=0600 - tags: - - config - - mailman - -- name: install the hyperkitty settings test file - copy: src=settings_test.py - dest="{{ mailman_webui_confdir }}/settings_test.py" - owner=root group=root mode=0644 - tags: - - config - - mailman - -- name: install the fedora-specific modules - copy: src={{ item }}.py - dest="{{ mailman_webui_confdir }}/{{ item }}.py" - owner=root group=root mode=0644 - with_items: - - django_fedora - - django_fedora_nosignup - tags: - - config - - mailman - notify: - - reload apache - -- name: install the hyperkitty urls file - copy: src=mailman3_urls.py - dest="{{ mailman_webui_confdir }}/urls.py" - owner=root group=root mode=0644 - tags: - - config - - mailman - notify: - - reload apache - when: env == 'staging' - -- name: install the hyperkitty urls file - copy: src=urls.py - dest="{{ mailman_webui_confdir }}/urls.py" - owner=root group=root mode=0644 - tags: - - config - - mailman - notify: - - reload apache - when: env == 'production' - -- name: install the hyperkitty wsgi file - copy: src=webui.wsgi - dest="{{ mailman_webui_confdir }}/webui.wsgi" - owner=root group=root mode=0644 - tags: - - config - - mailman - notify: - - reload apache - -- name: install the hyperkitty/postorius dummy httpd conf file - template: src=apache-dummy.conf.j2 - dest=/etc/httpd/conf.d/{{ item }}.conf - with_items: - - hyperkitty - - postorius - tags: - - config - - mailman - notify: - - reload apache - -- name: install the hyperkitty httpd conf file - template: src=apache.conf.j2 - dest=/etc/httpd/conf.d/mailman-webui.conf - tags: - - config - - mailman - notify: - - reload apache - -- name: create the fulltext index dir - file: path="{{ mailman_webui_basedir }}/fulltext_index" - state=directory owner=apache group=apache mode=0755 - tags: mailman - -- name: create the hyperkitty static files dir - file: path="{{ mailman_webui_basedir }}/static" - state=directory owner=root group=root mode=0755 - tags: mailman - -- name: create the fedora-specific static files dir - file: path="{{ mailman_webui_basedir }}/static-fedora" - state=directory owner=root group=root mode=0755 - tags: mailman - -- name: create the fedora-specific hyperkitty img dir - file: path="{{ mailman_webui_basedir }}/static-fedora/hyperkitty/img" - state=directory owner=root group=root mode=0755 - tags: mailman - -- name: create the hyperkitty templates override dirs - file: path="{{ mailman_webui_basedir }}/templates/{{ item }}" - state=directory owner=root group=root mode=0755 - with_items: - - hyperkitty - - django_mailman3 - tags: mailman - -# Add the Nest banner -# See issue https://pagure.io/fedora-infrastructure/issue/10103 -- name: Replace the top.html template in hyperkitty to change banner - copy: src=top.html dest="{{ mailman_webui_basedir }}/templates/hyperkitty/top.html" - notify: - - reload apache - tags: - - mailman - - banner - - -- name: install our fedora-specific logo - copy: src=logo-hyperkitty-fedora.png - dest="{{ mailman_webui_basedir }}/static-fedora/logo-hyperkitty-fedora.png" - tags: mailman - -- name: install our fedora-specific favicon - copy: src=favicon.ico - dest="{{ mailman_webui_basedir }}/static-fedora/favicon.ico" - tags: mailman - -- name: install our fedora-specific robots.txt - copy: src=robots.txt - dest="{{ mailman_webui_basedir }}/static-fedora/robots.txt" - tags: mailman - -- name: install our fedora-specific brand template override - copy: src=navbar-brand.html - dest="{{ mailman_webui_basedir }}/templates/hyperkitty/navbar-brand.html" - tags: mailman - when: env == 'production' - -- name: install our fedora-specific brand template override - copy: src=mailman3_navbar-brand.html - dest="{{ mailman_webui_basedir }}/templates/hyperkitty/navbar-brand.html" - tags: mailman - when: env == 'staging' - -- name: install our fedora-specific page headers - copy: src=headers.html - dest="{{ mailman_webui_basedir }}/templates/hyperkitty/headers.html" - tags: mailman - -- name: install our fedora-specific login page extension - copy: src=login_extra_top.html - dest="{{ mailman_webui_basedir }}/templates/django_mailman3/login_extra_top.html" - tags: mailman - -- name: Create dirs for signup_closed page - file: path="{{ mailman_webui_basedir }}/templates/account" - state=directory owner=root group=root mode=0755 - tags: mailman - -- name: install our fedora-specific signup_closed page - copy: src=signup_closed.html - dest="{{ mailman_webui_basedir }}/templates/account/signup_closed.html" - tags: mailman - -- name: Install our fedmenu js hook - template: src=bottom.html - dest="{{mailman_webui_basedir }}/templates/hyperkitty/bottom.html" - tags: mailman - -# -# Plug HyperKitty into Mailman -# -- name: copy the mailman-hyperkitty conffile - copy: src=mailman-hyperkitty.cfg - dest="/etc/mailman3.d/hyperkitty.cfg" - owner=root group=mailman mode=0640 - tags: - - config - - mailman - notify: - - restart mailman3 - -# -# Scripts -# -- name: install the migration conffile - template: src=mailman-migration.conf.j2 - dest=/etc/mailman-migration.conf - owner=root group=root mode=0644 - tags: mailman - -- name: create the scripts dir - file: path="{{ mailman_webui_basedir }}/bin" - state=directory owner=root group=root mode=0755 - tags: mailman - -- name: install the migration environment - template: src=mailman-migration-path.sh.j2 - dest=/etc/profile.d/mailman-migration-path.sh - owner=root group=root mode=0644 - tags: mailman - -- name: install the scripts - copy: src={{ item }} dest="{{ mailman_webui_basedir }}/bin/{{ item }}" - owner=root group=root mode=0755 - tags: mailman - with_items: - - yamlget - - pg-give-rights.py - - post-update.sh - - import-mm2.py - - periodic.py - - mailman-sar.py - - hyperkitty-delete-list.py - -- name: install the updated yamlget script - copy: src=mailman3_yamlget dest="{{ mailman_webui_basedir }}/bin/yamlget" - owner=root group=root mode=0755 - tags: mailman - when: env == 'staging' - -- name: install the updated pg-give-rights script - copy: src=mailman3_pg-give-rights.py dest="{{ mailman_webui_basedir }}/bin/pg-give-rights.py" - owner=root group=root mode=0755 - tags: mailman - when: env == 'staging' - -- name: install the templatized scripts - template: src={{ item }}.j2 dest="{{ mailman_webui_basedir }}/bin/{{ item }}" - owner=root group=root mode=0755 - tags: mailman - with_items: - - manage.py - -- name: install the staging-sync script - copy: src=prod-to-stg.py dest="{{ mailman_webui_basedir }}/bin/prod-to-stg.py" - when: env == "staging" - tags: mailman - -- name: copy the initial user fixture - template: src=initial-data.json.j2 - dest={{ mailman_webui_basedir }}/config/initial-data.json - owner=root group=apache mode=0640 - when: inventory_hostname.startswith('mailman01') - tags: mailman - -# Sync databases and collect static files on RPM install/upgrade -- name: install the post-transaction trigger - template: src=post-transaction.action.j2 - dest=/etc/dnf/plugins/post-transaction-actions.d/hyperkitty.action - tags: mailman - when: env == 'staging' - -# Sync databases and collect static files on RPM install/upgrade -- name: install the post-transaction trigger - template: src=post-transaction.action.j2 - dest=/etc/yum/post-actions/hyperkitty.action - tags: mailman - when: env == 'production' - -# Systemd -- name: install the systemd service files - template: src={{ item }}.service.j2 dest=/etc/systemd/system/{{ item }}.service - with_items: - - webui-qcluster - - webui-warm-up-cache - notify: - - systemctl daemon-reload - tags: - - config - - mailman - -# -# Only run this on mailman01 for now. -# - -# The post-update scripts needs memcached to be up (django-compressor will -# store the timestamps there) -- name: start services - service: state=started enabled=yes name=memcached - tags: mailman - -- name: run the post-update script - command: "{{ mailman_webui_basedir }}/bin/post-update.sh" - when: inventory_hostname.startswith('mailman01') - tags: mailman - - -## Postfix -# - name: create the postfix aliases -# command: su mailman -s /bin/sh -c "mailman3 aliases" -# creates=/var/lib/mailman3/data/postfix_lmtp.db - - -# Memcached -- name: set the memcached sysconfig file - copy: src=memcached.sysconfig dest=/etc/sysconfig/memcached - tags: mailman - notify: - - restart memcached - - -# SSL -- name: Letsencrypt for lists.pagure.org - include_role: name=letsencrypt - vars: - site_name: lists.pagure.io - when: env == 'production' - - -# Start services -- name: start services - service: state=started enabled=yes name={{ item }} - with_items: - - httpd - - mailman3 - - postfix - - webui-qcluster - tags: mailman - when: inventory_hostname.startswith('mailman01.iad2') - -- name: enable one-shot services - service: enabled=yes name={{ item }} - with_items: - - webui-warm-up-cache - tags: mailman - when: inventory_hostname.startswith('mailman01.iad2') - -- name: Create /etc/pki/fedora-messaging - file: - dest: /etc/pki/fedora-messaging - mode: 0775 - owner: root - group: root - state: directory - when: "deployment_type is defined" - tags: - - config - -# FIXME: Need to create a mailman cert -- name: Deploy the Fedora mailman fedora-messaging cert - copy: - src: "{{ private }}/files/rabbitmq/{{env}}/pki/issued/mailman{{env_suffix}}.crt" - dest: /etc/pki/fedora-messaging/mailman{{env_suffix}}-cert.pem - mode: 0644 - owner: root - group: root - when: "deployment_type is defined" - tags: - - config - -- name: Deploy the Fedora infra fedora-messaging key - copy: - src: "{{ private }}/files/rabbitmq/{{env}}/pki/private/mailman{{env_suffix}}.key" - dest: /etc/pki/fedora-messaging/mailman{{env_suffix}}-key.pem - mode: 0640 - owner: root - group: root - when: "deployment_type is defined" - tags: - - config - -- name: override the default syslog logrotate file - copy: src=syslog-logrotate dest=/etc/logrotate.d/syslog - tags: - - pagure - - logrotate diff --git a/roles/mailman/templates/apache-dummy.conf.j2 b/roles/mailman/templates/apache-dummy.conf.j2 deleted file mode 100644 index 584a4f036d..0000000000 --- a/roles/mailman/templates/apache-dummy.conf.j2 +++ /dev/null @@ -1 +0,0 @@ -# See {{ mailman_webui_confdir }} diff --git a/roles/mailman/templates/apache.conf.j2 b/roles/mailman/templates/apache.conf.j2 deleted file mode 100644 index 8bc0ab46c1..0000000000 --- a/roles/mailman/templates/apache.conf.j2 +++ /dev/null @@ -1,43 +0,0 @@ -Alias /favicon.ico {{ mailman_webui_basedir }}/static/favicon.ico -Alias /robots.txt {{ mailman_webui_basedir }}/static/robots.txt -Alias /static {{ mailman_webui_basedir }}/static - -#ErrorLog /var/log/httpd/webui_error.log -#CustomLog /var/log/httpd/webui_access.log combined - -WSGIScriptAlias / {{ mailman_webui_confdir }}/webui.wsgi -WSGIDaemonProcess webui display-name=webui maximum-requests=1000 processes=4 threads=30 -WSGISocketPrefix run/wsgi -WSGIRestrictStdout On -WSGIRestrictSignal Off -WSGIPythonOptimize 1 - - - - Order deny,allow - Allow from all - Require all granted - - WSGIProcessGroup webui - - - - Order deny,allow - Allow from all - Require all granted - - - -# Old static archives - -Alias /pipermail/ {{ mailman_webui_basedir }}/old-archives/pipermail/ - - Options FollowSymLinks - AllowOverride None - Require all granted - AddDefaultCharset Off - - -RedirectMatch ^/pipermail[/]*$ / -RedirectMatch ^/mailman/listinfo/$ / -RedirectMatch ^/mailman$ / diff --git a/roles/mailman/templates/bottom.html b/roles/mailman/templates/bottom.html deleted file mode 100644 index a892972a1f..0000000000 --- a/roles/mailman/templates/bottom.html +++ /dev/null @@ -1,15 +0,0 @@ -{% if env == 'staging' %} - -{% else %} - -{% endif %} - diff --git a/roles/mailman/templates/crontab-mailman3.j2 b/roles/mailman/templates/crontab-mailman3.j2 deleted file mode 100644 index 5be2306c6f..0000000000 --- a/roles/mailman/templates/crontab-mailman3.j2 +++ /dev/null @@ -1 +0,0 @@ -42 * * * * mailman {{ mailman_webui_basedir }}/bin/periodic.py diff --git a/roles/mailman/templates/crontab-webui.j2 b/roles/mailman/templates/crontab-webui.j2 deleted file mode 100644 index 89da068604..0000000000 --- a/roles/mailman/templates/crontab-webui.j2 +++ /dev/null @@ -1,26 +0,0 @@ -# This goes in /etc/cron.d/. -# Replace "apache" by your webserver user ("www-data" on Debian systems) and -# set the path to the Django project directory - -{% if env == 'staging' %} -MAILTO="" -{% endif %} - -{% if ansible_hostname == 'mailman01' %} -@hourly apache django-admin runjobs hourly --pythonpath {{ mailman_webui_confdir }} --settings settings -@daily apache django-admin runjobs daily --pythonpath {{ mailman_webui_confdir }} --settings settings -@weekly apache django-admin runjobs weekly --pythonpath {{ mailman_webui_confdir }} --settings settings -@monthly apache django-admin runjobs monthly --pythonpath {{ mailman_webui_confdir }} --settings settings -@yearly apache django-admin runjobs yearly --pythonpath {{ mailman_webui_confdir }} --settings settings -2,17,32,47 * * * * apache django-admin runjobs quarter_hourly --pythonpath {{ mailman_webui_confdir }} --settings settings -* * * * * apache django-admin runjobs minutely --pythonpath {{ mailman_webui_confdir }} --settings settings -{% else %} -# These are only active on mailman01 (primary) server -#@hourly apache django-admin runjobs hourly --pythonpath {{ mailman_webui_confdir }} --settings settings -#@daily apache django-admin runjobs daily --pythonpath {{ mailman_webui_confdir }} --settings settings -#@weekly apache django-admin runjobs weekly --pythonpath {{ mailman_webui_confdir }} --settings settings -#@monthly apache django-admin runjobs monthly --pythonpath {{ mailman_webui_confdir }} --settings settings -#@yearly apache django-admin runjobs yearly --pythonpath {{ mailman_webui_confdir }} --settings settings -#2,17,32,47 * * * * apache django-admin runjobs quarter_hourly --pythonpath {{ mailman_webui_confdir }} --settings settings -#* * * * * apache django-admin runjobs minutely --pythonpath {{ mailman_webui_confdir }} --settings settings -{% endif %} diff --git a/roles/mailman/templates/initial-data.json.j2 b/roles/mailman/templates/initial-data.json.j2 deleted file mode 100644 index d17e0d79ad..0000000000 --- a/roles/mailman/templates/initial-data.json.j2 +++ /dev/null @@ -1,30 +0,0 @@ -[ -{% for host in mailman_domains %} -{ - "fields": { - "domain": "{{ host }}", - "name": "Fedora mailing-lists" - }, - "model": "sites.site", - "pk": {{ loop.index }} -}, -{% endfor %} -{% for service_name, service_data in mailman_login.items() %} -{ - "fields": { - "name": "{{ service_data.display_name }}", - "sites": [ - {% for host in mailman_domains %} - {{ loop.index }}{% if not loop.last %},{% endif %} - {% endfor %} - ], - "client_id": "{{ mailman_login_secrets[env][service_name].client_id }}", - "secret": "{{ mailman_login_secrets[env][service_name].secret }}", - "key": "", - "provider": "{{ service_data.provider }}" - }, - "model": "socialaccount.socialapp", - "pk": {{ loop.index }} -}{% if not loop.last %},{% endif %} -{% endfor %} -] diff --git a/roles/mailman/templates/mailman-migration-path.sh.j2 b/roles/mailman/templates/mailman-migration-path.sh.j2 deleted file mode 100644 index 4c2cb5e5d8..0000000000 --- a/roles/mailman/templates/mailman-migration-path.sh.j2 +++ /dev/null @@ -1,3 +0,0 @@ -PATH=$PATH:{{ mailman_webui_basedir }}/bin -export PATH - diff --git a/roles/mailman/templates/mailman-migration.conf.j2 b/roles/mailman/templates/mailman-migration.conf.j2 deleted file mode 100644 index 96f852b563..0000000000 --- a/roles/mailman/templates/mailman-migration.conf.j2 +++ /dev/null @@ -1,2 +0,0 @@ -basedir: {{ mailman_webui_basedir }} -confdir: {{ mailman_webui_confdir }} diff --git a/roles/mailman/templates/mailman.cfg.j2 b/roles/mailman/templates/mailman.cfg.j2 deleted file mode 100644 index 5a99d48658..0000000000 --- a/roles/mailman/templates/mailman.cfg.j2 +++ /dev/null @@ -1,187 +0,0 @@ -# This is the absolute bare minimum base configuration file. User supplied -# configurations are pushed onto this. - -[mailman] -# This address is the "site owner" address. Certain messages which must be -# delivered to a human, but which can't be delivered to a list owner (e.g. a -# bounce from a list owner), will be sent to this address. It should point to -# a human. -site_owner: admin@fedoraproject.org - -# The local URL part to the administration interface (Postorius). -# The full URL will be constructed by prepending the domain URL set in the -# list's domain properties. -listinfo_url = /admin/ - -# Set the paths to be Fedora-compliant -layout: fhs - -[paths.dev] -var_dir = {{ mailman_webui_basedir }}/var - -[paths.fhs] -bin_dir: /usr/libexec/mailman3 -var_dir: /var/lib/mailman3 -queue_dir: /var/spool/mailman3 -log_dir: /var/log/mailman3 -lock_dir: /run/lock/mailman3 -ext_dir: /etc/mailman3.d -pid_file: /run/mailman3/master.pid - -[database] -class: mailman.database.postgresql.PostgreSQLDatabase -url: postgresql://mailmanadmin:{{ mailman_mailman_db_pass }}@{{ mailman_db_server }}/mailman - -[archiver.hyperkitty] -class: mailman_hyperkitty.Archiver -enable: yes -configuration: /etc/mailman3.d/hyperkitty.cfg - -[archiver.fedmsg] -class: mailman3_fedmsg_plugin.Archiver -enable: yes - -[archiver.prototype] -enable: yes - - -[antispam] -# This section defines basic antispam detection settings. - -# This value contains lines which specify RFC 822 headers in the email to -# check for spamminess. Each line contains a `key: value` pair, where the key -# is the header to check and the value is a Python regular expression to match -# against the header's value. E.g.: -# -# X-Spam: (yes|maybe) -# -# The header value and regular expression are always matched -# case-insensitively. -header_checks: - X-Spam: yes - X-Spam-Flag: Yes - X-Spam-Status: ^Yes, - -# The chain to jump to if any of the header patterns matches. This must be -# the name of an existing chain such as 'discard', 'reject', 'hold', or -# 'accept', otherwise 'hold' will be used. -jump_chain: discard - - -[mta] -# Email is sent on the submission port to bypass spam checking. -smtp_port: 587 -# Remove DKIM signatures in the email headers. -remove_dkim_headers: yes -# Don't process old stale bounces -verp_probes: yes - - -[language.en] -# Change the english language to be UTF-8 (it defaults to ascii). -description: English (USA) -charset: utf-8 -enabled: yes - - -# http://www.lingoes.net/en/translator/langcode.htm - -[language.pt] -description: Protuguese -charset: iso-8859-15 -enabled: yes - -[language.cs] -description: Czech -charset: utf-8 -enabled: yes - -[language.ca] -description: Catalan -charset: utf-8 -enabled: yes - -[language.ja] -description: Japanese -charset: utf-8 -enabled: yes - -[language.ar] -description: Arabic -charset: utf-8 -enabled: yes - -[language.nl] -description: Dutch -charset: utf-8 -enabled: yes - -[language.pl] -description: Polish -charset: utf-8 -enabled: yes - -[language.es] -description: Spanish -charset: utf-8 -enabled: yes - -[language.pt_BR] -description: Protuguese (Brazil) -charset: iso-8859-15 -enabled: yes - -[language.zh_CN] -description: Chinese (S) -charset: utf-8 -enabled: yes - -[language.zh_TW] -description: Chinese (T) -charset: utf-8 -enabled: yes - -[language.ru] -description: Russian -charset: utf-8 -enabled: yes - -[language.vi] -description: Vietnamese -charset: utf-8 -enabled: yes - -[language.it] -description: Italian -charset: utf-8 -enabled: yes - -[language.fr] -description: French -charset: utf-8 -enabled: yes - -[language.ro] -description: Romanian -charset: utf-8 -enabled: yes - -[language.de] -description: German -charset: utf-8 -enabled: yes - -[language.hu] -description: Hungarian -charset: utf-8 -enabled: yes - -[language.ko] -description: Korean -charset: utf-8 -enabled: yes - -[language.uk] -description: Ukrainian -charset: utf-8 -enabled: yes diff --git a/roles/mailman/templates/manage.py.j2 b/roles/mailman/templates/manage.py.j2 deleted file mode 100644 index cb11412e80..0000000000 --- a/roles/mailman/templates/manage.py.j2 +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env python - -import os -import sys - -if __name__ == "__main__": - sys.path.insert(0, "{{ mailman_webui_confdir }}") - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") - from django.core.management import execute_from_command_line - execute_from_command_line(sys.argv) diff --git a/roles/mailman/templates/post-transaction.action.j2 b/roles/mailman/templates/post-transaction.action.j2 deleted file mode 100644 index a344ebc629..0000000000 --- a/roles/mailman/templates/post-transaction.action.j2 +++ /dev/null @@ -1,8 +0,0 @@ -# Run the post-update script - -hyperkitty:install:{{ mailman_webui_basedir }}/bin/post-update.sh -hyperkitty:update:{{ mailman_webui_basedir }}/bin/post-update.sh -postorius:install:{{ mailman_webui_basedir }}/bin/post-update.sh -postorius:update:{{ mailman_webui_basedir }}/bin/post-update.sh -python-django-mailman3:install:{{ mailman_webui_basedir }}/bin/post-update.sh -python-django-mailman3:update:{{ mailman_webui_basedir }}/bin/post-update.sh diff --git a/roles/mailman/templates/settings.py.j2 b/roles/mailman/templates/settings.py.j2 deleted file mode 100644 index 2191f87acd..0000000000 --- a/roles/mailman/templates/settings.py.j2 +++ /dev/null @@ -1,432 +0,0 @@ -#-*- coding: utf-8 -*- -""" -Django settings for HyperKitty + Postorius -""" - -import os -BASE_DIR = os.path.dirname(os.path.abspath(__file__)) - -import django_fedora - -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = '{{ mailman_hyperkitty_cookie_key }}' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False - -ADMINS = ( - ('HyperKitty Admin', 'abompard@fedoraproject.org'), -) -SERVER_EMAIL = 'root@fedoraproject.org' -DEFAULT_FROM_EMAIL = "admin@fedoraproject.org" - -SITE_ID = 1 - -# Hosts/domain names that are valid for this site; required if DEBUG is False -# See https://docs.djangoproject.com/en/1.8/ref/settings/#allowed-hosts -ALLOWED_HOSTS = [ -{% for host in mailman_domains %} - "{{ host }}", -{% endfor %} - ".fedoraproject.org", - "localhost", # Archiving API from Mailman - "127.0.0.1", # HAProxy ping - "{{ ansible_hostname }}", # Varnish ping -] - -# Mailman API credentials -MAILMAN_REST_API_URL = 'http://localhost:8001' -MAILMAN_REST_API_USER = 'restadmin' -MAILMAN_REST_API_PASS = 'restpass' -MAILMAN_ARCHIVER_KEY = 'SecretArchiverAPIKey' -MAILMAN_ARCHIVER_FROM = ('127.0.0.1', '::1') - -# Application definition - -INSTALLED_APPS = ( - # Uncomment the next line to enable the admin: - 'django.contrib.admin', - # Uncomment the next line to enable admin documentation: - # 'django.contrib.admindocs', - 'django.contrib.auth', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'django.contrib.messages', - 'django.contrib.staticfiles', - 'hyperkitty', - 'rest_framework', - 'django_gravatar', -{% if env != 'staging' %} - 'paintstore', -{% endif %} - 'compressor', - 'haystack', - 'django_extensions', - 'postorius', - 'django_mailman3', - 'allauth', - 'allauth.account', - 'allauth.socialaccount', - 'django_q', - 'django_mailman3.lib.auth.fedora', - {% for service_name, service_data in mailman_login.items() %} - 'allauth.socialaccount.providers.{{ service_data.provider }}', - {% endfor %} - 'allauth.socialaccount.providers.openid', -) - - -{% if env == 'staging' %} -MIDDLEWARE = ( -{% else %} -MIDDLEWARE_CLASSES = ( -{% endif %} - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.middleware.common.CommonMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', - 'django.middleware.locale.LocaleMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', -{% if env == 'staging' %} - #'django.contrib.auth.middleware.SessionAuthenticationMiddleware', -{% else %} - 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', -{% endif %} - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', - 'django.middleware.security.SecurityMiddleware', - #'hyperkitty.middleware.SSLRedirect', - 'django_mailman3.middleware.TimezoneMiddleware', - 'postorius.middleware.PostoriusMiddleware', -) - -ROOT_URLCONF = 'urls' - - -TEMPLATES = [ - { - 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [ - '{{ mailman_webui_basedir }}/templates', - ], - 'OPTIONS': { - 'loaders': [ - # https://docs.djangoproject.com/en/1.8/ref/templates/api/#django.template.loaders.cached.Loader - ('django.template.loaders.cached.Loader', [ - 'django.template.loaders.filesystem.Loader', - 'django.template.loaders.app_directories.Loader', - ]), - ], - 'context_processors': [ - 'django.template.context_processors.debug', - 'django.template.context_processors.i18n', - 'django.template.context_processors.media', - 'django.template.context_processors.static', - 'django.template.context_processors.tz', - 'django.template.context_processors.csrf', - 'django.template.context_processors.request', - 'django.contrib.auth.context_processors.auth', - 'django.contrib.messages.context_processors.messages', - 'django_mailman3.context_processors.common', - 'hyperkitty.context_processors.common', - 'postorius.context_processors.postorius', - ], - }, - }, -] - -WSGI_APPLICATION = 'wsgi.application' - - -# Database -# https://docs.djangoproject.com/en/1.8/ref/settings/#databases - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'hyperkitty', - 'USER': 'hyperkittyapp', - 'PASSWORD': '{{ mailman_hyperkitty_db_pass }}', - 'HOST': '{{ mailman_db_server }}', - 'PORT': '', # Set to empty string for default. - } -} - - - -# Security & production settings -# https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/ - -CSRF_COOKIE_SECURE = True -CSRF_COOKIE_HTTPONLY = True -SESSION_COOKIE_SECURE = True -SECURE_CONTENT_TYPE_NOSNIFF = True -SECURE_BROWSER_XSS_FILTER = True -X_FRAME_OPTIONS = 'DENY' -# We're behind a proxy, use the X-Forwarded-Host header -# See https://docs.djangoproject.com/en/1.8/ref/settings/#use-x-forwarded-host -USE_X_FORWARDED_HOST = True -# In the Fedora infra, requests are systematically redirected to HTTPS. -SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_SCHEME', 'https') -#SECURE_SSL_REDIRECT = True -#SECURE_HSTS_SECONDS = 3600 -#SECURE_HSTS_INCLUDE_SUBDOMAINS = True - - -# Internationalization -# https://docs.djangoproject.com/en/1.8/topics/i18n/ - -LANGUAGE_CODE = 'en-us' - -TIME_ZONE = 'America/Chicago' - -USE_I18N = True - -USE_L10N = True - -USE_TZ = True - - -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.8/howto/static-files/ - -# Absolute path to the directory static files should be collected to. -# Don't put anything in this directory yourself; store your static files -# in apps' "static/" subdirectories and in STATICFILES_DIRS. -# Example: "/var/www/example.com/static/" -#STATIC_ROOT = '' -STATIC_ROOT = "{{ mailman_webui_basedir }}/static/" - -# URL prefix for static files. -# Example: "http://example.com/static/", "http://static.example.com/" -STATIC_URL = '/static/' - -# Additional locations of static files -STATICFILES_DIRS = ( - # Put strings here, like "/home/html/static" or "C:/www/django/static". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - "{{ mailman_webui_basedir }}/static-fedora/", -) - -# List of finder classes that know how to find static files in -# various locations. -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', -# 'django.contrib.staticfiles.finders.DefaultStorageFinder', - 'compressor.finders.CompressorFinder', -) - - -# Sessions -# https://docs.djangoproject.com/en/1.8/topics/http/sessions/ - -SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db' - - -# Compatibility with Bootstrap 3 -from django.contrib.messages import constants as messages -MESSAGE_TAGS = { - messages.ERROR: 'danger' - } - - -# -# Authentication -# - -LOGIN_URL = 'account_login' -LOGIN_REDIRECT_URL = 'hk_root' -LOGOUT_URL = 'account_logout' - -AUTHENTICATION_BACKENDS = ( - 'django.contrib.auth.backends.ModelBackend', - 'allauth.account.auth_backends.AuthenticationBackend', -) - -# Django Allauth -ACCOUNT_AUTHENTICATION_METHOD = "username_email" -ACCOUNT_EMAIL_REQUIRED = True -ACCOUNT_EMAIL_VERIFICATION = "mandatory" -ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" -ACCOUNT_UNIQUE_EMAIL = True -# Disable local signup -ACCOUNT_ADAPTER = "django_fedora_nosignup.NoLocalSignUpAdapter" -SOCIALACCOUNT_ADAPTER = "django_fedora_nosignup.SignUpEnabledSocialAdapter" - -SOCIALACCOUNT_PROVIDERS = { - 'openid': { - 'SERVERS': [ - dict(id='yahoo', - name='Yahoo', - openid_url='http://me.yahoo.com'), - ], - }, - 'google': { - 'SCOPE': ['profile', 'email'], - 'AUTH_PARAMS': {'access_type': 'online'}, - }, - 'facebook': { - 'METHOD': 'oauth2', - 'SCOPE': ['email'], - 'FIELDS': [ - 'email', - 'name', - 'first_name', - 'last_name', - 'locale', - 'timezone', - ], - 'VERSION': 'v2.4', - }, - 'stackexchange': { - 'SITE': 'stackoverflow', - }, -} - - -# -# Gravatar -# https://github.com/twaddington/django-gravatar -# -# Gravatar base url. -GRAVATAR_URL = 'http://cdn.libravatar.org/' -# Gravatar base secure https url. -GRAVATAR_SECURE_URL = 'https://seccdn.libravatar.org/' -# Gravatar size in pixels. -#GRAVATAR_DEFAULT_SIZE = '80' -# An image url or one of the following: 'mm', 'identicon', 'monsterid', 'wavatar', 'retro'. -GRAVATAR_DEFAULT_IMAGE = 'retro' -# One of the following: 'g', 'pg', 'r', 'x'. -#GRAVATAR_DEFAULT_RATING = 'g' -# True to use https by default, False for plain http. -GRAVATAR_DEFAULT_SECURE = True - -# -# django-compressor -# https://pypi.python.org/pypi/django_compressor -# -COMPRESS_PRECOMPILERS = ( - ('text/less', 'lessc {infile} {outfile}'), - ('text/x-scss', 'sassc -t compressed {infile} {outfile}'), - ('text/x-sass', 'sassc -t compressed {infile} {outfile}'), -) -COMPRESS_OFFLINE = True -# needed for debug mode -#INTERNAL_IPS = ('127.0.0.1',) - - -# -# Full-text search engine -# -HAYSTACK_CONNECTIONS = { - 'default': { - 'ENGINE': 'xapian_backend.XapianEngine', - 'PATH': "{{ mailman_webui_basedir }}/fulltext_index", - }, -} - - -# -# Asynchronous tasks -# -Q_CLUSTER = { - 'timeout': 300, - 'save_limit': 100000, - 'orm': 'default', -} - - -# -# REST framework -# -REST_FRAMEWORK = { - 'PAGE_SIZE': 10, - 'DEFAULT_FILTER_BACKENDS': ( - 'rest_framework.filters.OrderingFilter', - ), -} - - -# A sample logging configuration. The only tangible logging -# performed by this configuration is to send an email to -# the site admins on every HTTP 500 error when DEBUG=False. -# See http://docs.djangoproject.com/en/dev/topics/logging for -# more details on how to customize your logging configuration. -LOGGING = { - 'version': 1, - 'disable_existing_loggers': False, - 'filters': { - 'require_debug_false': { - '()': 'django.utils.log.RequireDebugFalse' - }, - 'exclude_useless_errors': { - '()': 'django.utils.log.CallbackFilter', - 'callback': django_fedora.exclude_useless_errors, - } - }, - 'handlers': { - 'mail_admins': { - 'level': 'ERROR', - 'filters': ['require_debug_false', 'exclude_useless_errors'], - 'class': 'django.utils.log.AdminEmailHandler' - }, - 'file':{ - 'level': 'DEBUG', - #'class': 'logging.handlers.RotatingFileHandler', - 'class': 'logging.handlers.WatchedFileHandler', - 'filename': '/var/log/hyperkitty/hyperkitty.log', - 'formatter': 'verbose', - }, - 'null': { - 'class': 'logging.NullHandler', - }, - }, - 'loggers': { - 'django.request': { - 'handlers': [ - 'file', - # Don't send an email on server errors, there's just too many - #{% if env == 'production' %} - #'mail_admins', - #{% endif %} - # - - ], - 'level': 'DEBUG', - }, - 'django.security.DisallowedHost': { - 'handlers': ['null'], - 'propagate': False, - }, - 'requests.packages.urllib3': { - 'level': 'WARNING', - }, - }, - 'formatters': { - 'verbose': { - 'format': '%(levelname)s %(asctime)s %(process)d %(name)s %(message)s' - }, - 'simple': { - 'format': '%(levelname)s %(message)s' - }, - }, - 'root': { - 'handlers': ['file'], - 'level': 'INFO', - }, -} - - -# Cache: use the local memcached server -CACHES = { - 'default': { - 'BACKEND': 'django.core.cache.backends.memcached.PyLibMCCache', - 'LOCATION': '127.0.0.1:11211', - } -} - - -# Only display mailing-lists from the same virtual host as the webserver -FILTER_VHOST = False diff --git a/roles/mailman/templates/settings_admin.py.j2 b/roles/mailman/templates/settings_admin.py.j2 deleted file mode 100644 index 41f256743e..0000000000 --- a/roles/mailman/templates/settings_admin.py.j2 +++ /dev/null @@ -1,23 +0,0 @@ -#-*- coding: utf-8 -*- - -""" -Copy of the Django settings file, but with database admin credentials (for -schema modifications) -""" - -from settings import * -try: - from settings_local import * -except ImportError: - pass - -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql_psycopg2', - 'NAME': 'hyperkitty', - 'USER': 'hyperkittyadmin', - 'PASSWORD': '{{ mailman_hyperkitty_admin_db_pass }}', - 'HOST': '{{ mailman_db_server }}', - 'PORT': '', - } -} diff --git a/roles/mailman/templates/webui-qcluster.service.j2 b/roles/mailman/templates/webui-qcluster.service.j2 deleted file mode 100644 index 1eb2eb854c..0000000000 --- a/roles/mailman/templates/webui-qcluster.service.j2 +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=Mailman web UI async tasks runner -After=network.target remote-fs.target - -[Service] -ExecStart=/usr/bin/django-admin qcluster --pythonpath {{ mailman_webui_confdir }} --settings settings -User=apache -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/roles/mailman/templates/webui-warm-up-cache.service.j2 b/roles/mailman/templates/webui-warm-up-cache.service.j2 deleted file mode 100644 index 8c251a4129..0000000000 --- a/roles/mailman/templates/webui-warm-up-cache.service.j2 +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Mailman web UI warm up cache -Requires=memcached.service -After=memcached.service - -[Service] -Type=oneshot -ExecStart=/usr/bin/django-admin hyperkitty_warm_up_cache --pythonpath {{ mailman_webui_confdir }} --settings settings -v 2 -User=apache - -[Install] -WantedBy=multi-user.target