Squorli

For plugin authors · English

Writing plugins: extensions your server runs itself

A plugin extends your own Squorli server: give roles for a limited time, greet new members, offer a slash command. This guide is for anybody who can write JavaScript. It leads from a first plugin in five minutes to every function and every limit of the interface. How you install and set up a finished plugin as an owner is in the administration guide.

New and not proven everywhere yet. The interface carries version 2. What was checked: the sandbox in automatic tests (an endless loop, a plugin that fills the memory, one that never finishes: each is stopped while another plugin keeps answering) and the whole course on a test instance: installing, enabling, the scope, commands, member actions, scheduled jobs, updates and removal. The network and the signatures of version 2 were checked too, in automatic tests and on a test instance: a file changed after it was signed, a host outside the manifest’s list, a redirect that leaves it, and the game news plugin in the real sandbox against a played internet and once against its real sources. Not checked yet: a server in real use over the internet, the package for Windows, the behaviour over days with many plugins, and the game news plugin over weeks against sources that change. Apart from this guide’s example and the three plugins that ship with the server, no plugins exist yet; whether the interface carries further uses remains to be seen.

What a plugin is, and what it is not

A plugin is one file, in JavaScript or TypeScript. At the very top, a comment holds the manifest: what the plugin is, what it may do and what it adds to the app. The code follows. The server stores the file in its database and runs it in a sandbox. It hands the plugin events, for example “a member joined”, and the plugin calls functions of the object squorli, for example “give this member this role”.

A plugin is not a bot. It has no token, no endpoint on the network and no process of its own, and you run nothing but your server. Squorli offers no bot interface.

What a plugin cannot do:

  • No files, no system, no network of its own. The sandbox holds the JavaScript language and squorli, nothing else: no fetch, no require, no import, no process and no timers such as setTimeout. Time goes through scheduled jobs. The one way to the internet is squorli.net.get(): for plugins Squorli signed, and only to the hosts their manifest names (The network).
  • No code in the app. A plugin never delivers HTML or JavaScript to the members. The app draws settings, dialogs, commands and tables from the manifest’s data.
  • Only what was opened to it. A plugin reaches only the roles and channels an admin picked in its settings. It sees attachments as a number only. Direct messages, voice channels, keys, presence and the game display are out of its reach altogether.

Three rules explain most of the interface:

  • Keep nothing in variables. The server stops a plugin’s sandbox when it had nothing to do for five minutes, and starts a fresh one for the next event. State belongs in squorli.storage, time in squorli.schedule.
  • Functions answer only inside a handler. Every function except squorli.log returns a promise. Wait for it with await, in the handler of the event you are handling. A call at the top level of the file is refused.
  • A plugin reaches what an admin picked. That is the scope.

A first plugin in five minutes

The smallest useful plugin offers two commands and greets new members. Save it as hello.js; the file is in the server repository too.

hello.js
/* squorli-plugin
{
  "id": "hello",
  "name": { "en": "Hello", "de": "Hallo" },
  "description": {
    "en": "The smallest plugin: a slash command that greets, and a welcome for new members.",
    "de": "Das kleinste Plugin: ein Schrägstrich-Befehl, der grüßt, und ein Willkommen für neue Mitglieder."
  },
  "version": "1.0.0",
  "apiVersion": 1,
  "capabilities": ["members.read", "messages.write"],
  "settings": [
    {
      "key": "channel",
      "type": "channel",
      "label": { "en": "Channel for the welcome", "de": "Kanal für das Willkommen" },
      "help": { "en": "Left empty, new members are not greeted.", "de": "Bleibt das Feld leer, werden neue Mitglieder nicht begrüßt." }
    },
    {
      "key": "greeting",
      "type": "text",
      "default": "Welcome",
      "maxLength": 80,
      "label": { "en": "Greeting", "de": "Gruß" }
    }
  ],
  "commands": [
    { "name": "hello", "description": { "en": "Says hello to you", "de": "Sagt dir Hallo" } },
    {
      "name": "say",
      "input": "text",
      "permission": "MANAGE_MESSAGES",
      "description": { "en": "Writes your text as the plugin", "de": "Schreibt deinen Text als Plugin" },
      "textHint": { "en": "text", "de": "Text" }
    }
  ]
}
*/

// The smallest useful plugin, in plain JavaScript. The guide walks through it line by line:
// https://squorli.com/en/docs/plugins/

// A member typed /hello or /say. Whatever a command handler returns is shown to that member only.
squorli.on("command", async (e) => {
  if (e.command === "hello") {
    const me = await squorli.members.get(e.by);
    return { message: { en: `Hello, ${me.displayName}!`, de: `Hallo, ${me.displayName}!` } };
  }
  if (e.command === "say") {
    if (!e.text) return { ok: false, message: { en: "Write the text after the command.", de: "Schreibe den Text hinter den Befehl." } };
    // A message everybody in the channel sees. During a command the plugin may write into the channel it was run in.
    await squorli.messages.send(e.channelId, e.text);
  }
});

// Somebody joined the server: greet them in the channel an admin picked in the settings.
squorli.on("member.join", async (e) => {
  const settings = await squorli.settings.get();
  if (!settings.channel) return;
  const member = await squorli.members.get(e.userId);
  if (member) await squorli.messages.send(settings.channel, `${settings.greeting}, ${member.displayName}!`);
});

The comment at the start is the manifest. It asks for two capabilities: seeing the member list, to look names up, and writing messages. It has two settings, a channel and a greeting, and two commands. The code below listens to two events:

  • command: whatever the handler returns is seen only by the member who typed the command. /hello answers that way. /say writes a message with squorli.messages.send() instead, which everybody in the channel sees; for that the manifest asks the member for the permission MANAGE_MESSAGES.
  • member.join: when an admin picked a channel in the settings, the plugin greets every new member there.

There are two ways to install the plugin. As an owner you upload the file in Administration under Plugins, with “Upload a file …”. Or you install it on the machine the server runs on, with the command squorli:

Terminal
# On the machine the server runs on. Linux: as root, as below. Windows: the same lines without sudo, as administrator.
# Installs or updates a plugin from a file, shows what it may do and asks whether to switch it on
sudo squorli plugin add hello.js
# The installed plugins and those that ship with the server
sudo squorli plugin list
sudo squorli plugin enable hello
sudo squorli plugin disable hello
# The last 100 entries of its log
sudo squorli plugin log hello
# Removes it with its storage, schedules and log; its messages stay unless --delete-messages is given (Windows: -DeleteMessages)
sudo squorli plugin remove hello

