From 4d311e03dff5f7ab42365618dbd1355f3b5452a1 Mon Sep 17 00:00:00 2001 From: "push-app-to-main[bot]" <203845782+push-app-to-main[bot]@users.noreply.github.com> Date: Thu, 30 Jul 2026 10:22:29 +0200 Subject: [PATCH] OmniRoute (#16155) * Add omniroute (ct) * Update omniroute.sh --------- Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com> Co-authored-by: CanbiZ (MickLesk) <47820557+MickLesk@users.noreply.github.com> --- ct/headers/omniroute | 6 ++++ ct/omniroute.sh | 69 ++++++++++++++++++++++++++++++++++++ install/omniroute-install.sh | 59 ++++++++++++++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 ct/headers/omniroute create mode 100644 ct/omniroute.sh create mode 100644 install/omniroute-install.sh diff --git a/ct/headers/omniroute b/ct/headers/omniroute new file mode 100644 index 000000000..3c038cd4f --- /dev/null +++ b/ct/headers/omniroute @@ -0,0 +1,6 @@ + ____ _ ____ __ + / __ \____ ___ ____ (_) __ \____ __ __/ /____ + / / / / __ `__ \/ __ \/ / /_/ / __ \/ / / / __/ _ \ +/ /_/ / / / / / / / / / / _, _/ /_/ / /_/ / /_/ __/ +\____/_/ /_/ /_/_/ /_/_/_/ |_|\____/\__,_/\__/\___/ + diff --git a/ct/omniroute.sh b/ct/omniroute.sh new file mode 100644 index 000000000..1dc0d25af --- /dev/null +++ b/ct/omniroute.sh @@ -0,0 +1,69 @@ +#!/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://github.com/diegosouzapw/OmniRoute + +APP="OmniRoute" +var_tags="${var_tags:-ai;gateway;llm}" +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_arm64="${var_arm64:-no}" +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/omniroute ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + msg_info "Checking for Updates" + local LATEST + LATEST=$(npm view omniroute version 2>/dev/null) + if [[ -z "$LATEST" ]]; then + msg_error "Could not determine latest OmniRoute version" + exit + fi + if [[ "$LATEST" == "$(omniroute --version 2>/dev/null)" ]]; then + msg_ok "Already up to date (${LATEST})" + exit + fi + msg_ok "New version available: ${LATEST}" + + msg_info "Stopping Service" + systemctl stop omniroute + msg_ok "Stopped Service" + + msg_info "Updating OmniRoute to ${LATEST}" + $STD npm install -g omniroute@latest + msg_ok "Updated OmniRoute to ${LATEST}" + + msg_info "Starting Service" + systemctl start omniroute + msg_ok "Started Service" + msg_ok "Updated successfully!" + 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}:20128${CL}" +echo -e "${INFO}${YW} The admin password is stored in /opt/omniroute/.env (INITIAL_PASSWORD)${CL}" diff --git a/install/omniroute-install.sh b/install/omniroute-install.sh new file mode 100644 index 000000000..ef3f36ec7 --- /dev/null +++ b/install/omniroute-install.sh @@ -0,0 +1,59 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: MickLesk (CanbiZ) +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/diegosouzapw/OmniRoute + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +NODE_VERSION="24" setup_nodejs + +msg_info "Installing OmniRoute" +$STD npm install -g omniroute@latest +msg_ok "Installed OmniRoute" + +msg_info "Configuring OmniRoute" +mkdir -p /opt/omniroute +cat </opt/omniroute/.env +JWT_SECRET=$(openssl rand -base64 48) +API_KEY_SECRET=$(openssl rand -hex 32) +STORAGE_ENCRYPTION_KEY=$(openssl rand -hex 32) +STORAGE_ENCRYPTION_KEY_VERSION=v1 +INITIAL_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-20) +PORT=20128 +OMNIROUTE_SERVER_HOST=0.0.0.0 +EOF +chmod 600 /opt/omniroute/.env +msg_ok "Configured OmniRoute" + +msg_info "Creating Service" +cat </etc/systemd/system/omniroute.service +[Unit] +Description=OmniRoute AI Gateway +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/omniroute +Environment=DATA_DIR=/opt/omniroute +ExecStart=/usr/bin/omniroute +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now omniroute +msg_ok "Created Service" + +motd_ssh +customize +cleanup_lxc