Repository navigation
Conversation
Laid out like the official Docker images below /var/www/html/nextcloud: shipped apps read-only in apps/, app store apps in custom_apps/ via apps_paths. Unlike the images, the code belongs to root; apache can only write config/, custom_apps/, data/ and .htaccess, covered by a CIL module for the SELinux contexts. The tarball stays unpatched, so occ integrity:check-core passes (payload verified byte for byte against the 35.0.2 tarball). %pre refuses downgrades and skipped majors, turns on maintenance mode and takes over an installation not installed by the package: app store apps move to custom_apps/, the previous code to /var/www/html/.nextcloud-before-package-*. %posttrans runs /usr/libexec/nextcloud/post-update (occ upgrade, db:add-missing-*). The web updater is off. PHP is pinned to the newest the distribution ships (8.4 on RHEL 10). nextcloud-httpd only pulls in httpd and php-fpm and ships the vHost as an example. The build verifies the tarball against the Nextcloud Security key (28806A878AE423A28372792ED75899B9A724937A) through the optional PKG_SOURCE_SIGNATURE_URL in package.conf. Verified on Rocky 10.2 VMs: takeover of an LFOps install (35.0.1 -> 35.0.2), fresh install plus package update (35.0.1 -> 35.0.2), and takeover of a manual install per the Nextcloud admin manual (34.0.5 -> 35.0.2).
Hosts update Nextcloud unattended, and occ upgrade disables the apps that do not support a new major release yet. Hold a new major back until its first bugfix release, as Nextcloud's own stable channel does. check-upstream.sh gets PKG_UPSTREAM_MAJOR_MIN_PATCH for that. It only works with tags: the latest GitHub release only shows the newest major, while Nextcloud keeps publishing bugfix releases of the previous one, so Nextcloud switches to PKG_UPSTREAM_SOURCE='tags'. The combination with 'releases' fails instead of silently doing nothing. Tested against the tags of nextcloud/server (35.0.2 is current, 34.0.5 would bump to 35.0.2) and with synthetic tag lists (36.0.0 held back, 35.0.3 and 36.0.1 taken).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nextcloud server as RPM for RHEL 10, so that LFOps can update Nextcloud and its apps unattended through the package manager instead of the web updater. First version: 35.0.2. Other distributions follow once this layout has proven itself.
Changes
packages/nextcloud/: the spec follows the Fedora/EPEL package (nextcloudplus-httpd,-mysql,-postgresql,-sqlite; no-nginx), the layout follows the official Docker images: everything below/var/www/html/nextcloud, shipped apps read-only inapps/, app store apps incustom_apps/(apps_pathsinconfig/package.config.php). Unlike the images, the code belongs to root; apache can only writeconfig/,custom_apps/,data/and.htaccess. A CIL module labels these paths, the base policy does not knowcustom_apps/.occ integrity:check-corepasses; onlyupdater/andconfig/CAN_INSTALLare left out,occbecomes 0755.%prerefuses a downgrade and a skipped major release, turns on maintenance mode, and takes over an installation the package did not install (LFOps role, tarball by hand): app store apps move tocustom_apps/, the rest of the previous code to/var/www/html/.nextcloud-before-package-<timestamp>/(0700).config/,data/,themes/and a data directory inside the tree stay.%posttransruns/usr/libexec/nextcloud/post-update: maintenance mode off,occ upgradewhen needed,db:add-missing-*,try-restart php-fpm. Without an installed instance it createsCAN_INSTALL. If it fails, dnf still succeeds; the instance stays on the update page until the script is run by hand.upgrade.disable-web).nextcloud-jobs.timeris shipped, not enabled.nextcloud-httpdpulls in httpd and php-fpm and ships the vHost as an example in/usr/share/doc, nothing active. The subpackages requirenextcloudwithout a version, so a refused downgrade cannot leave broken dependencies.PKG_SOURCE_SIGNATURE_URLinpackage.conf,%{gpgverify}in%prep.check-upstream.sh: optionalPKG_UPSTREAM_MAJOR_MIN_PATCH(tags only). Nextcloud sets1: a new major release is taken from its first bugfix release on, bugfix releases of the packaged major still come through.Tests
On Rocky 10.2 VMs, SELinux enforcing:
custom_apps/,occ upgraderan, integrity check andrpm -Vclean, 0 AVCs, new app store installs land incustom_apps/. A second LFOps run breaks nothing (it chowns the tree to apache again, to be removed in the role).occ upgraderan, setup checks clean apart from HSTS, MariaDB tuning, maintenance window and mimetype migration. Downgrade to 35.0.1 refused by%pre, instance unchanged; the next update set the subpackages right again.AllowOverride All) + package 35.0.2: takeover with major upgrade, HTTP behaviour unchanged,.htaccessrewritten byocc upgrade. With the PHP 8.4 pin the package update on such a host is refused until it switches tophp8.4-*with its extensions; after that andsystemctl enable --now php-fpm.service(removing the old php-fpm disables it) the instance runs again.--allowerasingalone would drop APCu and Redis without replacement.%{gpgverify}.check-upstream.shagainst the tags of nextcloud/server and with synthetic tag lists (36.0.0 held back, 35.0.3 and 36.0.1 taken).