mirror of
https://github.com/myronblair/jarvis
synced 2026-07-27 16:22:55 -05:00
Fix auto-detect agent install button: commands shown for Windows/Linux no longer use flags the scripts dont actually support (install-windows.ps1 has no -JarvisUrl/-Key params, install.sh has no --jarvis-url/--key flags), download links use the current page origin instead of a hardcoded URL thats unreachable from outside the LAN, Windows command reflects the new no-Python exe install, fixed the top-level install-agent.sh which still pointed at the pre-migration DO server IP (165.22.1.228) and would have failed outright
This commit is contained in:
@@ -1,15 +1,22 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# JARVIS Agent Installer — one-liner for any Linux host:
|
# JARVIS Agent Installer — one-liner for any Linux host:
|
||||||
# curl -sk https://jarvis.orbishosting.com/install-agent.sh | bash -s <hostname> <agent_type>
|
# curl -sk http://jarvis.orbishosting.com:1972/agent/install.sh | bash -s <hostname> <agent_type>
|
||||||
#
|
#
|
||||||
# agent_type: linux | proxmox | homeassistant
|
# agent_type: linux | proxmox | homeassistant
|
||||||
# Example: curl -sk https://jarvis.orbishosting.com/install-agent.sh | bash -s myserver linux
|
# Example: curl -sk http://jarvis.orbishosting.com:1972/agent/install.sh | bash -s myserver linux
|
||||||
|
#
|
||||||
|
# On the LAN, set JARVIS_URL to the direct internal address instead (faster,
|
||||||
|
# doesn't hairpin through Cloudflare): JARVIS_URL=http://10.48.200.211 curl ... | bash -s ...
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
HOSTNAME_ARG="${1:-$(hostname -s)}"
|
HOSTNAME_ARG="${1:-$(hostname -s)}"
|
||||||
AGENT_TYPE="${2:-linux}"
|
AGENT_TYPE="${2:-linux}"
|
||||||
JARVIS_URL="${JARVIS_URL:-https://jarvis.orbishosting.com}"
|
# Fixed 2026-07-07: jarvis.orbishosting.com on the default port isn't reachable
|
||||||
|
# from outside the LAN at all (no FortiGate VIP forwards it) — :1972 is the
|
||||||
|
# confirmed-working external path (same fix as the GitHub webhook and the
|
||||||
|
# Windows agent installer).
|
||||||
|
JARVIS_URL="${JARVIS_URL:-http://jarvis.orbishosting.com:1972}"
|
||||||
JARVIS_HOST=""
|
JARVIS_HOST=""
|
||||||
INSTALL_DIR="/opt/jarvis-agent"
|
INSTALL_DIR="/opt/jarvis-agent"
|
||||||
CONFIG_DIR="/etc/jarvis-agent"
|
CONFIG_DIR="/etc/jarvis-agent"
|
||||||
|
|||||||
@@ -438,8 +438,13 @@ function openAgentModal() {
|
|||||||
const content = document.getElementById('agentModalContent');
|
const content = document.getElementById('agentModalContent');
|
||||||
const modal = document.getElementById('agentModal');
|
const modal = document.getElementById('agentModal');
|
||||||
const regKey = 'f846a9aaf7ce9a61742c63c87c4186052a71d2a580c65518';
|
const regKey = 'f846a9aaf7ce9a61742c63c87c4186052a71d2a580c65518';
|
||||||
const baseUrl = 'https://jarvis.orbishosting.com/agent';
|
|
||||||
const jUrl = window.location.origin;
|
const jUrl = window.location.origin;
|
||||||
|
// Fixed 2026-07-07: this used to be hardcoded to https://jarvis.orbishosting.com/agent,
|
||||||
|
// which isn't reachable from outside the LAN at all (no FortiGate VIP forwards the
|
||||||
|
// default port there — confirmed HTTP:000). Using the current page's own origin
|
||||||
|
// instead means the download link always matches wherever the visitor actually
|
||||||
|
// reached this dashboard from, LAN or external.
|
||||||
|
const baseUrl = jUrl + '/agent';
|
||||||
|
|
||||||
if (os === 'tablet') {
|
if (os === 'tablet') {
|
||||||
title.textContent = '● JARVIS — TABLET / MOBILE';
|
title.textContent = '● JARVIS — TABLET / MOBILE';
|
||||||
@@ -460,9 +465,12 @@ function openAgentModal() {
|
|||||||
const inst = {
|
const inst = {
|
||||||
windows: {
|
windows: {
|
||||||
label:'Windows',
|
label:'Windows',
|
||||||
cmd:'# Run PowerShell as Administrator:\nSet-ExecutionPolicy Bypass -Scope Process -Force\nInvoke-WebRequest -Uri "'+baseUrl+'/install-windows.ps1" -OutFile "$env:TEMP\\install.ps1"\n& "$env:TEMP\\install.ps1" -JarvisUrl '+jUrl+' -Key '+regKey,
|
// install-windows.ps1 takes no parameters — it reads the reg key from
|
||||||
dl: baseUrl+'/install-windows.ps1',
|
// $env:JARVIS_REG_KEY and downloads the standalone exe itself (no
|
||||||
note:'Run PowerShell as Administrator. Installs as a Windows Task Scheduler service.'
|
// Python/pywin32 needed on the target machine as of the 2026-07-07 rebuild).
|
||||||
|
cmd:'# Run PowerShell as Administrator:\n$env:JARVIS_REG_KEY=\''+regKey+'\'\nirm '+baseUrl+'/install-windows.ps1 | iex',
|
||||||
|
dl: baseUrl+'/install-windows.exe',
|
||||||
|
note:'Run PowerShell as Administrator. Installs as a real Windows Service (auto-starts at boot, no window to keep open).'
|
||||||
},
|
},
|
||||||
mac: {
|
mac: {
|
||||||
label:'macOS',
|
label:'macOS',
|
||||||
@@ -472,15 +480,18 @@ function openAgentModal() {
|
|||||||
},
|
},
|
||||||
linux: {
|
linux: {
|
||||||
label:'Linux',
|
label:'Linux',
|
||||||
cmd:'curl -sSL '+baseUrl+'/install.sh | sudo bash -s -- \\\n --jarvis-url '+jUrl+' \\\n --key '+regKey,
|
// install.sh takes positional args (hostname, agent_type) and reads the
|
||||||
|
// JARVIS URL from an env var — the registration key is already baked in,
|
||||||
|
// no --key flag exists.
|
||||||
|
cmd:'curl -sSL '+baseUrl+'/install.sh | JARVIS_URL='+jUrl+' bash -s -- $(hostname) linux',
|
||||||
dl: baseUrl+'/install.sh',
|
dl: baseUrl+'/install.sh',
|
||||||
note:'Run in terminal. Installs as a systemd service.'
|
note:'Run in terminal (sudo). Installs as a systemd service.'
|
||||||
},
|
},
|
||||||
unknown: {
|
unknown: {
|
||||||
label:'Your System',
|
label:'Your System',
|
||||||
cmd:'# Browse installers:\nhttps://jarvis.orbishosting.com/agent/',
|
cmd:'# Couldn\'t detect your OS automatically. Installers are at:\n'+baseUrl+'/install.sh (Linux)\n'+baseUrl+'/install-mac.sh (macOS)\n'+baseUrl+'/install-windows.ps1 (Windows)',
|
||||||
dl: 'https://jarvis.orbishosting.com/agent/',
|
dl: baseUrl+'/install.sh',
|
||||||
note:'Choose your platform installer from the JARVIS agent directory.'
|
note:'Auto-detection didn\'t recognize this browser/OS — pick the matching installer above.'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const i = inst[os] || inst.unknown;
|
const i = inst[os] || inst.unknown;
|
||||||
|
|||||||
@@ -1,16 +1,23 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# JARVIS Agent Installer — one-liner for any Linux host:
|
# JARVIS Agent Installer — one-liner for any Linux host:
|
||||||
# curl -sk https://jarvis.orbishosting.com/install-agent.sh | bash -s <hostname> <agent_type>
|
# curl -sk http://jarvis.orbishosting.com:1972/agent/install.sh | bash -s <hostname> <agent_type>
|
||||||
#
|
#
|
||||||
# agent_type: linux | proxmox | homeassistant
|
# agent_type: linux | proxmox | homeassistant
|
||||||
# Example: curl -sk https://jarvis.orbishosting.com/install-agent.sh | bash -s myserver linux
|
# Example: curl -sk http://jarvis.orbishosting.com:1972/agent/install.sh | bash -s myserver linux
|
||||||
|
#
|
||||||
|
# On the LAN, set JARVIS_URL to the direct internal address instead (faster,
|
||||||
|
# doesn't hairpin through Cloudflare): JARVIS_URL=http://10.48.200.211 curl ... | bash -s ...
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
HOSTNAME_ARG="${1:-$(hostname -s)}"
|
HOSTNAME_ARG="${1:-$(hostname -s)}"
|
||||||
AGENT_TYPE="${2:-linux}"
|
AGENT_TYPE="${2:-linux}"
|
||||||
JARVIS_URL="https://165.22.1.228"
|
# Fixed 2026-07-07: jarvis.orbishosting.com on the default port isn't reachable
|
||||||
JARVIS_HOST="jarvis.orbishosting.com"
|
# from outside the LAN at all (no FortiGate VIP forwards it) — :1972 is the
|
||||||
|
# confirmed-working external path (same fix as the GitHub webhook and the
|
||||||
|
# Windows agent installer).
|
||||||
|
JARVIS_URL="${JARVIS_URL:-http://jarvis.orbishosting.com:1972}"
|
||||||
|
JARVIS_HOST=""
|
||||||
INSTALL_DIR="/opt/jarvis-agent"
|
INSTALL_DIR="/opt/jarvis-agent"
|
||||||
CONFIG_DIR="/etc/jarvis-agent"
|
CONFIG_DIR="/etc/jarvis-agent"
|
||||||
STATE_DIR="/var/lib/jarvis-agent"
|
STATE_DIR="/var/lib/jarvis-agent"
|
||||||
@@ -38,7 +45,7 @@ mkdir -p "$INSTALL_DIR" "$CONFIG_DIR" "$STATE_DIR"
|
|||||||
|
|
||||||
# ── Download agent ─────────────────────────────────────────────────────────────
|
# ── Download agent ─────────────────────────────────────────────────────────────
|
||||||
echo "Downloading agent..."
|
echo "Downloading agent..."
|
||||||
curl -sk -H "Host: $JARVIS_HOST" "$JARVIS_URL/agent/jarvis-agent.py" -o "$INSTALL_DIR/jarvis-agent.py"
|
curl -sk "$JARVIS_URL/agent/jarvis-agent.py" -o "$INSTALL_DIR/jarvis-agent.py"
|
||||||
cp "$INSTALL_DIR/jarvis-agent.py" /usr/local/bin/jarvis-agent.py
|
cp "$INSTALL_DIR/jarvis-agent.py" /usr/local/bin/jarvis-agent.py
|
||||||
chmod +x "$INSTALL_DIR/jarvis-agent.py" /usr/local/bin/jarvis-agent.py
|
chmod +x "$INSTALL_DIR/jarvis-agent.py" /usr/local/bin/jarvis-agent.py
|
||||||
|
|
||||||
@@ -50,7 +57,7 @@ else
|
|||||||
{
|
{
|
||||||
"jarvis_url": "$JARVIS_URL",
|
"jarvis_url": "$JARVIS_URL",
|
||||||
"host_header": "$JARVIS_HOST",
|
"host_header": "$JARVIS_HOST",
|
||||||
"ssl_verify": false,
|
"ssl_verify": true,
|
||||||
"registration_key": "$REG_KEY",
|
"registration_key": "$REG_KEY",
|
||||||
"hostname": "$HOSTNAME_ARG",
|
"hostname": "$HOSTNAME_ARG",
|
||||||
"agent_type": "$AGENT_TYPE",
|
"agent_type": "$AGENT_TYPE",
|
||||||
|
|||||||
Reference in New Issue
Block a user