A new plugin is switched off after its installation. When it is enabled, the server shows what the plugin may do and waits for your confirmation; squorli plugin add asks right away. Then type /hello in a text channel: as soon as you type the slash at the start of the message field, the app suggests the plugins’ commands. For the greeting, pick a channel in the plugin’s settings; only then may it write there.

If Administration has no Plugins tab, the server is older than the plugin interface, or the operator has switched plugins off.

The manifest

The manifest is JSON in a block comment that begins with the word squorli-plugin. It has to stand at the very start of the file. That way the server reads what a plugin is and asks for without running a line of it – and so can you, in any editor.

my-plugin.js
/* squorli-plugin
{
  "id": "my-plugin",
  "name": { "en": "My plugin", "de": "Mein Plugin" },
  "description": "One or two sentences about what the plugin does.",
  "version": "1.0.0",
  "apiVersion": 1
}
*/

// The code follows the comment.

The file ends in .js or .ts and has at most 256 KB, the manifest in it at most 32 KB. The server reads the manifest strictly: an unknown key, an unknown field type or an unknown capability means the plugin is not installed, and the message names the place.

KeyType and limitDefaultMeaning
idstring, 3–32requiredThe plugin’s id: lowercase letters, digits and hyphens, a letter first. A file whose id is installed already replaces that plugin (an update).
nameText, ≤ 60requiredThe name the plugin has in Administration and writes messages under.
descriptionText, ≤ 300requiredWhat the plugin does, in one or two sentences.
versionstringrequiredThe plugin’s own version: three numbers such as 1.0.0.
apiVersioninteger, 1–2requiredThe version of the interface the plugin is written for: 1, or 2 for a plugin that uses the network (see Versions).
authorstring, ≤ 80optionalWho wrote the plugin. Administration shows it; nothing checks it.
homepagestring, ≤ 300optionalAn address that starts with https://.
capabilitiesarray, ≤ 5[]The capabilities the plugin asks for; each one once at most.
networkobjectoptionalInterface version 2, together with the capability net.fetch: an object with the one key hosts (see The network).
network.hostsarray, 1–20optionalThe hosts squorli.net.get() may ask, and no others: full names in lower case such as api.example.org, each one once.
settingsarray, ≤ 30[]The fields of the settings. Role and channel fields define the scope.
commandsarray, ≤ 20[]The slash commands; each name once.
memberActionsarray, ≤ 10[]The entries in the member menu.
viewsarray, ≤ 5[]The tables in Administration.

Texts in two languages. Where the table says “Text”, there is either a string, which counts as English, or an object with both languages: "Hello" or { "en": "Hello", "de": "Hallo" }. en is required, de optional; without a German version the app shows the English one. The number is the greatest length in characters. A plugin’s texts are always shown as text, never as HTML or Markdown.

Capabilities

Whatever a plugin wants to do beyond storage, schedules and its log, it has to ask for in capabilities. There are five capabilities. The second column is the sentence the owner reads before enabling the plugin, under “What the plugin may do”; the confirmation marks two capabilities as far-reaching.

CapabilityWhat the owner readsMarkWhat it opens
members.readSee the member list (names, roles, when somebody joined) and learn when members join, leave or change roles.–squorli.members, squorli.roles.list() and the events member.join, member.leave, member.roles, role.delete.
roles.manageGive and take the roles you pick in its settings. Never roles with administrator rights.far-reachingsquorli.roles.give() and squorli.roles.take() for roles of the scope; also squorli.roles.list() and role.delete.
messages.readRead every message in the channels you pick in its settings.far-reachingsquorli.messages.history(), squorli.channels.list() and the events message.create, message.update, message.delete, each for channels of the scope only.
messages.writeWrite messages under its own name in the channels you pick in its settings, and where a member runs one of its commands.–squorli.messages.send(), edit() and delete(), also squorli.channels.list(): writing into channels of the scope and into the channel one of the plugin’s commands is running in; changing and deleting its own messages only.
net.fetchFetch data from the internet, from fixed addresses only. It can read there, never send anything but the address it asks.–squorli.net.get() for the hosts under network in the manifest. The server takes this capability only from a file that carries Squorli’s signature. In the confirmation the sentence names the hosts.

Without any capability every plugin may: keep data (squorli.storage), schedule jobs (squorli.schedule), write to its log (squorli.log), read its settings (squorli.settings), and offer commands, entries in the member menu and tables.

Enabling means allowing: the owner confirms exactly the list the manifest names. When an update asks for more than was allowed so far, the server stops the plugin until an owner confirms the new list. When a plugin calls a function whose capability it does not have, the server refuses the call with an error.

The scope

A capability alone is not enough. roles.manage does not mean “all roles”, and messages.read does not mean “all channels”. A plugin reaches only the roles and channels an admin picked in its settings: in fields of the type role, roles, channel or channels. The plugin for timed roles that ships with the server has a single field for that:

timed-roles.ts · manifest
  "settings": [
    {
      "key": "roles",
      "type": "roles",
      "required": true,
      "label": { "en": "Roles that may be given for a time", "de": "Rollen, die auf Zeit vergeben werden dürfen" },
      "help": {
        "en": "Only these roles appear in the member menu's dialog, and only these can the plugin give and take.",
        "de": "Nur diese Rollen erscheinen im Dialog des Mitgliedermenüs, und nur diese kann das Plugin vergeben und entziehen."
      }
    }
  ],

A plugin’s settings are edited by whoever may manage the server. On saving, the server checks every role and every channel that is added:

  • A role can be added only by somebody who could assign it themselves: it ranks below their own highest role and holds no permission they lack.
  • Never the default role and never a role with administrator rights – not even by an owner.
  • A channel can be added only by somebody who sees it. A channel field takes text channels, with "channelKind": "voice" voice channels.
  • What was in the scope already stays in it when somebody with fewer permissions saves the settings later.

On saving, the server remembers which permissions a role had. When the role gains permissions afterwards, the server refuses to let the plugin give or take it until an admin saves the settings again and thereby confirms it once more. When it gains administrator rights, it stays locked altogether. Whether a plugin may give a role right now is what manageable in squorli.roles.list() tells it.

There is one exception, for commands: while a plugin handles a command, it may write into the channel the member typed it in, even when that channel is not part of the scope.

Events

With squorli.on(name, handler) a plugin listens to an event. There is one handler per event; a second on for the same name replaces the first. The handler may be async.

