mirror of
https://github.com/m1k1o/neko.git
synced 2025-04-29 18:36:22 +02:00
add plugins.
This commit is contained in:
parent
8c6a800b57
commit
0ea50d4c9f
1 changed files with 70 additions and 0 deletions
70
webpage/docs/getting-started/configuration/plugins.md
Normal file
70
webpage/docs/getting-started/configuration/plugins.md
Normal file
|
@ -0,0 +1,70 @@
|
|||
---
|
||||
sidebar_position: 5
|
||||
description: Configuration related to the Neko plugins.
|
||||
---
|
||||
|
||||
# Plugins Configuration
|
||||
|
||||
Neko allows you to extend its functionality by using [plugins](https://pkg.go.dev/plugin). 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 title="config.yaml"
|
||||
plugins:
|
||||
enabled: true
|
||||
required: true
|
||||
dir: "./bin/plugins"
|
||||
```
|
||||
|
||||
- `enabled` enables the plugin support. If set to `false`, 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.
|
||||
|
||||
:::danger
|
||||
External plugins are experimental and may not work as expected. They will be replaced with [hashicorp/go-plugin](https://github.com/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 title="config.yaml"
|
||||
chat:
|
||||
enabled: true
|
||||
```
|
||||
|
||||
The chat plugin extends user profile and room settings by adding the following fields:
|
||||
|
||||
```yaml
|
||||
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 title="config.yaml"
|
||||
filetransfer:
|
||||
enabled: true
|
||||
dir: "./uploads"
|
||||
refresh_interval: 30s
|
||||
```
|
||||
|
||||
- `enabled` enables the file transfer support. If set to `false`, 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:
|
||||
|
||||
```yaml
|
||||
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.
|
||||
|
Loading…
Add table
Reference in a new issue