FS#71474 - [nextcloud] Allow .htaccess to be written by `occ`

Attached to Project: Community Packages
Opened by Caleb Maclennan (alerque) - Friday, 09 July 2021, 18:24 GMT
Last edited by Caleb Maclennan (alerque) - Friday, 20 August 2021, 23:32 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I've had trouble upgrading Nextcloud the last half a dozen packages. Even after a really rough go getting 21 going properly (in which I basically had to redo the install myself), the point releases since have been choking.

I seem to have 3 problems, presented here in the order of seriousness and ease of addressability:

* The main problem seems to be that the .htaccess file in `/usr/share/webapps/nextcloud` cannot be written by the `occ` utility. My config includes enabling the rewrite rules that remove artifacts like `/index.php` from user facing URLs. The option to enable this is set in the config, but then Nextcloud itself needs to be able to write to the htaccess file to actually make it work. In my case I expect to need to run `occ update` and `occ maintenence:update:htaccess` after updates, but the latter won't run because the file is owned as root. I think in needs to be owned by the *nextcloud* user.

* An addition to this that may or may not be appropriate to fix is that these settings get blown away on every update because the file is not listed for backup. I suspect fixing the first point will make this not as bad and it probably shouldn't be backed up, but ...

* Lastly there seems to be some issue with the config location. I have ongoing errors in the admin section complaining it can't write the config. I have `'config_is_read_only' => true` set but the UI still warns me to set it. Perhaps something is amiss with where Nextcloud expects to find configs?
This task depends upon

Closed by  Caleb Maclennan (alerque)
Friday, 20 August 2021, 23:32 GMT
Reason for closing:  Fixed
Additional comments about closing:  This was fixed in 22.0.0, [community] is up to 22.1.0 now and I can confirm this seems to be working.
Comment by David Runge (dvzrv) - Saturday, 17 July 2021, 21:36 GMT
@alerque: Thanks for the report!

The 1st and 2nd point can be solved by symlinking the .htaccess file from /etc/webapps/nextcloud/.htaccess to /usr/share/webapps/nextcloud/.htaccess and adding the file in /etc to the backup array. This needs be done in packaging.

Potentially your third issue will be solved by that as well, as the file should then be owned by the nextcloud user.

I'll try to add this to a pkgrel bump before we release 22.0.0 to [community].
Comment by David Runge (dvzrv) - Saturday, 17 July 2021, 21:59 GMT
The changes are now available in 22.0.0-2 in [community-testing]. Please test! :)

Loading...