EventThe handler getsCapabilityWhen
enable{ reason }noneAn owner enabled the plugin (reason: "enabled") or installed a new version of it ("updated"). The event is not sent when the server starts.
disable{}noneThe plugin is being switched off or removed. The handler has about a second.
settings.check{ values, by }noneInterface version 2. An admin is about to save the settings: values is what would be saved. The handler lets it pass (no return value), refuses fields with fieldErrors, or hands values back in another form with values (see Settings and field types). Only a running plugin is asked.
settings.change{}noneAn admin saved the settings. Read the values with squorli.settings.get().
member.join{ userId }members.readA new membership. Nothing is sent when somebody who was a member already signs in.
member.leave{ userId, reason }members.readA member is no longer on the server. reason is "kicked", "banned" or "deleted".
member.roles{ userId, added, removed, origin, by? }members.readA member’s roles changed; added and removed are role ids. origin names the cause: "user" (a person, by is their id), "reaction" (a reaction role, by is the member), "plugin" (another plugin) or "system" (the server).
role.delete{ roleId, name }members.read or roles.manageA role was deleted. The members who had it get no member.roles of their own.
message.create{ message }messages.readA new message in a channel of the scope. message holds id, seq, channelId, authorId, content, createdAt, editedAt, attachments (only the number of files) and plugin (the id of the plugin that wrote it, else null).
message.update{ message }messages.readThe text of a message was changed.
message.delete{ channelId, messageIds }messages.readMessages of a channel of the scope were deleted.
command{ command, channelId, by, text, values }noneA member ran one of the plugin’s commands. The handler may return an answer.
memberAction{ action, userId, by, values }noneA member used one of the plugin’s entries in the member menu on the member userId. The handler may return an answer.
view{ view }noneAdministration asks for the rows of a table. The handler returns them.
job{ name, key, payload, dueAt, late, attempt }noneA scheduled job is due.
  • A plugin never gets what it caused itself. When it writes a message or gives a role, no event about that reaches it. When two plugins set each other off, the chain ends after a few steps.
  • One at a time. A plugin handles one event at a time; further ones wait, up to 100.
  • Events a plugin has no handler for do not start its sandbox.
  • Ids are strings, times ISO strings such as "2026-11-15T18:00:00.000Z".

Functions

Whatever a plugin does, it does through the object squorli. Every function except those of squorli.log returns a promise. When the server refuses a call – the capability is missing, the role is outside the scope, a limit is reached – the promise is rejected with an Error whose message names the reason. If you catch it with try and catch, the handler goes on. squorli.apiVersion names the version of the interface.

squorli.roles

CallResultCapabilityNotes and limits
squorli.roles.list()A list of roles: { id, name, color, position, isDefault, manageable }members.read or roles.manageEvery role of the server, the most powerful first. manageable says whether the plugin may give and take the role right now.
squorli.roles.give(userId, roleId)true when something changedroles.manageRoles of the scope only. At most 60 role changes a minute, giving and taking together.
squorli.roles.take(userId, roleId)true when something changedroles.managefalse when the member did not have the role or is no member any more.

squorli.members

CallResultCapabilityNotes and limits
squorli.members.list({ offset, limit }){ total, members }members.readA page of the member list in the order of joining, at most 100 per call. A member: { userId, displayName, handle, roleIds, joinedAt, isOwner }; handle is "@name", "~name" or null, roleIds lists the roles without the default role.
squorli.members.get(userId)A member or nullmembers.readnull when the id is no member.

squorli.channels

CallResultCapabilityNotes and limits
squorli.channels.list()A list of channels: { id, name, kind }messages.read or messages.writeThe channels of the scope; kind is "text" or "voice".

squorli.messages

CallResultCapabilityNotes and limits
squorli.messages.history(channelId, { before, limit }){ messages, hasMore }messages.readMessages of a channel of the scope, the oldest first: 20 without limit, at most 50. before is a seq to page backwards. When the page does not fit into one answer, fewer messages come and hasMore is true. attachments is null here.
squorli.messages.send(channelId, content){ id, seq }messages.write1 to 4000 characters, Markdown as members write it, no files. Links get a preview only in the messages of a plugin that holds net.fetch. With { card } as a third argument the message is drawn as a card (version 2). At most 20 messages a minute, sending and editing together.
squorli.messages.edit(messageId, content)truemessages.writeThe plugin’s own messages only; 1 to 4000 characters.
squorli.messages.delete(messageId)truemessages.writeThe plugin’s own messages only.

squorli.storage

CallResultCapabilityNotes and limits
squorli.storage.get(key)The value or nullnonenull when the key does not exist.
squorli.storage.set(key, value)truenoneAnything JSON can hold except null; at most 64 KB per value, keys of up to 128 characters. At most 120 writes a minute, storing and deleting together.
squorli.storage.delete(key)true when the key existednone
squorli.storage.list(prefix)A list of keysnoneThe keys that start with prefix (all of them without one), sorted, at most 1000.

squorli.schedule

CallResultCapabilityNotes and limits
squorli.schedule.at(when, name, payload, { key }){ id, dueAt }nonewhen is a Date, a number of milliseconds or an ISO string; a time in the past means “now”. name has up to 64 characters, payload up to 4 KB and comes back with the event job. A key (up to 128 characters) names the job: scheduling the same one again replaces it. At most 1000 waiting jobs, at most five years ahead.
squorli.schedule.cancel(key)true when a job with that key was waitingnone
squorli.schedule.list()A list of jobs: { key, name, dueAt }noneThe waiting jobs, the next one first, at most 500.

squorli.settings

CallResultCapabilityNotes and limits
squorli.settings.get()An object with the saved valuesnoneBy the keys of the manifest’s settings; which value a field yields is under Settings and field types.

squorli.net

CallResultCapabilityNotes and limits
squorli.net.get(url){ url, contentType, text }net.fetchOne GET over https to a host of the manifest; text is the answer read as UTF-8, url the address it came from. Rejected with an error when the host does not answer with text, JSON or XML within 5 seconds, when the answer is larger than 512 KB, and for a redirect to a host the manifest does not name. At most 30 requests a minute. More under The network.

squorli.log

CallResultCapabilityNotes and limits
squorli.log.info(...parts)nothingnoneA line in the plugin’s log, up to 1000 characters. At most 60 lines a minute; further ones are dropped without an error. console.log, console.info and console.debug write the same level.
squorli.log.warn(...parts)nothingnoneLike log.info, as a warning; console.warn too.
squorli.log.error(...parts)nothingnoneLike log.info, as an error; console.error too.

Settings and field types

