chore: release v1.7.49-alpha
This commit is contained in:
@@ -229,6 +229,7 @@ impl RpcHandler {
|
||||
let deps = detect_running_deps().await?;
|
||||
check_install_deps(package_id, &deps)?;
|
||||
log_optional_dep_info(package_id, &deps);
|
||||
check_bitcoin_implementation_conflict(package_id).await?;
|
||||
|
||||
// Check if container already exists
|
||||
let check_output = tokio::process::Command::new("podman")
|
||||
@@ -1961,9 +1962,51 @@ fn should_try_orchestrator_install(package_id: &str, orchestrator_available: boo
|
||||
orchestrator_available && uses_orchestrator_install_flow(package_id)
|
||||
}
|
||||
|
||||
async fn check_bitcoin_implementation_conflict(package_id: &str) -> Result<()> {
|
||||
let other = match package_id {
|
||||
"bitcoin-core" => "bitcoin-knots",
|
||||
"bitcoin-knots" => "bitcoin-core",
|
||||
_ => return Ok(()),
|
||||
};
|
||||
|
||||
let output = tokio::process::Command::new("podman")
|
||||
.args([
|
||||
"ps",
|
||||
"-a",
|
||||
"--format",
|
||||
"{{.Names}}",
|
||||
"--filter",
|
||||
&format!("name=^{}$", other),
|
||||
])
|
||||
.output()
|
||||
.await
|
||||
.context("Failed to check existing Bitcoin node containers")?;
|
||||
|
||||
if String::from_utf8_lossy(&output.stdout).trim().is_empty() {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let current = match other {
|
||||
"bitcoin-core" => "Bitcoin Core",
|
||||
"bitcoin-knots" => "Bitcoin Knots",
|
||||
_ => "another Bitcoin node",
|
||||
};
|
||||
let requested = match package_id {
|
||||
"bitcoin-core" => "Bitcoin Core",
|
||||
"bitcoin-knots" => "Bitcoin Knots",
|
||||
_ => "the requested Bitcoin node",
|
||||
};
|
||||
|
||||
Err(anyhow::anyhow!(
|
||||
"{} is already installed. Stop and uninstall {} before installing {}; both implementations use the same Bitcoin data directory and ports.",
|
||||
current,
|
||||
current,
|
||||
requested
|
||||
))
|
||||
}
|
||||
|
||||
fn orchestrator_install_app_id(package_id: &str) -> &str {
|
||||
match package_id {
|
||||
"bitcoin-knots" => "bitcoin-core",
|
||||
"electrs" | "mempool-electrs" => "electrumx",
|
||||
_ => package_id,
|
||||
}
|
||||
@@ -2049,7 +2092,8 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn install_aliases_map_to_manifest_app_ids() {
|
||||
assert_eq!(orchestrator_install_app_id("bitcoin-knots"), "bitcoin-core");
|
||||
assert_eq!(orchestrator_install_app_id("bitcoin-knots"), "bitcoin-knots");
|
||||
assert_eq!(orchestrator_install_app_id("bitcoin-core"), "bitcoin-core");
|
||||
assert_eq!(orchestrator_install_app_id("electrs"), "electrumx");
|
||||
assert_eq!(orchestrator_install_app_id("mempool-electrs"), "electrumx");
|
||||
assert_eq!(orchestrator_install_app_id("lnd"), "lnd");
|
||||
|
||||
@@ -355,7 +355,7 @@ pub(in crate::api::rpc) fn known_service_port(name: &str) -> u16 {
|
||||
"penpot" => 9001,
|
||||
"nginx-proxy-manager" => 81,
|
||||
"vaultwarden" => 8343,
|
||||
"indeedhub" => 7777,
|
||||
"indeedhub" => 7778,
|
||||
_ => 0,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user