nixos/prometheus-exporters/fastly: fix secret handling (#370898)
This commit is contained in:
commit
a1945f760a
@ -31,18 +31,17 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
tokenPath = mkOption {
|
environmentFile = mkOption {
|
||||||
type = path;
|
type = path;
|
||||||
description = ''
|
description = ''
|
||||||
A run-time path to the token file, which is supposed to be provisioned
|
An environment file containg at least the FASTLY_API_TOKEN= environment
|
||||||
outside of Nix store.
|
variable.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
serviceOpts = {
|
serviceOpts = {
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
LoadCredential = "fastly-api-token:${cfg.tokenPath}";
|
EnvironmentFile = cfg.environmentFile;
|
||||||
Environment = [ "FASTLY_API_TOKEN=%d/fastly-api-token" ];
|
|
||||||
ExecStart = escapeSystemdExecArgs (
|
ExecStart = escapeSystemdExecArgs (
|
||||||
[
|
[
|
||||||
(getExe pkgs.prometheus-fastly-exporter)
|
(getExe pkgs.prometheus-fastly-exporter)
|
||||||
|
@ -399,7 +399,7 @@ let
|
|||||||
fastly = {
|
fastly = {
|
||||||
exporterConfig = {
|
exporterConfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
tokenPath = pkgs.writeText "token" "abc123";
|
environmentFile = pkgs.writeText "fastly-exporter-env" "FASTLY_API_TOKEN=abc123";
|
||||||
};
|
};
|
||||||
|
|
||||||
exporterTest = ''
|
exporterTest = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user