Settings, the dialog of an entry in the member menu and the form of a command are made of the same fields. You describe them in the manifest, the app draws them, and the server checks every value before your code gets it. A field has these keys:

KeyType and limitDefaultMeaning
keystring, 1–32requiredThe value is found under this key in settings.get() or in a handler’s values. Letters and digits, a lowercase letter first.
typestringrequiredOne of the twelve field types below.
labelText, ≤ 80requiredThe field’s label.
helpText, ≤ 300optionalAn explaining sentence below the field.
requiredbooleanfalseWhether the field has to be filled in.
defaultanyoptionalThe value a field gets that was left empty.
optionsarray, 1–50optionalselect only, required there: the choices, each { "value", "label" } with a value of up to 64 characters and a label (Text, ≤ 80).
minnumberoptionalnumber: the smallest value. duration: the shortest duration in seconds.
maxnumberoptionalnumber: the largest value. duration: the longest duration in seconds.
maxLengthinteger, 1–20002000text: the greatest length in characters.
multilinebooleanoptionaltext: several lines.
presetsarray, ≤ 8optionalduration: suggested values in seconds, as buttons.
channelKind"text" | "voice""text"channel, channels: which kind of channel can be picked.
yearOptionalbooleanoptionaldate: the year may be left out, as for a birthday.
fieldsarray, 1–4optionallist: what an entry is made of, one to four simple fields of the types text, number, boolean and select, each with key, type, label and, as needed, required, default, options, min, max, maxLength (200 at most).
maxItemsinteger, 1–10050list: how many entries the list holds at most.
fromstring, ≤ 32optionalIn dialogs and forms only, on role and channel fields: the key of a settings field of the same kind. The field then offers only that field’s values.

There are twelve field types:

TypeThe app showsThe value in the code
textA text field, with multiline several lines.Text without whitespace at its ends, up to maxLength characters.
numberA number.A number between min and max.
booleanA switch.true or false; false when untouched.
selectA choice from options.The value of the chosen option.
roleA role.The role’s id.
rolesSeveral roles.A list of role ids, at most 50; [] when empty.
channelA channel of the kind channelKind.The channel’s id.
channelsSeveral channels.A list of channel ids, at most 50; [] when empty.
memberA member.The member’s id.
durationA duration, with the presets as buttons.Whole seconds, at least 1 and at most ten years, narrower with min and max.
dateA date, which the app draws as a date picker.Text of the form YYYY-MM-DD; with yearOptional without a year as --MM-DD. The server lets through only days the calendar has.
listInterface version 2, in the settings only: entries an admin adds and removes, each a row of the fields under fields.A list of objects keyed by those fields, at most maxItems; empty []. A row nobody typed anything into is dropped.
  • Empty fields. A field that was left empty gets its default. Without one, its key is missing from the result; only boolean then yields false, and roles and channels yield an empty list. Before an admin saves the settings for the first time, settings.get() is empty.
  • from. A role field in a dialog offers the roles of the scope. With "from": "roles" it offers only what the settings field roles holds. from has to name a settings field of the same kind: roles for roles, channels for channels.
  • What a dialog offers. Role and channel fields in dialogs and forms show only what lies in the scope, and of the roles only those the member may assign themselves. The server checks the same again when the dialog is submitted.
  • When an older app does not know a field type, it shows the notice “This field needs a newer app.” for that one field instead of the field. If it is a required field, the dialog cannot be submitted there. That holds for list in apps up to 0.17.0; the server’s web client knows the field from release 0.15.0 on.

Checking settings before they are saved. Since interface version 2 the server asks a running plugin with the event settings.check before it saves settings. The handler gets what would be saved, checked against the fields by the server already, and the admin waits for the answer. With fieldErrors it refuses fields, each with a sentence of its own; nothing is saved then, and the sentence stands at the field. With values it hands fields back in another form, for example a typed name as what it stands for; the server checks them like the admin’s values. Role, channel and member fields cannot be changed this way: for those the server checked the admin’s rank. The game news plugin looks every new game up at Steam this way:

game-news.ts
squorli.on("settings.check", async (e: Squorli.SettingsCheckEvent): Promise<Squorli.SettingsCheckResult | void> => {
  const out: { game: string; show: string }[] = [];
  const ids: number[] = [];
  const en: string[] = [], de: string[] = [];
  const pictures: Art = {};
  let lookups = 0;
  for (const raw of list(e.values.games)) {
    const item = obj(raw);
    const typed = str(item.game, 200).replace(/\s+/g, " ").trim();
    if (!typed) continue;
    const show = item.show === "patch" ? "patch" : "all";
    const done = RESOLVED.exec(typed);
    let game: { id: number; name: string };
    if (done) game = { id: Number(done[2]), name: done[1]! };
    else {
      if (lookups >= LOOKUPS_PER_SAVE) {
        en.push(`Add at most ${LOOKUPS_PER_SAVE} new games per save.`); de.push(`Füge pro Speichern höchstens ${LOOKUPS_PER_SAVE} neue Spiele hinzu.`);
        break;
      }
      lookups++;
      const found = await lookUp(typed);
      if ("en" in found) { en.push(found.en); de.push(found.de); continue; }
      game = found;
      // Steam's answer to the lookup names the game's small picture already: remembered for its cards.
      if (found.picture) pictures[String(found.id)] = { url: found.picture, at: Math.floor(Date.now() / 1000) };
    }
    if (ids.includes(game.id)) continue; // the same game twice: once is enough
    ids.push(game.id);
    out.push({ game: `${short(game.name, 100)} (${game.id})`, show });
  }
  if (en.length) return { fieldErrors: { games: { en: short(en.join(" "), 480), de: short(de.join(" "), 480) } } };
  if (Object.keys(pictures).length) await squorli.storage.set(ART, { ...(await loadArt()), ...pictures });
  return { values: { games: out } };
});

Member actions

A member action is an entry in a member’s menu that opens a small dialog. That is how the plugin that ships with the server adds “Role for a time…”, with a role and a duration:

timed-roles.ts · manifest
  "memberActions": [
    {
      "id": "give",
      "label": { "en": "Role for a time…", "de": "Rolle auf Zeit…" },
      "permission": "MANAGE_ROLES",
      "target": "any",
      "submitLabel": { "en": "Give", "de": "Vergeben" },
      "fields": [
        { "key": "role", "type": "role", "from": "roles", "required": true, "label": { "en": "Role", "de": "Rolle" } },
        {
          "key": "duration",
          "type": "duration",
          "required": true,
          "min": 60,
          "presets": [3600, 86400, 604800, 2592000],
          "label": { "en": "For how long", "de": "Wie lange" }
        }
      ]
    }
  ],
