From 1dabc220b44bfe95430de36ecf853dc45b719745 Mon Sep 17 00:00:00 2001 From: Benedek Nagy Date: Wed, 18 Sep 2024 23:35:25 +0200 Subject: [PATCH] nextcloud: Fix issue with upgrading to next version Don't delete overwrite.cli.url when the Nextcloud app's settings are updated with no domain configured. Instead, set it to the default value of http://localhost/nextcloud We might want to consider updating existing, faulty setups. Helps: #2433 Signed-off-by: Benedek Nagy Reviewed-by: Sunil Mohan Adapa --- plinth/modules/nextcloud/privileged.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plinth/modules/nextcloud/privileged.py b/plinth/modules/nextcloud/privileged.py index 14268c77f..3cdacf18c 100644 --- a/plinth/modules/nextcloud/privileged.py +++ b/plinth/modules/nextcloud/privileged.py @@ -119,7 +119,7 @@ def get_override_domain(): def set_override_domain(domain_name: str): """Set the domain name that Nextcloud will use to override all domains.""" protocol = 'https' - if domain_name.endswith('.onion'): + if domain_name.endswith('.onion') or not domain_name: protocol = 'http' if domain_name: @@ -130,7 +130,8 @@ def set_override_domain(domain_name: str): else: _run_occ('config:system:delete', 'overwritehost') _run_occ('config:system:delete', 'overwriteprotocol') - _run_occ('config:system:delete', 'overwrite.cli.url') + _run_occ('config:system:set', 'overwrite.cli.url', '--value', + f'{protocol}://localhost/nextcloud') # Restart to apply changes immediately action_utils.service_restart('nextcloud-freedombox')