···631 </listitem>
632 <listitem>
633 <para>
00000000000000000634 The <literal>coq</literal> package and versioned variants
635 starting at <literal>coq_8_14</literal> no longer include
636 CoqIDE, which is now available through
···631 </listitem>
632 <listitem>
633 <para>
634+ The <literal>openssl</literal>-extension for the PHP
635+ interpreter used by Nextcloud is built against OpenSSL 1.1 if
636+ <xref linkend="opt-system.stateVersion" /> is below
637+ <literal>22.11</literal>. This is to make sure that people
638+ using
639+ <link xlink:href="https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/encryption_configuration.html">server-side
640+ encryption</link> don’t loose access to their files.
641+ </para>
642+ <para>
643+ In any other case it’s safe to use OpenSSL 3 for PHP’s openssl
644+ extension. This can be done by setting
645+ <xref linkend="opt-services.nextcloud.enableBrokenCiphersForSSE" />
646+ to <literal>false</literal>.
647+ </para>
648+ </listitem>
649+ <listitem>
650+ <para>
651 The <literal>coq</literal> package and versioned variants
652 starting at <literal>coq_8_14</literal> no longer include
653 CoqIDE, which is now available through
+7
nixos/doc/manual/release-notes/rl-2211.section.md
···204205- The `p4` package now only includes the open-source Perforce Helix Core command-line client and APIs. It no longer installs the unfree Helix Core Server binaries `p4d`, `p4broker`, and `p4p`. To install the Helix Core Server binaries, use the `p4d` package instead.
2060000000207- The `coq` package and versioned variants starting at `coq_8_14` no
208 longer include CoqIDE, which is now available through
209 `coqPackages.coqide`. It is still possible to get CoqIDE as part of
···204205- The `p4` package now only includes the open-source Perforce Helix Core command-line client and APIs. It no longer installs the unfree Helix Core Server binaries `p4d`, `p4broker`, and `p4p`. To install the Helix Core Server binaries, use the `p4d` package instead.
206207+- The `openssl`-extension for the PHP interpreter used by Nextcloud is built against OpenSSL 1.1 if
208+ [](#opt-system.stateVersion) is below `22.11`. This is to make sure that people using [server-side encryption](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/encryption_configuration.html)
209+ don't loose access to their files.
210+211+ In any other case it's safe to use OpenSSL 3 for PHP's openssl extension. This can be done by setting
212+ [](#opt-services.nextcloud.enableBrokenCiphersForSSE) to `false`.
213+214- The `coq` package and versioned variants starting at `coq_8_14` no
215 longer include CoqIDE, which is now available through
216 `coqPackages.coqide`. It is still possible to get CoqIDE as part of
+57-1
nixos/modules/services/web-apps/nextcloud.nix
···13 phpPackage = cfg.phpPackage.buildEnv {
14 extensions = { enabled, all }:
15 (with all;
16- enabled
0000017 ++ optional cfg.enableImagemagick imagick
18 # Optionally enabled depending on caching settings
19 ++ optional cfg.caching.apcu apcu
···8081 options.services.nextcloud = {
82 enable = mkEnableOption (lib.mdDoc "nextcloud");
000000000000000000000000000000000083 hostName = mkOption {
84 type = types.str;
85 description = lib.mdDoc "FQDN for the nextcloud instance.";
···649 ++ (optional (versionOlder cfg.package.version "23") (upgradeWarning 22 "22.05"))
650 ++ (optional (versionOlder cfg.package.version "24") (upgradeWarning 23 "22.05"))
651 ++ (optional (versionOlder cfg.package.version "25") (upgradeWarning 24 "22.11"))
00000000000000000652 ++ (optional isUnsupportedMariadb ''
653 You seem to be using MariaDB at an unsupported version (i.e. at least 10.6)!
654 Please note that this isn't supported officially by Nextcloud. You can either
···13 phpPackage = cfg.phpPackage.buildEnv {
14 extensions = { enabled, all }:
15 (with all;
16+ # disable default openssl extension
17+ (lib.filter (e: e.pname != "php-openssl") enabled)
18+ # use OpenSSL 1.1 for RC4 Nextcloud encryption if user
19+ # has acknowledged the brokeness of the ciphers (RC4).
20+ # TODO: remove when https://github.com/nextcloud/server/issues/32003 is fixed.
21+ ++ (if cfg.enableBrokenCiphersForSSE then [ cfg.phpPackage.extensions.openssl-legacy ] else [ cfg.phpPackage.extensions.openssl ])
22 ++ optional cfg.enableImagemagick imagick
23 # Optionally enabled depending on caching settings
24 ++ optional cfg.caching.apcu apcu
···8586 options.services.nextcloud = {
87 enable = mkEnableOption (lib.mdDoc "nextcloud");
88+89+ enableBrokenCiphersForSSE = mkOption {
90+ type = types.bool;
91+ default = versionOlder stateVersion "22.11";
92+ defaultText = literalExpression "versionOlder system.stateVersion \"22.11\"";
93+ description = lib.mdDoc ''
94+ This option enables using the OpenSSL PHP extension linked against OpenSSL 1.1
95+ rather than latest OpenSSL (≥ 3), this is not recommended unless you need
96+ it for server-side encryption (SSE). SSE uses the legacy RC4 cipher which is
97+ considered broken for several years now. See also [RFC7465](https://datatracker.ietf.org/doc/html/rfc7465).
98+99+ This cipher has been disabled in OpenSSL ≥ 3 and requires
100+ a specific legacy profile to re-enable it.
101+102+ If you deploy Nextcloud using OpenSSL ≥ 3 for PHP and have
103+ server-side encryption configured, you will not be able to access
104+ your files anymore. Enabling this option can restore access to your files.
105+ Upon testing we didn't encounter any data corruption when turning
106+ this on and off again, but this cannot be guaranteed for
107+ each Nextcloud installation.
108+109+ It is `true` by default for systems with a [](#opt-system.stateVersion) below
110+ `22.11` to make sure that existing installations won't break on update. On newer
111+ NixOS systems you have to explicitly enable it on your own.
112+113+ Please note that this only provides additional value when using
114+ external storage such as S3 since it's not an end-to-end encryption.
115+ If this is not the case,
116+ it is advised to [disable server-side encryption](https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/encryption_configuration.html#disabling-encryption) and set this to `false`.
117+118+ In the future, Nextcloud may move to AES-256-GCM, by then,
119+ this option will be removed.
120+ '';
121+ };
122 hostName = mkOption {
123 type = types.str;
124 description = lib.mdDoc "FQDN for the nextcloud instance.";
···688 ++ (optional (versionOlder cfg.package.version "23") (upgradeWarning 22 "22.05"))
689 ++ (optional (versionOlder cfg.package.version "24") (upgradeWarning 23 "22.05"))
690 ++ (optional (versionOlder cfg.package.version "25") (upgradeWarning 24 "22.11"))
691+ ++ (optional cfg.enableBrokenCiphersForSSE ''
692+ You're using PHP's openssl extension built against OpenSSL 1.1 for Nextcloud.
693+ This is only necessary if you're using Nextcloud's server-side encryption.
694+ Please keep in mind that it's using the broken RC4 cipher.
695+696+ If you don't use that feature, you can switch to OpenSSL 3 and get
697+ rid of this warning by declaring
698+699+ services.nextcloud.enableBrokenCiphersForSSE = false;
700+701+ If you need to use server-side encryption you can ignore this waring.
702+ Otherwise you'd have to disable server-side encryption first in order
703+ to be able to safely disable this option and get rid of this warning.
704+ See <https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/encryption_configuration.html#disabling-encryption> on how to achieve this.
705+706+ For more context, here is the implementing pull request: https://github.com/NixOS/nixpkgs/pull/198470
707+ '')
708 ++ (optional isUnsupportedMariadb ''
709 You seem to be using MariaDB at an unsupported version (i.e. at least 10.6)!
710 Please note that this isn't supported officially by Nextcloud. You can either
···170 </listitem>
171 </itemizedlist>
172 </listitem>
173+ <listitem>
174+ <formalpara>
175+ <title>Server-side encryption</title>
176+ <para>
177+ Nextcloud supports <link xlink:href="https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/encryption_configuration.html">server-side encryption (SSE)</link>.
178+ This is not an end-to-end encryption, but can be used to encrypt files that will be persisted
179+ to external storage such as S3. Please note that this won't work anymore when using OpenSSL 3
180+ for PHP's openssl extension because this is implemented using the legacy cipher RC4.
181+ If <xref linkend="opt-system.stateVersion" /> is <emphasis>above</emphasis> <literal>22.05</literal>,
182+ this is disabled by default. To turn it on again and for further information please refer to
183+ <xref linkend="opt-services.nextcloud.enableBrokenCiphersForSSE" />.
184+ </para>
185+ </formalpara>
186+ </listitem>
187 </itemizedlist>
188 </section>
189
+7
nixos/tests/nextcloud/basic.nix
···37 "d /var/lib/nextcloud-data 0750 nextcloud nginx - -"
38 ];
390040 services.nextcloud = {
41 enable = true;
42 datadir = "/var/lib/nextcloud-data";
···99 # This is just to ensure the nextcloud-occ program is working
100 nextcloud.succeed("nextcloud-occ status")
101 nextcloud.succeed("curl -sSf http://nextcloud/login")
0000102 nextcloud.succeed(
103 "${withRcloneEnv} ${copySharedFile}"
104 )
···108 "${withRcloneEnv} ${diffSharedFile}"
109 )
110 assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
0111 '';
112})) args
···37 "d /var/lib/nextcloud-data 0750 nextcloud nginx - -"
38 ];
3940+ system.stateVersion = "22.11"; # stateVersion >=21.11 to make sure that we use OpenSSL3
41+42 services.nextcloud = {
43 enable = true;
44 datadir = "/var/lib/nextcloud-data";
···101 # This is just to ensure the nextcloud-occ program is working
102 nextcloud.succeed("nextcloud-occ status")
103 nextcloud.succeed("curl -sSf http://nextcloud/login")
104+ # Ensure that no OpenSSL 1.1 is used.
105+ nextcloud.succeed(
106+ "${nodes.nextcloud.services.phpfpm.pools.nextcloud.phpPackage}/bin/php -i | grep 'OpenSSL Library Version' | awk -F'=>' '{ print $2 }' | awk '{ print $2 }' | grep -v 1.1"
107+ )
108 nextcloud.succeed(
109 "${withRcloneEnv} ${copySharedFile}"
110 )
···114 "${withRcloneEnv} ${diffSharedFile}"
115 )
116 assert "hi" in client.succeed("cat /mnt/dav/test-shared-file")
117+ nextcloud.succeed("grep -vE '^HBEGIN:oc_encryption_module' /var/lib/nextcloud-data/data/root/files/test-shared-file")
118 '';
119})) args
···91 [ ]
92 allExtensionFunctions;
9394- getExtName = ext: lib.removePrefix "php-" (builtins.parseDrvName ext.name).name;
9596 # Recursively get a list of all internal dependencies
97 # for a list of extensions.
···91 [ ]
92 allExtensionFunctions;
9394+ getExtName = ext: ext.extensionName;
9596 # Recursively get a list of all internal dependencies
97 # for a list of extensions.