KeyType and limitDefaultMeaning
idstring, 1–32requiredThe entry’s id; it arrives as action in the event.
labelText, ≤ 60requiredThe text of the entry in the member menu.
permissionstringrequiredThe server-wide permission a member needs to see and run the entry, for example MANAGE_ROLES. There is no default: you decide.
target"any" | "manageable" | "notSelf""manageable"Whom the entry may be used on: any = anybody, manageable = only members who rank below the one running it (as with a kick), notSelf = anybody but oneself.
fieldsarray, ≤ 10[]The fields of the dialog. Without fields the dialog only asks for confirmation.
submitLabelText, ≤ 40optionalThe label of the button that submits the dialog.

Permissions are named by their name: ADMINISTRATOR, MANAGE_SERVER, MANAGE_CHANNELS, MANAGE_ROLES, KICK_MEMBERS, BAN_MEMBERS, CREATE_INVITES, VIEW_CHANNELS, SEND_MESSAGES, MANAGE_MESSAGES, CONNECT_VOICE, ATTACH_FILES, STREAM_VIDEO, MODERATE_VOICE, VIEW_VIDEO, CONTROL_RADIO, MOVE_MEMBERS, BYPASS_STICKY, MANAGE_REPORTS, ADD_REACTIONS, MANAGE_NOTICES.

Before the server calls your plugin, it has checked:

  • The member running the action holds the permission of permission, and the rule of target is met.
  • Every value fits its field: type, range, required fields.
  • A role in the values lies in the scope, and the member running the action could assign it to that member by hand as well. Without this check a plugin would be a way around the role hierarchy.
  • A channel in the values is one the member running the action sees.

Above every dialog of a plugin there is a fixed line of the app, “Plugin: ” and its name. A plugin can neither change it nor leave it out, so its dialog can never pass for one of the app’s own.

The handler gets the checked values in values, the member concerned in userId and the one running the action in by:

timed-roles.ts
// "Rolle auf Zeit…" in the member menu. The server has checked by now that the caller may assign this role to this
// member by hand and that the role is one of those picked in the settings.
squorli.on("memberAction", async (e: Squorli.MemberActionEvent): Promise<Squorli.ActionResult> => {
  const roleId = e.values.role as string;
  const seconds = e.values.duration as number;
  const all = await load();
  const key = keyOf(e.userId, roleId);
  if (!all[key] && Object.keys(all).length >= MAX_ASSIGNMENTS) {
    return { ok: false, message: { en: "Too many timed roles are running. Wait until some have ended.", de: "Es laufen zu viele Zeitrollen. Warte, bis einige abgelaufen sind." } };
  }
  const until = Date.now() + seconds * 1000;
  // The schedule first, the role second: if the server stops in between, the worst case is a job that takes a role the
  // member never got, which changes nothing. The other order could leave a role nobody takes away again.
  await squorli.schedule.at(until, "expire", { userId: e.userId, roleId }, { key });
  all[key] = { userId: e.userId, roleId, until, by: e.by };
  await save(all);
  try {
    await squorli.roles.give(e.userId, roleId);
  } catch (err) {
    await forget(all, [key]);
    squorli.log.warn("could not give the role", String(err));
    return { ok: false, message: { en: "The role could not be given. The plugin's log says why.", de: "Die Rolle konnte nicht vergeben werden. Das Protokoll des Plugins nennt den Grund." } };
  }
  const t = span(seconds);
  return { ok: true, message: { en: `The role is taken away again in ${t.en}.`, de: `Die Rolle wird in ${t.de} wieder entzogen.` } };
});

Whatever the handler returns, the dialog shows only to the member who submitted it: a string, or an object with ok, message (a text, up to 500 characters) and fieldErrors (a text per field key, shown at the field). With ok: false or with fieldErrors the action counts as not carried out. The whole file is in the server repository.

Slash commands

A command is what a member types into the message field of a text channel after a slash. The first plugin above has two of them.

KeyType and limitDefaultMeaning
namestring, 1–32requiredWhat a member types after the slash: lowercase letters, digits and hyphens, a letter first.
descriptionText, ≤ 120requiredA sentence the app shows next to the command.
permissionstring"SEND_MESSAGES"The permission a member needs in that channel to run the command.
input"none" | "text" | "form""none"none = the command runs at once, text = the rest of the line is its argument, form = a dialog with fields.
textHintText, ≤ 80optionalWith text: a hint at what belongs after the command.
fieldsarray, ≤ 10[]With form, at least one there: the fields of the dialog.
  • Three kinds of input. With none there is nothing to enter. With text the rest of the line arrives as text in the event, up to 2000 characters. With form the app opens a dialog, and the checked values arrive as values.
  • Answer or message. Whatever the handler returns is seen only by the member who ran the command: the app shows it at the message field with the plugin’s name and the note “Only you can see this.” Nothing appears in the channel. If the channel should see something, the plugin writes a message with squorli.messages.send(e.channelId, …). During the command that works outside the scope too, when the plugin has the capability messages.write and the member may write in that channel. The message names the member and the command.
  • Permissions. The server checks permission in the channel the command was typed in, with the channel’s permissions. The app offers a member only commands they may run.
  • Equal names. Two enabled plugins never share a command name. When the second one is enabled, the server refuses and names the plugin the command belongs to already.
  • An older app knows no commands: there, a typed /hello goes into the channel as an ordinary message.

Messages a plugin writes

A plugin writes under its own name, the name of the manifest. In doing so it is not a member: it is not in the member list, has no roles and cannot be banned.

  • A message has 1 to 4000 characters and may hold Markdown as members write it. A plugin cannot attach files.
  • For links in a plugin’s messages the server fetches no link previews. Otherwise a plugin could make the server request any address. The exception is a plugin that holds net.fetch: it is signed and may fetch anyway, so links in its messages get a preview like a member’s, unless the operator switched link previews off.
  • The message carries which plugin wrote it; the app shows the mark “Plugin” next to the name. When it came from a command, it also carries who ran it and which command it was, and the app shows “triggered by” with the member’s name.
  • A plugin can change and delete only its own messages.
  • An older app shows a plugin’s message as a notice line without an author.
  • When the plugin is removed, its messages stay unless something else is chosen at removal.

