From 5c101a1447081195ceba664eaeb08ed806a12609 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 17 Apr 2024 15:38:07 -0700 Subject: [PATCH] nextcloud: Enable pretty URLs without /index.php in them Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- .../apache2/conf-available/nextcloud-freedombox.conf | 2 +- plinth/modules/nextcloud/privileged.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/plinth/modules/nextcloud/data/usr/share/freedombox/etc/apache2/conf-available/nextcloud-freedombox.conf b/plinth/modules/nextcloud/data/usr/share/freedombox/etc/apache2/conf-available/nextcloud-freedombox.conf index b201d0e2f..6aa23576c 100644 --- a/plinth/modules/nextcloud/data/usr/share/freedombox/etc/apache2/conf-available/nextcloud-freedombox.conf +++ b/plinth/modules/nextcloud/data/usr/share/freedombox/etc/apache2/conf-available/nextcloud-freedombox.conf @@ -47,5 +47,5 @@ Alias /nextcloud/ /var/lib/nextcloud/ # Allow a limited set of directives in .htaccess files found in /, /config, # and /data directories of nextcloud. - AllowOverride AuthConfig FileInfo Indexes Limit Options + AllowOverride AuthConfig FileInfo Indexes Limit Options=Indexes,MultiViews diff --git a/plinth/modules/nextcloud/privileged.py b/plinth/modules/nextcloud/privileged.py index 679ab212f..d45cfe8f1 100644 --- a/plinth/modules/nextcloud/privileged.py +++ b/plinth/modules/nextcloud/privileged.py @@ -230,6 +230,16 @@ def _nextcloud_setup_wizard(db_password: str): # jobs correctly. Cron is the recommended setting. _run_occ('background:cron') + # Enable pretty URLs without /index.php in them. + _run_occ('config:system:set', 'htaccess.RewriteBase', '--value', + '/nextcloud') + _run_occ('config:system:set', 'htaccess.IgnoreFrontController', + '--type=boolean', '--value=true') + # Update the .htaccess file to contain mod_rewrite rules needed for pretty + # URLs. This is automatically re-run by scripts when upgrading to next + # version. + _run_occ('maintenance:update:htaccess') + def _configure_ldap(): _run_occ('app:enable', 'user_ldap')