From caece5423f830d37b90da122de81ec5f44c5c5bf Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Mon, 5 May 2025 13:44:23 +0200 Subject: [PATCH] Create komodo.sh --- ct/komodo.sh | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 ct/komodo.sh diff --git a/ct/komodo.sh b/ct/komodo.sh new file mode 100644 index 0000000..2f5d9f2 --- /dev/null +++ b/ct/komodo.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: MickLesk +# 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:-12}" +var_unprivileged="${var_unprivileged:-1}" + +header_info "$APP" +variables +color +catch_errors + +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_info "Updating ${APP}" + COMPOSE_FILE="" + for file in /opt/komodo/*.compose.yaml; do + if [[ "$file" != "compose.env" ]]; then + COMPOSE_FILE="${file#/opt/komodo/}" + break + fi + done + + if [[ -z "$COMPOSE_FILE" ]]; then + msg_error "No valid compose file found in /opt/komodo!" + exit 1 + fi + + BACKUP_FILE="${COMPOSE_FILE}.bak_$(date +%Y%m%d_%H%M%S)" + mv "/opt/komodo/$COMPOSE_FILE" "/opt/komodo/$BACKUP_FILE" || { + msg_error "Failed to create backup of $COMPOSE_FILE!" + exit 1 + } + + GITHUB_URL="https://raw.githubusercontent.com/moghtech/komodo/main/compose/${COMPOSE_FILE}" + if ! curl -fsSL "$GITHUB_URL" -o "/opt/komodo/${COMPOSE_FILE}"; then + msg_error "Failed to download ${COMPOSE_FILE} from GitHub!" + mv "/opt/komodo/${BACKUP_FILE}" "/opt/komodo/${COMPOSE_FILE}" + exit 1 + fi + + $STD docker compose -p komodo -f "/opt/komodo/$COMPOSE_FILE" --env-file /opt/komodo/compose.env up -d + msg_ok "Updated ${APP}" +} + +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}"