diff --git a/functional_tests/features/pagekite.feature b/functional_tests/features/pagekite.feature index bf21aebb3..b421ec883 100644 --- a/functional_tests/features/pagekite.feature +++ b/functional_tests/features/pagekite.feature @@ -15,7 +15,7 @@ # along with this program. If not, see . # -@apps @pagekite +@apps @pagekite @backups Feature: Pagekite Public Visibility Configure Pagekite public visitbility server. @@ -37,3 +37,13 @@ Scenario: Configure pagekite application Given pagekite is enabled When I configure pagekite with host pagekite.example.com, port 8080, kite name mykite.example.com and kite secret mysecret Then pagekite should be configured with host pagekite.example.com, port 8080, kite name mykite.example.com and kite secret mysecret + +Scenario: Backup and restore pagekite + Given pagekite is enabled + When I configure pagekite with host beforebackup.example.com, port 8081, kite name beforebackup.example.com and kite secret beforebackupsecret + And I create a backup of the pagekite app data + And I configure pagekite with host afterbackup.example.com, port 8082, kite name afterbackup.example.com and kite secret afterbackupsecret + And I export the pagekite app data backup + And I restore the pagekite app data backup + Then pagekite should be enabled + And pagekite should be configured with host beforebackup.example.com, port 8081, kite name beforebackup.example.com and kite secret beforebackupsecret diff --git a/functional_tests/support/system.py b/functional_tests/support/system.py index dd613c1db..2f9f46101 100644 --- a/functional_tests/support/system.py +++ b/functional_tests/support/system.py @@ -205,7 +205,7 @@ def pagekite_is_enabled(browser): """Return whether pagekite is enabled.""" nav_to_module(browser, 'pagekite') browser.find_link_by_href('/plinth/sys/pagekite/configure/').first.click() - return browser.find_by_id('id_pagekite-enabled').value + return browser.find_by_id('id_pagekite-enabled').checked def pagekite_configure(browser, host, port, kite_name, kite_secret): diff --git a/plinth/modules/pagekite/__init__.py b/plinth/modules/pagekite/__init__.py index 74ae8c9d4..4d1d8c2bb 100644 --- a/plinth/modules/pagekite/__init__.py +++ b/plinth/modules/pagekite/__init__.py @@ -25,11 +25,14 @@ from plinth.menu import main_menu from plinth.utils import format_lazy from . import utils +from .manifest import backup version = 1 depends = ['names'] +managed_services = ['pagekite'] + managed_packages = ['pagekite'] first_boot_steps = [ @@ -52,8 +55,8 @@ description = [ 'the rest of the Internet. This includes the following ' 'situations:'), box_name=_(cfg.box_name)), format_lazy( - _('{box_name} is behind a restricted firewall.'), box_name=_( - cfg.box_name)), + _('{box_name} is behind a restricted firewall.'), + box_name=_(cfg.box_name)), format_lazy( _('{box_name} is connected to a (wireless) router which you ' 'don\'t control.'), box_name=_(cfg.box_name)), diff --git a/plinth/modules/pagekite/manifest.py b/plinth/modules/pagekite/manifest.py new file mode 100644 index 000000000..19d4ba694 --- /dev/null +++ b/plinth/modules/pagekite/manifest.py @@ -0,0 +1,28 @@ +# +# This file is part of FreedomBox. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +""" +Application manifest for pagekite. +""" + +from plinth.modules.backups.api import validate as validate_backup + +backup = validate_backup({ + 'config': { + 'directories': ['/etc/pagekite.d/'] + }, + 'services': ['pagekite'] +})