mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-19 12:36:06 +00:00
matrixsynapse: Allow upgrade to 1.8.*
- Use new configuration from package. - Re-run the post-install to set our custom config. - Re-apply setting for public registration if enabled. Tested by manually downgrading matrix-synapse to 1.6.1-1 and then running apt update. Fixes #1754. Signed-off-by: James Valleroy <jvalleroy@mailbox.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
5b399ef2f7
commit
f6c7f77c0f
@ -33,6 +33,7 @@ from plinth.daemon import Daemon
|
||||
from plinth.modules.apache.components import Webserver
|
||||
from plinth.modules.firewall.components import Firewall
|
||||
from plinth.modules.letsencrypt.components import LetsEncrypt
|
||||
from plinth.utils import Version
|
||||
|
||||
from .manifest import backup, clients # noqa, pylint: disable=unused-import
|
||||
|
||||
@ -141,6 +142,26 @@ def setup(helper, old_version=None):
|
||||
app.get_component('letsencrypt-matrixsynapse').setup_certificates()
|
||||
|
||||
|
||||
def force_upgrade(helper, packages):
|
||||
"""Force upgrade matrix-synapse to resolve conffile prompt."""
|
||||
if 'matrix-synapse' not in packages:
|
||||
return False
|
||||
|
||||
# Allow any lower version to upgrade to 1.8.*
|
||||
package = packages['matrix-synapse']
|
||||
if Version(package['new_version']) > Version('1.9~'):
|
||||
return False
|
||||
|
||||
public_registration_status = get_public_registration_status()
|
||||
helper.install(['matrix-synapse'], force_configuration='new')
|
||||
actions.superuser_run('matrixsynapse', ['post-install'])
|
||||
if public_registration_status:
|
||||
actions.superuser_run('matrixsynapse',
|
||||
['public-registration', 'enable'])
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def setup_domain(domain_name):
|
||||
"""Configure a domain name for matrixsynapse."""
|
||||
app.get_component('letsencrypt-matrixsynapse').setup_certificates(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user