From 73bdd01b93ea8604802ff7b152cee7df8a1d54d1 Mon Sep 17 00:00:00 2001 From: James Valleroy Date: Thu, 2 Aug 2018 21:48:26 -0400 Subject: [PATCH] Add backups info to apps Signed-off-by: James Valleroy --- plinth/modules/dynamicdns/__init__.py | 1 + plinth/modules/dynamicdns/manifest.py | 32 ++++++++++++++++++++++++ plinth/modules/ejabberd/__init__.py | 2 +- plinth/modules/ejabberd/manifest.py | 16 ++++++++++++ plinth/modules/ikiwiki/__init__.py | 2 +- plinth/modules/ikiwiki/manifest.py | 16 ++++++++++++ plinth/modules/infinoted/__init__.py | 2 +- plinth/modules/infinoted/manifest.py | 23 +++++++++++++++-- plinth/modules/matrixsynapse/__init__.py | 2 +- plinth/modules/matrixsynapse/manifest.py | 27 ++++++++++++++++++++ plinth/modules/mediawiki/__init__.py | 2 +- plinth/modules/mediawiki/manifest.py | 16 ++++++++++++ plinth/modules/minetest/__init__.py | 2 +- plinth/modules/minetest/manifest.py | 16 ++++++++++++ plinth/modules/radicale/__init__.py | 2 +- plinth/modules/radicale/manifest.py | 16 ++++++++++++ plinth/modules/repro/__init__.py | 2 +- plinth/modules/repro/manifest.py | 16 ++++++++++++ 18 files changed, 185 insertions(+), 10 deletions(-) create mode 100644 plinth/modules/dynamicdns/manifest.py diff --git a/plinth/modules/dynamicdns/__init__.py b/plinth/modules/dynamicdns/__init__.py index de58b4d36..60b8c232a 100644 --- a/plinth/modules/dynamicdns/__init__.py +++ b/plinth/modules/dynamicdns/__init__.py @@ -26,6 +26,7 @@ from plinth.signals import domain_added from plinth.utils import format_lazy from . import dynamicdns +from .manifest import backup version = 1 diff --git a/plinth/modules/dynamicdns/manifest.py b/plinth/modules/dynamicdns/manifest.py new file mode 100644 index 000000000..a3c6e7078 --- /dev/null +++ b/plinth/modules/dynamicdns/manifest.py @@ -0,0 +1,32 @@ +# +# 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 . +# + +backup = { + 'config': { + 'directories': ['/etc/ez-ipupdate/'], + 'files': [], + }, + 'data': { + 'directories': [], + 'files': [], + }, + 'secrets': { + 'directories': [], + 'files': [], + }, + 'services': [] +} diff --git a/plinth/modules/ejabberd/__init__.py b/plinth/modules/ejabberd/__init__.py index b7c896231..3cf06c474 100644 --- a/plinth/modules/ejabberd/__init__.py +++ b/plinth/modules/ejabberd/__init__.py @@ -31,7 +31,7 @@ from plinth.signals import (domainname_change, post_hostname_change, pre_hostname_change) from plinth.utils import format_lazy -from .manifest import clients +from .manifest import backup, clients version = 1 diff --git a/plinth/modules/ejabberd/manifest.py b/plinth/modules/ejabberd/manifest.py index bb6188e9c..b36b19991 100644 --- a/plinth/modules/ejabberd/manifest.py +++ b/plinth/modules/ejabberd/manifest.py @@ -120,3 +120,19 @@ _clients = validate([{ _clients.extend(jsxc_manifest.clients) clients = _clients + +backup = { + 'config': { + 'directories': [], + 'files': ['/etc/ejabberd/ejabberd.yml'], + }, + 'data': { + 'directories': ['/var/lib/ejabberd/'], + 'files': [], + }, + 'secrets': { + 'directories': [], + 'files': ['/etc/ejabberd/ejabberd.pem'], + }, + 'services': ['ejabberd'] +} diff --git a/plinth/modules/ikiwiki/__init__.py b/plinth/modules/ikiwiki/__init__.py index 0164f00fa..af4e1dbcb 100644 --- a/plinth/modules/ikiwiki/__init__.py +++ b/plinth/modules/ikiwiki/__init__.py @@ -27,7 +27,7 @@ from plinth.menu import main_menu from plinth.modules.users import register_group from plinth.utils import format_lazy -from .manifest import clients +from .manifest import backup, clients version = 1 diff --git a/plinth/modules/ikiwiki/manifest.py b/plinth/modules/ikiwiki/manifest.py index 75de216bd..553f87314 100644 --- a/plinth/modules/ikiwiki/manifest.py +++ b/plinth/modules/ikiwiki/manifest.py @@ -26,3 +26,19 @@ clients = validate([{ 'url': '/ikiwiki' }] }]) + +backup = { + 'config': { + 'directories': [], + 'files': [], + }, + 'data': { + 'directories': ['/var/lib/ikiwiki/'], + 'files': [], + }, + 'secrets': { + 'directories': [], + 'files': [], + }, + 'services': [] +} diff --git a/plinth/modules/infinoted/__init__.py b/plinth/modules/infinoted/__init__.py index c7158618f..ffc4cfbe5 100644 --- a/plinth/modules/infinoted/__init__.py +++ b/plinth/modules/infinoted/__init__.py @@ -29,7 +29,7 @@ from plinth import service as service_module 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/infinoted/manifest.py b/plinth/modules/infinoted/manifest.py index 6cf22acd4..085307c64 100644 --- a/plinth/modules/infinoted/manifest.py +++ b/plinth/modules/infinoted/manifest.py @@ -29,8 +29,8 @@ clients = validate([{ 'usage': format_lazy( _('Start Gobby and select "Connect to Server" and ' - 'enter your {box_name}\'s domain name.'), box_name=_( - cfg.box_name)), + 'enter your {box_name}\'s domain name.'), + box_name=_(cfg.box_name)), 'platforms': [{ 'type': 'download', 'os': 'gnu-linux', @@ -45,3 +45,22 @@ clients = validate([{ 'name': 'gobby' }] }]) + +backup = { + 'config': { + 'directories': [], + 'files': [], + }, + 'data': { + 'directories': ['/var/lib/infinoted/'], + 'files': [], + }, + 'secrets': { + 'directories': [], + 'files': [ + '/etc/infinoted/infinoted-cert.pem', + '/etc/infinoted/infinoted-key.pem' + ], + }, + 'services': ['infinoted'] +} diff --git a/plinth/modules/matrixsynapse/__init__.py b/plinth/modules/matrixsynapse/__init__.py index 0a51f640b..8ce2c3dfe 100644 --- a/plinth/modules/matrixsynapse/__init__.py +++ b/plinth/modules/matrixsynapse/__init__.py @@ -29,7 +29,7 @@ from plinth import service as service_module from plinth import action_utils, actions, frontpage from plinth.menu import main_menu -from .manifest import clients +from .manifest import backup, clients version = 2 diff --git a/plinth/modules/matrixsynapse/manifest.py b/plinth/modules/matrixsynapse/manifest.py index dcc020b65..f6cd58e65 100644 --- a/plinth/modules/matrixsynapse/manifest.py +++ b/plinth/modules/matrixsynapse/manifest.py @@ -52,3 +52,30 @@ clients = validate([{ 'url': _riot_desktop_download_url, }] }]) + +backup = { + 'config': { + 'directories': ['/etc/matrix-synapse/conf.d/'], + 'files': [ + '/etc/matrix-synapse/homeserver.yaml', + '/etc/matrix-synapse/log.yaml' + ], + }, + 'data': { + 'directories': [ + '/var/lib/matrix-synapse/media/', + '/var/lib/matrix-synapse/uploads/' + ], + 'files': ['/var/lib/matrix-synapse/homeserver.db'], + }, + 'secrets': { + 'directories': [], + 'files': [ + '/etc/matrix-synapse/homeserver.signing.key', + '/etc/matrix-synapse/homeserver.tls.crt', + '/etc/matrix-synapse/homeserver.tls.dh', + '/etc/matrix-synapse/homeserver.tls.key' + ], + }, + 'services': ['matrix-synapse'] +} diff --git a/plinth/modules/mediawiki/__init__.py b/plinth/modules/mediawiki/__init__.py index 12358b1dd..88d9bf37d 100644 --- a/plinth/modules/mediawiki/__init__.py +++ b/plinth/modules/mediawiki/__init__.py @@ -24,7 +24,7 @@ from plinth import service as service_module from plinth import action_utils, actions, frontpage from plinth.menu import main_menu -from .manifest import clients +from .manifest import backup, clients version = 4 diff --git a/plinth/modules/mediawiki/manifest.py b/plinth/modules/mediawiki/manifest.py index 746a57c62..0f17408d1 100644 --- a/plinth/modules/mediawiki/manifest.py +++ b/plinth/modules/mediawiki/manifest.py @@ -26,3 +26,19 @@ clients = validate([{ 'url': '/mediawiki' }] }]) + +backup = { + 'config': { + 'directories': [], + 'files': [], + }, + 'data': { + 'directories': ['/var/lib/mediawiki-db/'], + 'files': [], + }, + 'secrets': { + 'directories': [], + 'files': [], + }, + 'services': [] +} diff --git a/plinth/modules/minetest/__init__.py b/plinth/modules/minetest/__init__.py index 9b9379cca..5e82d54f8 100644 --- a/plinth/modules/minetest/__init__.py +++ b/plinth/modules/minetest/__init__.py @@ -27,7 +27,7 @@ from plinth import action_utils, actions, cfg, frontpage from plinth.menu import main_menu from plinth.utils import format_lazy -from .manifest import clients +from .manifest import backup, clients version = 2 diff --git a/plinth/modules/minetest/manifest.py b/plinth/modules/minetest/manifest.py index 0d92ad5b3..9591028de 100644 --- a/plinth/modules/minetest/manifest.py +++ b/plinth/modules/minetest/manifest.py @@ -50,3 +50,19 @@ clients = validate([{ 'name': 'minetest' }] }]) + +backup = { + 'config': { + 'directories': [], + 'files': ['/etc/minetest/minetest.conf'], + }, + 'data': { + 'directories': ['/var/games/minetest-server/'], + 'files': [], + }, + 'secrets': { + 'directories': [], + 'files': [], + }, + 'services': ['minetest-server'] +} diff --git a/plinth/modules/radicale/__init__.py b/plinth/modules/radicale/__init__.py index 657727b60..be2564213 100644 --- a/plinth/modules/radicale/__init__.py +++ b/plinth/modules/radicale/__init__.py @@ -27,7 +27,7 @@ from plinth import action_utils, actions, cfg, frontpage from plinth.menu import main_menu from plinth.utils import format_lazy -from .manifest import clients +from .manifest import backup, clients version = 1 diff --git a/plinth/modules/radicale/manifest.py b/plinth/modules/radicale/manifest.py index a9429c338..afffcabc6 100644 --- a/plinth/modules/radicale/manifest.py +++ b/plinth/modules/radicale/manifest.py @@ -85,3 +85,19 @@ clients = validate([{ 'name': 'evolution' }] }]) + +backup = { + 'config': { + 'directories': [], + 'files': [], + }, + 'data': { + 'directories': ['/var/lib/radicale/'], + 'files': [], + }, + 'secrets': { + 'directories': [], + 'files': [], + }, + 'services': ['radicale'] +} diff --git a/plinth/modules/repro/__init__.py b/plinth/modules/repro/__init__.py index 95cb7ec92..7ba8d29b3 100644 --- a/plinth/modules/repro/__init__.py +++ b/plinth/modules/repro/__init__.py @@ -26,7 +26,7 @@ from plinth import action_utils, actions, frontpage from plinth.menu import main_menu from plinth.views import ServiceView -from .manifest import clients +from .manifest import backup, clients version = 2 diff --git a/plinth/modules/repro/manifest.py b/plinth/modules/repro/manifest.py index d77db6839..4410390a2 100644 --- a/plinth/modules/repro/manifest.py +++ b/plinth/modules/repro/manifest.py @@ -73,3 +73,19 @@ clients = validate([{ 'url': store_url('google-play', _csipsimple_package_id) }] }]) + +backup = { + 'config': { + 'directories': [], + 'files': ['/etc/repro/repro.config', '/etc/repro/users.txt'], + }, + 'data': { + 'directories': ['/var/lib/repro/'], + 'files': [], + }, + 'secrets': { + 'directories': ['/etc/repro/ssl/'], + 'files': ['/etc/repro/dh2048.pem'], + }, + 'services': ['repro'] +}