Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Basavaraju-G/gosmee

 
 

Repository files navigation

gosmee - smee.io go client

A command line client for Smee’s webhook payload delivery service in GO.

Description

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.

Screenshot

Screenshot

Install

Release

Go to the release page and choose your archive or package for your platform.

Homebrew

brew tap chmouel/gosmee https://github.com/chmouel/gosmee
brew install gosmee
yay -S gosmee-bin
docker run ghcr.io/chmouel/gosmee:latest

GO

go install -v github.com/chmouel/gosmee@latest

Git

Checkout the directory and use :

-$ make build
-$ ./bin/gosmee --help

System Services

System Service example file for macOS and Linux is available in the misc directory.

Shell completion

Shell completion is available with:

# BASH
source <(gosmee completion bash)

# ZSH
source <(gosmee completion zsh)

Usage

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:8080

this 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:8080

What 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.

Kubernetes

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 :

http://service.namespace:8080

Thanks

  • 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.

Copyright

Apache-2.0

Authors

Chmouel Boudjnah <@chmouel>

About

Command line client for https://smee.io/ webhook payload delivery service in GO.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Go 67.5%
  • Ruby 12.6%
  • Shell 9.5%
  • Makefile 7.0%
  • Dockerfile 3.4%