A command line client for Smee’s webhook payload delivery service in GO.
Replay message from https://smee.io/ to a target host. Allowing you to easily expose a local dev service to the internet to be consumed by webhooks.
Go to the release page and choose your archive or package for your platform.
brew tap chmouel/gosmee https://github.com/chmouel/gosmee
brew install gosmeeyay -S gosmee-bindocker run ghcr.io/chmouel/gosmee:latestgo install -v github.com/chmouel/gosmee@latestCheckout the directory and use :
-$ make build
-$ ./bin/gosmee --helpSystem Service example file for macOS and Linux is available in the misc directory.
Shell completion is available with:
# BASH
source <(gosmee completion bash)
# ZSH
source <(gosmee completion zsh)You first may want to generate your own smee URL by going to https://smee.io/new
When you have it the basic usage is the folllowing :
gosmee https://smee.io/aBcDeF https://localhost:8080this will replay all payload comingto to the smee URL on a service running on http://localhost:8080
Another option is to be able to save all the replay as a handy shell script :
gosmee --saveDir /tmp/savedreplay https://smee.io/aBcDeF https://localhost:8080What this will do is when you have a new payload comming to your smee URL, gosmee will save the json to
/tmp/savedreplay/timestamp.json and generate a shell script with curl options to
/tmp/savedreplay/timestamp.sh. You then can simply replay the webhook at ease by
launching the shell script again and again..
You can ignore some events (if we detect it from Gitlab/GitHub/Bitbucket) if you add one or multiple --ignore-event flags.
You can add --noReplay if you only want the saving and not replaying.
You will have a pretty colored emoji unless you specify --nocolor as argument.
You can expose an internal kubernetes via gosmee :
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gosmee
namespace: gitea
spec:
replicas: 1
selector:
matchLabels:
app: gosmee
template:
metadata:
labels:
app: gosmee
spec:
containers:
- image: ghcr.io/chmouel/gosmee:latest
imagePullPolicy: IfNotPresent
name: gosmee
args:
[
"--saveDir",
"/tmp/save",
"https://yousmee.url",
"http://deployment.name.namespace.name:PORT_OF_SERVICE",
]the http://deployment.name.namespace.name:PORT_OF_SERVICE url is the url of your internal deployment running on your cluster, for example :
- Most of the works is done by the go-sse library.
- Used previously pysmee but it seems that the underlying sse library is broken with chunked transfer.
Chmouel Boudjnah <@chmouel>