Skip to content

Conversation

@solracsf
Copy link
Member

@solracsf solracsf commented Sep 13, 2025

Summary

In some environnements, it can be useful to "lock" apps to disallow updates by administrators for many reasons; control when updates are made, deny updates from the Web while manually forcing them on the CLI (after disable the switch), forcing an app to remain on a specific version, etc.

Actually, to accomplish a similar behavior, one must render the /apps/<app> folder unwritable by the webserver (ex.: cd /var/www/nextcloud/apps/; chmod 0750 <app>; chown -R root:www-data <app>) because if webserver can't write on the app folder, app can't be updated.

With this PR, an Administrator could publish an array of apps on config.php like:

'apps_locked' => ['user_saml', 'groupfolders', 'onlyoffice'];

And such apps couldn't be updated unless the app name is removed from the array.
We could also implement a --force switch on the CLI, but i believe that removing the app from the array could be more effective.

One question remains; if, while upgrading server to a major version (32>33) apps need update for compatibility reasons, how to handle this case effectively:

  1. Deny server upgrade and ask administrator to empty the array?
  2. Bypass that switch and upgrade apps nevertheless?

Please review and comment.

ToDo

  • Documentation

Checklist

@solracsf solracsf added this to the Nextcloud 33 milestone Sep 13, 2025
@solracsf solracsf requested review from a team, ArtificialOwl, come-nc and leftybournes and removed request for a team September 13, 2025 13:17
@solracsf solracsf force-pushed the lockedAppsForUpdates branch from ee3b61a to 6c81571 Compare September 13, 2025 13:22
@solracsf solracsf changed the title feat(updater): Allow to defined locked apps feat(updater): Allow to define locked apps to (not) be updated Sep 13, 2025
@solracsf solracsf force-pushed the lockedAppsForUpdates branch from 6c81571 to 7cdf800 Compare September 13, 2025 13:24
@solracsf solracsf self-assigned this Sep 13, 2025
@solracsf solracsf force-pushed the lockedAppsForUpdates branch from 7cdf800 to 3040762 Compare September 13, 2025 13:30
@solracsf solracsf marked this pull request as ready for review September 14, 2025 19:34
@solracsf solracsf requested a review from a team as a code owner September 14, 2025 19:34
@solracsf solracsf added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Sep 14, 2025
@CarlSchwan CarlSchwan added the pending documentation This pull request needs an associated documentation update label Sep 15, 2025
@CarlSchwan
Copy link
Member

This is missing documentation in config.sample.php

@solracsf
Copy link
Member Author

I'll do it when green light about a possible merge 😁

@CarlSchwan
Copy link
Member

@AndyScherzinger what do you think about this feature :)

@AndyScherzinger
Copy link
Member

I'd like to discuss it first, since I get the use case and motivation but think the feature solves an issue that shouldn't be there in the first place: there shouldn't be a reason not to update an app

Things I do understand in terms of version management and would agree to are:

  • updating the server (within a major version) but not the apps that aren't shipped with the server package
  • update an individual app (not bundled with the server)

Or in other word admins shouldn't need a a mechanism to block updating for some apps since they should be the only ones having the permissions on the system to do it anyways (!).

@solracsf
Copy link
Member Author

Main problems I'm trying to solve here are:

  1. Multi-admins on a system : if for some reason an app must not be updated, it can be "pinned" (just like apt pin system) so one of the admins couldn't update that app without it being removed from the array.
  2. Server updates also (auto) updates apps : when performing a server update, apps are updated, be it a minor or major upgrade, if a newer version is found on the app store. There is absolutely no control here.

There shouldn't be a reason not to update an app

Sometimes, there is a good reason.

@solracsf
Copy link
Member Author

Once again here: nextcloud/groupfolders#4003

@provokateurin
Copy link
Member

Btw we already have support for multiple app directories and having them marked read-only, however a lot of the logic around it is really broken and would be fixed by #51667

@MichaIng
Copy link
Member

One question remains; if, while upgrading server to a major version (32>33) apps need update for compatibility reasons, how to handle this case effectively:

  1. Deny server upgrade and ask administrator to empty the array?
  2. Bypass that switch and upgrade apps nevertheless?
  1. Show the app as incompatible with the target Nextcloud version and disable it automatically on update, like those apps which have no compatible version available yet. A disabled app is probably not better than an app on a version you didn't want it to have for whatever reason. But an inaccessible Nextcloud UI or whole instance due to an incompatible enabled app is worse.
  1. Server updates also (auto) updates apps : when performing a server update, apps are updated, be it a minor or major upgrade, if a newer version is found on the app store. There is absolutely no control here.

Another idea is to generally not update apps with Nextcloud, unless required for compatibility. But means more efforts for admins to update everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement feature: install and update pending documentation This pull request needs an associated documentation update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants