mirror of
https://github.com/alvierahman90/gohookr.git
synced 2024-12-04 09:01:58 +00:00
parent
dfd44b7ea1
commit
cdd19d95e9
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
gohookr
|
25
readme.md
25
readme.md
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
A _really_ simple webhook receiver, which listens at `/webhooks/<webhook-name>`.
|
A _really_ simple webhook receiver, which listens at `/webhooks/<webhook-name>`.
|
||||||
|
|
||||||
Default config path is `/etc/gohookr.conf` and can be overriden by setting environment variable
|
|
||||||
`CONFIG`.
|
|
||||||
|
|
||||||
Check below for an example configuration.
|
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
After you [install go](https://golang.org/doc/install):
|
After you [install go](https://golang.org/doc/install):
|
||||||
@ -15,7 +10,17 @@ After you [install go](https://golang.org/doc/install):
|
|||||||
make
|
make
|
||||||
```
|
```
|
||||||
|
|
||||||
## Signature Verification
|
## Configuration
|
||||||
|
|
||||||
|
Default config path is `/etc/gohookr.json`.
|
||||||
|
It can be overriden by setting environment variable `CONFIG`.
|
||||||
|
|
||||||
|
Check below for an example configuration, which should tell you most of the things you need to know
|
||||||
|
to configure gohookr.
|
||||||
|
|
||||||
|
Currently gohookr must be restarted after config changes.
|
||||||
|
|
||||||
|
### Signature Verification
|
||||||
|
|
||||||
Signature verificaiton is done using SHA256 HMACs.
|
Signature verificaiton is done using SHA256 HMACs.
|
||||||
You **must** set which HTTP header gohookr will receive a signature from using the `SignatureHeader`
|
You **must** set which HTTP header gohookr will receive a signature from using the `SignatureHeader`
|
||||||
@ -25,20 +30,20 @@ You should also specify a shared secret in the `Secret` key.
|
|||||||
You may also need to specify a `SignaturePrefix`.
|
You may also need to specify a `SignaturePrefix`.
|
||||||
For GitHub it would be `sha256=`.
|
For GitHub it would be `sha256=`.
|
||||||
|
|
||||||
### Disable Signature Verification
|
#### Disable Signature Verification
|
||||||
|
|
||||||
You can disable signature verification by setting `DisableSignatureVerification` for a service to `true`.
|
You can disable signature verification by setting `DisableSignatureVerification` for a service to `true`.
|
||||||
|
|
||||||
You can disable signature verification for all services by setting environment variable
|
You can disable signature verification for all services by setting environment variable
|
||||||
`NO_SIGNATURE_VERIFICATION` to `true`.
|
`NO_SIGNATURE_VERIFICATION` to `true`.
|
||||||
|
|
||||||
## Writing Commands
|
### Writing Commands
|
||||||
|
|
||||||
gohookr doesn't care what the command is as long as the `Program` is executable.
|
gohookr doesn't care what the command is as long as the `Program` is executable.
|
||||||
You can specify extra arguments with the `Arguments` field.
|
You can specify extra arguments with the `Arguments` field.
|
||||||
You can ask it to put the payload as the last argument by setting `AppendPayload` to true.
|
You can ask it to put the payload as the last argument by setting `AppendPayload` to true.
|
||||||
|
|
||||||
## Writing Tests
|
### Writing Tests
|
||||||
|
|
||||||
gohookr can run test before running your script.
|
gohookr can run test before running your script.
|
||||||
Tests must be in the form of bash scripts.
|
Tests must be in the form of bash scripts.
|
||||||
@ -48,7 +53,7 @@ deploy.
|
|||||||
Tests are run in the order they're listed so any actions that need to be done before
|
Tests are run in the order they're listed so any actions that need to be done before
|
||||||
tests are run can simply be put in this section before the tests.
|
tests are run can simply be put in this section before the tests.
|
||||||
|
|
||||||
## Example Config
|
### Example Config
|
||||||
|
|
||||||
Required config keys are `ListenAddress` and `Services`.
|
Required config keys are `ListenAddress` and `Services`.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user