Cards. Since interface version 2 squorli.messages.send takes { card } as a third argument. The app then draws the message as a framed box: a small line above the title (kicker, at most 80 characters), the title (title, at most 200 characters; a link when url names an https address), a text (text, at most 2000 characters, Markdown as in a message), a small picture in the corner (thumbnail) and a large one below (image). A card needs a title or a text; everything else may be missing. Colours and layout are the app’s, not the plugin’s.

  • The message’s text stays mandatory. An app that does not know cards yet shows it in the card’s place, and notifications quote it. Write it so that it stands on its own.
  • You name pictures as https addresses; what is served are the server’s copies. The server fetches the addresses itself, like the pictures of link previews: from public addresses only, pictures only (PNG, JPEG, WebP, GIF) up to 2 MB. A member’s app never asks a foreign host. The pictures appear a moment after the message. This exists only for a plugin that holds net.fetch and only while the operator has not switched link previews off; otherwise, or when an address is no picture, the card appears without it.
  • A message with a card gets no link previews: the card stands in their place.
  • The app shows title and kicker as plain text. In text the rule of every message holds: escape what comes from outside before you put formatting of your own around it.

This is how the game news plugin announces a new driver:

game-news.ts
  await squorli.messages.send(c.drivers, `🖥️ **NVIDIA ${line(name, 80)} ${version}**${date ? ` · ${date}` : ""}\n${address}`, {
    card: { kicker: c.language === "en" ? "NVIDIA · Graphics driver" : "NVIDIA · Grafiktreiber", title: `${plain(name, 80)} ${version}`, url: address, ...(date ? { text: c.language === "en" ? `Released ${date}` : `Veröffentlicht am ${date}` } : {}) },
  });

Scheduled jobs and storage

The sandbox has no timers. When something should happen later, the plugin schedules a job: squorli.schedule.at(when, name, payload, { key }). At that time the event job arrives with the same name and payload.

  • Jobs survive restarts. They are kept in the database. When the server was down at a job’s time, or the plugin switched off, the job comes afterwards; late is true when it is more than a minute late.
  • At least once. When the server stops at the wrong moment, a job comes a second time. Write the handler so that a second run breaks nothing.
  • New tries. When the handler fails, the job comes again after 2 minutes, after 10 minutes and after an hour; attempt counts from 1. After the fourth failure the server drops it and notes that in the log.
  • A job for a plugin without a handler for job is dropped with a warning in the log.

The plugin that ships with the server schedules the end first and only then gives the role. The comment in the handler above says why: when the server stops in between, the worst case is a job that takes a role that was never given. The other order could leave a role nobody takes away again. The job’s handler copes with a second run:

timed-roles.ts
// The time is up. A job may come twice (after a restart at the wrong moment): taking a role that is gone changes nothing.
squorli.on("job", async (job: Squorli.JobEvent): Promise<void> => {
  if (job.name !== "expire") return;
  const { userId, roleId } = job.payload as { userId: string; roleId: string };
  const all = await load();
  const key = keyOf(userId, roleId);
  const entry = all[key];
  // Given again for longer in the meantime: that newer schedule replaced this one, so an entry that is not due stays.
  if (entry && entry.until > Date.now() + 5000) return;
  await squorli.roles.take(userId, roleId);
  if (entry) {
    delete all[key];
    await save(all);
  }
});

The storage is the plugin’s alone: JSON values under keys. A value has at most 64 KB, a key at most 128 characters. In all it is 10,000 keys and 5 MB at most; the operator can change the size. An update of the plugin keeps the storage and the jobs, removal deletes both.

Because a sandbox ends after five minutes without an event, a variable holds nothing any more at the next event. That is why the plugin that ships with the server loads its state from the storage in every handler and writes it back there:

timed-roles.ts
/** One running assignment. `until` is a time in milliseconds, `by` the member who gave the role. */
interface Assignment { userId: string; roleId: string; until: number; by: string }
type Assignments = Record<string, Assignment>;

const STORE = "assignments";
/** The one value holds every assignment; this many fit comfortably into the 64 KB one storage value may have. */
const MAX_ASSIGNMENTS = 400;

const keyOf = (userId: string, roleId: string): string => `${userId}:${roleId}`;

async function load(): Promise<Assignments> {
  return ((await squorli.storage.get(STORE)) as Assignments | null) ?? {};
}
async function save(all: Assignments): Promise<void> {
  await squorli.storage.set(STORE, all);
}

Views: tables in Administration

A view is a table on the plugin’s page in Administration. The manifest names the title and the columns, the plugin supplies the rows. Whoever may manage the server can see it.

timed-roles.ts · manifest
  "views": [
    {
      "id": "running",
      "title": { "en": "Running assignments", "de": "Laufende Zuweisungen" },
      "columns": [
        { "key": "member", "type": "member", "label": { "en": "Member", "de": "Mitglied" } },
        { "key": "role", "type": "role", "label": { "en": "Role", "de": "Rolle" } },
        { "key": "until", "type": "time", "label": { "en": "Until", "de": "Bis" } },
        { "key": "by", "type": "member", "label": { "en": "Given by", "de": "Vergeben von" } }
      ]
    }
  ]
KeyType and limitDefaultMeaning
idstring, 1–32requiredThe table’s id; it arrives as view in the event.
titleText, ≤ 80requiredThe table’s heading.
columnsarray, 1–8requiredThe columns.
columns[].keystring, 1–32requiredThe column’s value is found under this key in every row.
columns[].labelText, ≤ 60requiredThe column’s heading.
columns[].typestring"text"How the app shows the value, see below.
Column typeThe value in the row
textA text as it is.
memberA member’s id; the app shows the name.
roleA role’s id; the app shows the role.
channelA channel’s id; the app shows the channel.
timeA point in time: milliseconds or an ISO string.
durationA duration in seconds.

When somebody opens the table, the plugin gets the event view and returns the rows: a list of objects with the columns’ keys, or an object with that list under rows. The app shows at most 500 rows and says so when there would have been more. The table exists only while the plugin runs.

timed-roles.ts
// Verwaltung > Plugins > Zeitrollen > "Laufende Zuweisungen".
squorli.on("view", async (): Promise<Squorli.ViewResult> => {
  const all = await load();
  return Object.values(all)
    .sort((a, b) => a.until - b.until)
    .map((a) => ({ member: a.userId, role: a.roleId, until: a.until, by: a.by }));
});

The network: fetching from the internet

Since interface version 2 a plugin can fetch data from the internet with squorli.net.get(url): a game’s patch notes, a feed, the state of a service. Three things have to hold for that:

  • The manifest asks for it: "apiVersion": 2, the capability net.fetch and the hosts under network. The capability and the hosts go together; one without the other means the plugin is not installed.
  • The file carries Squorli’s signature. Without it the server installs no plugin that asks for the network, whoever uploads it. How a plugin gets one is under Signed plugins.
  • The operator left it on. With PLUGIN_NET=false in the server’s .env, no plugin fetches anything.

