Skip to content

Commit

Permalink
nixos/nextcloud: add overwriteProtocol option
Browse files Browse the repository at this point in the history
The overwriteprotocol option can be used to force Nextcloud to generate
URLs with the given protocol. This is useful for instances behind
reverse proxies that serve Nextcloud with HTTPS.

In this case Nextcloud can't determine the proper protocol and it needs
to be configured manually.
  • Loading branch information
Ma27 committed Feb 27, 2019
1 parent 8b6b3c9 commit b42c24f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions nixos/modules/services/web-apps/nextcloud.nix
Expand Up @@ -223,6 +223,19 @@ in {
<literal>services.nextcloud.hostname</literal> here.
'';
};

overwriteProtocol = mkOption {
type = types.nullOr (types.enum [ "http" "https" ]);
default = null;
example = "https";

description = ''
Force Nextcloud to always use HTTPS i.e. for link generation. Nextcloud
uses the currently used protocol by default, but when behind a reverse-proxy,
it may use <literal>http</literal> for everything although Nextcloud
may be served via HTTPS.
'';
};
};

caching = {
Expand Down Expand Up @@ -287,6 +300,7 @@ in {
${optionalString cfg.caching.apcu "'memcache.local' => '\\OC\\Memcache\\APCu',"}
'log_type' => 'syslog',
'log_level' => '${builtins.toString cfg.logLevel}',
${optionalString (cfg.config.overwriteProtocol != null) "'overwriteprotocol' => '${cfg.config.overwriteProtocol}',"}
];
'';
occInstallCmd = let
Expand Down

0 comments on commit b42c24f

Please sign in to comment.