mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
Closes: #2159. Ship a separate Apache configuration file instead of editing the one provided by roundcube package. This avoids configuration file prompt when roundcube package needs to be upgraded. Tests: - Freshly install roundcube package 1.4.x (using apt preferences and Bullseye), run functional tests and login to a gmail account. - Freshly install roundcube package 1.5.x (from testing), run functional tests and login to a gmail account. - Install roundcube 1.4.x version on testing container without these changes. After applying these changes, run 'apt update' while roundcube is enabled and let FreedomBox upgrade roundcube to 1.5.x version. After this, run functional tests and login to a gmail account. - Repeat the previous test with upgrade while rouncube is disabled. Then enable rouncube, run functional tests and login to gmail account. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
43 lines
1.1 KiB
Python
Executable File
43 lines
1.1 KiB
Python
Executable File
#!/usr/bin/python3
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
Configuration helper for Roundcube server.
|
|
"""
|
|
|
|
import argparse
|
|
|
|
from plinth import action_utils
|
|
|
|
|
|
def parse_arguments():
|
|
"""Return parsed command line arguments as dictionary."""
|
|
parser = argparse.ArgumentParser()
|
|
subparsers = parser.add_subparsers(dest='subcommand', help='Sub command')
|
|
|
|
subparsers.add_parser('pre-install',
|
|
help='Perform Roundcube pre-install configuration')
|
|
|
|
subparsers.required = True
|
|
return parser.parse_args()
|
|
|
|
|
|
def subcommand_pre_install(_):
|
|
"""Preseed debconf values before packages are installed."""
|
|
action_utils.debconf_set_selections([
|
|
'roundcube-core roundcube/dbconfig-install boolean true',
|
|
'roundcube-core roundcube/database-type string sqlite3'
|
|
])
|
|
|
|
|
|
def main():
|
|
"""Parse arguments and perform all duties."""
|
|
arguments = parse_arguments()
|
|
|
|
subcommand = arguments.subcommand.replace('-', '_')
|
|
subcommand_method = globals()['subcommand_' + subcommand]
|
|
subcommand_method(arguments)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|