nextcloud: Enable pretty URLs without /index.php in them

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-04-17 15:38:07 -07:00 committed by James Valleroy
parent f1276d736a
commit 5c101a1447
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 11 additions and 1 deletions

View File

@ -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
</Directory>

View File

@ -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')