mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
searx: Fix issue with uwsgi crashing
Latest version of uwsgi in Debian crashes when trying to auto load plugins for an unknown option. Workaround uwsgi crashing by disabling auto load explicitly. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
e1ab5b7131
commit
c1d2e0e1db
@ -20,6 +20,7 @@ Configuration helper for searx.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import augeas
|
||||||
import os
|
import os
|
||||||
import secrets
|
import secrets
|
||||||
import shutil
|
import shutil
|
||||||
@ -31,6 +32,8 @@ from plinth.utils import gunzip
|
|||||||
|
|
||||||
SETTINGS_FILE = '/etc/searx/settings.yml'
|
SETTINGS_FILE = '/etc/searx/settings.yml'
|
||||||
|
|
||||||
|
UWSGI_FILE = '/etc/uwsgi/apps-available/searx.ini'
|
||||||
|
|
||||||
|
|
||||||
def parse_arguments():
|
def parse_arguments():
|
||||||
"""Return parsed command line arguments as dictionary."""
|
"""Return parsed command line arguments as dictionary."""
|
||||||
@ -64,10 +67,22 @@ def _copy_uwsgi_configuration():
|
|||||||
"""
|
"""
|
||||||
example_config = ('/usr/share/doc/searx/examples/'
|
example_config = ('/usr/share/doc/searx/examples/'
|
||||||
'uwsgi/apps-available/searx.ini')
|
'uwsgi/apps-available/searx.ini')
|
||||||
destination = '/etc/uwsgi/apps-available/'
|
if not os.path.exists(UWSGI_FILE):
|
||||||
|
shutil.copy(example_config, os.path.dirname(UWSGI_FILE))
|
||||||
|
|
||||||
if not os.path.exists(os.path.join(destination, 'searx.ini')):
|
|
||||||
shutil.copy(example_config, destination)
|
def _update_uwsgi_configuration():
|
||||||
|
"""Fix uwsgi configuration.
|
||||||
|
|
||||||
|
uwsgi 2.0.15-debian crashes when trying to autoload.
|
||||||
|
"""
|
||||||
|
aug = augeas.Augeas(
|
||||||
|
flags=augeas.Augeas.NO_LOAD + augeas.Augeas.NO_MODL_AUTOLOAD)
|
||||||
|
aug.set('/augeas/load/inifile/lens', 'Puppet.lns')
|
||||||
|
aug.set('/augeas/load/inifile/incl[last() + 1]', UWSGI_FILE)
|
||||||
|
aug.load()
|
||||||
|
aug.set('/files/etc/uwsgi/apps-available/searx.ini/uwsgi/autoload', 'false')
|
||||||
|
aug.save()
|
||||||
|
|
||||||
|
|
||||||
def _generate_secret_key(settings):
|
def _generate_secret_key(settings):
|
||||||
@ -119,6 +134,7 @@ def write_settings(settings):
|
|||||||
def subcommand_setup(_):
|
def subcommand_setup(_):
|
||||||
"""Post installation actions for Searx"""
|
"""Post installation actions for Searx"""
|
||||||
_copy_uwsgi_configuration()
|
_copy_uwsgi_configuration()
|
||||||
|
_update_uwsgi_configuration()
|
||||||
action_utils.webserver_enable('proxy_uwsgi', kind='module')
|
action_utils.webserver_enable('proxy_uwsgi', kind='module')
|
||||||
|
|
||||||
if not os.path.exists(SETTINGS_FILE):
|
if not os.path.exists(SETTINGS_FILE):
|
||||||
|
|||||||
@ -31,7 +31,7 @@ from .manifest import clients
|
|||||||
|
|
||||||
clients = clients
|
clients = clients
|
||||||
|
|
||||||
version = 1
|
version = 2
|
||||||
|
|
||||||
managed_services = ['searx']
|
managed_services = ['searx']
|
||||||
|
|
||||||
@ -80,7 +80,9 @@ def setup(helper, old_version=None):
|
|||||||
"""Install and configure the module."""
|
"""Install and configure the module."""
|
||||||
helper.install(managed_packages)
|
helper.install(managed_packages)
|
||||||
helper.call('post', actions.superuser_run, 'searx', ['setup'])
|
helper.call('post', actions.superuser_run, 'searx', ['setup'])
|
||||||
helper.call('post', actions.superuser_run, 'searx', ['enable'])
|
if not old_version:
|
||||||
|
helper.call('post', actions.superuser_run, 'searx', ['enable'])
|
||||||
|
|
||||||
global service
|
global service
|
||||||
if service is None:
|
if service is None:
|
||||||
service = service_module.Service(managed_services[0], name, ports=[
|
service = service_module.Service(managed_services[0], name, ports=[
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user