Skip to content

Commit 209d65d

Browse files
authored
Add NEXTCLOUD_INIT_HTACCESS to run occ maintenance:update:htaccess after init (#1761)
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
1 parent c416385 commit 209d65d

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

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)