Add SSH configuration options for enhanced connectivity

This commit is contained in:
Bastian (BaM)
2025-09-14 12:29:44 +02:00
parent bb4cac4a2b
commit 7637f748d1
2 changed files with 8 additions and 3 deletions

View File

@@ -11,6 +11,8 @@ services:
WOL_MAC: "${WOL_MAC}"
WOL_BCAST: "${WOL_BCAST:-192.168.222.255}" # optional
WOL_PORT: "${WOL_PORT:-9}" # optional
SSH_PUBLIC_KEY: "${SSH_PUBLIC_KEY}"
SSH_PRIVATE_KEY: "${SSH_PRIVATE_KEY}"
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime:ro

View File

@@ -17,6 +17,8 @@ local CONTAINER_NAME = getenv("CONTAINER_NAME", "paperless-ai")
local SINCE = getenv("SINCE", "0s")
local OLLAMA_HOST = getenv("OLLAMA_HOST", "192.168.222.12")
local OLLAMA_PORT = tonumber(getenv("OLLAMA_PORT", "11434"))
local SSH_PORT = tonumber(getenv("SSH_PORT", "22"))
local SSH_IDENTITY_FILE = getenv("SSH_IDENTITY_FILE", "/root/.ssh/id") -- e.g. "/path/to/id_rsa"
local ERROR_PATTERN = getenv(
"ERROR_PATTERN",
("connect EHOSTUNREACH %s:%d"):format(OLLAMA_HOST, OLLAMA_PORT)
@@ -61,9 +63,6 @@ local function send_wol(mac_str, bcast_ip, port)
return ok ~= nil, err
end
-- Kept for reference; not used to keep parity with your minimal bash
-- local function port_is_up(host, port, timeout_sec)
-- local deadline = socket.gettime() + (timeout_sec or 1)
@@ -103,6 +102,10 @@ local function main()
-- else
-- log("Timeout waiting for Ollama.")
-- end
if port_is_up(OLLAMA_HOST, SSH_PORT, 60) then
log("SSH is reachable. Starting ollama service...")
--ssh("wsl.exe -d Debian -- sudo systemctl enable --now ollama && sudo systemctl start ollama", "micro", OLLAMA_HOST, SSH_PORT, SSH_IDENTITY_FILE)
end
end