summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-12 14:15:44 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-05-12 14:16:18 +0100
commitb87c83549ddefa22ca0b1d989abcf12a6465b560 (patch)
tree91a57f3bc12d9fc864ba9ea3b63089c3d03a6b80 /pykolab
parent77622e6c45bd64b2a159e1b0768f44f81e9881d8 (diff)
downloadpykolab-b87c83549ddefa22ca0b1d989abcf12a6465b560.tar.gz
During setup, scratch the des_key setting for Roundcube (#715)
Diffstat (limited to 'pykolab')
-rw-r--r--pykolab/setup/setup_roundcube.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pykolab/setup/setup_roundcube.py b/pykolab/setup/setup_roundcube.py
index 0077a3d..30a2aa9 100644
--- a/pykolab/setup/setup_roundcube.py
+++ b/pykolab/setup/setup_roundcube.py
@@ -18,7 +18,10 @@
#
from Cheetah.Template import Template
+import hashlib
import os
+import random
+import re
import subprocess
import sys
@@ -58,6 +61,15 @@ def execute(*args, **kw):
conf.mysql_roundcube_password = mysql_roundcube_password
rc_settings = {
+ 'des_key': re.sub(
+ r'[^a-zA-Z0-9]',
+ "",
+ "%s%s" % (
+ hashlib.md5("%s" % random.random()).digest().encode("base64"),
+ hashlib.md5("%s" % random.random()).digest().encode("base64")
+ )
+ )[:25],
+
'imap_admin_login': conf.get('cyrus-imapd', 'admin_login'),
'imap_admin_password': conf.get('cyrus-imapd', 'admin_password'),
'ldap_base_dn': conf.get('ldap', 'base_dn'),