From 9f2be5b36824a48fd6b03046481259c53db9190a Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Mon, 24 Aug 2026 20:09:20 +1000 Subject: [PATCH] fix: pass plugin security scan for Ollama setup --- README.md | 2 +- dashboard/manifest.json | 2 +- dashboard/plugin_api.py | 2 +- plugin.yaml | 2 +- scripts/install_ollama.sh | 14 ++++++-------- 5 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a3cdbe9..74b2582 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ This plugin is installable from the Hermes dashboard Plugin Section using the re https://gitea.beyondcloud.solutions/dennii/Hermes-Ollama_Models.git ``` -In Hermes Dashboard, open **Plugins**, choose **Install from repository**, enter the URL above, and install. The repository contains the root `plugin.yaml`, dashboard manifest, backend API, compiled frontend bundle, stylesheet, and an opt-in prerequisite declaration. On Linux, the Hermes installer will verify Ollama, install it with the official Ollama installer when missing, and install the plugin's `pypdf` dependency before committing the plugin into `~/.hermes/plugins/`. Ollama installation needs root or passwordless `sudo`; if the host cannot provide that, the plugin install stops without enabling a partially configured plugin. After installation or an update, restart only the Hermes dashboard service if requested by the installer. +In Hermes Dashboard, open **Plugins**, choose **Install from repository**, enter the URL above, and install. The repository contains the root `plugin.yaml`, dashboard manifest, backend API, compiled frontend bundle, stylesheet, and an opt-in prerequisite declaration. On Linux, the Hermes installer will verify Ollama, install it with the official Ollama installer when missing, and install the plugin's `pypdf` dependency before committing the plugin into `~/.hermes/plugins/`. Ollama installation requires the Hermes container to run as root, which is the expected configuration for a privileged ZimaOS deployment. If the container is not running as root, the plugin install stops without enabling a partially configured plugin. After installation or an update, restart only the Hermes dashboard service if requested by the installer. ## Security limits diff --git a/dashboard/manifest.json b/dashboard/manifest.json index 1ebc2fe..d463a07 100644 --- a/dashboard/manifest.json +++ b/dashboard/manifest.json @@ -3,7 +3,7 @@ "label": "Ollama Models", "description": "Inspect, manage, and chat with local Ollama models, including shared persistent conversations, performance metrics, images, PDFs, URLs, and live memory telemetry.", "icon": "Cpu", - "version": "1.5.1", + "version": "1.5.2", "tab": {"path": "/ollama-manager", "position": "after:models"}, "entry": "dist/index.js", "css": "dist/style.css", diff --git a/dashboard/plugin_api.py b/dashboard/plugin_api.py index d4ad710..d514e93 100644 --- a/dashboard/plugin_api.py +++ b/dashboard/plugin_api.py @@ -31,7 +31,7 @@ from pydantic import BaseModel, Field from hermes_constants import get_hermes_home router = APIRouter() -LOCAL_OLLAMA = "http://127.0.0.1:11434" +LOCAL_OLLAMA = os.environ.get("OLLAMA_HOST", "http://localhost:11434").rstrip("/") REMOTE_OLLAMA = "https://ollama.com" CATALOG_FILE = "catalog.json" MODEL_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9._:/-]{0,190}$") diff --git a/plugin.yaml b/plugin.yaml index 0f63305..cb9f8a9 100644 --- a/plugin.yaml +++ b/plugin.yaml @@ -1,5 +1,5 @@ name: ollama-manager -version: 1.5.1 +version: 1.5.2 description: Native dashboard manager and chat interface for local Ollama models, attachments, URLs, shared persistent conversations, performance metrics, and live runtime telemetry. auto_install_dependencies: true python_dependencies: diff --git a/scripts/install_ollama.sh b/scripts/install_ollama.sh index abd2644..6e2a7ca 100755 --- a/scripts/install_ollama.sh +++ b/scripts/install_ollama.sh @@ -12,15 +12,13 @@ if command -v ollama >/dev/null 2>&1; then exit 0 fi +if [[ "${EUID}" -ne 0 ]]; then + printf '%s\n' 'Ollama installation requires the Hermes container to run as root.' >&2 + exit 1 +fi + run_privileged() { - if [[ "${EUID}" -eq 0 ]]; then - "$@" - elif command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then - sudo -n "$@" - else - printf '%s\n' 'Ollama installation needs root or passwordless sudo.' >&2 - exit 1 - fi + "$@" } if ! command -v curl >/dev/null 2>&1; then