Mailman: sync with recent developments

This commit is contained in:
Aurélien Bompard 2013-12-18 16:27:24 +00:00
parent 869a1965b3
commit 7b744d074e
5 changed files with 27 additions and 14 deletions

View file

@ -66,17 +66,13 @@ class Importer(object):
(list_is_new or not self.opts.new_only):
call(["sudo", "kittystore-import", "-p",
self.config["confdir"], "-s", "settings_admin",
"-l", listaddr, "--continue", "--no-refresh",
"-l", listaddr, "--continue", "--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 self.opts.no_archives:
call(["sudo", "kittystore-refresh-cache", "-p",
self.config["confdir"], "-s", "settings_admin"])
else:
call(["sudo", "kittystore-refresh-cache", "-p",
self.config["confdir"], "-s", "settings_admin", "-f"])
call(["sudo", "kittystore-sync-mailman", "-p",
self.config["confdir"], "-s", "settings_admin"])

View file

@ -18,9 +18,11 @@ def give_rights(dbhost, dbuser, dbpasswd, dbname):
conn = psycopg2.connect(host=dbhost, user=dbuser, password=dbpasswd,
database=dbname)
cur = conn.cursor()
# Database permissions
dbrightsquery = "GRANT CONNECT,TEMP ON DATABASE %s TO %sapp;" % (dbname, dbname)
print dbrightsquery
cur.execute(dbrightsquery)
# Table permissions
cur.execute("""
SELECT 'GRANT SELECT,INSERT,UPDATE,DELETE,TRUNCATE ON ' || relname || ' TO %sapp;'
FROM pg_class
@ -28,6 +30,17 @@ def give_rights(dbhost, dbuser, dbpasswd, dbname):
WHERE nspname = 'public' AND relkind IN ('r', 'v');
""" % dbname)
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 %sapp;'
FROM pg_class
JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace
WHERE nspname = 'public' AND relkind = 'S';
""" % dbname)
queries = [ q[0] for q in cur ]
for query in queries:
print query
cur.execute(query)

View file

@ -13,7 +13,7 @@ INDEXDIR=$BASEDIR/kittystore_search_index
django-admin collectstatic --clear --noinput --pythonpath $CONFDIR --settings settings
django-admin assets build --parse-templates --pythonpath $CONFDIR --settings settings
django-admin syncdb --pythonpath $CONFDIR --settings settings_admin
django-admin migrate hyperkitty --pythonpath $CONFDIR --settings settings_admin
django-admin migrate --pythonpath $CONFDIR --settings settings_admin
django-admin loaddata /etc/postorius/sites/default/initial-user.json --pythonpath $CONFDIR --settings settings_admin
kittystore-updatedb --pythonpath $CONFDIR --settings settings_admin
chown mailman:mailman -R $INDEXDIR
@ -21,3 +21,8 @@ chmod g+w -R $INDEXDIR
# Give database rights to the non-admin user
$BASEDIR/bin/pg-give-rights.py
# Reload Apache to flush the python cache
systemctl reload httpd
# Restart Mailman3 since kittystore was updated
systemctl restart mailman3

View file

@ -150,10 +150,6 @@
notify:
- reload apache
- name: copy the manage.py script
command: /bin/cp /etc/hyperkitty/sites/default/manage.py "{{ mailman_webui_confdir }}/manage.py"
creates="{{ mailman_webui_confdir }}/manage.py"
- name: create the kittystore plain text index dir
file: path="{{ mailman_webui_basedir }}/kittystore_search_index"
state=directory owner=mailman group=mailman mode=0755

View file

@ -220,9 +220,9 @@ AUTH_PROFILE_MODULE = 'hyperkitty.UserProfile'
# https://github.com/twaddington/django-gravatar
#
# Gravatar base url.
#GRAVATAR_URL = 'http://www.gravatar.com/'
#GRAVATAR_URL = 'http://cdn.libravatar.org/'
# Gravatar base secure https url.
#GRAVATAR_SECURE_URL = 'https://secure.gravatar.com/'
#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'.
@ -328,6 +328,9 @@ KITTYSTORE_SEARCH_INDEX = '{{ mailman_webui_basedir }}/kittystore_search_index'
# Use SSL when logged in
USE_SSL = True
# Only display mailing-lists from the same virtual host as the webserver
FILTER_VHOST = False
# WARNING: the KITTYSTORE_DEBUG variable below will output every SQL query.
# That's a huge amount of text, don't enable it if you don't need to.
KITTYSTORE_DEBUG = False