pagekite: Enable backup/restore

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Joseph Nuthalapati 2018-10-04 22:04:35 -07:00 committed by James Valleroy
parent 382e23636a
commit 78f1737788
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
4 changed files with 45 additions and 4 deletions

View File

@ -15,7 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
@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

View File

@ -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):

View File

@ -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)),

View File

@ -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 <http://www.gnu.org/licenses/>.
#
"""
Application manifest for pagekite.
"""
from plinth.modules.backups.api import validate as validate_backup
backup = validate_backup({
'config': {
'directories': ['/etc/pagekite.d/']
},
'services': ['pagekite']
})