Network, UniFi

Run the ISN UniFi connector as a service

The ISN connector is a small program that sits next to your UniFi controller and talks to ISN for you, so nothing on your firewall needs opening. This guide shows how to keep it running for good: it starts by itself after every reboot and starts again if it ever stops. It covers what the computer needs, the UniFi account the connector uses, ready-made scripts for Linux, Windows and Docker, and how to prove it survives a reboot.

1

What the connector is, in plain words

Your UniFi controller (a Cloud Key, a Dream Machine or a computer running the UniFi Network application) lives inside your own network. ISN cannot reach into it, and you should not open it to the internet. The connector solves this: it runs on a small always-on computer inside your network, calls out to ISN over the normal secure web port, asks "is there anything to do?", and does it on the controller (let a guest in, cut one off, restart an access point). The controller login is typed only on that computer. It is never sent to ISN.

Because it is an ordinary program, you start it with a command. For production you want it to start by itself after a power cut or reboot and to restart if it crashes. That is what the scripts on this page set up. You first create a connector in your dashboard (Network, Connect, UniFi) to get the program, then use this page to make it permanent.

2

What the computer needs

ItemRequirement
Operating systemAnything that runs Node.js 22 or newer: Windows 10 or 11, Windows Server, Linux (Debian, Ubuntu, Raspberry Pi OS and similar), macOS, or Docker. 64-bit is recommended.
SoftwareNode.js 22 or newer (nodejs.org). Nothing else: the connector is a single file with no other dependencies.
Processor and memoryOne CPU core and 512 MB of memory is the minimum. 2 GB is comfortable. A Raspberry Pi 4 or a small mini-PC is plenty.
DiskAbout 1 GB free. The connector stores no data; its log is written to the console, or to a small file if you use the scripts below.
NetworkWired Ethernet on the same network as the controller (or a VLAN allowed to reach it). A reserved or static LAN address is recommended so the address never changes.
Outbound to ISNHTTPS (port 443) to isnfreewifi.co.za. Nothing else on the internet is needed. The computer must be able to resolve that name through DNS.
Inside your networkHTTPS to the controller: port 443 for a UniFi OS console such as a Cloud Key Gen2 Plus, Dream Machine or Cloud Gateway, or port 8443 for a self-hosted Network application.
InboundNone. Nothing needs to be opened on any firewall.
ClockKeep the clock correct (time sync on). A wrong clock can break secure connections.
Data usedRoughly 0.2 MB an hour for the "anything to do?" calls, plus a status snapshot about once a minute. Expect from a few hundred MB to about 2 GB a month depending on how many guests are connected.
PrivilegesThe connector itself needs no administrator or root rights. Installing the service does, once.
AntivirusNo exclusions are known to be needed. If your security software blocks the program, allow the connector file and outbound HTTPS to isnfreewifi.co.za.
3

The UniFi account the connector uses

Create a dedicated local account on the controller for the connector. Do not use a personal login. The connector signs in by itself, so the account must be local to the controller (not a Ubiquiti cloud sign-in) and must not use two-factor prompts. Choose a password without the characters & | < > ^ % " (the Windows script refuses them).

RoleWhat the connector can do with it
Site Admin (recommended)The full set: let guests in and cut them off, block and unblock devices, restart and upgrade access points, change WiFi names and passwords, speed caps and the read-only security check. Scope it to the site the guest WiFi is on.
Hotspot Operator (smallest)Only authorising and de-authorising guest devices. Enough for a basic guest portal, but it cannot block devices and cannot restart devices or change settings, so those buttons will report an error.
API key (alternative)Newer UniFi Network versions can issue an API key under Network, Control Plane, Integrations, which is Ubiquiti's own supported way to authorise guests. The connector supports it (set UNIFI_API_KEY instead of the user name and password).

Ubiquiti explains its roles on its help centre: UniFi Roles Explained. Role names differ slightly between UniFi OS consoles and the stand-alone Network application. We confirm the exact minimum role for your controller version during your proof of concept.

4

Linux (systemd): Ubuntu, Debian, Raspberry Pi OS and similar

This installs the connector as a service called isn-connector that starts at boot, restarts if it stops, and runs as its own no-login user.

1. Install Node.js and download the connector

Install Node.js 22 or newer, then create the folder and download the connector into it (use the command shown in your dashboard; it works once and expires in 15 minutes):

sudo mkdir -p /opt/isn-connector
sudo curl -fsSL "THE-LINK-FROM-YOUR-DASHBOARD" -o /opt/isn-connector/isn-unifi-connector.js
2. Get the installer, check it, and read it

Download the installer and check that it is exactly the file ISN published before you run it. The command prints OK only when the file matches:

curl -fsSL https://isnfreewifi.co.za/isn/connector/install-isn-connector.sh -o install-isn-connector.sh
echo "1dab833c9e932a7c9a88ffb8a1bcef3d73e28be1992e508f3d4faa4598dc3bd1  install-isn-connector.sh" | sha256sum -c -
less install-isn-connector.sh

If it says FAILED, do not run it. The same checksum is shown on this page and in the file's own folder, so only trust it if you opened this page yourself at https://isnfreewifi.co.za/docs/connector.

3. Find your controller's certificate fingerprint

The connector will not start until it can tell your real controller from an impostor, because it sends the controller login to it. Get the fingerprint of the controller's certificate (change the address and port to yours):

