Skip to content

Commit

Permalink
nixos/nextcloud: deprecated dbtableprefix
Browse files Browse the repository at this point in the history
Closes #320381

Installation with a custom dbtableprefix is not allowed anymore for a
while[1] and we shouldn't advertise it as such.

The option is deprecated for now since I'm not sure if there are some
weird corner-cases where removing the option directly would break
existing installations from before <20 with a custom dbtableprefix. The
migration-path for such a case is as follows:

* Check if /var/lib/nextcloud/config/config.php has the correct
  dbtableprefix set and if not, take care of it.
* Remove `dbtableprefix` from the NixOS configuration. It's effectively
  state anyways.

After a bit of time to switch (perhaps after the next release
branchoff), the option can be removed.

[1] nextcloud/server#24836
  • Loading branch information
Ma27 committed Jun 19, 2024
1 parent 2dbcf71 commit 45d2b8b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 14 additions & 1 deletion nixos/modules/services/web-apps/nextcloud.nix
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,13 @@ in {
dbtableprefix = mkOption {
type = types.nullOr types.str;
default = null;
description = "Table prefix in Nextcloud's database.";
description = ''
Table prefix in Nextcloud's database.
__Note:__ since Nextcloud 20 it's not an option anymore to create a database
schema with a custom table prefix. This option only exists for backwards compatibility
with installations that were originally provisioned with Nextcloud <20.
'';
};
adminuser = mkOption {
type = types.str;
Expand Down Expand Up @@ -826,6 +832,13 @@ in {
Using config.services.nextcloud.poolConfig is deprecated and will become unsupported in a future release.
Please migrate your configuration to config.services.nextcloud.poolSettings.
'')
++ (optional (cfg.config.dbtableprefix != null) ''
Using `services.nextcloud.config.dbtableprefix` is deprecated. Fresh installations with this
option set are not allowed anymore since v20.
If you have an existing installation with a custom table prefix, make sure it is
set correctly in `config.php` and remove the option from your NixOS config.
'')
++ (optional (versionOlder cfg.package.version "25") (upgradeWarning 24 "22.11"))
++ (optional (versionOlder cfg.package.version "26") (upgradeWarning 25 "23.05"))
++ (optional (versionOlder cfg.package.version "27") (upgradeWarning 26 "23.11"))
Expand Down
1 change: 0 additions & 1 deletion nixos/tests/nextcloud/basic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ runTest ({ config, ... }: {
services.nextcloud = {
enable = true;
datadir = "/var/lib/nextcloud-data";
config.dbtableprefix = "nixos_";
autoUpdateApps = {
enable = true;
startAt = "20:00";
Expand Down

0 comments on commit 45d2b8b

Please sign in to comment.