Skip to content

Commit dff2177

Browse files
committed
Add NEXTCLOUD_INIT_HTACCESS to run occ maintenance:update:htaccess after init
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent e88d8e4 commit dff2177

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ If you share your html folder with multiple docker containers, you might want to
141141

142142
- `NEXTCLOUD_INIT_LOCK` (not set by default) Set it to true to enable initialization locking. Other containers will wait for the current process to finish updating the html volume to continue.
143143

144+
You might also want to make sure the htaccess is up to date after each container update. Especially on multiple swarm nodes as any discrepancy will make your server unusable.
145+
146+
- `NEXTCLOUD_INIT_HTACCESS` (not set by default) Set it to true to enable run `occ maintenance:update:htaccess` after container initialization.
147+
144148
If you want to use Redis you have to create a separate [Redis](https://hub.docker.com/_/redis/) container in your setup / in your docker-compose file. To inform Nextcloud about the Redis container, pass in the following parameters:
145149

146150
- `REDIS_HOST` (not set by default) Name of Redis container

docker-entrypoint.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
217217
echo "Initializing finished"
218218
fi
219219
fi
220+
221+
# Update htaccess after init if requested
222+
if [ -n "${NEXTCLOUD_INIT_HTACCESS+x}" ]; then
223+
run_as 'php /var/www/html/occ maintenance:update:htaccess'
224+
fi
225+
220226
fi
221227

222228
exec "$@"

0 commit comments

Comments
 (0)