Keep .htaccess on updates #29
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When updating Nextcloud by installing a new nextcloud-server package, one gets asked whether to keep .htaccess or overwrite it. As far as I understand, the right answer is always "keep", and let Nextcloud update .htaccess afterwards with
occ maintenance:update:htaccess
Currently you're listing .htaccess as "conffiles", but https://www.debian.org/doc/manuals/maint-guide/dother.en.html#conffiles says: "If your program uses configuration files but also rewrites them on its own, it's best not to make them conffiles because dpkg will then prompt users to verify the changes all the time."
Unfortunately it does not say how to prevent such files from getting overwritten on an update, otherwise you'd have another PR from me :)
.htaccess is in the way on package updatesto Keep .htacces on updatesKeep .htacces on updatesto Keep .htaccess on updatesIf remove .htaccess from conffiles You will break lot Nextcloud installation because admin's adjust/change .htaccess.
Since creating this incident, I've learnt that manual changes in .htaccess are not supported at all, and get deleted by Nextcloud's occ. See https://help.nextcloud.com/t/changes-to-htaccess-are-deleted-after-update/160884, and the linked issues.
I'd suggest dropping .htaccess from conffiles so that it gets always overwritten by the new version, and adding
su 'www-data' -s /bin/sh -c 'php /var/www/nextcloud/occ maintenance:update:htaccess'
to nextcloud-server.postinst to ensure that it is properly set up.Thanks for suggestion, I apply commit
e0a0d1f61b
Thank you!