bug fixes from sxsw
This commit is contained in:
@@ -34,11 +34,6 @@ impl RpcHandler {
|
||||
return Err(anyhow::anyhow!("Invalid Docker image format"));
|
||||
}
|
||||
|
||||
// Virtual app: Indeehub (no container, opens external URL)
|
||||
if package_id == "indeedhub" {
|
||||
return Ok(serde_json::json!({ "success": true }));
|
||||
}
|
||||
|
||||
// Multi-container apps: create full stack
|
||||
if package_id == "immich" {
|
||||
return self.install_immich_stack().await;
|
||||
@@ -117,8 +112,17 @@ impl RpcHandler {
|
||||
}
|
||||
|
||||
// Pull the image (skip for local images - must be built locally first)
|
||||
// For registry images, also check if a local build exists first (avoids
|
||||
// pull failures when the registry image hasn't been pushed yet).
|
||||
let is_local_image = docker_image.starts_with("localhost/");
|
||||
if !is_local_image {
|
||||
let has_local_fallback = if !is_local_image {
|
||||
let local_tag = format!("localhost/{}:latest", package_id);
|
||||
let check = tokio::process::Command::new("sudo")
|
||||
.args(["podman", "images", "-q", &local_tag])
|
||||
.output().await.ok();
|
||||
check.map_or(false, |o| !String::from_utf8_lossy(&o.stdout).trim().is_empty())
|
||||
} else { false };
|
||||
if !is_local_image && !has_local_fallback {
|
||||
debug!("Pulling image: {}", docker_image);
|
||||
|
||||
// Set package state to Installing with progress
|
||||
@@ -156,6 +160,9 @@ impl RpcHandler {
|
||||
|
||||
// Mark pull as complete (100%)
|
||||
self.set_install_progress(package_id, 100, 100).await;
|
||||
} else if has_local_fallback {
|
||||
// Registry image exists locally — use the local build
|
||||
debug!("Using local build for {} (skipping registry pull)", package_id);
|
||||
} else {
|
||||
// Verify local image exists
|
||||
let images_output = tokio::process::Command::new("sudo")
|
||||
@@ -165,7 +172,7 @@ impl RpcHandler {
|
||||
.context("Failed to check local image")?;
|
||||
if String::from_utf8_lossy(&images_output.stdout).trim().is_empty() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"Local image {} not found. Run ./deploy-to-archipelago.sh from the Indeehub Prototype project on your Mac—it builds the image on this server and starts the app.",
|
||||
"Local image {} not found. Build the image first or ensure the registry is reachable.",
|
||||
docker_image
|
||||
));
|
||||
}
|
||||
@@ -342,8 +349,13 @@ printtoconsole=1\n";
|
||||
run_args.push(arg);
|
||||
}
|
||||
|
||||
// Finally, the image
|
||||
run_args.push(docker_image);
|
||||
// Finally, the image — use local build if available, otherwise registry image
|
||||
let effective_image = if has_local_fallback {
|
||||
format!("localhost/{}:latest", package_id)
|
||||
} else {
|
||||
docker_image.to_string()
|
||||
};
|
||||
run_args.push(&effective_image);
|
||||
|
||||
debug!("Running container with args: {:?}", run_args);
|
||||
|
||||
@@ -1723,9 +1735,9 @@ fn get_app_config(
|
||||
]),
|
||||
),
|
||||
"indeedhub" => (
|
||||
vec!["7777:7777".to_string()],
|
||||
vec!["8190:3000".to_string()],
|
||||
vec![],
|
||||
vec!["NGINX_HOST=0.0.0.0".to_string(), "NGINX_PORT=7777".to_string()],
|
||||
vec!["NODE_ENV=production".to_string(), "NEXT_TELEMETRY_DISABLED=1".to_string()],
|
||||
None,
|
||||
None,
|
||||
),
|
||||
|
||||
@@ -136,6 +136,9 @@ impl DockerPackageScanner {
|
||||
} else if app_id == "dwn" {
|
||||
debug!("Using DWN server: http://localhost:3100");
|
||||
Some("http://localhost:3100".to_string())
|
||||
} else if app_id == "indeedhub" {
|
||||
debug!("Using Indeehub: http://localhost:8190");
|
||||
Some("http://localhost:8190".to_string())
|
||||
} else if app_id == "mempool-electrs" || app_id == "electrs" {
|
||||
// Electrs UI runs on host at port 50002
|
||||
debug!("Using electrs-ui for mempool-electrs: http://localhost:50002");
|
||||
@@ -219,66 +222,6 @@ impl DockerPackageScanner {
|
||||
info!("Detected container: {} ({})", metadata.title, package_state_str(&package_state));
|
||||
}
|
||||
|
||||
// Virtual app: Indeehub (opens external URL, no container required)
|
||||
if !packages.contains_key("indeedhub") {
|
||||
let metadata = get_app_metadata("indeedhub");
|
||||
let lan_address = Some("https://archipelago.indeehub.studio".to_string());
|
||||
let virtual_pkg = PackageDataEntry {
|
||||
state: PackageState::Running,
|
||||
static_files: StaticFiles {
|
||||
license: "MIT".to_string(),
|
||||
instructions: metadata.description.clone(),
|
||||
icon: metadata.icon.clone(),
|
||||
},
|
||||
manifest: Manifest {
|
||||
id: "indeedhub".to_string(),
|
||||
title: metadata.title.clone(),
|
||||
version: "0.1.0".to_string(),
|
||||
description: Description {
|
||||
short: metadata.description.clone(),
|
||||
long: metadata.description.clone(),
|
||||
},
|
||||
release_notes: "Virtual app (opens archipelago.indeehub.studio)".to_string(),
|
||||
license: "MIT".to_string(),
|
||||
wrapper_repo: metadata.repo.clone(),
|
||||
upstream_repo: metadata.repo.clone(),
|
||||
support_site: metadata.repo.clone(),
|
||||
marketing_site: metadata.repo.clone(),
|
||||
donation_url: None,
|
||||
author: Some("Indeehub Team".to_string()),
|
||||
website: lan_address.clone(),
|
||||
tier: Some("optional".to_string()),
|
||||
interfaces: Some(Interfaces {
|
||||
main: Some(MainInterface {
|
||||
ui: Some("true".to_string()),
|
||||
tor_config: None,
|
||||
lan_config: None,
|
||||
}),
|
||||
}),
|
||||
},
|
||||
installed: Some(InstalledPackageDataEntry {
|
||||
current_dependents: HashMap::new(),
|
||||
current_dependencies: HashMap::new(),
|
||||
last_backup: None,
|
||||
interface_addresses: {
|
||||
let mut addresses = HashMap::new();
|
||||
addresses.insert(
|
||||
"main".to_string(),
|
||||
InterfaceAddress {
|
||||
tor_address: String::new(),
|
||||
lan_address: lan_address,
|
||||
},
|
||||
);
|
||||
addresses
|
||||
},
|
||||
status: ServiceStatus::Running,
|
||||
}),
|
||||
install_progress: None,
|
||||
};
|
||||
packages.insert("indeedhub".to_string(), virtual_pkg);
|
||||
info!("Virtual app: Indeehub (archipelago.indeehub.studio)");
|
||||
}
|
||||
|
||||
Ok(packages)
|
||||
}
|
||||
}
|
||||
@@ -505,7 +448,7 @@ fn get_app_metadata(app_id: &str) -> AppMetadata {
|
||||
repo: "https://github.com/tailscale/tailscale".to_string(),
|
||||
tier: "",
|
||||
},
|
||||
"indeedhub" => AppMetadata {
|
||||
"indeedhub" | "indeehub" => AppMetadata {
|
||||
title: "Indeehub".to_string(),
|
||||
description: "Decentralized media streaming platform".to_string(),
|
||||
icon: "/assets/img/app-icons/indeehub.ico".to_string(),
|
||||
|
||||
Reference in New Issue
Block a user