fix: auto-build UI containers for Bitcoin, LND, Electrumx

Critical: headless services (Bitcoin, LND, Electrumx) need companion
UI containers that serve web dashboards. These were only built for
Bitcoin, and only on bundled ISO builds.

Changes:
- install.rs: auto-build UI containers for LND (port 8081) and
  Electrumx (port 50002) in addition to Bitcoin (port 8334)
- build-auto-installer-iso.sh: always bundle docker UI source files
  (was skipping for unbundled builds — they're tiny HTML, not images)
- Dockerfiles: fix nginx base image tag 1.29.6→1.27.4 (matches registry)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-03-29 17:48:13 +01:00
parent 173cceb8a9
commit fbabbd0722
5 changed files with 41 additions and 18 deletions

View File

@ -615,31 +615,54 @@ printtoconsole=1\n",
}); });
} }
if matches!(package_id, "bitcoin" | "bitcoin-core" | "bitcoin-knots") { // Build and start companion UI containers for headless services
let ui_builds: Vec<(&str, &str, &str, &str)> = match package_id {
"bitcoin" | "bitcoin-core" | "bitcoin-knots" => {
vec![("bitcoin-ui", "/opt/archipelago/docker/bitcoin-ui", "localhost/bitcoin-ui", "8334:80")]
}
"lnd" => {
vec![("archy-lnd-ui", "/opt/archipelago/docker/lnd-ui", "localhost/lnd-ui", "8081:80")]
}
"electrumx" | "electrs" | "mempool-electrs" => {
vec![("archy-electrs-ui", "/opt/archipelago/docker/electrs-ui", "localhost/electrs-ui", "50002:80")]
}
_ => vec![],
};
for (name, ui_dir, image, port) in ui_builds {
let name = name.to_string();
let ui_dir = ui_dir.to_string();
let image = image.to_string();
let port = port.to_string();
tokio::spawn(async move { tokio::spawn(async move {
let ui_dir = "/opt/archipelago/docker/bitcoin-ui"; if !std::path::Path::new(&ui_dir).exists() {
info!("UI source not found at {}, skipping", ui_dir);
return;
}
info!("Building UI container {} from {}", name, ui_dir);
let _ = tokio::process::Command::new("podman") let _ = tokio::process::Command::new("podman")
.args(["build", "-t", "localhost/bitcoin-ui", ui_dir]) .args(["build", "-t", &image, &ui_dir])
.output() .output()
.await; .await;
let _ = tokio::process::Command::new("podman") let _ = tokio::process::Command::new("podman")
.args(["rm", "-f", "bitcoin-ui"]) .args(["rm", "-f", &name])
.output() .output()
.await; .await;
let _ = tokio::process::Command::new("podman") let _ = tokio::process::Command::new("podman")
.args([ .args([
"run", "run", "-d",
"-d", "--name", &name,
"--name",
"bitcoin-ui",
"--restart=unless-stopped", "--restart=unless-stopped",
"-p", "--network=archy-net",
"8334:80", "--cap-drop=ALL",
"localhost/bitcoin-ui:latest", "--cap-add=NET_BIND_SERVICE",
"--memory=64m",
"-p", &port,
&format!("{}:latest", image),
]) ])
.output() .output()
.await; .await;
info!("Bitcoin UI container started on port 8334"); info!("{} UI container started on port {}", name, port);
}); });
} }
} }

View File

@ -1,4 +1,4 @@
FROM 80.71.235.15:3000/archipelago/nginx:1.29.6-alpine FROM 80.71.235.15:3000/archipelago/nginx:1.27.4-alpine
COPY index.html /usr/share/nginx/html/ COPY index.html /usr/share/nginx/html/
COPY 50x.html /usr/share/nginx/html/ COPY 50x.html /usr/share/nginx/html/
COPY assets/ /usr/share/nginx/html/assets/ COPY assets/ /usr/share/nginx/html/assets/

View File

@ -1,4 +1,4 @@
FROM 80.71.235.15:3000/archipelago/nginx:1.29.6-alpine FROM 80.71.235.15:3000/archipelago/nginx:1.27.4-alpine
COPY index.html /usr/share/nginx/html/ COPY index.html /usr/share/nginx/html/
COPY 50x.html /usr/share/nginx/html/ COPY 50x.html /usr/share/nginx/html/
COPY assets/ /usr/share/nginx/html/assets/ COPY assets/ /usr/share/nginx/html/assets/

View File

@ -1,4 +1,4 @@
FROM 80.71.235.15:3000/archipelago/nginx:1.29.6-alpine FROM 80.71.235.15:3000/archipelago/nginx:1.27.4-alpine
# Copy the HTML file # Copy the HTML file
COPY index.html /usr/share/nginx/html/ COPY index.html /usr/share/nginx/html/

View File

@ -1370,9 +1370,9 @@ if [ -f "$SCRIPT_DIR/../scripts/image-versions.sh" ]; then
echo " ✅ Bundled image-versions.sh" echo " ✅ Bundled image-versions.sh"
fi fi
# Bundle docker UI source files for building custom UIs on first boot (fallback if images not captured) # Bundle docker UI source files for building custom UIs on first boot
# Skip for unbundled builds # Always bundle — these are tiny HTML/CSS files, not container images
if [ "$UNBUNDLED" != "1" ]; then if true; then
DOCKER_UI_DIR="$SCRIPT_DIR/../docker" DOCKER_UI_DIR="$SCRIPT_DIR/../docker"
if [ -d "$DOCKER_UI_DIR" ]; then if [ -d "$DOCKER_UI_DIR" ]; then
echo " Bundling docker UI source files..." echo " Bundling docker UI source files..."