The game news plugin (Squorli’s own; it is installed from the catalogue) names six hosts:

game-news.ts · manifest
  "capabilities": ["messages.write", "net.fetch"],
  "network": {
    "hosts": ["api.steampowered.com", "store.steampowered.com", "store-site-backend-static.ak.epicgames.com", "www.gamerpower.com", "gfwsl.geforce.com", "www.intel.com"]
  },

Hosts. A manifest names 1 to 20 hosts. Each is a full name in lower case: no wildcard, no port, no IP address, no bare name such as localhost. A name counts exactly as written: api.example.org opens neither example.org nor eu.api.example.org. The owner reads the list before enabling the plugin, and the signature covers it like the rest of the file.

A request is one GET over https to one of these hosts. A plugin cannot add headers, a body or cookies: the address is all it sends. The server asks under its own name (the user agent SquorliBot) and from its own address. It refuses every address that leads into a private network or back to itself, also when a named host resolves there.

The answer resolves the promise with { url, contentType, text }: the address the answer came from, its content type and its body read as UTF-8. Parse it yourself, for example with JSON.parse(text):

game-news.ts
async function getJson(url: string): Promise<unknown> {
  return JSON.parse((await squorli.net.get(url)).text) as unknown;
}

For everything else the promise is rejected with an Error: the host does not answer with status 200 within 5 seconds, the answer is neither text nor JSON nor XML, it is larger than 512 KB, or a redirect leads to a host the manifest does not name (redirects among the named hosts are followed). The message lists these reasons; the server does not say which one it was.

What follows from that for your code:

  • Catch the error. A source that is down must not fail the handler; repeated failures suspend the plugin.
  • One request per event. An event has 10 seconds in all, and a single request may take 5 of them. The game news plugin therefore asks one source per scheduled job and schedules the next job a few seconds later; that also keeps it below the 30 requests a minute a plugin may make.
  • Remember what you posted. Keep the source’s own ids in squorli.storage, so that a restart or a job that comes twice posts nothing twice.
  • Treat every answer as text a stranger wrote. A headline from outside must not become a mention, a link or formatting in your channel. The game news plugin removes angle brackets and addresses and escapes Markdown’s characters before it writes a message.
  • Keep members’ data out of addresses. Whatever stands in an address reaches the host. A plugin that puts names, ids or message texts there gets no signature, unless that is its declared purpose.

Links in the messages of a plugin that holds net.fetch get a link preview. The whole example is in the plugin repository.

TypeScript

The server takes a file that ends in .ts as well. At installation it removes the types and does not check them; checking is the job of tsc on your machine. Lines and columns stay where they were: an error in the log points into your source file. The server uses the function of Node.js that removes types for this; Node.js still lists it as experimental.

The server takes only what can be removed without rewriting code. Refused at installation are enum, a namespace with values and parameter properties in a constructor. If you need those, or code from npm, bundle your plugin into a single .js file first.

The types of the interface are in one file: index.d.ts. It is not on npm. Copy it next to your plugin and name both in a tsconfig.json:

tsconfig.json
{
  "compilerOptions": {
    "target": "es2023",
    "lib": ["es2023"],
    "types": [],
    "strict": true,
    "erasableSyntaxOnly": true,
    "noEmit": true
  },
  "files": ["index.d.ts", "my-plugin.ts"]
}

squorli and the namespace Squorli are global then; nothing is imported. erasableSyntaxOnly reports on your machine already what the server would refuse. The plugin that ships with the server is written this way.

Limits and failures

Every plugin runs with fixed budgets. Those with a variable in brackets can be changed by the server’s operator; the number is the default.

LimitValueWhat happens then
CPU time of one event200 ms (PLUGIN_CPU_MS)The event fails. The next event gets a fresh sandbox.
Duration of one event in all, calls to the server included10 sThe event fails.
Calls of the server’s functions in one event50Every further call is refused with an error. Log lines count here too.
Memory of the sandbox32 MB (PLUGIN_MEMORY_MB)The event fails. The next event gets a fresh sandbox.
Size of one argument and of one answer as JSON64 KBThe call is refused with an error. The answer of net.get() has a limit of its own, below.
Events waiting for one plugin100Further events are dropped.
Calls per minute300The call is refused with an error until the minute is over. Log lines do not count here.
Role changes per minute60As above.
Messages per minute (sending and editing)20As above.
Writes to the storage per minute120As above.
Log lines per minute60Further lines are dropped without an error.
Requests to the network per minute30The call is refused with an error until the minute is over.
One answer of net.get()512 KB, 5 sThe call is refused with an error.
Hosts a manifest names20The plugin is not installed.
Storage of one plugin5 MB (PLUGIN_STORAGE_MB), 10,000 keysstorage.set() is refused with an error.
Waiting jobs1,000schedule.at() is refused with an error.
Log of one plugin2,000 lines, 30 daysOlder lines are deleted.
Installed plugins per server20 (PLUGIN_MAX)A further plugin is not installed.

Further limits are listed with each function and with the manifest.

What a failure is. An event fails when its handler throws an error nobody catches, when it exceeds its budget of CPU time, duration or memory, or when the plugin does not even start. The server then writes a line with the reason into the plugin’s log. A refused call your code catches is no failure.

Five failures within ten minutes suspend the plugin: it gets no more events, and its commands and entries in the member menu disappear from the app. An owner starts it again; installing a new version lifts the suspension as well. The other plugins and the server keep running meanwhile.

Reading the log. The log is on the plugin’s page in Administration and on the server under squorli plugin log <id>. It holds what your code writes with squorli.log or console.log, and what the server notes itself: installed, enabled and switched off and by whom, every role given and taken, every failure with the line in the source.

Versions

apiVersion in the manifest names the version of the interface a plugin is written for. Today there are the versions 1 and 2; a server from release 0.15.0 on runs both.

  • Version 2 added the network (the capability net.fetch, network in the manifest and squorli.net.get()), for settings the field type list and the event settings.check, and cards for messages. Everything else is the same in both versions. Name version 2 only when your plugin uses one of them: a plugin of version 1 also runs on servers from release 0.14.0 on, the first with plugins.
  • Within a version, things are only added. New events, functions, field types or capabilities change nothing for a plugin that does not use them. A change that would break existing plugins would get a new version number.
  • A plugin for a later version than the server offers is not installed; the message names both versions and advises updating the server.
  • When a plugin is installed and the server is set back to an older release that does not know its version, it stays installed but does not run.

