mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
ttrss: Add backup support
- Use backup hooks to dump and restore database. - Add functional test for backup and restore. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
1 parent
8a60581f3d
commit
1eed7d581d
6 files changed
+123
-2
No files matched your search
@@ -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 = 3
|
||||
|
||||
@@ -132,3 +132,13 @@ def diagnose():
|
||||
check_certificate=False))
|
||||
|
||||
return results
|
||||
|
||||
|
||||
def backup_pre(packet):
|
||||
"""Save database contents."""
|
||||
actions.superuser_run('ttrss', ['dump-database'])
|
||||
|
||||
|
||||
def restore_post(packet):
|
||||
"""Restore database contents."""
|
||||
actions.superuser_run('ttrss', ['restore-database'])
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth.modules.backups.api import validate as validate_backup
|
||||
from plinth.clients import store_url, validate
|
||||
|
||||
clients = validate([{
|
||||
@@ -41,3 +42,13 @@ clients = validate([{
|
||||
'url': '/tt-rss'
|
||||
}]
|
||||
}])
|
||||
|
||||
backup = validate_backup({
|
||||
'data': {
|
||||
'files': ['/var/lib/plinth/backups-data/ttrss-database.sql']
|
||||
},
|
||||
'secrets': {
|
||||
'files': ['/etc/tt-rss/database.php']
|
||||
},
|
||||
'services': ['tt-rss']
|
||||
})
|
||||
Reference in new issue
Block a user