From 5f15fdda45e0f6bb87cd46360f382f2af37390b9 Mon Sep 17 00:00:00 2001 From: Joseph Nuthalapati Date: Wed, 3 Oct 2018 14:36:01 -0700 Subject: [PATCH] quassel: Enable backup/restore - All the configuration is in data folder, no custom configuration. - SSL certificate is in the data folder. - Users, logs etc. are in sqlite file in the data folder. Reviewed-by: James Valleroy --- functional_tests/features/quassel.feature | 8 ++++++++ plinth/modules/quassel/__init__.py | 2 +- plinth/modules/quassel/manifest.py | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/functional_tests/features/quassel.feature b/functional_tests/features/quassel.feature index 70bf86b44..eb00705de 100644 --- a/functional_tests/features/quassel.feature +++ b/functional_tests/features/quassel.feature @@ -32,3 +32,11 @@ Scenario: Disable quassel application Given the quassel application is enabled When I disable the quassel application Then the quassel service should not be running + +# TODO: Improve this to actually check that data configured servers is restored. +Scenario: Backup and restore quassel + Given the quassel application is enabled + When I create a backup of the quassel app data + And I export the quassel app data backup + And I restore the quassel app data backup + Then the quassel service should be running diff --git a/plinth/modules/quassel/__init__.py b/plinth/modules/quassel/__init__.py index 3dd96e9db..c7f05e332 100644 --- a/plinth/modules/quassel/__init__.py +++ b/plinth/modules/quassel/__init__.py @@ -27,7 +27,7 @@ from plinth.menu import main_menu from plinth.utils import format_lazy from plinth.views import ServiceView -from .manifest import clients +from .manifest import backup, clients version = 1 diff --git a/plinth/modules/quassel/manifest.py b/plinth/modules/quassel/manifest.py index e31af0f3a..a97f2f0a0 100644 --- a/plinth/modules/quassel/manifest.py +++ b/plinth/modules/quassel/manifest.py @@ -18,6 +18,7 @@ from django.utils.translation import ugettext_lazy as _ from plinth.clients import store_url, validate +from plinth.modules.backups.api import validate as validate_backup clients = validate([{ 'name': @@ -58,3 +59,10 @@ clients = validate([{ 'url': store_url('google-play', 'com.iskrembilen.quasseldroid'), }] }]) + +backup = validate_backup({ + 'secrets': { + 'directories': ['/var/lib/quassel/'] + }, + 'services': ['quassel-core'], +})