feat: fallback container registry at 23.182.128.160:3000
When primary registry (git.tx1138.com) fails, image pull automatically retries from Gitea registry at 23.182.128.160:3000. Tags pulled image with original name so install continues seamlessly. Gitea added as external app in app session config. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
bcd120e1d0
commit
1a41d16cef
@ -603,7 +603,30 @@ impl RpcHandler {
|
|||||||
.await
|
.await
|
||||||
.context("Failed to wait for image pull")?;
|
.context("Failed to wait for image pull")?;
|
||||||
if !status.success() {
|
if !status.success() {
|
||||||
return Err(anyhow::anyhow!("podman pull exited with non-zero status"));
|
// Try fallback registry if primary fails
|
||||||
|
let fallback = docker_image.replace("git.tx1138.com/lfg2025/", "23.182.128.160:3000/lfg2025/");
|
||||||
|
if fallback != docker_image {
|
||||||
|
tracing::info!("Primary registry failed, trying fallback: {}", fallback);
|
||||||
|
let fb_status = tokio::process::Command::new("podman")
|
||||||
|
.args(["pull", &fallback, "--tls-verify=false"])
|
||||||
|
.env("TMPDIR", &user_tmp)
|
||||||
|
.stdout(std::process::Stdio::null())
|
||||||
|
.stderr(std::process::Stdio::null())
|
||||||
|
.status()
|
||||||
|
.await;
|
||||||
|
if fb_status.map(|s| s.success()).unwrap_or(false) {
|
||||||
|
// Tag as the original name so the rest of the install works
|
||||||
|
let _ = tokio::process::Command::new("podman")
|
||||||
|
.args(["tag", &fallback, docker_image])
|
||||||
|
.status()
|
||||||
|
.await;
|
||||||
|
tracing::info!("Fallback pull succeeded: {}", fallback);
|
||||||
|
} else {
|
||||||
|
return Err(anyhow::anyhow!("Image pull failed from both registries"));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return Err(anyhow::anyhow!("podman pull exited with non-zero status"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verify image exists locally after pull
|
// Verify image exists locally after pull
|
||||||
|
|||||||
@ -97,6 +97,7 @@ export const HTTPS_PROXY_PATHS: Record<string, string> = {
|
|||||||
|
|
||||||
/** External HTTPS apps -- always loaded directly */
|
/** External HTTPS apps -- always loaded directly */
|
||||||
export const EXTERNAL_URLS: Record<string, string> = {
|
export const EXTERNAL_URLS: Record<string, string> = {
|
||||||
|
'gitea': 'http://23.182.128.160:3000',
|
||||||
'nwnn': 'https://nwnn.l484.com',
|
'nwnn': 'https://nwnn.l484.com',
|
||||||
'484-kitchen': 'https://484.kitchen',
|
'484-kitchen': 'https://484.kitchen',
|
||||||
'call-the-operator': 'https://cta.tx1138.com',
|
'call-the-operator': 'https://cta.tx1138.com',
|
||||||
|
|||||||
@ -9,8 +9,9 @@
|
|||||||
# Run: podman images --format '{{.Repository}}:{{.Tag}}' | grep 'git.tx1138' | sort
|
# Run: podman images --format '{{.Repository}}:{{.Tag}}' | grep 'git.tx1138' | sort
|
||||||
# to verify against the registry.
|
# to verify against the registry.
|
||||||
|
|
||||||
# Archipelago app registry
|
# Archipelago app registries (primary + fallback)
|
||||||
ARCHY_REGISTRY="git.tx1138.com/lfg2025"
|
ARCHY_REGISTRY="git.tx1138.com/lfg2025"
|
||||||
|
ARCHY_REGISTRY_FALLBACK="23.182.128.160:3000/lfg2025"
|
||||||
|
|
||||||
# Bitcoin stack
|
# Bitcoin stack
|
||||||
BITCOIN_KNOTS_IMAGE="$ARCHY_REGISTRY/bitcoin-knots:latest"
|
BITCOIN_KNOTS_IMAGE="$ARCHY_REGISTRY/bitcoin-knots:latest"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user