Skip to content
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
4 changes: 2 additions & 2 deletions nixos-modules/queue-runner-module.nix
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ in
type = lib.types.ints.positive;
default = 5;
};
tokenListPath = lib.mkOption {
description = "Path to a list of allowed authentication tokens.";
tokenPaths = lib.mkOption {
description = "List of paths of allowed authentication tokens.";
type = lib.types.nullOr (lib.types.listOf lib.types.path);
default = null;
};
Expand Down
17 changes: 12 additions & 5 deletions subprojects/hydra-queue-runner/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ struct AppConfig {
#[serde(default = "default_concurrent_upload_limit")]
concurrent_upload_limit: usize,

token_list_path: Option<std::path::PathBuf>,
token_paths: Option<Vec<std::path::PathBuf>>,

#[serde(default = "default_enable_fod_checker")]
enable_fod_checker: bool,
Expand Down Expand Up @@ -323,10 +323,17 @@ impl TryFrom<AppConfig> for PreparedApp {
let hydra_log_dir = val.hydra_data_dir.join("build-logs");
let lockfile = val.hydra_data_dir.join("queue-runner/lock");

let token_list = val.token_list_path.and_then(|p| {
fs_err::read_to_string(p)
.map(|s| s.lines().map(|t| t.trim().to_string()).collect())
.ok()
let token_list = val.token_paths.and_then(|l| {
l.iter()
.map(|p| {
fs_err::read_to_string(p)
.map(|s| s.trim().to_string())
.inspect_err(|e| {
tracing::warn!("Failed to load token file, skipping file. Err={e}");
})
.ok()
})
.collect()
});

Ok(Self {
Expand Down