-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow root owned config. #11075
Comments
Neither config nor apps should NEED to be writable except when you want to make changes. At all other times those areas should be locked down to prevent the webserver software from making unwanted/unauthorized changes. This way you are protected from unauthorized changes that may come about through weaknesses in any of the systems involved (code, webserver, php, leaked/weak credentials, etc.). |
Also very interested in support for a read-only config through the whole lifecycle of nextcloud (installation, running, upgrading). We currently run into unwanted side-effects with having the @Dreamsorcerer As for the issues you mentioned, I think it might help breaking them down to PRs, linking to this issue. Thinking your ideas further, this would also imply the |
Of course, but the 4 line patch I linked is the only work I've put into this so far. Certainly doing a separate PR for each step will be useful if someone does start to work on this seriously. |
I don't think any checks of owners are correct. Checking scripts should only check read |
Write access is needed to complete the upgrade, right? Because it will try to update the apps installed. |
I mean writes should go to DB. Besides upgrades could be handled by package managers instead. Then write should not be needed. |
But an app is a set of files downloaded on the system (in the datadir). To upgrade them, you must overwrite those files with the new app... |
Apps can be stored in another directory and/or can also be handled by package managers. |
It would still need write access to that directory in order to complete the upgrade, how would that be any different from how it works right now? Package managers sounds like a bad idea, as now you need someone to package and update everything in the Nextcloud app store and keep up to date with all new submissions. You would also need to disable the app store in the Nextcloud interface as it would result in broken behaviour. My proposal is to make it easier to package Nextcloud (e.g. in Debian), not harder. |
The question is what exactly does it need to write to finish the upgrade? Why is replacing the files (by package managers) not sufficient? Can the code be modified to no longer need it? If yes, then it gives the users/packagers more options, to choose from. They can still do it without packaging. It's not forcing people into it. You enumerated disadvantages of packaging but forgot about advantages. A very similar situation arises with Python PIP. The software outside system package management can not have system-level dependencies or they must be installed manually. This is already the case with Nextcloud video conversion app which requires you to install Updates are obviously easier to perform using one tool rather than two tools. System packaging also often gives you some guarantees about the packaged software: it's reviewed and signed. I didn't check Nextcloud apps deeply enough to tell but I'd be surprised if Nextcloud app store has security and reliability guarantees comparable to those of Debian. Finally, the problems you describe can be mitigated by automating packaging (as is already done in Debian in cases of Python, Rust...) Disabling app store is already possible in config and it's non-issue if the administrator installed Nextcloud using package manger - he can install apps too. I would personally like to see it the same as with Python PIP - package apps as |
This still sounds like a lot more work than I imagine a Debian maintainer would like to take on. My proposal here is to imitate the WordPress package in Debian. Note that there are not thousands of packages in Debian for every plugin and theme available in the WP store. Nextcloud uses a very similar design and I expect Debian maintainers would look to handle it in much the same way. There are certainly user advantages to what you propose, I just don't think any maintainer will agree that those are worth the extra work though. |
Depends, really. Some may be more willing than others. There's tons of python packages for instance. Also there's a few Wordpress themes and one plugin. It's not out of question. My point is make it possible, not mandatory. I would personally like to take a closer look at it at some point. |
The themes are the pre-installed ones for previous versions of WP, I suspect they are included for some kind of backwards-compatibility reason. Not sure about the random plugin. Regardless, my point is that the user still has the choice to install plugins from the store. This requires write access to the plugins directory. In much the same way, if the user has the choice to install apps in Nextcloud, we need write access to the data directory. I'm not even sure why we're arguing about this, because in what possible situation would the server not have write access to the data directory? This is only likely if you've misconfigured something and your install is therefore broken... |
Oh, you were talking about writing to data directory ( |
Ah, I forgot that this is not the default behaviour. The way I have the config setup (which would be required for Debian packages) is with an app path in the data directory. It still picks up system installed apps just fine, but user installed apps go into the data directory. |
Yes, you can have multiple paths and it should be used in packaging. :) |
But, basically, it's that path which needs to be writable, because Nextcloud will try to upgrade incompatible apps. With a couple of hacks I have this working already, with me manually updating the core nextcloud code as root, and then running the usual upgrade step in a browser. At some point, I want to come back to this issue so I can implement it properly without hacks and make it user-friendly. |
Cool! I was looking into making |
No idea, sorry. |
Do you mind creating a PR with this patch for further discussion? |
First step has finally been merged. Next up is storing some of the options used during upgrade in the DB. |
Cool! FYI I have some initial packaging work done. It works mostly well except upgrades of NC versions are now broken. Also I've automated the apps packaging as I mentioned, it was pretty easy. |
It would be good to fully support read-only configs, in order to be able to support a setup where the config is owned by root in /etc/nextcloud/ for example. This increases security, and better supports packaging Nextcloud into Linux distributions.
With some minor tweaks to the code, I have successfully managed to run Nextcloud as described, and have managed to perform an upgrade successfully by manually making changes to the config.
In order to accomplish this properly, these are the changes I believe are needed:
The text was updated successfully, but these errors were encountered: