mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-22 10:01:45 +00:00
ttrss: Ensure database used is PostgreSQL
- Installing dbcommon-pgsql and not install dbcommon-mysql does not ensure that PostgreSQL is selected as the database for the application. Set a debconf value to force selection of PostgreSQL. - Minor styling fixes.
This commit is contained in:
parent
368e64c5ca
commit
4c6d572e67
@ -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()
|
||||
|
||||
@ -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():
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
#
|
||||
|
||||
"""
|
||||
URLs for the ttrss module.
|
||||
URLs for the Tiny Tiny RSS module.
|
||||
"""
|
||||
|
||||
from django.conf.urls import url
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user