mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
matrixsynapse: Completely uninstall app
Remove database, mediafiles and freedombox configs. Removal of certs are not neccessary since the next setup will overwrite them Test: 1. Install the app and set a domain 2. Reinstall the app and confirm the domain can be set like it's the first time Signed-off-by: nbenedek <contact@nbenedek.me> [sunil: Update docstrings, make uninstall fail-safe] [sunil: Fix uninstall functional test] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
b2ad4088aa
commit
1659b456d1
@ -126,6 +126,11 @@ class MatrixSynapseApp(app_module.App):
|
||||
config = self.get_component('turn-matrixsynapse').get_configuration()
|
||||
update_turn_configuration(config, force=True)
|
||||
|
||||
def uninstall(self):
|
||||
"""De-configure and uninstall the app."""
|
||||
super().uninstall()
|
||||
privileged.uninstall()
|
||||
|
||||
|
||||
class MatrixSynapseTurnConsumer(TurnConsumer):
|
||||
"""Component to manage Coturn configuration for Matrix Synapse."""
|
||||
|
||||
@ -339,3 +339,10 @@ def _generate_mac(shared_secret: str, nonce: str, user: str, password: str,
|
||||
mac.update(user_type.encode('utf8'))
|
||||
|
||||
return mac.hexdigest()
|
||||
|
||||
|
||||
@privileged
|
||||
def uninstall():
|
||||
"""Delete configuration and data directories."""
|
||||
for item in ['/etc/matrix-synapse/conf.d', '/var/lib/matrix-synapse']:
|
||||
shutil.rmtree(item, ignore_errors=True)
|
||||
|
||||
@ -24,3 +24,9 @@ class TestMatrixSynapseApp(functional.BaseAppTests):
|
||||
functional.install(session_browser, self.app_name)
|
||||
functional.app_select_domain_name(session_browser, self.app_name,
|
||||
'mydomain.example')
|
||||
|
||||
def test_uninstall(self, session_browser):
|
||||
"""After uninstall test, after installing select the domain again."""
|
||||
super().test_uninstall(session_browser)
|
||||
functional.app_select_domain_name(session_browser, self.app_name,
|
||||
'mydomain.example')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user