Merge pull request #172926 from aidalgol/nextcloud-hsts-options
nixos/nextcloud: Add option for max-age HSTS directive
This commit is contained in:
commit
0b904cfc7e
@ -2514,6 +2514,16 @@ cp /var/lib/redis/dump.rdb "/var/lib/redis-mastodon/dump.rdb"
|
|||||||
enabled.
|
enabled.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The Nextcloud module now allows setting the value of the
|
||||||
|
<literal>max-age</literal> directive of the
|
||||||
|
<literal>Strict-Transport-Security</literal> HTTP header,
|
||||||
|
which is now controlled by the
|
||||||
|
<literal>services.nextcloud.https</literal> option, rather
|
||||||
|
than <literal>services.nginx.recommendedHttpHeaders</literal>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
The <literal>spark3</literal> package has been updated from
|
The <literal>spark3</literal> package has been updated from
|
||||||
|
@ -892,6 +892,8 @@ In addition to numerous new and upgraded packages, this release has the followin
|
|||||||
- The Nextcloud module now supports to create a Mysql database automatically
|
- The Nextcloud module now supports to create a Mysql database automatically
|
||||||
with `services.nextcloud.database.createLocally` enabled.
|
with `services.nextcloud.database.createLocally` enabled.
|
||||||
|
|
||||||
|
- The Nextcloud module now allows setting the value of the `max-age` directive of the `Strict-Transport-Security` HTTP header, which is now controlled by the `services.nextcloud.https` option, rather than `services.nginx.recommendedHttpHeaders`.
|
||||||
|
|
||||||
- The `spark3` package has been updated from 3.1.2 to 3.2.1 ([#160075](https://github.com/NixOS/nixpkgs/pull/160075)):
|
- The `spark3` package has been updated from 3.1.2 to 3.2.1 ([#160075](https://github.com/NixOS/nixpkgs/pull/160075)):
|
||||||
|
|
||||||
- Testing has been enabled for `aarch64-linux` in addition to `x86_64-linux`.
|
- Testing has been enabled for `aarch64-linux` in addition to `x86_64-linux`.
|
||||||
|
@ -546,11 +546,24 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nginx.recommendedHttpHeaders = mkOption {
|
nginx = {
|
||||||
|
recommendedHttpHeaders = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
description = "Enable additional recommended HTTP response headers";
|
description = "Enable additional recommended HTTP response headers";
|
||||||
};
|
};
|
||||||
|
hstsMaxAge = mkOption {
|
||||||
|
type = types.ints.positive;
|
||||||
|
default = 15552000;
|
||||||
|
description = ''
|
||||||
|
Value for the <code>max-age</code> directive of the HTTP
|
||||||
|
<code>Strict-Transport-Security</code> header.
|
||||||
|
|
||||||
|
See section 6.1.1 of IETF RFC 6797 for detailed information on this
|
||||||
|
directive and header.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable (mkMerge [
|
config = mkIf cfg.enable (mkMerge [
|
||||||
@ -983,7 +996,9 @@ in {
|
|||||||
add_header X-Permitted-Cross-Domain-Policies none;
|
add_header X-Permitted-Cross-Domain-Policies none;
|
||||||
add_header X-Frame-Options sameorigin;
|
add_header X-Frame-Options sameorigin;
|
||||||
add_header Referrer-Policy no-referrer;
|
add_header Referrer-Policy no-referrer;
|
||||||
add_header Strict-Transport-Security "max-age=15552000; includeSubDomains" always;
|
''}
|
||||||
|
${optionalString (cfg.https) ''
|
||||||
|
add_header Strict-Transport-Security "max-age=${toString cfg.nginx.hstsMaxAge}; includeSubDomains" always;
|
||||||
''}
|
''}
|
||||||
client_max_body_size ${cfg.maxUploadSize};
|
client_max_body_size ${cfg.maxUploadSize};
|
||||||
fastcgi_buffers 64 4K;
|
fastcgi_buffers 64 4K;
|
||||||
|
Loading…
Reference in New Issue
Block a user