Add SSH configuration options for enhanced connectivity
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user