Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions nixos/modules/services/web-apps/nextcloud.nix
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ let
'use_ssl' => ${lib.boolToString s3.useSsl},
${lib.optionalString (s3.region != null) "'region' => '${s3.region}',"}
'use_path_style' => ${lib.boolToString s3.usePathStyle},
'use_presigned_url' => ${lib.boolToString s3.usePresignedUrl},
${lib.optionalString (s3.sseCKeyFile != null) "'sse_c_key' => nix_read_secret('s3_sse_c_key'),"}
],
]
Expand Down Expand Up @@ -765,6 +766,15 @@ in
`http://hostname.domain/bucket` instead.
'';
};
usePresignedUrl = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Allow bypassing nextcloud instance and serve files
directly from the S3 server. Such a download is protected
with a presigned download link.
'';
};
sseCKeyFile = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
Expand Down Expand Up @@ -1314,6 +1324,14 @@ in
Use `services.nextcloud.secrets.mail_smtppassword` instead and set it to a file containing the password.
'';
}
{
assertion =
lib.versionAtLeast cfg.package.version "33.0.0"
|| cfg.config.objectstore.s3.use_presigned_url == null;
message = ''
Presigned URLs are only available on Nextcloud >= 33.0.0.
'';
}
];
}

Expand Down
Loading