mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-03-03 18:15:53 +00:00
Part of #12467 — scripts only (no framework changes). New exit codes 250-254 registered in api.func and error_handler.func: - 250: App download failed or version not determined - 251: App file extraction failed (corrupt/incomplete archive) - 252: App required file or resource not found - 253: App data migration required — update aborted - 254: App user declined prompt or input timed out Existing codes reused where applicable: - 10: privileged/Docker required (unifi-os-server) - 64: invalid user input (postgresql, tomcat) - 71: system error (pulse useradd) - 150: service failed to start (docker, npmplus) - 153: build failed (booklore) - 233: app not installed (evcc, endurain, grafana, loki, itsm-ng) - 236: hardware not detected (unifi-os-server /dev/net/tun) - 238: OS not supported (frigate)
76 lines
2.5 KiB
Bash
76 lines
2.5 KiB
Bash
#!/usr/bin/env bash
|
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
|
|
# Copyright (c) 2021-2026 community-scripts ORG
|
|
# Author: MickLesk (CanbiZ)
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
# Source: https://komo.do/
|
|
|
|
APP="Komodo"
|
|
var_tags="${var_tags:-docker}"
|
|
var_cpu="${var_cpu:-2}"
|
|
var_ram="${var_ram:-2048}"
|
|
var_disk="${var_disk:-10}"
|
|
var_os="${var_os:-debian}"
|
|
var_version="${var_version:-13}"
|
|
var_unprivileged="${var_unprivileged:-1}"
|
|
|
|
header_info "$APP"
|
|
variables
|
|
color
|
|
catch_errors
|
|
|
|
ADDON_SCRIPT="https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/komodo.sh"
|
|
|
|
function update_script() {
|
|
header_info
|
|
check_container_storage
|
|
check_container_resources
|
|
|
|
if [[ ! -d /opt/komodo ]]; then
|
|
msg_error "No ${APP} Installation Found!"
|
|
exit
|
|
fi
|
|
|
|
msg_warn "⚠️ ${APP} has been migrated to an addon script."
|
|
echo ""
|
|
msg_info "This is a one-time migration. After this, you can update ${APP} anytime with:"
|
|
echo -e "${TAB}${TAB}${GN}update_komodo${CL} or ${GN}bash <(curl -fsSL ${ADDON_SCRIPT})${CL}"
|
|
echo ""
|
|
read -r -p "${TAB}Migrate update function now? [y/N]: " CONFIRM
|
|
if [[ ! "${CONFIRM,,}" =~ ^(y|yes)$ ]]; then
|
|
msg_warn "Migration skipped. The old update will continue to work for now."
|
|
msg_info "Updating ${APP} (legacy)"
|
|
COMPOSE_FILE=$(find /opt/komodo -maxdepth 1 -type f -name '*.compose.yaml' ! -name 'compose.env' | head -n1)
|
|
if [[ -z "$COMPOSE_FILE" ]]; then
|
|
msg_error "No valid compose file found in /opt/komodo!"
|
|
exit 252
|
|
fi
|
|
$STD docker compose -p komodo -f "$COMPOSE_FILE" --env-file /opt/komodo/compose.env pull
|
|
$STD docker compose -p komodo -f "$COMPOSE_FILE" --env-file /opt/komodo/compose.env up -d
|
|
msg_ok "Updated ${APP}"
|
|
exit
|
|
fi
|
|
|
|
msg_info "Migrating update function"
|
|
cat <<'MIGRATION_EOF' >/usr/bin/update
|
|
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/tools/addon/komodo.sh)"
|
|
MIGRATION_EOF
|
|
chmod +x /usr/bin/update
|
|
|
|
ln -sf /usr/bin/update /usr/bin/update_komodo 2>/dev/null || true
|
|
msg_ok "Migration complete"
|
|
|
|
msg_info "Running addon update"
|
|
type=update bash <(curl -fsSL "${ADDON_SCRIPT}")
|
|
exit
|
|
}
|
|
|
|
start
|
|
build_container
|
|
description
|
|
|
|
msg_ok "Completed successfully!\n"
|
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
|
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:9120${CL}"
|