mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +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(_):
|
def subcommand_enable(_):
|
||||||
"""Enable web configuration and reload."""
|
"""Enable web configuration and reload."""
|
||||||
if not os.path.exists('/etc/uwsgi/apps-enabled/searx.ini'):
|
action_utils.uwsgi_enable('searx')
|
||||||
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.webserver_enable('searx-freedombox')
|
action_utils.webserver_enable('searx-freedombox')
|
||||||
|
|
||||||
|
|
||||||
def subcommand_disable(_):
|
def subcommand_disable(_):
|
||||||
"""Disable web configuration and reload."""
|
"""Disable web configuration and reload."""
|
||||||
action_utils.webserver_disable('searx-freedombox')
|
action_utils.webserver_disable('searx-freedombox')
|
||||||
os.unlink('/etc/uwsgi/apps-enabled/searx.ini')
|
action_utils.uwsgi_disable('searx')
|
||||||
action_utils.service_restart('uwsgi')
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|||||||
@ -18,8 +18,6 @@
|
|||||||
FreedomBox app to configure Searx.
|
FreedomBox app to configure Searx.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from plinth import service as service_module
|
from plinth import service as service_module
|
||||||
@ -105,7 +103,7 @@ def get_safe_search_setting():
|
|||||||
def is_enabled():
|
def is_enabled():
|
||||||
"""Return whether the module is enabled."""
|
"""Return whether the module is enabled."""
|
||||||
return (action_utils.webserver_is_enabled('searx-freedombox')
|
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():
|
def enable():
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user