Skip to content

Commit

Permalink
Releasing workflow, dockerfile and Readme files aupdated
Browse files Browse the repository at this point in the history
  • Loading branch information
tarampampam committed Nov 15, 2022
1 parent 8e74f7e commit 5b92880
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 48 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: documentation

on:
push:
branches: [master, main]
paths: ['README.md']

jobs:
docker-hub-description:
name: Docker Hub Description
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3

- uses: peter-evans/dockerhub-description@v3 # Action page: <https://github.com/peter-evans/dockerhub-description>
with:
username: ${{ secrets.DOCKER_LOGIN }}
password: ${{ secrets.DOCKER_USER_PASSWORD }}
repository: tarampampam/webhook-tester
15 changes: 6 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,20 @@ jobs:
matrix:
os: [linux, windows, darwin]
arch: [amd64]
include:
- {os: linux, arch: 386}
- {os: windows, arch: 386}
steps:
- uses: actions/checkout@v3

- uses: gacts/setup-node-with-cache@v1
with: {node-version: 1.19}
with: {node-version: 19}

- run: npm ci --no-audit

- run: npm run generate
- run: npm ci --no-audit && npm run generate
working-directory: ./web

- run: npm run build
working-directory: ./web

- uses: gacts/setup-go-with-cache@v1
with: {go-version: 19}
with: {go-version: 1.19}

- run: |
go install "github.com/deepmap/oapi-codegen/cmd/[email protected]"
Expand Down Expand Up @@ -83,7 +80,7 @@ jobs:
with:
context: .
push: true
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v6,linux/arm/v7
platforms: linux/amd64,linux/arm64
build-args: "APP_VERSION=${{ steps.slug.outputs.version }}"
tags: |
tarampampam/webhook-tester:${{ steps.slug.outputs.version }}
Expand Down
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].

## UNRELEASED
## v1.0.0

### Added

Expand All @@ -22,9 +22,6 @@ The format is based on [Keep a Changelog][keepachangelog] and this project adher
- E2E tests now use the hurl instead of postman/newman
- CLI global flags now should be defined before the sub-command (`./app serve --log-json ...` &rarr; `./app --log-json serve ...`)

