diff --git a/functional_tests/features/security.feature b/functional_tests/features/security.feature index 0b63b5e3f..e9011266c 100644 --- a/functional_tests/features/security.feature +++ b/functional_tests/features/security.feature @@ -31,3 +31,11 @@ Scenario: Disable restricted console logins Given restricted console logins are enabled When I disable restricted console logins Then restricted console logins should be disabled + +Scenario: Backup and restore security + When I enable restricted console logins + And I create a backup of the security app data + And I disable restricted console logins + And I export the security app data backup + And I restore the security app data backup + Then restricted console logins should be enabled diff --git a/plinth/modules/security/__init__.py b/plinth/modules/security/__init__.py index d6e08a832..e5f9a4214 100644 --- a/plinth/modules/security/__init__.py +++ b/plinth/modules/security/__init__.py @@ -23,6 +23,8 @@ from django.utils.translation import ugettext_lazy as _ from plinth import actions from plinth.menu import main_menu +from .manifest import backup + version = 4 is_essential = True diff --git a/plinth/modules/security/manifest.py b/plinth/modules/security/manifest.py new file mode 100644 index 000000000..ba414444b --- /dev/null +++ b/plinth/modules/security/manifest.py @@ -0,0 +1,27 @@ +# +# 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 security. +""" + +from plinth.modules.backups.api import validate as validate_backup + +backup = validate_backup({ + 'config': { + 'files': ['/etc/security/access.conf'] + } +})