Sharkord
Plugins

Installation

Install a plugin on your Sharkord server.

Security warning

Plugins run with full access to your server and to every user's browser. Read Security first.

Enable Plugins First

Plugins are off by default. Turn the plugin system on in the server settings. Until you do, nothing is loaded and the marketplace is unavailable.

You need the MANAGE_PLUGINS permission to install and toggle plugins, and users need USE_PLUGINS to run their commands and actions.

From the Marketplace

The marketplace is built into the interface. Browse it in the server settings, pick a plugin, and install. Sharkord downloads the release, verifies it against the checksum in the registry, and unpacks it into your data directory.

See Marketplace for what the listings mean and how to publish your own.

Manually

  1. Open your data directory.
  2. Create a plugins folder if it does not exist.
  3. Copy the built plugin folder (dist/<plugin-id> from the build) into it.
  4. Open Plugins in the server settings. The folder is scanned live, so it shows up without a restart.
  5. Enable it.

The result should look like this:

~/.config/sharkord/plugins/
  my-plugin/
    manifest.json
    server/index.js
    client/index.js

The folder name has to match the id in manifest.json, and all three files must be present, even for a plugin with no interface.

The Plugin's Page

Selecting a plugin in the server settings opens its own page, with its name, version, author, homepage, and the reason it failed to load if it did. Below that:

TabWhat it is
SettingsThe options the plugin registered, if any. See Settings.
CommandsIts slash commands, runnable from here as well as from chat.
LogsWhat the plugin logged, including why it failed to load.
PermissionsWhich roles may use each command, action and UI slot. Needs MANAGE_PLUGIN_PERMISSIONS.

A plugin can also add tabs of its own, which appear after those. A plugin with nothing but logs gets no tabs at all.

Where a Plugin Keeps Its Data

Two directories, side by side in the data directory:

DirectoryContents
plugins/<plugin-id>/The plugin itself. Deleted and rewritten on every update.
plugin-data/<plugin-id>/Whatever the plugin wrote. Survives updates, deleted with the plugin.

Settings, per-user data, capability rules and the version on record live in the database, and are removed with the plugin. Files a plugin attached to messages are not: they belong to the message, and show up under Uninstalled in the Storage tab until those messages go.

Updating and Removing

Marketplace plugins can be updated and removed from the same screen. Sharkord unloads the plugin, replaces the files, and loads it again. If the version changed and the plugin ships an onUpgrade, that runs first; a failed upgrade stops the load and is retried next time rather than leaving a half-migrated plugin running.

For manual installs, replace the folder's contents and toggle the plugin off and on.

Removing a plugin's folder from disk while the server is running is noticed within a couple of seconds: Sharkord unloads it and treats it as uninstalled.

If It Does Not Load

Each plugin has a log view in the server settings, and load failures are recorded there with the reason. See Troubleshooting for the common causes.

On this page