Plugins Configuration
Neko allows you to extend its functionality by using plugins. Go plugins come with a lot of benefits as well as some limitations. The main advantage is that you can extend the functionality of the application without recompiling the main application. But the main limitation is that you need to use the same Go version and all dependencies with the same version as the main application.
- YAML Configuration File
- Environment Variables
- Command Line Arguments
NEKO_PLUGINS_ENABLED=false
NEKO_PLUGINS_REQUIRED=false
NEKO_PLUGINS_DIR="./bin/plugins"
--plugins.enabled false
--plugins.required false
--plugins.dir "./bin/plugins"
plugins:
enabled: false
required: false
dir: "./bin/plugins"
enabled
enables the plugin support. If set tofalse
, the plugins are not loaded.required
makes the plugin loading mandatory, meaning that if a plugin fails to load, the application will not start.dir
refers to the directory where the plugins are stored.
External plugins are experimental and may not work as expected. They will be replaced with hashicorp/go-plugin in the future.
There exist a few pre-loaded internal plugins that are shipped with Neko:
Chat Plugin
The chat plugin is a simple pre-loaded internal plugin that allows you to chat with other users in the same session. The chat messages are sent to the server and then broadcasted to all users in the same session.
- YAML Configuration File
- Environment Variables
- Command Line Arguments
NEKO_CHAT_ENABLED=true
--chat.enabled true
chat:
enabled: true
enabled
enables the chat support. If set tofalse
, the chat is disabled.
The chat plugin extends user profile and room settings by adding the following fields:
plugins:
chat.can_send: true
chat.can_receive: true
chat.can_send
in the room settings context controls whether the chat messages can be sent by any user in the room, and in the user's profile context controls whether the user can send chat messages.chat.can_receive
in the room settings context controls whether the chat messages can be received by any user in the room, and in the user's profile context controls whether the user can receive chat messages.
File Transfer Plugin
The file transfer plugin is a simple pre-loaded internal plugin that allows you to transfer files between the client and the server. The files are uploaded to the server and then downloaded by the client.
- YAML Configuration File
- Environment Variables
- Command Line Arguments
NEKO_FILETRANSFER_ENABLED=true
NEKO_FILETRANSFER_DIR="./uploads"
NEKO_FILETRANSFER_REFRESH_INTERVAL="30s"
--filetransfer.enabled true
--filetransfer.dir "./uploads"
--filetransfer.refresh_interval "30s"
filetransfer:
enabled: true
dir: "./uploads"
refresh_interval: "30s"
enabled
enables the file transfer support. If set tofalse
, the file transfer is disabled.dir
refers to the directory where the files are stored.refresh_interval
refers to the interval at which the file list is refreshed.
The file transfer plugin extends user profile and room settings by adding the following fields:
plugins:
filetransfer.enabled: true
filetransfer.enabled
in the room settings context controls whether the file transfer is enabled for any user in the room, and in the user's profile context controls whether the user can transfer files.