https://github.com/seabird-chat/seabird-plugin-bundle
https://github.com/seabird-chat/seabird-plugin-bundle
grpc rust seabird-plugin
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/seabird-chat/seabird-plugin-bundle
- Owner: seabird-chat
- License: mit
- Created: 2019-11-20T09:05:38.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-08-17T01:25:00.000Z (8 months ago)
- Last Synced: 2025-08-17T03:23:03.370Z (8 months ago)
- Topics: grpc, rust, seabird-plugin
- Language: Rust
- Size: 475 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# seabird-plugin-bundle
## Requirements
- Rust 1.42
- Postgres
- Protobuf
## Settings
Settings can either be included as a part of the environment or in a .env file.
- `SEABIRD_HOST`
- `SEABIRD_TOKEN`
- `DATABASE_URL` - connection string for the database - can either be in connection string or url format
- `SEABIRD_ENABLED_PLUGINS` - comma-separated list of enabled plugins - if this is empty, all plugins will be loaded
- `SEABIRD_DISABLED_PLUGINS` - comma-separated list of plugins that should not be enabled
- `DARKSKY_API_KEY` - needed for forecast/weather support
- `OPENWEATHERMAP_API_KEY` - needed for forecast/weather support
## Writing a new plugin
Unfortunately, writing a new plugin requires a few steps.
1. You must pick a unique name for your plugin. See `supported_plugins` in `src/plugin.rs` `load()` for the list of all existing plugin names.
2. You must create a new file in `src/plugins` that adheres to the `Plugin` async trait. See existing plugins in `src/plugins` for reference.
3. You must add your plugin to `src/plugins/mod.rs`. See existing entries in the file for reference.
4. You must add your unique plugin name to the `supported_plugins` `Vec` from step one.
5. You must load your plugin in `src/plugin.rs` `load()`. See existing entries for reference.
## Building
```
cargo build
```
`seabird-plugin-bundle` will read `DATABASE_URL` at compile time to typecheck queries. If you see errors like `relation "karma" does not exist`, that means that migrations have had issues. The recommended fix is the following:
```
$ cargo install sqlx-cli
$ sqlx migrate run
```
Builds should succeed after this.