Commit graph

96 commits

Author SHA1 Message Date
faba2949d2 cargo: Bump hmac and sha2 dependencies.
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Bump the `hmac` dependency to `0.12`, therefor remove deprecated
`NewMac`. Further, bump the `sha2` dependency to `0.10`.
2023-06-11 22:37:25 +02:00
57d4f10b41 cargo: Bump clap to 4.3
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Bump `clap` to latest version.
2023-06-11 18:01:37 +02:00
35b31b2a15 cargo: Cargo update
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Update the build dependencies by `cargo update`.
2023-06-11 17:28:01 +02:00
71153b28ec cargo: Order dependencies alphabetically
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
To improve readability of dependencies order them alphabetically.
2023-06-11 17:28:01 +02:00
f6ec8af944 clippy: Fix clippy::get_first
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Fix the `clippy::get_first` lint.

Note clippy fails due to a false positive.
2023-06-11 17:27:18 +02:00
55c5134840 ci: Update CI config
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-10-15 01:56:07 +02:00
f38c70373c metrics: Increase hooks_successful when done
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-03-23 15:20:39 +01:00
f25ee6b943 ci: run everything in pipeline in parallel
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-02-11 19:52:09 +01:00
976c25ba1a ci: Also execute the tests during ci
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
2022-02-10 01:38:37 +01:00
81be79d46d ci: Add a basic ci config
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Do things like build docs, check fmt, clippy and build in non-release
and release mode as well as the debian package. Include a badge which
reflects the status of the ci for the main branch to the readme.
2022-02-10 00:56:49 +01:00
f195162ce5 Update build dependencies
Use clap `v3.0`.
2022-01-07 11:50:52 +01:00
0312a600ed Add from annotation to inherited errors 2022-01-07 11:49:16 +01:00
f7aea10c6b Update build dependencies 2021-12-14 17:00:55 +01:00
620fa520ce Raise version to 0.1.6 2021-12-09 13:43:46 +01:00
856cdc9457 Update build dependencies
This needed also some adaption in order to use `clap 3.0.0-rc.0`.
2021-12-09 13:40:17 +01:00
2c3319ad84 Create the webhookey manpage
Also add the manpage to the build recipe of the debian package.
This closes #13.
2021-11-26 11:59:47 +01:00
0f62ce701e Set server ident in headers
Set server ident in headers to Webhookey.
2021-11-26 11:44:59 +01:00
5f5d014bc0 Update build dependencies 2021-11-26 10:58:37 +01:00
c1b322bc52 Add link to webhooks wiki page to readme
So that we have one thing which points to an explaination about what
webhooks are.
2021-11-22 14:42:38 +01:00
506001a366 Improve error message
Write a more correct error message.
2021-11-22 14:42:10 +01:00
33e39f0b40 Improve readme and fix typos
Improve wording and fix typos in readme.
2021-11-19 17:21:29 +01:00
5775870a8e Move hook related code into hooks.rs
This concludes the code separation into several files.
2021-11-19 14:28:26 +01:00
1280352f25 Move config related code into config.rs
To continue with code separation to improve readability.
2021-11-19 13:41:48 +01:00
5e1d433c38 Move metrics related code into metrics.rs
To improve readability metrics related code moves to `metrics.rs`.
2021-11-19 11:40:21 +01:00
3a95ecfd11 Rename webook.rs to filter.rs
Also improve code separation, still more to come.
2021-11-19 11:28:37 +01:00
b7ad590d39 Create interrelate macro to evaluate filters
This reduces code duplication.
2021-11-19 11:26:53 +01:00
b8f114900b Compile regex when parsing config
The regexes are now compiled when the config is parsed and not each
time a new webhook is received.

Adapt tests to using parsed regex.
2021-11-19 11:26:23 +01:00
83785cc77d Add comments to metrics
To improve readability.
2021-11-18 00:16:09 +01:00
181edf589c Update readme with filters not and header 2021-11-17 15:19:38 +01:00
8c9d9e63f2 Add HeaderFilter for filter based on the header
This extends filtering to filter also on the received http header.
2021-11-17 15:13:12 +01:00
0d9c5f650f Update build dependencies 2021-11-17 14:07:39 +01:00
9c423b8dc8 Add Not filter to FilterType
To invert the result of filters.
2021-11-17 14:06:07 +01:00
4d39488c32 Use a custom parser for commands
The removes the dependency for `nom` as commands are now parsed with
its own tiny parser.
2021-11-17 13:17:15 +01:00
4b9186b10d Fix json parsing bug
Increase version for building a new Debian package.
2021-11-16 14:39:22 +01:00
3a482a3eb9 Remove prototyping code which is commented out
This comments are ment for future development and not for the main
branch yet.
2021-11-14 11:58:34 +01:00
4a54aabf26 Increase version to v0.1.3
Increase version to `v0.1.3` and update build deps.
2021-11-13 20:00:07 +01:00
e7e136195b Fix metrics check when disabled
Previously, disabled metrics had no effect and a request to the
`/metrics` route was answered nonetheless.

Remove needles borrow
2021-11-13 19:59:58 +01:00
a122bf28d2 Use atomics instead of mutexes
Use atomics instead of mutexes to improve access on metrics. Therefor
also remove unneeded borrows.
2021-11-13 14:37:02 +01:00
b4b46ebd58 Refactor filters
Clean up some comments and refactor the code to improve readability
and to get rid of "ugly" unwraps.
2021-11-13 14:16:21 +01:00
d92e8029f2 Break up code into multiple files
In order to increase readability, maintainability and maybe a future
independence regarding web frameworks move code to new files.
2021-11-11 21:09:47 +01:00
b2205ea5f4 Increase version to 0.1.2
Also update build dependencies and fix readme.
2021-11-10 10:50:59 +01:00
f24a786ec6 Make the metrics page configurable
Make the metrics page configurable with an `ip_filter`.

This closes #10.
2021-11-09 14:57:41 +01:00
f0f1d3239d Use BTreeMap instead of HashMap
As ordering of `BTreeMap` is easier for testing and the difference
does not really matter.
2021-11-09 13:58:57 +01:00
a12ad80cba Add metrics page
Add a page to print metrics.
2021-11-08 14:59:49 +01:00
beb039aa3c Reorder code
To improve readibility and to prepeare split of `webhookey` code from
`Rocket` some functions are reordered.
2021-11-07 16:43:10 +01:00
4594db6c44 Remove feature annotation
This is not needed anymore.
2021-11-07 16:41:58 +01:00
b7cb27ed22 Update readme as nightly is not needed anymore
Due to the update to `rocket v0.5` nightly is not needed anymore.
2021-11-06 12:21:12 +01:00
02dc225fa8 Update build dependencies to latest versions
Update build dependencies to latest version, also use the 2021 Rust
edition. This is also the next version of `webhookey` with version
number 0.1.1.
2021-11-06 12:12:22 +01:00
c82c0fcbd5 Remove double parsing of data pointed to
As there was an issues with the parser which checked the validity of
the JSON pointer pointing to the received JSON data this part is
removed. Further some checks were added to double check that case
which lead to an invalid behaviour.

This fixes #9.
2021-11-06 11:03:27 +01:00
87d6f58f72 Rename variable in parse_command test
Rename `map` to `headers` inside the `parse_command` test to improve
readability.
2021-11-06 10:38:52 +01:00