diff --git a/actions/ttrss b/actions/ttrss index 9622548b8..40578cec9 100755 --- a/actions/ttrss +++ b/actions/ttrss @@ -23,6 +23,7 @@ Configuration helper for Tiny Tiny RSS. import argparse import augeas +import subprocess from plinth import action_utils @@ -35,6 +36,7 @@ def parse_arguments(): parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(dest='subcommand', help='Sub command') + subparsers.add_parser('pre-setup', help='Perform pre-setup operations') subparsers.add_parser('setup', help='Setup Tiny Tiny RSS configuration') subparsers.add_parser('enable', help='Enable Tiny Tiny RSS site') subparsers.add_parser('disable', help='Disable Tiny Tiny RSS site') @@ -42,6 +44,13 @@ def parse_arguments(): return parser.parse_args() +def subcommand_pre_setup(_): + """Preseed debconf values before packages are installed.""" + subprocess.check_output( + ['debconf-set-selections'], + input=b'tt-rss tt-rss/database-type string pgsql') + + def subcommand_setup(_): """Setup Tiny Tiny RSS configuration.""" aug = load_augeas() diff --git a/plinth/modules/ttrss/__init__.py b/plinth/modules/ttrss/__init__.py index 3520f4bee..9cb4a6f0c 100644 --- a/plinth/modules/ttrss/__init__.py +++ b/plinth/modules/ttrss/__init__.py @@ -58,6 +58,7 @@ def init(): def setup(helper, old_version=None): """Install and configure the module.""" + helper.call('pre', actions.superuser_run, 'ttrss', ['pre-setup']) helper.install(['tt-rss', 'postgresql', 'dbconfig-pgsql', 'php-pgsql']) helper.call('post', actions.superuser_run, 'ttrss', ['setup']) helper.call('post', service.notify_enabled, None, True) @@ -72,7 +73,7 @@ def get_status(): def is_enabled(): """Return whether the module is enabled.""" return (action_utils.service_is_enabled('tt-rss') and - action_utils.webserver_is_enabled('tt-rss-plinth')) + action_utils.webserver_is_enabled('tt-rss-plinth')) def is_running(): diff --git a/plinth/modules/ttrss/urls.py b/plinth/modules/ttrss/urls.py index 271321841..d758af068 100644 --- a/plinth/modules/ttrss/urls.py +++ b/plinth/modules/ttrss/urls.py @@ -16,7 +16,7 @@ # """ -URLs for the ttrss module. +URLs for the Tiny Tiny RSS module. """ from django.conf.urls import url