Merge pull request #230888 from Misterio77/nextcloud-createlocally-optin

nixos/nextcloud: default createLocally to false
This commit is contained in:
Ryan Lahfa 2023-05-15 09:28:15 +02:00 committed by GitHub
commit fa06a3b646
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 13 additions and 9 deletions

View File

@ -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.

View File

@ -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";

View File

@ -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

View File

@ -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!

View File

@ -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)};
};
};

View File

@ -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

View File

@ -25,6 +25,7 @@ in {
redis = true;
memcached = false;
};
database.createLocally = true;
config = {
dbtype = "pgsql";
inherit adminuser;