openssl s_client -connect 192.168.1.2:443 < /dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256

If the controller has a normal, publicly trusted certificate you can use CONTROLLER_VERIFY_TLS=1 instead of the fingerprint.

4. Run the installer

Run it with your controller address, the local account and the fingerprint:

sudo CONTROLLER_URL="https://192.168.1.2" CONTROLLER_USER="isn-connector" CONTROLLER_CERT_SHA256="PASTE-THE-FINGERPRINT-HERE" bash install-isn-connector.sh

You are asked for the password, so it never appears in your command history or the system log.

Check it with systemctl status isn-connector and watch its log with journalctl -u isn-connector -f. Remove it with sudo bash install-isn-connector.sh --uninstall. The full script, so you can see exactly what it does:

#!/usr/bin/env bash
# ISN connector (UniFi or TP-Link Omada): run it as a service that starts by itself after every reboot (Linux, systemd).
#
# 1. Put the connector program next to where this script will look for it (download it from your ISN dashboard):
#      UniFi:  /opt/isn-connector/isn-unifi-connector.js
#      Omada:  /opt/isn-omada-connector/isn-omada-connector.js      (also set CONNECTOR_KIND=omada, see below)
# 2. Run this script as root, giving the controller address and the LOCAL account the connector signs in with
#    (UniFi: a local controller account. Omada: the hotspot operator account made under Hotspot Manager).
#    You are asked for the password, so it is never written in your command history or in the system log:
#
#      sudo CONTROLLER_URL="https://192.168.1.2" CONTROLLER_USER="isn-connector" bash install-isn-connector.sh
#      sudo CONNECTOR_KIND=omada CONTROLLER_URL="https://192.168.1.2:8043" CONTROLLER_USER="isn-hotspot-operator" bash install-isn-connector.sh
#
#    REQUIRED for both UniFi and Omada: CONTROLLER_CERT_SHA256="<the controller certificate's SHA-256 fingerprint>" makes the
#    connector refuse any other certificate (so nobody on your network can pose as the controller and collect the password).
#    Use CONTROLLER_VERIFY_TLS=1 instead if the controller has a normal, trusted certificate. (Lab use only: CONTROLLER_ACCEPT_ANY_CERT=1
#    skips the check, which is NOT safe on a real network.)
#    (The older names UNIFI_URL, UNIFI_USER, UNIFI_PASS, UNIFI_CERT_SHA256 and the OMADA_ equivalents still work.)
#    (Setting CONTROLLER_PASS on the command line also works, but then the password is recorded in your shell history and the sudo log.)
#
# To remove the service again:   sudo bash install-isn-connector.sh --uninstall      (add CONNECTOR_KIND=omada for the Omada one)
# Read this file before you run it. It only creates the files named below and one systemd service.
# The service runs as its own account with no login, and is sandboxed: it cannot change the system, see other users' files,
# load kernel modules, gain new privileges, or use anything except normal network connections.
set -euo pipefail

# Which connector: UniFi (the default, and the names used since the first release) or TP-Link Omada.
KIND="${CONNECTOR_KIND:-unifi}"
case "$KIND" in
  unifi) NAME=isn-connector;       PROGRAM=isn-unifi-connector.js; PRE=UNIFI; LABEL="UniFi" ;;
  omada) NAME=isn-omada-connector; PROGRAM=isn-omada-connector.js; PRE=OMADA; LABEL="Omada" ;;
  *) printf 'ERROR: CONNECTOR_KIND must be unifi or omada\n' >&2; exit 1 ;;
esac
# ISN_INSTALL_ROOT is for the test suite only (it lets the files be written under a scratch folder); leave it unset.
ROOT="${ISN_INSTALL_ROOT:-}"
APP_DIR=$ROOT/opt/$NAME
APP_FILE="$APP_DIR/$PROGRAM"
ENV_FILE=$ROOT/etc/$NAME.env
UNIT_FILE=$ROOT/etc/systemd/system/$NAME.service
SERVICE_USER=$NAME

say() { printf '%s\n' "$*"; }
die() { printf 'ERROR: %s\n' "$*" >&2; exit 1; }

[ "$(id -u)" -eq 0 ] || die "Run this as root, for example: sudo bash $0"
command -v systemctl >/dev/null 2>&1 || die "This script needs systemd. On another system use Docker (see the ISN connector guide)."

if [ "${1:-}" = "--uninstall" ]; then
  systemctl disable --now "$NAME.service" 2>/dev/null || true
  rm -f "$UNIT_FILE" "$ENV_FILE"; rm -rf "$UNIT_FILE.d"
  systemctl daemon-reload
  say "The ISN $LABEL connector service was removed, and so was the file that held the controller password. The program file in $APP_DIR was left in place; delete it yourself if you want."
  say "If you will not use this connector again, also create a new connector in your ISN dashboard (or switch the connector off there): a new connector replaces the old key."
  exit 0
fi

# Node.js 22 or newer is required (older versions no longer receive security fixes).
NODE_BIN="$(command -v node || true)"
[ -n "$NODE_BIN" ] || die "Node.js is not installed. Install Node.js 22 or newer first (for example from nodejs.org or your package manager)."
case "$NODE_BIN" in /home/*|/root/*) die "Node.js is installed in a personal folder ($NODE_BIN). Install the system-wide Node.js (your package manager or NodeSource) so the service does not depend on one person's files." ;; esac
NODE_MAJOR="$("$NODE_BIN" -p 'process.versions.node.split(".")[0]')"
[ "$NODE_MAJOR" -ge 22 ] || die "Node.js $NODE_MAJOR found, but 22 or newer is required. Older versions no longer receive security fixes: install the current long-term-support release."

[ -f "$APP_FILE" ] || die "The connector program is missing. Put it at $APP_FILE first (download it from your ISN dashboard)."

# The generic names win; the older UNIFI_ / OMADA_ names still work.
pick() { for v in "$@"; do eval "val=\${$v:-}"; [ -n "$val" ] && { printf '%s' "$val"; return; }; done; printf ''; }
C_URL="$(pick CONTROLLER_URL UNIFI_URL OMADA_URL)"; C_USER="$(pick CONTROLLER_USER UNIFI_USER OMADA_USER)"; C_PASS="$(pick CONTROLLER_PASS UNIFI_PASS OMADA_PASS)"
C_PIN="$(pick CONTROLLER_CERT_SHA256 UNIFI_CERT_SHA256 OMADA_CERT_SHA256)"; C_VERIFY="$(pick CONTROLLER_VERIFY_TLS UNIFI_VERIFY_TLS OMADA_VERIFY_TLS)"
C_ANY="$(pick CONTROLLER_ACCEPT_ANY_CERT UNIFI_ACCEPT_ANY_CERT OMADA_ACCEPT_ANY_CERT)"
[ -n "$C_URL" ]  || die "Set CONTROLLER_URL, for example https://192.168.1.2"
# The connector sends the controller login to the controller, so it must be able to tell the real controller from an impostor (UniFi and Omada).
if [ -z "$C_PIN" ] && [ -z "$C_VERIFY" ] && [ -z "$C_ANY" ]; then
  case "$C_URL" in https:*) die "Set CONTROLLER_CERT_SHA256 to the controller certificate fingerprint (or CONTROLLER_VERIFY_TLS=1 if it has a normal trusted certificate). The connector refuses to start without one of them, so nobody on your network can pose as the controller and collect the controller login." ;; esac
fi
[ -n "$C_USER" ] || die "Set CONTROLLER_USER to the local $LABEL account for the connector."
# A line break inside a value would let it add its own settings to the service's environment file, so refuse it.
case "$C_URL$C_USER$C_PIN$C_VERIFY" in *$'\n'*|*$'\r'*) die "The address, user name and fingerprint cannot contain line breaks." ;; esac
if [ -z "$C_PASS" ]; then
  [ -t 0 ] || die "Set CONTROLLER_PASS (or run this in a terminal and type it when asked)."
  read -r -s -p "Password for $C_USER: " C_PASS; printf '\n'
fi

# A dedicated account with no login and no home folder: the connector needs no special rights.
id "$SERVICE_USER" >/dev/null 2>&1 || useradd --system --no-create-home --shell /usr/sbin/nologin "$SERVICE_USER"
chown -R root:"$SERVICE_USER" "$APP_DIR"; chmod 750 "$APP_DIR"; chmod 640 "$APP_FILE"

# systemd reads this file as root, so only root needs to be able to read it. Quotes and backslashes are escaped for systemd.
esc() { printf '%s' "$1" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g'; }
umask 077
{
  printf '%s_URL="%s"\n' "$PRE" "$(esc "$C_URL")"
  printf '%s_USER="%s"\n' "$PRE" "$(esc "$C_USER")"
  printf '%s_PASS="%s"\n' "$PRE" "$(esc "$C_PASS")"
  [ -n "$C_PIN" ]    && printf '%s_CERT_SHA256="%s"\n' "$PRE" "$(esc "$C_PIN")"
  [ -n "$C_ANY" ] && printf '%s_ACCEPT_ANY_CERT="1"\n' "$PRE"
  [ -n "$C_VERIFY" ] && printf '%s_VERIFY_TLS="%s"\n' "$PRE" "$(esc "$C_VERIFY")"
} > "$ENV_FILE"
chmod 600 "$ENV_FILE"; chown root:root "$ENV_FILE"

cat > "$UNIT_FILE" <<UNIT
[Unit]
Description=ISN $LABEL connector
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=$SERVICE_USER
EnvironmentFile=$ENV_FILE
ExecStart=$NODE_BIN $APP_FILE
Restart=always
RestartSec=10
# Sandbox: the connector only needs to make outgoing network connections. (Directives an older systemd does not know are ignored.)
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
PrivateTmp=true
PrivateDevices=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectKernelLogs=true
ProtectControlGroups=true
ProtectClock=true
ProtectHostname=true
RestrictNamespaces=true
RestrictRealtime=true
RestrictSUIDSGID=true
LockPersonality=true
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
CapabilityBoundingSet=
AmbientCapabilities=
SystemCallArchitectures=native
UMask=0077
ProtectProc=invisible
ProcSubset=pid
MemoryMax=300M
TasksMax=128

[Install]
WantedBy=multi-user.target
UNIT
chmod 644 "$UNIT_FILE"

# An extra filter on the system calls the program may use. It cannot be tried out in advance on every Linux, so it goes in a separate file and is
# CHECKED: if the service does not stay running with it, the file is removed again and the service is restarted without it.
DROPIN_DIR="$UNIT_FILE.d"; DROPIN="$DROPIN_DIR/10-syscall-filter.conf"
mkdir -p "$DROPIN_DIR"
cat > "$DROPIN" <<DROP
[Service]
SystemCallFilter=@system-service
SystemCallErrorNumber=EPERM
DROP
chmod 644 "$DROPIN"

systemctl daemon-reload
systemctl enable --now "$NAME.service"
sleep 4
if ! systemctl is-active --quiet "$NAME.service"; then
  rm -f "$DROPIN"; rmdir "$DROPIN_DIR" 2>/dev/null || true
  systemctl daemon-reload
  systemctl restart "$NAME.service" || true
  sleep 3
  say "The service did not stay running with the extra system-call filter, so the filter was removed and the service restarted without it."
  say "If it still is not running, look at the log: journalctl -u $NAME -n 30 (a wrong controller address, login or certificate fingerprint is the usual reason)."
fi
systemctl --no-pager --lines=8 status "$NAME.service" || true
say ""
say "Done. The connector now starts by itself after every reboot and restarts if it stops."
say "Check it:        systemctl status $NAME"
say "Watch its log:   journalctl -u $NAME -f"
say "See how well it is sandboxed:   systemd-analyze security $NAME"
say "Update it:       replace $APP_FILE with the new download, then: sudo systemctl restart $NAME"
5

Windows 10, 11 and Windows Server

This registers a scheduled task called ISN UniFi Connector that runs at startup as the low-privilege Local Service account (not as the all-powerful SYSTEM account), restarts if it stops, and writes a log file. It needs a PowerShell window opened with Run as administrator.

1. Install Node.js

Install Node.js 22 or newer (64-bit) from nodejs.org.

2. Download the connector

Create the folder and download the connector (the dashboard command; curl.exe is built into Windows 10 and later):

mkdir C:\ProgramData\ISN-Connector
curl.exe -fsSL "THE-LINK-FROM-YOUR-DASHBOARD" -o C:\ProgramData\ISN-Connector\isn-unifi-connector.js
3. Get, check and run the installer

Get the installer, read it, then run it:

curl.exe -fsSL https://isnfreewifi.co.za/isn/connector/install-isn-connector.ps1 -o install-isn-connector.ps1
Get-FileHash .\install-isn-connector.ps1 -Algorithm SHA256   # expected: 25a6011d0ab89ba76c65036c478b629732421e7944a043475db26879fb89c2b9
notepad install-isn-connector.ps1
powershell -ExecutionPolicy Bypass -File .\install-isn-connector.ps1 -UnifiUrl "https://192.168.1.2" -UnifiUser "isn-connector" -CertSha256 "PASTE-THE-FINGERPRINT-HERE"

You are asked for the password, so it is never left in your command history. Add -DryRun to see what it would do without changing anything, and -Uninstall to remove the task. The log is C:\ProgramData\ISN-Connector\logs\connector.log. The password is stored in a small runner file in that folder, which the script locks so only Administrators, the system and the connector's own service account can read it. The service account can read and run the connector files but not change them, and can write only to the logs folder. The full script:

<#
  ISN connector (UniFi or TP-Link Omada): run it as a Windows scheduled task that starts by itself after every reboot.

  1. Install Node.js 22 or newer (nodejs.org, 64-bit).
  2. Download the connector program from your ISN dashboard to
       UniFi:  C:\ProgramData\ISN-Connector\isn-unifi-connector.js
       Omada:  C:\ProgramData\ISN-Omada-Connector\isn-omada-connector.js      (and add  -Kind omada  below)
  3. Open PowerShell as Administrator and run:

       powershell -ExecutionPolicy Bypass -File .\install-isn-connector.ps1 -ControllerUrl "https://192.168.1.2" -ControllerUser "isn-connector"
       powershell -ExecutionPolicy Bypass -File .\install-isn-connector.ps1 -Kind omada -ControllerUrl "https://192.168.1.2:8043" -ControllerUser "isn-hotspot-operator"

     (you are asked for the password; or add -ControllerPass 'the-password'. The older names -UnifiUrl, -UnifiUser and -UnifiPass
      still work.)

     Recommended for UniFi and REQUIRED for Omada: add  -CertSha256 "<the controller certificate's SHA-256 fingerprint>"  so the connector
     refuses any other certificate (nobody on your network can pose as the controller and collect the password). Use  -VerifyTls
     instead if the controller has a normal, trusted certificate. (Lab use only: -AcceptAnyCertificate skips the check, which is
     NOT safe on a real network.)

  To remove it again:  .\install-isn-connector.ps1 -Uninstall      (add -Kind omada for the Omada one)
  To only show what would be done:  add -DryRun

  Read this file before you run it. It creates one folder under C:\ProgramData, one scheduled task, and nothing else.
  The task runs as the low-privilege "Local Service" account (not as SYSTEM): it may read and run the connector files, and write
  only to the logs folder inside the connector's folder under C:\ProgramData.
#>
[CmdletBinding()]
param(
  [ValidateSet('unifi','omada')][string]$Kind = 'unifi',
  [Alias('UnifiUrl','OmadaUrl')][string]$ControllerUrl,
  [Alias('UnifiUser','OmadaUser')][string]$ControllerUser,
  [Alias('UnifiPass','OmadaPass')][string]$ControllerPass,
  [string]$CertSha256,
  [switch]$VerifyTls,
  [switch]$AcceptAnyCertificate,
  [switch]$Uninstall,
  [switch]$DryRun
)
$ErrorActionPreference = 'Stop'
# The UniFi names are exactly the ones used since the first release; Omada has its own folder, file, task and setting names.
if ($Kind -eq 'omada') { $FolderName = 'ISN-Omada-Connector'; $ProgramName = 'isn-omada-connector.js'; $TaskName = 'ISN Omada Connector'; $Pre = 'OMADA'; $Label = 'Omada' }
else                   { $FolderName = 'ISN-Connector';       $ProgramName = 'isn-unifi-connector.js'; $TaskName = 'ISN UniFi Connector'; $Pre = 'UNIFI'; $Label = 'UniFi' }
$AppDir  = Join-Path $env:ProgramData $FolderName
$AppFile = Join-Path $AppDir $ProgramName
$Runner  = Join-Path $AppDir 'run-connector.cmd'
$LogDir  = Join-Path $AppDir 'logs'
$LogFile = Join-Path $LogDir 'connector.log'
$ServiceAccount = 'NT AUTHORITY\LOCAL SERVICE'

function Say($m) { Write-Host $m }
function Do-It($what, [scriptblock]$action) { if ($DryRun) { Say "[dry run] $what" } else { & $action } }

$isAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if (-not $isAdmin -and -not $DryRun) { throw 'Run this in a PowerShell window opened with "Run as administrator".' }

if ($Uninstall) {
  Do-It "Stop and remove the scheduled task '$TaskName'" {
    if (Get-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue) { Stop-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue; Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false }
    if (Test-Path $Runner) { Remove-Item $Runner -Force }
  }
  Say "The ISN $Label connector task was removed, and so was the file that held the controller password. The folder $AppDir was left in place; delete it yourself if you want."
  Say 'If you will not use this connector again, also create a new connector in your ISN dashboard (or switch the connector off there): a new connector replaces the old key.'
  return
}

# Node.js 22 or newer (older versions no longer receive security fixes)
$node = Get-Command node -ErrorAction SilentlyContinue
if (-not $node) { throw 'Node.js is not installed. Install Node.js 22 or newer (64-bit) from nodejs.org first.' }
# The task runs under a service account, so the Node.js it starts must not sit in a folder an ordinary user can change.
if ($node.Source -like "$env:SystemDrive\Users\*") { throw "Node.js is installed in a user folder ($($node.Source)). Install the system-wide Node.js from nodejs.org (it goes in Program Files) and run this again." }
$major = [int](& $node.Source -p "process.versions.node.split('.')[0]")
if ($major -lt 22) { throw "Node.js $major found, but 22 or newer is required. Older versions no longer receive security fixes: install the current long-term-support release from nodejs.org." }

if (-not (Test-Path $AppFile) -and -not $DryRun) { throw "The connector program is missing. Download it from your ISN dashboard to $AppFile first." }
if (-not $ControllerUrl)  { throw 'Give -ControllerUrl, for example https://192.168.1.2' }
if (-not $ControllerUser) { throw "Give -ControllerUser, the local $Label account for the connector." }
if (-not $ControllerPass) {
  if ($DryRun) { $ControllerPass = 'dry-run' }
  else {
    $secure = Read-Host -AsSecureString "Password for $ControllerUser"
    $ControllerPass = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($secure))
  }
}
# cmd.exe special characters in the values would break the runner file, so refuse them rather than guess.
foreach ($v in @($ControllerUrl, $ControllerUser, $ControllerPass)) { if ($v -match '[&|<>^%"\r\n]') { throw 'The address, user name and password cannot contain these characters: & | < > ^ % " . Pick a password without them for this account.' } }
# The connector sends the controller login to the controller, so it must be able to tell the real controller from an impostor (UniFi and Omada).
if ($ControllerUrl -like 'https:*' -and -not $CertSha256 -and -not $VerifyTls -and -not $AcceptAnyCertificate) { throw 'Give -CertSha256 (the controller certificate fingerprint) or -VerifyTls (if it has a normal trusted certificate). The connector refuses to start without one of them, so nobody on your network can pose as the controller and collect the controller login.' }
if ($CertSha256 -and $CertSha256 -notmatch '^[0-9A-Fa-f:]{64,95}$') { throw '-CertSha256 must be the controller certificate''s SHA-256 fingerprint (64 hexadecimal characters, colons allowed).' }

Do-It "Lock $AppDir (Administrators and SYSTEM may change it; $ServiceAccount may only read and run it; only $LogDir is writable by the service), then write $Runner" {
  New-Item -ItemType Directory -Force -Path $AppDir, $LogDir | Out-Null
  # Lock the folder FIRST (and the files already in it, such as the connector program), so nobody else can read the password even for a moment.
  & icacls $AppDir /inheritance:r /grant:r 'SYSTEM:(OI)(CI)F' 'Administrators:(OI)(CI)F' "${ServiceAccount}:(OI)(CI)RX" /T | Out-Null
  if ($LASTEXITCODE -ne 0) { throw "Could not restrict access to $AppDir, so nothing was written." }
  # The log folder is the only place the connector may write.
  & icacls $LogDir /grant:r "${ServiceAccount}:(OI)(CI)M" | Out-Null
  if ($LASTEXITCODE -ne 0) { throw "Could not give the connector access to its log folder $LogDir." }
  $lines = @('@echo off', "set ${Pre}_URL=$ControllerUrl", "set ${Pre}_USER=$ControllerUser", "set ${Pre}_PASS=$ControllerPass")
  if ($CertSha256) { $lines += "set ${Pre}_CERT_SHA256=$CertSha256" }
  if ($VerifyTls)  { $lines += "set ${Pre}_VERIFY_TLS=1" }
  if ($AcceptAnyCertificate) { $lines += "set ${Pre}_ACCEPT_ANY_CERT=1" }
  $lines += "`"$($node.Source)`" `"$AppFile`" >> `"$LogFile`" 2>&1"
  Set-Content -Path $Runner -Value $lines -Encoding ASCII
}

Do-It "Register the scheduled task '$TaskName' (runs at startup as $ServiceAccount, restarts if it stops)" {
  if (Get-ScheduledTask -TaskName $TaskName -ErrorAction SilentlyContinue) { Unregister-ScheduledTask -TaskName $TaskName -Confirm:$false }
  $action    = New-ScheduledTaskAction -Execute 'cmd.exe' -Argument "/c `"$Runner`""
  $trigger   = New-ScheduledTaskTrigger -AtStartup
  $principal = New-ScheduledTaskPrincipal -UserId $ServiceAccount -LogonType ServiceAccount -RunLevel Limited
  $settings  = New-ScheduledTaskSettingsSet -ExecutionTimeLimit ([TimeSpan]::Zero) -RestartCount 999 -RestartInterval (New-TimeSpan -Minutes 1) -StartWhenAvailable -MultipleInstances IgnoreNew -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries
  Register-ScheduledTask -TaskName $TaskName -Action $action -Trigger $trigger -Principal $principal -Settings $settings -Description "ISN $Label connector (starts at boot)" | Out-Null
  Start-ScheduledTask -TaskName $TaskName
}

Say ''
Say 'Done. The connector now starts by itself after every reboot and restarts if it stops.'
Say "Check it:       Get-ScheduledTask -TaskName '$TaskName' | Get-ScheduledTaskInfo"
Say "Its log:        Get-Content '$LogFile' -Tail 30"
Say "Update it:      replace $AppFile with the new download, then  Stop-ScheduledTask -TaskName '$TaskName'; Start-ScheduledTask -TaskName '$TaskName'"
6

Docker (any system with Docker)

Put the connector file, the two files below and nothing else in one folder, make the environment file private (chmod 600 isn-connector.env), then run docker compose up -d. The restart: unless-stopped line makes Docker start it after every reboot and after any crash.

isn-connector.env (keep this file private):

UNIFI_URL=https://192.168.1.2
UNIFI_USER=isn-connector
UNIFI_PASS=the-password
UNIFI_CERT_SHA256=PASTE-THE-FINGERPRINT-HERE

compose.yaml:

services:
  isn-connector:
    image: node:22-alpine
    container_name: isn-connector
    restart: unless-stopped
    working_dir: /app
    command: ["node", "/app/isn-unifi-connector.js"]
    user: "node"                      # not root
    read_only: true                   # the container cannot change its own files
    tmpfs:
      - /tmp
    cap_drop:
      - ALL
    security_opt:
      - no-new-privileges:true
    pids_limit: 100
    volumes:
      - ./isn-unifi-connector.js:/app/isn-unifi-connector.js:ro
    env_file:
      - ./isn-connector.env
6b

What keeps the connector safe, and the settings that make it stricter

The connector holds your controller login, so it is built to trust as little as possible. It only ever calls out to ISN; nothing on your network has to be opened to the internet.

ProtectionWhat it does
Signed jobsEvery job ISN sends is digitally signed. The connector refuses a job that is not signed, was signed for another connector, is older than ten minutes, or is a repeat of one it already ran. It runs only what was signed. Your computer's clock must be roughly right (within ten minutes).
https onlyThe connector will not start if the ISN address does not begin with https (the connector secret travels on every call).
Controller certificate requiredIt will not start unless it can tell your real controller from an impostor (UNIFI_CERT_SHA256 or UNIFI_VERIFY_TLS=1). Without this, anyone on your network could pose as the controller and collect the login.
Only a fixed list of actionsLet a guest in or out, block or unblock a device, restart or upgrade a device, change the guest WiFi, read the status and settings the security check needs. Nothing else, and every value is checked before it is used.
Guest WiFi onlyISN can change the WiFi name and password only on your guest network. Your staff or office WiFi cannot be changed or opened from ISN.
Settings stay on your sideThe controller's settings are never sent to ISN in full. Only the few items the security check reads (guest portal on, sign-in type, SSH on or off) leave your network.
Its own low-privilege accountOn Linux it runs as its own no-login user inside a systemd sandbox with memory and task limits and a filter on the system calls it may use (the installer checks that the service still runs with the filter and removes the filter by itself if it does not). On Windows it runs as the low-privilege Local Service account from a locked folder. In Docker it runs as a non-root user with a read-only file system.
One-use downloadThe connector secret is never shown on screen. The download link works once and expires after 15 minutes. Anyone who tries wrong secrets too often is blocked for a minute.

Make it stricter on your side. You can add these settings to the connector's environment (the installers keep the same environment file; add the lines and restart the service):

SettingWhat it does
UNIFI_READONLY=1The connector refuses every change (restart, firmware upgrade, WiFi change, speed cap). Guests can still be let in and out. Use this if you only want ISN to read and authorise.
UNIFI_MAX_CHANGES_PER_HOUR=60 and UNIFI_MAX_UPGRADES_PER_HOUR=6These are the defaults even if you set nothing. The connector accepts at most this many changes (restart, firmware upgrade, WiFi change, speed cap) per hour, and at most 6 firmware upgrades. A mistake or a problem on the ISN side therefore cannot reboot or re-flash your whole network at once. Letting guests in and out and reading status are never counted. Raise the numbers only if you really run large fleet actions.
UNIFI_ALLOWED_SITES=default,lobbyThe connector only works on the named sites and refuses any other site, whatever ISN asks.

Honest limits. ISN holds the key that signs the jobs, so signing protects you from someone tampering with the connection, not from a compromise of ISN itself; that is why the guest-WiFi-only rule, the hourly change limits, read-only mode and the site list are enforced on your machine too. On Windows the login sits in a file only Administrators, SYSTEM and the Local Service account can read. A newer connector program is not installed automatically: you replace the file when ISN tells you to. This has been tested against simulated controllers, and the first real installation is where it is confirmed on real hardware.

7

Prove it survives a reboot

  1. In your dashboard (Network, Connect, UniFi) the connector shows Connected.
  2. Restart the computer. Do not log in to it.
  3. Wait about two minutes. The dashboard shows Connected again by itself.
  4. Press Test connection in the same card. It should say it reached the controller.
  5. Unplug the computer's network cable for a minute and plug it back. The connector retries on its own (it waits a little longer after each failed try, up to 30 seconds) and the dashboard returns to Connected without any action from you.

While the connector is offline ISN cannot tell the controller about new guests, so a guest who signs in at that moment is not let through and may need to sign in again once the connector is back. Guests who are already online are not affected, and the dashboard shows Not connected until it returns.

8

Updating, replacing and removing it

Health reporting (connector 1.2.0 and newer). Besides doing its jobs, the connector now tells ISN how its own computer is doing: CPU, memory, disk, temperature and battery, where the computer exposes them. It reads only the computer's own counters, runs no extra command, and sends nothing but numbers. For UniFi it also reports the health of the gateways, access points and switches your controller lists. You see all of it under Network → Device monitor, and a connector that goes quiet raises an alert. To get it, download the connector again from the dashboard and replace the old one (the steps below).

Update or replace the program. In the dashboard press Create a NEW connector secret (the old one stops working), copy the new download command, download the new file over the old one, then restart the service: sudo systemctl restart isn-connector on Linux, Stop-ScheduledTask -TaskName 'ISN UniFi Connector'; Start-ScheduledTask -TaskName 'ISN UniFi Connector' on Windows, or docker compose restart with Docker. Changing the controller address or the account means running the installer again with the new values.

Move it to another computer. Install it there first (new secret, new download), confirm it shows Connected, then remove the old one.

Remove it. Use the --uninstall option (Linux) or -Uninstall option (Windows), or docker compose down. Then delete the connector in the dashboard if you no longer use UniFi with ISN.

9

If it shows "Not connected"

What you seeWhat to check
Log says "could not reach ISN"The computer cannot reach isnfreewifi.co.za on port 443. Test with curl -I https://isnfreewifi.co.za. Check DNS, the firewall and any proxy.
"Forbidden" or HTTP 403 from ISNThe connector secret was replaced. Download the newest connector and restart it.
Cannot reach the controllerCheck the address in UNIFI_URL (use the controller's IP address with https://), the port (443 or 8443) and that the computer is on the right network or VLAN.
Controller says the login is wrongUse a local account, not your Ubiquiti cloud sign-in, with no two-factor prompt. Re-run the installer with the right password.
An action fails but the connector is ConnectedThe account's role is too small for that action (see panel 3). A Hotspot Operator cannot block devices or change settings.
Certificate warningsControllers use their own self-signed certificate by default. Best: pin it. Set UNIFI_CERT_SHA256 to the certificate's fingerprint and the connector refuses any other certificate, so nobody on your network can pose as the controller and collect its password (get the fingerprint with openssl s_client -connect CONTROLLER:443 < /dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256, or from your browser's certificate details). If the controller has a normal, trusted certificate, set UNIFI_VERIFY_TLS=1 instead. With neither, the connector accepts any certificate and prints a warning.

Still stuck? Send ISN the last 30 lines of the log (journalctl, the log file, or docker logs isn-connector). They contain no passwords. See also Network and routers for the rest of the UniFi setup.

10

TP-Link Omada: the same connector for Omada controllers Beta

If your guest WiFi runs on TP-Link Omada, ISN used to need to call your controller's web address from the internet, which means opening a port. The ISN Omada connector removes that: it is the same small program idea as the UniFi connector. It runs on a computer inside your network, only ever calls out to ISN, and when a guest has earned access it tells your Omada controller to let that guest's device online. You open nothing on your network, and the controller's hotspot operator login stays on your computer: ISN never sees it and does not store it.

Beta: it is tested against a simulated Omada controller. The first real controller is what proves it, so try it on a spare site first.

What you need

  • An always-on computer inside the same network as the controller, as described in panel 2 (Node.js 22 or newer).
  • A hotspot operator account on the Omada controller (made in Omada under Hotspot Manager, Operators). Use this, not your administrator login, so the connector can only do hotspot work.
  • Your controller's address with its port, for example https://192.168.1.100:8043 (software controller) or the address of your hardware controller.

Set it up

  1. In the ISN dashboard open the TP-Link Omada integration card, choose Through the ISN Omada connector, press Create the connector, and copy the download command. The link works once and expires in 15 minutes.
  2. On your computer, put the program in place and install it as a service that starts by itself. Linux:
sudo mkdir -p /opt/isn-omada-connector
cd /opt/isn-omada-connector
sudo curl -fsSL "THE-DOWNLOAD-LINK-FROM-ISN" -o isn-omada-connector.js
# then, with the installer script from panel 4 saved next to you:
sudo CONNECTOR_KIND=omada CONTROLLER_URL="https://192.168.1.100:8043" CONTROLLER_USER="isn-hotspot-operator" CONTROLLER_CERT_SHA256="THE-CONTROLLER-CERTIFICATE-FINGERPRINT" bash install-isn-connector.sh

Windows (PowerShell as Administrator, program saved as C:\ProgramData\ISN-Omada-Connector\isn-omada-connector.js, installer from panel 5):

powershell -ExecutionPolicy Bypass -File .\install-isn-connector.ps1 -Kind omada -ControllerUrl "https://192.168.1.100:8043" -ControllerUser "isn-hotspot-operator" -CertSha256 "THE-CONTROLLER-CERTIFICATE-FINGERPRINT"

You are asked for the operator password; it is never written in your command history. The same installers are used for UniFi and Omada: CONNECTOR_KIND=omada (Linux) or -Kind omada (Windows) chooses Omada, with its own service name (isn-omada-connector), its own no-login account and its own folder, so it never touches a UniFi connector on the same machine.

Docker works the same way as in panel 6: use node:22-alpine, run node /app/isn-omada-connector.js, mount the program read-only, and put OMADA_URL, OMADA_USER, OMADA_PASS and OMADA_CERT_SHA256 in the private environment file.

  1. Back in the dashboard press Test the connection. It should say the connector reached your controller and signed in. Then tick Enable Omada integration and Save Omada settings.

The settings the program reads

SettingWhat it is
OMADA_URLYour controller's address, starting with https:// and including the port.
OMADA_USER, OMADA_PASSThe hotspot operator account. They stay on this computer.
OMADA_CERT_SHA256 (required, or the next line)The controller certificate's SHA-256 fingerprint. The connector then refuses any other certificate, so nobody on your network can pose as the controller and collect the operator password. Get it with: openssl s_client -connect 192.168.1.100:8043 < /dev/null 2>/dev/null | openssl x509 -noout -fingerprint -sha256 or from your browser's certificate details.
OMADA_API_CLIENT_ID, OMADA_API_CLIENT_SECRET, OMADA_ID (optional, all three)Turns on device watching. Make an API client in the controller (in its Open API settings), then give the connector its client id, client secret and the Omada ID. Once a minute the connector reads the list of your access points, switches and gateways and tells ISN which ones are connected. ISN then shows them on the Omada settings screen and in the Monitor, and tells you when one stops reporting. It only reads, and the secret stays on this computer. Set OMADA_SITE if your site is not called Default. Not yet tried on a real controller: the connector's answer shapes follow TP-Link's Open API documentation and are tested against a pretend controller only.
OMADA_VERIFY_TLS=1Use this instead of the fingerprint only if the controller has a normal, publicly trusted certificate.
OMADA_ACCEPT_ANY_CERT=1Lab use only. It switches the certificate check off, which is not safe on a real network: anyone on your network could pose as the controller and collect the operator password.

The Omada connector will not start without a fingerprint or strict checking, because it sends the hotspot operator password to the controller and must be able to tell the real controller from an impostor. The installers ask for the same. (The UniFi connector only warns, for older installations.) Also: on Windows the saved settings file can be read by other programs running as the low-privilege Local Service account, so give the connector its own computer where you can.

What it covers. The Omada connector does the part that lets a guest online (signing in as the hotspot operator and authorizing the guest's device) and the connection test. The optional network-map feature (Network, Connect a controller) still reads your controller's Open API directly, so that one only works if the controller is reachable from the internet; leave it off if you do not want that.

One limit when a captive is suspended or canceled. ISN stops letting new guests online at once. But ISN cannot yet tell an Omada controller to remove a guest who is already online (the Omada external-portal interface ISN uses only offers "authorize"), so those guests stay connected until the time they were granted runs out. Routers on MikroTik, OpenWrt/Teltonika and UniFi are cut right away. If you need an Omada guest removed immediately, disconnect them from the Guest page in the Omada controller.

If it does not work

What you seeWhat to check
The dashboard says "Not connected"The program is not running or cannot reach isnfreewifi.co.za on port 443. Check the service (systemctl status isn-omada-connector, or the scheduled task on Windows) and its log.
"Omada Controller login failed"The address or port is wrong, or the user name and password are not a hotspot operator account. Re-run the installer with the right values.
"showed a different certificate than the one you pinned"The fingerprint does not match the controller's current certificate. If you replaced the certificate on purpose, get the new fingerprint and re-run the installer. If you did not, do not continue: someone may be pretending to be your controller.
The test passes but guests are not let onlineOmada only lets ISN authorize guests that reached ISN through Omada's own external-portal redirect. Check the external portal settings in Omada (panel on the Network guide) and that the router is set to Omada in ISN.

To go back to the direct method, choose Directly in the same card and fill in the controller address and operator login there. To remove the connector, remove the service as in panel 8 (with CONNECTOR_KIND=omada or -Kind omada) and create a new connector or switch the integration off in the dashboard.