mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
roundcube: Completely uninstall app
* remove local config and sqlite file * add them to the backup manifest Tests: 1. Modify the user's email address inside roundcube 2. Reinstall the app and confirm the modification was reset 3. Functional tests passed Signed-off-by: nbenedek <contact@nbenedek.me> [sunil: Update docstrings, make uninstall fail-safe] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
1659b456d1
commit
f11074ab9d
@ -95,6 +95,11 @@ class RoundcubeApp(app_module.App):
|
||||
privileged.set_config(local_only=True)
|
||||
self.enable()
|
||||
|
||||
def uninstall(self):
|
||||
"""De-configure and uninstall the app."""
|
||||
super().uninstall()
|
||||
privileged.uninstall()
|
||||
|
||||
def force_upgrade(self, packages):
|
||||
"""Force upgrade package to resolve conffile prompts."""
|
||||
if 'roundcube-core' not in packages:
|
||||
|
||||
@ -10,4 +10,9 @@ clients = [{
|
||||
}]
|
||||
}]
|
||||
|
||||
backup = {}
|
||||
backup = {
|
||||
'data': {
|
||||
'files': ['/etc/roundcube/freedombox-config.php',
|
||||
'/var/lib/dbconfig-common/sqlite3/roundcube/roundcube']
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,8 @@ from plinth import action_utils
|
||||
from plinth.actions import privileged
|
||||
|
||||
_config_file = pathlib.Path('/etc/roundcube/freedombox-config.php')
|
||||
_rc_db_file = pathlib.Path('/var/lib/dbconfig-common/sqlite3/'
|
||||
'roundcube/roundcube')
|
||||
|
||||
|
||||
@privileged
|
||||
@ -68,3 +70,10 @@ $config['smtp_helo_host'] = 'localhost';
|
||||
'''
|
||||
|
||||
_config_file.write_text(config, encoding='utf-8')
|
||||
|
||||
|
||||
@privileged
|
||||
def uninstall():
|
||||
"""Remove config file and database."""
|
||||
for item in _config_file, _rc_db_file:
|
||||
item.unlink(missing_ok=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user