whook/README.md

58 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2022-01-17 19:33:31 +01:00
# whook
2022-01-17 22:29:48 +01:00
A simple and naive implementation of a web server for the usage with webhooks.
2022-01-17 19:33:31 +01:00
## Installation
**Requirements:**
- Go >= 1.17
```sh
git clone https://git.hhhammer.de/hamburghammer/whook.git
cd whook
go build
```
You should now have a `whook` executable in the directory.
2022-01-17 19:33:31 +01:00
## Usage
2022-01-17 22:29:48 +01:00
The server is build to run behind a proxy that provides `https` and some kind of
2022-03-13 15:24:06 +01:00
`auth` and it is not designed for long running processes.
2022-01-17 22:29:48 +01:00
2022-01-17 19:33:31 +01:00
```sh
./whook -c ./test.sh
2022-01-17 19:33:31 +01:00
```
2022-01-17 22:29:48 +01:00
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 19:33:31 +01:00
```plain
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
2022-01-17 19:33:31 +01:00
```
## Options
2022-01-17 22:29:48 +01:00
2022-01-17 19:33:31 +01:00
```plain
A small server to listen for requests to execute some particular code.
USAGE:
whook [FLAGS] --cmd [COMMAND [--args [ARGS]]]
2022-01-17 19:33:31 +01:00
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")
2022-01-17 19:33:31 +01:00
```
## License
This project is licensed under the [MIT](LICENSE) license.