version is the version of your plugin. An update is the same installation once more: a file with the same id. The settings that still fit, the storage and the scheduled jobs stay, and an enabled plugin gets the event enable with reason: "updated".

Not part of the interface are events from voice channels and a field type for lists.

Signed plugins: submitting a plugin

A plugin file can carry Squorli’s signature. A plugin that asks for the network needs it; every other plugin is installed without one, as before, and may carry one.

What the signature is. One more comment, as the last line of the file:

my-plugin.js · end of a signed file
// ... the plugin's code ...

/* squorli-signature {"v":1,"key":"2026-11","kind":"reviewed","sig":"<88 characters>"} */

It is made with Squorli’s plugin key (Ed25519), a key of its own and not the one that signs the server’s releases. Its public half is built into every server from release 0.15.0 on, so a server checks a signature by itself, at installation and again at every start, and asks nobody. The signature covers the whole file apart from that last comment: the manifest with its capabilities, hosts, author and version, and every line of code. Change one character and it no longer holds; line endings alone do not count. A file whose signature does not hold is not installed, whatever it asks for.

Two kinds. official is a plugin Squorli wrote itself, such as game news. reviewed is somebody else’s plugin that Squorli read before signing it. Administration shows the mark “From Squorli” or “Reviewed by Squorli” on the plugin; an app from before these marks shows none, and everything else works there.

What “reviewed” says, and what it does not. Somebody at Squorli read this version of the file: which hosts it asks and what for, what it does with what it learns on a server, and whether its code can be read at all. That is no promise that the plugin is free of faults, and no warranty; Squorli does not maintain the plugin, and its author stays responsible for it. The decision stays the owner’s: the confirmation still lists what the plugin may do, and the plugin is still one file anybody can read.

Submitting a plugin

A plugin is submitted as a pull request to the repository squorli-plugins on GitHub:

  • A folder plugins/<id>/ with the plugin file, unsigned, a README.md that says what the plugin does and what it needs each host for, and a test (<id>.test.ts): it runs the plugin in the server’s real sandbox and plays its sources instead of asking them. A submission without a test is refused; the test of game news is the model.
  • The file as you wrote it: not bundled, not minified, and no code that is built from text at run time.
  • An open-source licence, named in the file with a line // SPDX-License-Identifier: …. The repository’s README lists the licences it takes.
  • No data of members and no message texts in addresses, unless that is the plugin’s declared purpose.
  • One plugin per pull request.

The repository’s REVIEW.md lists what is looked at. Every pull request is checked with the server’s own code first: the manifest, and whether the file compiles in the sandbox. Then somebody at Squorli reads the plugin and may ask for changes. There is no claim to a signature and no deadline. Once the pull request is merged, the file is signed. The signed file is published as a release of that repository and listed in the plugin catalogue; an owner downloads it there and installs it like any other plugin.

Updates. A signature belongs to one version of one file. Every update is a new pull request and gets a new signature; what is read then is the difference to the version that was signed last. A server fetches no updates by itself: an owner installs the new file.

Trying it out before it is signed. No server installs an unsigned plugin that asks for the network. Try yours on a server of your own without the part that fetches, or run it against sources your own test plays: the test of the game news plugin in the repository squorli-plugins shows how: it runs in the server’s real sandbox, and node tools/test.mjs there runs it with a checkout of the server.

What the server answers

When a file is not installed because of its signature, the message carries one of these codes. A plugin that is installed already and meets one of them later does not run; Administration shows it as suspended, with the reason.

CodeMeaning
plugin_signature_requiredThe plugin asks for the network, and the file carries no signature this server takes.
plugin_signature_invalidThe file was changed after it was signed, the comment at its end cannot be read, or it was signed with a key this server does not know.
plugin_signature_revokedSquorli took its signature of this version back.
plugin_net_offThe operator switched the network off for plugins (PLUGIN_NET=false).

Taking a signature back. When a signed plugin turns out to do harm, Squorli takes its signature of that version back. The list of such versions travels with the server’s releases: a server learns of it with its next update. From then on it no longer installs that version, and an installed one stops running. The limit of this: until that update the plugin keeps running, and a server that is never updated never learns of it, because a server asks nobody whether a signature still stands. If you no longer trust a plugin, switch it off yourself.

Security in plain words

What the sandbox is. Every plugin runs in a JavaScript engine of its own (QuickJS, compiled to WebAssembly) in a thread of its own, with a memory that cannot grow beyond its limit. That engine knows the language and the functions listed above, nothing else: no access to files, the network, the database or the server’s configuration. Every call passes through a single place in the server that checks capability, scope and limits; a request to the internet is such a call too, made by the server and not by the sandbox. A plugin that hangs is stopped without touching the others.

What a plugin can never do, whatever its manifest asks for: give a role with administrator rights or the default role, reach a role or a channel outside its scope, read files or direct messages, read another plugin’s storage, run code in a member’s app, open a connection to the network by itself, or get the server to ask a host its manifest does not name.

What a plugin with the network can do. Read from the hosts its manifest names: over https, one GET at a time. It cannot reach your home network or the server itself, cannot send a body, a header or a cookie, and cannot be sent on to another host by a redirect. What does leave your server is the address it asks, to the host it asks, from your server’s IP address. An address can carry data: a plugin that reads messages and may also fetch could write what it read into an address. That is why the server takes this capability only with Squorli’s signature, and it is the first thing a review looks for.

What still matters. A sandbox limits what a plugin can reach. It does not judge what the plugin does with what it is allowed. A plugin with messages.read reads every message of the chosen channels and can keep them in its storage; one with roles.manage gives the chosen roles whenever its code decides to. So, as an owner, read what a plugin asks for before you enable it, keep the scope small and read the code: it is a single file. Most plugin files carry no signature: nobody but you has looked at them. Administration shows the SHA-256 checksum of the installed file, so that you can compare it with the file you examined, and the mark of a signed one. A signature says that Squorli read that version; it does not replace your own look at what the plugin asks for. And a sandbox is software too: what was checked about it and what was not is at the top of this page.

The operator has the last word. The variable PLUGINS in the server’s .env sets who may install plugins: owner (the default) lets owners upload in Administration and the operator use the command squorli plugin, operator allows the command only, and off switches plugins off altogether. PLUGIN_NET=false keeps every plugin away from the internet: one that asks for the network is then not installed, and one that is installed does not run. The installation guide names the variables for the budgets.

Open original file