Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhooks #53

Closed
neben opened this issue Aug 2, 2022 · 7 comments
Closed

Webhooks #53

neben opened this issue Aug 2, 2022 · 7 comments

Comments

@neben
Copy link

neben commented Aug 2, 2022

I really like that you've added webhook support. There are two things that make it unnecessarily difficult to use, however:

  1. The suffix rssh_webhook is added to the webhook. This is a problem, as, e.g., Slack and Mattermost generate webhooks to use, and they don't expect that the generated webhook is appended with a suffix (and therefore break). Can this be removed?
  2. Slack (and Mattermost, which is similar) expect the main text message to be transmitted in the text key/value of the payload. It would be great if this key could be added to contain a summary of the event. This would allow users to directly display events in Slack/Mattermost without requiring further ingress processing. It could also be a switch that can be set while adding a webhook.
@NHAS
Copy link
Owner

NHAS commented Aug 2, 2022

Hello!
These are great suggestions, I personally dont use slack or mattermost myself and just use it to feed a small program that I myself wrote.

@NHAS
Copy link
Owner

NHAS commented Aug 2, 2022

Sweet as, I have a new implementation on the unstable branch, please play around with it, if it suits your needs then I'll merge it to master

@neben
Copy link
Author

neben commented Aug 3, 2022

Really nice! Works out of the box :)

image

@neben
Copy link
Author

neben commented Aug 3, 2022

I'd have one last request for this feature: Could you make the webhook configurable via the startup parameter of the server binary? That would allow me to persistently activate the webhook on startup. Maybe something like this:

./server --webhook https://my.server/my.hook 0.0.0.0:3232

Also, might be nice if more than one webhook could be set, as is currently possible via the CLI.

@NHAS
Copy link
Owner

NHAS commented Aug 3, 2022

Great! Glad to see that it just works (tm)

I think being able to specify webhooks via the command line is reasonable, so I'll add that

@NHAS
Copy link
Owner

NHAS commented Aug 3, 2022

Ah! Actually this feature already exists, and is just very poorly documented.

When you activate a webhook, the server will write config.json to its working directory, so that the webhooks will persist across reboot/program restart.

config.json format:

Map of strings to bool. The bool indicates whether the rssh server should check if the TLS certificate is valid or not.

Example:

{"http://localhost:8111/noot/noot":true}

@NHAS
Copy link
Owner

NHAS commented Aug 3, 2022

Hope this helps! Im going to close this comment as the feature already vaguely exists. If you feel Im missed some nuance of what you were asking feel free to reopen it.

@NHAS NHAS closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants