on this page
server.lua
Which Lurker instance to talk to, and how to sign in to it. This is the
server table in the config. On Lurker 2.3.0 or newer, url is the only thing
you need to set.
Changes here take effect the next time luir starts. F5 reloads everything
else but leaves the connection alone.
Signing in
On Lurker 2.3.0 or newer there is nothing to set up. The first time luir connects, it prints an address, tries to open it in your browser, and asks for a code:
- Open the address and sign in to Lurker.
- Approve luir. The page then shows a code.
- Paste the code into luir.
That approves luir with OAuth, so it never handles your password. The token it
is given never expires, and luir keeps it in auth.json beside the config,
where on Linux and macOS only you can read it.
It works over SSH too. Nothing has to reach back to the machine luir runs on, so open the address wherever you have a browser. luir does not try to open one itself over SSH, or where there is no display.
luir login and luir logout
| Command | |
|---|---|
luir login |
Approve luir again, and revoke the token it replaces |
luir logout |
Revoke luir's token on the server, and forget it |
If luir logout cannot revoke the token on the server, it still forgets it,
and tells you to revoke luir in Lurker under Settings, Authorized apps.
Revoking it there works at any time: luir notices on its next start and asks
for approval again.
When luir has been approved before and the approval page shows an error instead of a code, press enter at the prompt, and luir starts again with a fresh registration.
Older servers, and scripts
Servers older than Lurker 2.3.0 have no browser sign-in, so luir falls back to a username and password, and mints a fresh 30-day session token each time it starts:
return {
url = "https://lurker.example.com",
username = "you",
password = "hunter2",
}
A newer server uses the same fallback when luir starts with no terminal to ask in, such as from a script, and when luir cannot reach the server to ask whether browser sign-in is offered. Otherwise browser sign-in wins, even when a username and password are set.
With no terminal and no password, luir stops and asks you to run luir login
in a terminal once. After that, the token it keeps is used, script or not.
The order luir tries
luir uses the first of these it finds:
- the
LURKER_TOKENenvironment variable tokentoken_command- the token kept from approving luir, unless the server says it was revoked
- approving luir in a browser, when the server offers it and there is a terminal
usernameandpassword
A blank value counts as not set, and a token_command that prints nothing
falls through to the next step.
A token you give luir yourself can be a session token from
POST /api/auth/login/token, or an OAuth access token. API tokens from
/settings/api-tokens fail with a 401, because they authenticate Lurker's MCP
endpoint only.
Keeping secrets out of the file
Being Lua, server.lua can read a token or password from the environment,
from a variable of whatever name you like:
password = os.getenv("LURKER_PASSWORD"),
Or hand the job to a password manager with token_command:
token_command = "pass show lurker/token",
Options
- url
The base address of your Lurker instance, such as
"https://lurker.example.com". The WebSocket address is worked out from it.luir will not connect without it, and it must be a valid URL. Browser sign-in happens at this address too, unless
hostedis set.luir --demoneeds no server, so it runs without one.- username
Your Lurker username, for signing in with a password: on servers older than Lurker 2.3.0, or when luir runs with no terminal. With
passwordset too, luir signs in withPOST /api/auth/login/tokeneach time it starts, and gets a session token that lasts 30 days.With
hosted = true, this is the email address you sign in to app.lurker.chat with.- password
The password for
username.- token
A token you already have: a session token from
POST /api/auth/login/token, which expires after 30 days, or an OAuth access token. An API token from the web UI's/settings/api-tokensfails with a 401.Checked after
LURKER_TOKENand beforetoken_command.- token_command
A command that prints a token on standard output, to keep it out of this file. It is run with
sh -c, or on Windows with the shellCOMSPECnames, which iscmd.exeunless it has been changed. Write it for whichever shell the machine running luir actually has.If the command exits with an error, luir stops and shows what it wrote to standard error.
- hosted
Sign in through the hosted service at app.lurker.chat rather than your own instance. Browser approval happens there, and so does a username and password sign-in, where
usernameis your email address.- insecure
Accept a TLS certificate that cannot be verified, such as the self-signed one on a self-hosted instance. Only turn this on for a host you trust: it gives up the protection TLS is there for.
- reconnect_min_secs
How long to wait before the first attempt to reconnect after the connection drops, in seconds. Anything below 1 counts as 1.
- reconnect_max_secs
The longest wait between reconnect attempts, in seconds. Anything below 1 counts as 1.
