mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
searx: Use action utils for uwsgi configuration management
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
2c59bbe0f3
commit
bed43564c3
@ -152,20 +152,14 @@ def subcommand_setup(_):
|
||||
|
||||
def subcommand_enable(_):
|
||||
"""Enable web configuration and reload."""
|
||||
if not os.path.exists('/etc/uwsgi/apps-enabled/searx.ini'):
|
||||
os.symlink('/etc/uwsgi/apps-available/searx.ini',
|
||||
'/etc/uwsgi/apps-enabled/searx.ini')
|
||||
|
||||
action_utils.service_enable('uwsgi')
|
||||
action_utils.service_restart('uwsgi')
|
||||
action_utils.uwsgi_enable('searx')
|
||||
action_utils.webserver_enable('searx-freedombox')
|
||||
|
||||
|
||||
def subcommand_disable(_):
|
||||
"""Disable web configuration and reload."""
|
||||
action_utils.webserver_disable('searx-freedombox')
|
||||
os.unlink('/etc/uwsgi/apps-enabled/searx.ini')
|
||||
action_utils.service_restart('uwsgi')
|
||||
action_utils.uwsgi_disable('searx')
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
@ -18,8 +18,6 @@
|
||||
FreedomBox app to configure Searx.
|
||||
"""
|
||||
|
||||
import os
|
||||
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
from plinth import service as service_module
|
||||
@ -105,7 +103,7 @@ def get_safe_search_setting():
|
||||
def is_enabled():
|
||||
"""Return whether the module is enabled."""
|
||||
return (action_utils.webserver_is_enabled('searx-freedombox')
|
||||
and os.path.exists('/etc/uwsgi/apps-enabled/searx.ini'))
|
||||
and action_utils.uwsgi_is_enabled('searx'))
|
||||
|
||||
|
||||
def enable():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user