Changeset View
Changeset View
Standalone View
Standalone View
pykolab/setup/setup_roundcube.py
Show All 11 Lines | |||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
# GNU General Public License for more details. | # GNU General Public License for more details. | ||||
# You should have received a copy of the GNU General Public License | # You should have received a copy of the GNU General Public License | ||||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
# | # | ||||
from __future__ import print_function | |||||
import codecs | import codecs | ||||
import grp | import grp | ||||
import hashlib | import hashlib | ||||
import os | import os | ||||
import random | import random | ||||
import re | import re | ||||
import subprocess | import subprocess | ||||
import sys | import sys | ||||
Show All 18 Lines | def __init__(): | ||||
components.register('roundcube', execute, description=description(), after=['mysql', 'ldap']) | components.register('roundcube', execute, description=description(), after=['mysql', 'ldap']) | ||||
def description(): | def description(): | ||||
return _("Setup Roundcube.") | return _("Setup Roundcube.") | ||||
def execute(*args, **kw): | def execute(*args, **kw): | ||||
print >> sys.stderr, utils.multiline_message( | print(utils.multiline_message( | ||||
""" | """ | ||||
Please supply a password for the MySQL user 'roundcube'. | Please supply a password for the MySQL user 'roundcube'. | ||||
This password will be used by the Roundcube webmail | This password will be used by the Roundcube webmail | ||||
interface. | interface. | ||||
""" | """ | ||||
) | ), file=sys.stderr) | ||||
mysql_roundcube_password = utils.ask_question( | mysql_roundcube_password = utils.ask_question( | ||||
"MySQL roundcube password", | "MySQL roundcube password", | ||||
default=utils.generate_password(), | default=utils.generate_password(), | ||||
password=True, | password=True, | ||||
confirm=True | confirm=True | ||||
) | ) | ||||
▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | for root, directories, filenames in os.walk('/usr/share/doc/'): | ||||
schema_files.append(schema_filepath) | schema_files.append(schema_filepath) | ||||
if len(schema_files) > 0: | if len(schema_files) > 0: | ||||
break | break | ||||
if len(schema_files) > 0: | if len(schema_files) > 0: | ||||
break | break | ||||
if not os.path.isfile('/tmp/kolab-setup-my.cnf'): | if not os.path.isfile('/tmp/kolab-setup-my.cnf'): | ||||
print >> sys.stderr, utils.multiline_message( | print(utils.multiline_message( | ||||
"""Please supply the MySQL root password (use 'unix_socket' for socket based authentication)""" | """Please supply the MySQL root password (use 'unix_socket' for socket based authentication)""" | ||||
) | ), file=sys.stderr) | ||||
mysql_root_password = utils.ask_question( | mysql_root_password = utils.ask_question( | ||||
_("MySQL root password"), | _("MySQL root password"), | ||||
password=True | password=True | ||||
) | ) | ||||
socket_path = None | socket_path = None | ||||
socket_paths = [ | socket_paths = [ | ||||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |