Documentation / LemmeSee Hub

Configuration

The hub reads its settings from config.json in the hub folder, once, when it starts. After changing the file, restart the hub (Restart hub in the web UI, or stop and start it). Most of what you set up day to day, such as tasks, webhooks, feeds, and users, lives in the hub's database and is managed in the web UI instead.

A complete example

{
  "mqtt": { "broker": "localhost", "port": 1883 },
  "server": {
    "host": "0.0.0.0",
    "port": 8765,
    "local_admin": true,
    "external_host": "hub.example.com",
    "external_scheme": "https",
    "ssl_bind_host": "0.0.0.0",
    "ssl_bind_port": 8443,
    "ssl_cert_file": "/path/to/hub.crt",
    "ssl_key_file": "/path/to/hub.key"
  },
  "db_path": "/path/to/lemmeknow.db",
  "plugins_path": "/path/to/plugins",
  "filters_path": "/path/to/filters",
  "webhooks_path": "/path/to/webhook-scripts",
  "internal_allow_cidrs": ["127.0.0.1/32"],
  "broker_snapshot_path": "/path/to/broker_snapshot.txt",
  "ping_messages": {
    "100": "Backup finished",
    "500": { "label": "Disk failing", "private": true }
  },
  "log_sources": {
    "backup": "Nightly backup",
    "build":  { "label": "Build agent", "private": true }
  }
}

Only db_path is required. Everything else can be left out and takes its default.

mqtt

The broker the hub publishes to. The hub connects without a username or password, so point it at a listener that allows anonymous access on the same PC. See MQTT and Mosquitto.

SettingDefaultMeaning
broker"localhost"Broker address.
port1883Broker port.

These are the only two keys this block accepts; any other key stops the hub from starting.

server

How the hub's web UI and API listen, and how they sign callers in. Unknown keys in this block are ignored.

SettingDefaultMeaning
host"0.0.0.0"Address the plain HTTP listener binds to. "0.0.0.0" listens on every network interface; "127.0.0.1" keeps it on this PC only.
port8765Port of the plain HTTP listener.
local_admintrueWhen on, a request from this same PC that carries no access key is treated as the admin. Turn it off and on-box callers need a key or a signed-in session like anyone else.
ssl_bind_host""Address for the optional HTTPS listener. Empty means "0.0.0.0".
ssl_bind_port0Port for the optional HTTPS listener.
ssl_cert_file""Certificate file for the HTTPS listener.
ssl_key_file""Private key file for the HTTPS listener.
external_host""The address people use to reach the hub from the internet, such as "hub.example.com". Used in the startup log entry's links. When empty, the hub looks up its public IP address.
external_scheme"http""https" or "http" for those links.
require_authfalseOnly applies while the hub has no users. See below.
access_key""Only applies while the hub has no users. See below.

The HTTPS listener starts only when ssl_cert_file, ssl_key_file and ssl_bind_port are all set. It serves the same web UI and API as the plain listener. See Remote access.

require_auth and access_key are a simple shared-key mode for a hub with no user accounts. While no users exist, a caller is let in as the admin when require_auth is off or access_key is empty; with both set, a caller must send the key in an X-Access-Key header. Once you create the first user (see First run), these two settings have no effect: every caller needs a user's key or a signed-in session.

local_admin counts anything arriving from the loopback address as local. If you put a reverse proxy on the same PC in front of the hub, every request it forwards looks local, so turn local_admin off in that setup.

Paths

SettingDefaultMeaning
db_pathnone, requiredFull path of the database file. It holds users, tasks, webhooks, feeds, watcher snapshots, invites, plugin keys, and the hub's own settings, including its server id. The hub refuses to start without it, and creates the file if it doesn't exist. Use the same file as LemmeKnow Server on this PC.
plugins_pathnot setFolder the hub loads plugin scripts from. Set it to the folder that holds your plugins. See Installing hub plugins.
formats_pathnot setFolder the hub loads custom log file formats from. Set it to use custom formats in file feeds. See Log file formats.
filters_paththe folder of filters that ships with the hubFolder of named filter scripts. See Named filters.
webhooks_pathnoneFolder of webhook scripts. Without it, webhook scripts are off. See Webhooks.

Use full paths for all of these.

Broker sign-in

These settings matter when phones sign in to the broker through the LemmeKnow auth plugin for Mosquitto. See MQTT and Mosquitto.

SettingDefaultMeaning
internal_allow_cidrs[]Address ranges allowed to ask the hub to check a broker sign-in or a plugin key. Empty means nobody may, which makes every phone sign-in at the broker fail. Include "127.0.0.1/32" for a broker on the same PC, plus the address of any other broker that checks sign-ins against this hub. Invalid entries are skipped.
broker_snapshot_path""File where the hub writes every user's permissions for the auth plugin to read. The hub writes it at startup and rewrites it within about 30 seconds of a change. Empty means no file is written. Set the plugin's plugin_opt_snapshot_path to the same file.
replication_allowed_cidrs[]Address ranges allowed to download that same permission snapshot over HTTP, for a second broker that mirrors this hub's permissions. Empty means nobody may.

ping_messages

Labels for the ping codes your scripts send. Each entry is either a bare label (a public code) or an object with label and private. Phones receive this list filtered to what each user may see, and show the label instead of the bare code. The app acts only on pings whose code has a label its user can see.

"ping_messages": {
  "100": "Backup finished",
  "500": { "label": "Disk failing", "private": true }
}

The hub refuses to start if an entry has no label, if two codes share the same label, or if you use the code -1 or 0. Every code that reads as a whole number of zero or less is reserved for the app's built-in pings, and the app ignores pings with those codes from a server, so give your codes positive numbers or names. See Pings.

log_sources

Friendly labels and tiers for the log sources your scripts use. A bare string is a public source with that label; an object takes label (defaults to the source name) and private.

"log_sources": {
  "backup": "Nightly backup",
  "build":  { "label": "Build agent", "private": true }
}

Only sources listed here appear, with their labels, in the list phones receive. Sources you don't list still deliver their log entries to phones; they just have no label. On the hub's own Logs page, Dashboard and logs API, the tier set here decides who sees a source's lines, and a source you don't list counts as private. See Logs and Logs and pings.

streams

An optional streams block turns on the video streams feature. Without it, the Streams pages and API answer 404. Its settings are described in Streams.