A simple and naive implementation of a web server for the usage with webhooks.
Find a file
2022-03-13 15:40:55 +01:00
.gitignore Init commit 2022-01-17 19:33:31 +01:00
go.mod Init commit 2022-01-17 19:33:31 +01:00
go.sum Init commit 2022-01-17 19:33:31 +01:00
LICENSE Add LICENSE 2022-01-17 19:37:37 +01:00
main.go Fix typo 2022-03-13 15:40:55 +01:00
README.md Change clone address from ssh to http 2022-03-13 15:28:16 +01:00

whook

A simple and naive implementation of a web server for the usage with webhooks.

Installation

Requirements:

  • Go >= 1.17
git clone https://git.hhhammer.de/hamburghammer/whook.git
cd whook
go build

You should now have a whook executable in the directory.

Usage

The server is build to run behind a proxy that provides https and some kind of auth and it is not designed for long running processes.

./whook -c ./test.sh

The test.sh script contains only echo "hellow" so that the output after starting the application and opening the given URL in side the browser we see following output:

2022/01/17 21:48:43 The HTTP server is running: http://localhost:8080/
2022/01/17 21:48:49 Executing a command...
2022/01/17 21:48:49 hellow

Options

A small server to listen for requests to execute some particular code.

USAGE:
  whook [FLAGS] --cmd [COMMAND [--args [ARGS]]]
	
FLAGS:
  -a, --args strings   Arguments for the command. Can be provided multiple times or as comma-separated string.
  -c, --cmd string     REQUIRED: The command to execute.
  -d, --dir string     The Directory to execute the command.
                       Defaults to the directory the tool was called on.
  -h, --help           Prints this help message and exits.
  -p, --port string    Port to listen for incoming connections. (default "8080")

License

This project is licensed under the MIT license.