Commit graph

20 commits

Author SHA1 Message Date
41d8efe8a8 Fix readme path in Debian package
Move the readme into to right directory when installing the debian
package.
2021-10-17 08:53:31 +02:00
ed6646195c Cargo update
Update dependencies.
2021-09-30 00:20:54 +02:00
65430e65b7 Restructure and minor improvements
In order to keep things together the code was restructured. Some small
improvements such as clippy warnings and the validation of a hook in
regards of the ip filter.
2021-06-15 12:48:00 +02:00
d29bfdf88d Use clap for command line arguments
To support command line arguments `clap` is used. This adds following
argument `--config`/`-c` to provide a different path for the
configurationf file and the subcommand `configtest` which parses and
loads the configuration and exits.
2021-05-31 16:14:19 +02:00
891a8a70ae Update build deps and improve readability
The ip filtering is improved as well as the replacing of
parameters. The index page is removed.
2021-05-29 01:03:07 +02:00
29caaff596 Fix debian build overwriting config file
Add missing `confi-files` parameter to `Cargo.toml`.
2021-04-22 13:19:28 +02:00
280dab6e8c Support matching boolean values with regex 2021-04-22 11:56:28 +02:00
d552e29e8f Build a Debian package
The first version `0.1.0-rc.0` and metadata for `cargo-deb` is now in
`Cargo.toml`. For that, the service file as well as the config file
were moved.

For a improved systemd service file the `User` and `Group` is now set
via variables and the log level is now set to `info`. In the previous
version of the service file the parameter for `ExecStart` was missing
which prevented this file from working.

The dependencies in `Cargo.lock` were updated.
2021-04-17 00:08:11 +02:00
17778cf8b4 Fix execution of scripts
For better script and argument support `run_script` is used instead of
`process::Command`.
2021-04-17 00:04:22 +02:00
7f143e0b08 Split from_data() up in smaller pieces
To still be able to handle errors correctly, also regarding the http
status code, `thiserror::Error` is used.
2021-04-03 01:10:50 +02:00
8314214e06 Add optional ip_filter to hook config
In order to allow or deny sources of requests the possibility to
configure a list of allowed or denied IP addresses was added as
described by the readme.

Closes #3
2021-04-02 01:59:45 +02:00
ee32424f8c Use signature field for verification
Instead of looking for a "secret" field hmac is used. Therefore the
raw payload is hashed with all secrets consecutively in order to
validate its content. If the content is certified the established
behaviour is pursued..
2021-03-28 04:18:35 +02:00
82b308f8cf Make tls an optional feature 2021-03-21 23:37:30 +01:00
0610fd49c9 Replace command parameters with values
To create a minimalistic parser, nom is used to identify and replace
parameters given in the command field.

For clarity the `action` field for hooks was renamed to `command`.
2021-03-21 22:38:14 +01:00
e052af5114 Enable tls and update dependencies 2021-03-19 15:44:26 +01:00
45cdd104b0 Add meta data to Cargo.toml 2021-03-17 11:01:30 +01:00
606a3ad9c1 Add license 2021-03-12 17:23:35 +01:00
82ccbf0a7e Implement proper logging
The `log` and `env_logger` crates are used for logging.
2021-03-03 17:01:41 +01:00
c8505b27c5 Parse config file and act upon
All dependencies were updated.

An example configuration file `config.yml` is added to show the
configuration options. Following locations are checked:
- `/etc/webhookey/config.yml`
- `<config_dir>/webhookey/config.yml`
- `./config.yml`

Whereas `<config_dir>` is depending on the platform:
- Linux:   `$XDG_CONFIG_HOME` or `$HOME/.config`
- macOS:   `$HOME/Library/Application Support`
- Windows: `{FOLDERID_RoamingAppData}`

Each hook's action is executed if all of the specified filters match.
2021-03-03 15:36:31 +01:00
d8ca63ab37 Parse JSON from post request
Accept a post request and try to parse it expecting the data is
formated in JSON.
2021-02-02 11:17:27 +01:00