[#149]:https://github.com/tarampampam/webhook-tester/issues/149
[#160]:https://github.com/tarampampam/webhook-tester/issues/160

### Removed

- `--public` flag (and env variable `PUBLIC_DIR`) support for `serve` sub-command
Expand All @@ -33,6 +30,9 @@ The format is based on [Keep a Changelog][keepachangelog] and this project adher

- A lot of small frontend issues

[#149]:https://github.com/tarampampam/webhook-tester/issues/149
[#160]:https://github.com/tarampampam/webhook-tester/issues/160

## v0.4.3

### Changed
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ RUN set -x \
&& npm run build

# Image page: <https://hub.docker.com/_/golang>
FROM golang:1.19-buster as builder
FROM golang:1.19-alpine as builder

# can be passed with any prefix (like `v1.2.3@GITHASH`)
# e.g.: `docker build --build-arg "APP_VERSION=v1.2.3@GITHASH" .`
Expand All @@ -34,7 +34,8 @@ ENV OAPI_CODEGEN_VERSION="1.12.2"

RUN set -x \
# Install `oapi-codegen`: <https://github.com/deepmap/oapi-codegen>
&& GOBIN=/bin go install "github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v${OAPI_CODEGEN_VERSION}"
&& GOBIN=/bin go install "github.com/deepmap/oapi-codegen/cmd/oapi-codegen@v${OAPI_CODEGEN_VERSION}" \
&& apk add --no-cache gcc musl-dev

COPY . /src

Expand Down
82 changes: 49 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
This application allows you to test and debug Webhooks and HTTP requests using unique (random) URLs. You can customize the response code, `content-type` HTTP header, response content and set some delay for the HTTP responses. The main idea is viewed [here](https://github.com/fredsted/webhook.site).

<p align="center">
<img src="/assets/app-animated.png?raw=true" alt="screenshot" width="925" />
<img src="https://user-images.githubusercontent.com/7326800/201918441-ec70a826-48dc-4bb0-af27-d194ea89a4ad.gif" alt="screencast" />
</p>

This application is written in GoLang and works very fast. It comes with a tiny UI (written in `Vue.js`), which is built in the binary file, so you don't need any additional assets for the application using. Websockets are also used for incoming webhook notifications in the UI - you don't need any 3rd party solutions (like `pusher.com`) for this!

### :fire: Features list
### 🔥 Features list

- Liveness/readiness probes (routes `/live` and `/ready` respectively)
- Can be started without any 3rd party dependencies
Expand All @@ -38,23 +38,53 @@ This application is written in GoLang and works very fast. It comes with a tiny
- Free and open-source
- Ready to scale

### Storage
## 📷 Screenshots

| Dashboard | Request details | Help screen | Session options |
|:---------------------:|:------------------------:|:---------------------:|:----------------------------:|
| [![dash][scr1]][scr1] | [![request][scr2]][scr2] | [![help][scr3]][scr3] | [![new-session][scr4]][scr4] |

[scr1]:https://user-images.githubusercontent.com/7326800/201884152-7df553d8-c2aa-4e8e-9657-602ba07c1d9a.png
[scr2]:https://user-images.githubusercontent.com/7326800/201884148-af541ccc-83d7-41ae-b639-9f4d9f2d7ed3.png
[scr3]:https://user-images.githubusercontent.com/7326800/201884143-80c5dcaf-4540-460e-92f5-b5e640614b1e.png
[scr4]:https://user-images.githubusercontent.com/7326800/201884129-0ebece4b-dd1e-455c-aacc-8dc4a42fef7d.png

### 🗃 Storage

At the moment 2 types of data storage are supported - **memory** and **redis server** (flag `--storage-driver`).

The **memory** driver is useful for fast local debugging when recorded requests will not be needed after the app stops. The **Redis driver**, on the contrary, stores all the data on the redis server, and the data will not be lost after the app restarts. When running multiple app instances (behind the load balancer), it is also necessary to use the redis driver.

### Pub/sub
### 📢 Pub/sub

Publishing/subscribing are used to send notifications using WebSockets, and it also supports 2 types of driver - **memory** and **redis server** (flag `--pubsub-driver`).

For multiple app instances redis driver must be used.

## Installing
## 🧩 Installation

Download the latest binary file for your arch (to run on macOS use the `linux/arm64` platform) from the [releases page][link_releases]. For example, let's install it on **amd64** arch (e.g.: Debian, Ubuntu, etc):

```shell
$ curl -SsL -o ./webhook-tester https://github.com/tarampampam/webhook-tester/releases/latest/download/webhook-tester-linux-amd64
$ chmod +x ./webhook-tester

# optionally, install the binary file globally:
$ sudo install -g root -o root -t /usr/local/bin -v ./webhook-tester
$ rm ./webhook-tester
$ webhook-tester --help
```

Additionally, you can use our docker image:

| Registry | Image |
|----------------------------------------|--------------------------------------|
| [GitHub Container Registry][link_ghcr] | `ghcr.io/tarampampam/webhook-tester` |
| [Docker Hub][link_docker_hub] | `tarampampam/webhook-tester` |

Download the latest binary file for your os/arch from the [releases page][link_releases] or use our [docker image][link_ghcr] ([hub.docker.com][link_docker_hub]).
> Using the `latest` tag for the docker image is highly discouraged because of possible backward-incompatible changes during **major** upgrades. Please, use tags in `X.Y.Z` format
## Usage
## Usage

This application supports the following sub-commands:

Expand All @@ -72,7 +102,7 @@ And global flags:
| `--debug` | Debug output |
| `--log-json` | Logs in JSON format |

### HTTP server starting
### 🖥 HTTP server starting

`serve` sub-command allows to use next flags:

Expand All @@ -96,37 +126,29 @@ And global flags:
Server starting command example:

```shell
$ ./webhook-tester serve \
--port 8080
--storage-driver redis
--pubsub-driver redis
--redis-dsn redis://redis-host:6379/0
--max-requests 512
--ignore-header-prefix X-Forwarded-
--ignore-header-prefix X-Reverse-Proxy-
--ws-max-clients 30000
$ ./webhook-tester --log-json serve \
--port 8080 \
--storage-driver redis \
--pubsub-driver redis \
--redis-dsn redis://redis-host:6379/0 \
--max-requests 512 \
--ignore-header-prefix X-Forwarded- \
--ignore-header-prefix X-Reverse-Proxy- \
--create-session 00000000-0000-0000-0000-000000000000 \
--ws-max-clients 30000 \
--ws-max-lifetime 6h
```

After that you can navigate your browser to `http://127.0.0.1:8080/` try to send your first HTTP request for the webhook-tester!

### Using docker

| Registry | Image |
|----------------------------------------|--------------------------------------|
| [GitHub Container Registry][link_ghcr] | `ghcr.io/tarampampam/webhook-tester` |
| [Docker Hub][link_docker_hub] | `tarampampam/webhook-tester` |

> Using the `latest` tag for the docker image is highly discouraged because of possible backward-incompatible changes during **major** upgrades. Please, use tags in `X.Y.Z` format
### 🐋 Using docker

Just execute in your terminal:

```shell
$ docker run --rm -p 8080:8080/tcp tarampampam/webhook-tester serve
```

Where `X.X.X` is image tag _(application version)_.

#### Docker-compose

For running this app using docker-compose and if you want to keep the data after restarts, you can use the following example with a Redis server as a backend for the data:
Expand Down Expand Up @@ -173,12 +195,6 @@ services:
Changes log can be [found here][link_changes_log].
## Releasing
New versions publishing is very simple - just "publish" new release using repo releases page.
> Release version _(and git tag, of course)_ MUST starts with `v` prefix (eg.: `v0.0.1` or `v1.2.3-RC1`)

## Support
[![Issues][badge_issues]][link_issues]
Expand Down
Binary file removed assets/app-animated.png
Binary file not shown.

0 comments on commit 5b92880

Please sign in to comment.