Skip to content

Commit

Permalink
feat(device-manager): Allow unsigned ACAPs (#122)
Browse files Browse the repository at this point in the history
For development, it is not feasible to sign the ACAP for every
iteration.

Allow unsigned ACAPs as part of the initialization process.

---

`crates/device-manager/src/initialization.rs`:
- Use the term "ACAP application" because this is the replacement used
  in PR267 of AxisCommunications/acap-native-sdk-examples making me
  think it is the preferred term.
- Make no attempt to check if the request error is expected for the
  current firmware for simplicity. This follows the example established
  with `restore_root_ssh_user`.
- Deviate from the aforementioned pattern by naming the firmware in
  which the API was introduced because this seems like it could be
  useful information, it is unlikely to become incorrect and earlier
  commits don't give a reason for omitting this information.
  • Loading branch information
kjughx authored Oct 31, 2024
1 parent cf2ec43 commit 9603842
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/device-manager/src/initialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,14 @@ pub async fn initialize(host: Host, pass: &str) -> anyhow::Result<HttpClient> {
.arg(&format!("root@{}", host));
log_stdout(sshpass)?;

info!("Allowing unsigned ACAP applications...");
let resp = client
.get("/axis-cgi/applications/config.cgi?action=set&name=AllowUnsigned&value=true")?
.send()
.await?;
if let Err(e) = resp.error_for_status() {
info!("Could not allow unsigned apps because {e} (this is expected on LTS2022 and earlier)")
}

Ok(client)
}

0 comments on commit 9603842

Please sign in to comment.