Crates.io | pass-it-on |
lib.rs | pass-it-on |
version | 0.16.3 |
source | src |
created_at | 2023-06-10 02:18:49.818522 |
updated_at | 2024-11-25 05:58:24.832108 |
description | A library that provides a simple notification client and server that receives messages and passes them on to endpoints |
homepage | https://github.com/kwheelans/pass-it-on |
repository | https://github.com/kwheelans/pass-it-on |
max_upload_size | |
id | 886668 |
size | 271,189 |
A library that provides a simple notification client and server that receives messages and passes them on to endpoints.
This library was designed to enable the creation of processes that handle the business of when and what notification should be sent and then pass those notifications to the pass-it-on client which handles sending it across the configured interface to the pass-it-on server where the endpoints are configured. The idea is to allow a single instance of the server to handle messages from many clients which may or may not be going to the same endpoint.
Which notifications are go to a particular endpoint can be controlled by adding a notification name notifications
field in the server configuration
that matches the notification name that is used in the ClientReadyMessage
by the client.
Endpoint
EndpointConfig
Interfaces can be used for both the server and the client.
Interface | Description |
---|---|
Http | Communication between the client and server using the Http/Https protocol. |
Pipe | Communication between the client and server using a FIFO Named Pipe. (Unix Only) |
Endpoints are the destinations for notifications received by the server.
Endpoint | Description |
---|---|
Regular File | Write notifications to a file. |
Matrix | Send notifications to Matrix room(s). |
Discord Webhook | Send notifications to Discord via a webhook. |
Send notifications via SMTP email. |
The Server and Client support configuration via a TOML file. At least one interface must be setup for a Client and at least one interface and endpoint must be setup for the Server.
[server]
key = "sdfsf4633ghf44dfhdfhQdhdfhewaasg"
[[server.interface]]
type = "pipe"
path = '/path/to/pipe.fifo'
group_read_permission = true
[[server.interface]]
type = "http"
host = "192.168.1.2"
port = 8080
[[server.endpoint]]
type = "matrix"
home_server = "example.com"
username = "test1"
password = "pass"
session_store_path = '/path/to/session/store/matrix_store'
recovery_passphrase = "recover123"
[[server.endpoint.room]]
room = "!dfsdfsdf:example.com"
notifications = ["notification_id1", "notification_id2"]
[[server.endpoint.room]]
room = "#matrix-room:example.com"
notifications = ["notification_id4"]
[[server.endpoint]]
type = "file"
path = '/test_data/file_endpoint.txt'
notifications = ["notification_id1", "notification_id3"]
[[server.endpoint]]
type = "discord"
url = "https://discord.com/api/webhooks/webhook_id/webhook_token"
notifications = ["notification_id1", "notification_id3"]
[server.endpoint.allowed_mentions]
parse = ["everyone"]
[[server.endpoint]]
type = "email"
hostname = "smtp.example.com"
port = 587
username = "test_user"
password = "test_password"
implicit_tls = false
allow_invalid_certs = false
from = "asdf@example.com"
to = ["qwerty@example.com"]
subject = "test_email"
notifications = ["notification1", "notification2"]
[client]
key = "sdfsf4633ghf44dfhdfhQdhdfhewaasg"
[[client.interface]]
type = "pipe"
path = '/path/to/pipe.fifo'
group_read_permission = true
group_write_permission = true
[[client.interface]]
type = "http"
host = "192.168.1.2"
port = 8080
Feature | Description |
---|---|
client | Enables the client but not any particular interface. |
discord | Enables the discord webhook endpoint. |
Enables the email endpoint. | |
endpoints | Enables the Endpoint and EndpointConfig traits. |
file | Enables the regular file endpoint. |
http | Enables the Http interface client and server. |
http-client | Enables the Http interface for just the client. |
http-server | Enables the Http interface for just the server. |
interfaces | Enables the Interface and InterfaceConfig traits. |
matrix | Enables the matrix endpoint. |
parse-cfg | Enables parsing of client or server configurations from TOML when those features are also enabled. |
pipe | Enables the named pipe interface client and server. (Unix only) |
pipe-client | Enables the named pipe interface client. (Unix only) |
pipe-server | Enables the named pipe interface server. (Unix only) |
server | Enables the server but not any particular interface or endpoint. |
server-bin-full | Enables the building of the provided pass-it-on-server binary with all available interfaces and endpoints |
server-bin-minimal | Enables the building of the provided pass-it-on-server binary while not requiring any specific interface or endpoint |
rustls-tls-native-roots | Enables rustls-tls-native-roots for reqwest. |