Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/prometheus-exporters/fastly: fix secret handling #370898

Merged
merged 1 commit into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,17 @@ in
'';
};

tokenPath = mkOption {
environmentFile = mkOption {
type = path;
description = ''
A run-time path to the token file, which is supposed to be provisioned
outside of Nix store.
An environment file containg at least the FASTLY_API_TOKEN= environment
variable.
'';
};
};
serviceOpts = {
serviceConfig = {
LoadCredential = "fastly-api-token:${cfg.tokenPath}";
Environment = [ "FASTLY_API_TOKEN=%d/fastly-api-token" ];
EnvironmentFile = cfg.environmentFile;
ExecStart = escapeSystemdExecArgs (
[
(getExe pkgs.prometheus-fastly-exporter)
Expand Down
2 changes: 1 addition & 1 deletion nixos/tests/prometheus-exporters.nix
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ let
fastly = {
exporterConfig = {
enable = true;
tokenPath = pkgs.writeText "token" "abc123";
environmentFile = pkgs.writeText "fastly-exporter-env" "FASTLY_API_TOKEN=abc123";
};

exporterTest = ''
Expand Down
Loading