diff --git a/nixos/doc/manual/release-notes/rl-2605.section.md b/nixos/doc/manual/release-notes/rl-2605.section.md index 1ec3860bcac2..df368a6d9f62 100644 --- a/nixos/doc/manual/release-notes/rl-2605.section.md +++ b/nixos/doc/manual/release-notes/rl-2605.section.md @@ -94,6 +94,12 @@ of pulling the upstream container image from Docker Hub. If you want the old beh - `services.oauth2-proxy.clientSecret` and `services.oauth2-proxy.cookie.secret` have been replaced with `services.oauth2-proxy.clientSecretFile` and `services.oauth2-proxy.cookie.secretFile` respectively. This was done to ensure secrets don't get made world-readable. +- [`services.grafana.settings.security.secret_key`](#opt-services.grafana.settings.security.secret_key) doesn't have a + default value anymore. Please generate your own key or hard-code the old one explicitly. + See the [upstream docs](https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#secret_key) and + the [instructions on how to rotate](https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-database-encryption/#re-encrypt-secrets) + for further information. + - Ethercalc and its associated module have been removed, as the package is unmaintained and cannot be installed from source with npm now. - `services.cgit` before always had the git-http-backend and its "export all" setting enabled, which sidestepped any access control configured in cgit's settings. Now you have to make a decision and either enable or disable `services.cgit.gitHttpBackend.checkExportOkFiles` (or disable the git-http-backend). diff --git a/nixos/modules/services/monitoring/grafana.nix b/nixos/modules/services/monitoring/grafana.nix index 9f458792c34b..96a725b3a844 100644 --- a/nixos/modules/services/monitoring/grafana.nix +++ b/nixos/modules/services/monitoring/grafana.nix @@ -889,7 +889,8 @@ in to work around that. Look at the documentation for details: ''; - type = types.str; + type = types.nullOr types.str; + default = null; }; disable_gravatar = mkOption { @@ -2060,6 +2061,17 @@ in || cfg.provision.alerting.muteTimings.path == null; message = "Cannot set both mute timings settings and mute timings path"; } + { + assertion = cfg.settings.security.secret_key != null; + message = '' + Grafana's secret key (services.grafana.settings.security.secret_key) doesn't have a default + value anymore. Please generate your own and use a file-provider on this option! See also + https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#secret_key + for more information. + + See https://grafana.com/docs/grafana/latest/setup-grafana/configure-security/configure-database-encryption/#re-encrypt-secrets on how to re-encrypt. + ''; + } ]; systemd.services.grafana = {