diff options
author | Ryan Lahfa <masterancpp@gmail.com> | 2023-05-15 09:28:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 09:28:15 +0200 |
commit | fa06a3b646bd874366761de2f0e51ec81b01b33d (patch) | |
tree | 0c968c8f6c703bbc608cf9339925383183a0b7cf /nixos | |
parent | 25f3323d60271ac9b668757322c47f96aa7ca726 (diff) | |
parent | f9f76529cd9682bee8a3a805cb4c8f7e0f8e7af4 (diff) |
Merge pull request #230888 from Misterio77/nextcloud-createlocally-optin
nixos/nextcloud: default createLocally to false
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/doc/manual/release-notes/rl-2305.section.md | 1 | ||||
-rw-r--r-- | nixos/modules/services/web-apps/nextcloud.md | 10 | ||||
-rw-r--r-- | nixos/modules/services/web-apps/nextcloud.nix | 7 | ||||
-rw-r--r-- | nixos/tests/nextcloud/basic.nix | 1 | ||||
-rw-r--r-- | nixos/tests/nextcloud/openssl-sse.nix | 1 | ||||
-rw-r--r-- | nixos/tests/nextcloud/with-mysql-and-memcached.nix | 1 | ||||
-rw-r--r-- | nixos/tests/nextcloud/with-postgresql-and-redis.nix | 1 |
7 files changed, 13 insertions, 9 deletions
diff --git a/nixos/doc/manual/release-notes/rl-2305.section.md b/nixos/doc/manual/release-notes/rl-2305.section.md index c969312334996..c7e92beae9f9e 100644 --- a/nixos/doc/manual/release-notes/rl-2305.section.md +++ b/nixos/doc/manual/release-notes/rl-2305.section.md @@ -243,7 +243,6 @@ In addition to numerous new and upgraded packages, this release has the followin - [`services.nextcloud.database.createLocally`](#opt-services.nextcloud.database.createLocally) now uses socket authentication and is no longer compatible with password authentication. - If you want the module to manage the database for you, unset [`services.nextcloud.config.dbpassFile`](#opt-services.nextcloud.config.dbpassFile) (and [`services.nextcloud.config.dbhost`](#opt-services.nextcloud.config.dbhost), if it's set). - - If your database is external, simply set [`services.nextcloud.database.createLocally`](#opt-services.nextcloud.database.createLocally) to `false`. - If you want to use password authentication **and** create the database locally, you will have to use [`services.mysql`](#opt-services.mysql.enable) to set it up. - `protonmail-bridge` package has been updated to major version 3. diff --git a/nixos/modules/services/web-apps/nextcloud.md b/nixos/modules/services/web-apps/nextcloud.md index 6ecfc6ca7e473..5be81a18dfecd 100644 --- a/nixos/modules/services/web-apps/nextcloud.md +++ b/nixos/modules/services/web-apps/nextcloud.md @@ -17,11 +17,12 @@ and optionally supports For the database, you can set [`services.nextcloud.config.dbtype`](#opt-services.nextcloud.config.dbtype) to -either `sqlite` (the default), `mysql`, or `pgsql`. For the last two, by -default, a local database will be created and nextcloud will connect to it via -socket; this can be disabled by setting +either `sqlite` (the default), `mysql`, or `pgsql`. The simplest is `sqlite`, +which will be automatically created and managed by the application. For the +last two, you can easily create a local database by setting [`services.nextcloud.database.createLocally`](#opt-services.nextcloud.database.createLocally) -to `false`. +to `true`, Nextcloud will automatically be configured to connect to it through +socket. A very basic configuration may look like this: ``` @@ -30,6 +31,7 @@ A very basic configuration may look like this: services.nextcloud = { enable = true; hostName = "nextcloud.tld"; + database.createLocally = true; config = { dbtype = "pgsql"; adminpassFile = "/path/to/admin-pass-file"; diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index b7408c344aef4..01dca43776892 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -317,7 +317,7 @@ in { createLocally = mkOption { type = types.bool; - default = true; + default = false; description = lib.mdDoc '' Create the database and database user locally. ''; @@ -754,9 +754,8 @@ in { { assertions = [ { assertion = cfg.database.createLocally -> cfg.config.dbpassFile == null; message = '' - Using `services.nextcloud.database.createLocally` (that now defaults - to true) with database password authentication is no longer - supported. + Using `services.nextcloud.database.createLocally` with database + password authentication is no longer supported. If you use an external database (or want to use password auth for any other reason), set `services.nextcloud.database.createLocally` to diff --git a/nixos/tests/nextcloud/basic.nix b/nixos/tests/nextcloud/basic.nix index a475049e7b264..e17f701c54b7d 100644 --- a/nixos/tests/nextcloud/basic.nix +++ b/nixos/tests/nextcloud/basic.nix @@ -43,6 +43,7 @@ in { enable = true; datadir = "/var/lib/nextcloud-data"; hostName = "nextcloud"; + database.createLocally = true; config = { # Don't inherit adminuser since "root" is supposed to be the default adminpassFile = "${pkgs.writeText "adminpass" adminpass}"; # Don't try this at home! diff --git a/nixos/tests/nextcloud/openssl-sse.nix b/nixos/tests/nextcloud/openssl-sse.nix index 871947e1d2b20..e1f2706a7348b 100644 --- a/nixos/tests/nextcloud/openssl-sse.nix +++ b/nixos/tests/nextcloud/openssl-sse.nix @@ -9,6 +9,7 @@ args@{ pkgs, nextcloudVersion ? 25, ... }: services.nextcloud = { enable = true; config.adminpassFile = "${pkgs.writeText "adminpass" adminpass}"; + database.createLocally = true; package = pkgs.${"nextcloud" + (toString nextcloudVersion)}; }; }; diff --git a/nixos/tests/nextcloud/with-mysql-and-memcached.nix b/nixos/tests/nextcloud/with-mysql-and-memcached.nix index f673e5e75d3ba..e57aabfaf86b5 100644 --- a/nixos/tests/nextcloud/with-mysql-and-memcached.nix +++ b/nixos/tests/nextcloud/with-mysql-and-memcached.nix @@ -26,6 +26,7 @@ in { redis = false; memcached = true; }; + database.createLocally = true; config = { dbtype = "mysql"; # Don't inherit adminuser since "root" is supposed to be the default diff --git a/nixos/tests/nextcloud/with-postgresql-and-redis.nix b/nixos/tests/nextcloud/with-postgresql-and-redis.nix index 43892d39e9f0c..1cbb131042876 100644 --- a/nixos/tests/nextcloud/with-postgresql-and-redis.nix +++ b/nixos/tests/nextcloud/with-postgresql-and-redis.nix @@ -25,6 +25,7 @@ in { redis = true; memcached = false; }; + database.createLocally = true; config = { dbtype = "pgsql"; inherit adminuser; |