diff --git a/nixos-modules/queue-runner-module.nix b/nixos-modules/queue-runner-module.nix index 643fa8879..4685a582b 100644 --- a/nixos-modules/queue-runner-module.nix +++ b/nixos-modules/queue-runner-module.nix @@ -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; }; diff --git a/subprojects/hydra-queue-runner/src/config.rs b/subprojects/hydra-queue-runner/src/config.rs index a50e6863a..adeb53d47 100644 --- a/subprojects/hydra-queue-runner/src/config.rs +++ b/subprojects/hydra-queue-runner/src/config.rs @@ -249,7 +249,7 @@ struct AppConfig { #[serde(default = "default_concurrent_upload_limit")] concurrent_upload_limit: usize, - token_list_path: Option, + token_paths: Option>, #[serde(default = "default_enable_fod_checker")] enable_fod_checker: bool, @@ -323,10 +323,17 @@ impl TryFrom 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 {