mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
upgrades: Drop special handling for searx
Helps: #2493. - searx will not be part of Trixie. - This special upgrade code is not required for Bookworm -> Trixie upgrade. - This code is not be invoked for Bullseye -> Bookworm upgrade as this removal will not reach Bullseye. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
7cef898948
commit
1d8e406528
@ -162,43 +162,9 @@ def _restore_snapshots_config(reenable=False):
|
|||||||
], input='{"args": ["no"], "kwargs": {}}'.encode(), check=True)
|
], input='{"args": ["no"], "kwargs": {}}'.encode(), check=True)
|
||||||
|
|
||||||
|
|
||||||
def _disable_searx() -> bool:
|
|
||||||
"""If searx is enabled, disable it until we can upgrade it properly.
|
|
||||||
|
|
||||||
Return whether searx was originally enabled.
|
|
||||||
"""
|
|
||||||
searx_is_enabled = pathlib.Path(
|
|
||||||
'/etc/uwsgi/apps-enabled/searx.ini').exists()
|
|
||||||
if searx_is_enabled:
|
|
||||||
print('Disabling searx...', flush=True)
|
|
||||||
subprocess.run(
|
|
||||||
['/usr/share/plinth/actions/actions', 'apache', 'uwsgi_disable'],
|
|
||||||
input='{"args": ["searx"], "kwargs": {}}'.encode(), check=True)
|
|
||||||
|
|
||||||
return searx_is_enabled
|
|
||||||
|
|
||||||
|
|
||||||
def _update_searx(reenable=False):
|
|
||||||
"""If searx is installed, update search engines list.
|
|
||||||
|
|
||||||
Re-enable if previously enabled.
|
|
||||||
"""
|
|
||||||
if pathlib.Path('/etc/searx/settings.yml').exists():
|
|
||||||
print('Updating searx search engines list...', flush=True)
|
|
||||||
subprocess.run([
|
|
||||||
'/usr/share/plinth/actions/actions', 'searx', 'setup', '--no-args'
|
|
||||||
], check=True)
|
|
||||||
if reenable:
|
|
||||||
print('Re-enabling searx after upgrade...', flush=True)
|
|
||||||
subprocess.run([
|
|
||||||
'/usr/share/plinth/actions/actions', 'apache', 'uwsgi_enable'
|
|
||||||
], input='{"args": ["searx"], "kwargs": {}}'.encode(), check=True)
|
|
||||||
|
|
||||||
|
|
||||||
def perform():
|
def perform():
|
||||||
"""Perform upgrade to next release of Debian."""
|
"""Perform upgrade to next release of Debian."""
|
||||||
reenable_snapshots = _take_snapshot_and_disable()
|
reenable_snapshots = _take_snapshot_and_disable()
|
||||||
reenable_searx = _disable_searx()
|
|
||||||
|
|
||||||
# If quassel is running during dist upgrade, it may be restarted
|
# If quassel is running during dist upgrade, it may be restarted
|
||||||
# several times. This causes IRC users to rapidly leave/join
|
# several times. This causes IRC users to rapidly leave/join
|
||||||
@ -245,8 +211,6 @@ def perform():
|
|||||||
'Apt full-upgrade was not successful. Distribution upgrade '
|
'Apt full-upgrade was not successful. Distribution upgrade '
|
||||||
'will be retried at a later time.')
|
'will be retried at a later time.')
|
||||||
|
|
||||||
_update_searx(reenable_searx)
|
|
||||||
|
|
||||||
if quassel_was_running:
|
if quassel_was_running:
|
||||||
print('Re-starting quassel service after dist upgrade...',
|
print('Re-starting quassel service after dist upgrade...',
|
||||||
flush=True)
|
flush=True)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user