mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-04-22 10:01:45 +00:00
searx: Completely uninstall app
* If only the SETTINGS_FILE gets removed, the setup
process fails afterwards
* Don't remove the public access file since the setup process
will remove it anyway
Test: 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
17e062e829
commit
be7fd45393
@ -100,6 +100,11 @@ class SearxApp(app_module.App):
|
||||
self.enable()
|
||||
self.set_shortcut_login_required(True)
|
||||
|
||||
def uninstall(self):
|
||||
"""De-configure and uninstall the app."""
|
||||
super().uninstall()
|
||||
privileged.unininstall()
|
||||
|
||||
|
||||
class SearxWebserverAuth(Webserver):
|
||||
"""Component to handle Searx authentication webserver configuration."""
|
||||
|
||||
@ -153,3 +153,10 @@ def disable_public_access():
|
||||
"""Disable public access to the SearX application."""
|
||||
if os.path.exists(PUBLIC_ACCESS_SETTING_FILE):
|
||||
os.remove(PUBLIC_ACCESS_SETTING_FILE)
|
||||
|
||||
|
||||
@privileged
|
||||
def unininstall():
|
||||
"""Remove configuration uWSGI file."""
|
||||
shutil.rmtree('/etc/searx', ignore_errors=True)
|
||||
pathlib.Path(UWSGI_FILE).unlink(missing_ok=True)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user