Enable explicitly configured private artifact storage for authenticated production releases

This commit is contained in:
2026-11-18 11:08:53 +01:00
parent 0b07baf7be
commit 9c7ccbb59b
2 changed files with 8 additions and 4 deletions
+3 -1
View File
@@ -123,11 +123,13 @@ pub fn store() -> Result<UpdateArtifacts, Error> {
if !metadata.is_file() || metadata.permissions().mode() & 0o077 != 0 {
return Err(fail("AGENT_UPDATE_NOT_CONFIGURED"));
}
let profile = std::env::var("RMM_PROFILE").unwrap_or_default();
Ok(UpdateArtifacts::new(
&std::env::var("RMM_PROFILE").unwrap_or_default(),
&profile,
match std::env::var_os("RMM_AGENT_UPDATE_ARTIFACT_DIR") {
Some(value) if FsPath::new(&value).is_absolute() => value.into(),
Some(_) => return Err(fail("AGENT_UPDATE_NOT_CONFIGURED")),
None if profile != "development" => return Err(fail("AGENT_UPDATE_NOT_CONFIGURED")),
None => path
.parent()
.ok_or_else(|| fail("AGENT_UPDATE_NOT_CONFIGURED"))?