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.
This commit is contained in:
finga 2021-04-17 00:08:11 +02:00
parent 17778cf8b4
commit d552e29e8f
4 changed files with 28 additions and 16 deletions

22
Cargo.lock generated
View File

@ -438,9 +438,9 @@ dependencies = [
[[package]]
name = "httparse"
version = "1.3.5"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691"
checksum = "4a1ce40d6fc9764887c2fdc7305c3dcc429ba11ff981c1509416afd5697e4437"
[[package]]
name = "humantime"
@ -542,9 +542,9 @@ dependencies = [
[[package]]
name = "libc"
version = "0.2.92"
version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56d855069fafbb9b344c0f962150cd2c1187975cb1c22c1522c240d8c4986714"
checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41"
[[package]]
name = "linked-hash-map"
@ -928,7 +928,7 @@ checksum = "b093b7a2bb58203b5da3056c05b4ec1fed827dcfdb37347a8841695263b3d06d"
dependencies = [
"proc-macro2 1.0.26",
"quote 1.0.9",
"syn 1.0.68",
"syn 1.0.69",
]
[[package]]
@ -1004,9 +1004,9 @@ dependencies = [
[[package]]
name = "syn"
version = "1.0.68"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ce15dd3ed8aa2f8eeac4716d6ef5ab58b6b9256db41d7e1a0224c2788e8fd87"
checksum = "48fe99c6bd8b1cc636890bcc071842de909d902c81ac7dab53ba33c421ab8ffb"
dependencies = [
"proc-macro2 1.0.26",
"quote 1.0.9",
@ -1045,7 +1045,7 @@ checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0"
dependencies = [
"proc-macro2 1.0.26",
"quote 1.0.9",
"syn 1.0.68",
"syn 1.0.69",
]
[[package]]
@ -1111,9 +1111,9 @@ dependencies = [
[[package]]
name = "unicode-bidi"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
checksum = "eeb8be209bb1c96b7c177c7420d26e04eccacb0eeae6b980e35fcb74678107e0"
dependencies = [
"matches",
]
@ -1202,7 +1202,7 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]]
name = "webhookey"
version = "0.1.0"
version = "0.1.0-rc.0"
dependencies = [
"anyhow",
"dirs",

View File

@ -1,7 +1,7 @@
[package]
name = "webhookey"
version = "0.1.0"
authors = ["finga <coding@onders.org>"]
version = "0.1.0-rc.0"
authors = ["finga <webhookey@onders.org>"]
edition = "2018"
license = "GPL-3.0-or-later"
readme = "README.md"
@ -27,3 +27,14 @@ hex = "0.4"
ipnet = { version = "2.3", features = ["serde"] }
thiserror = "1.0"
run_script = "0.7"
[package.metadata.deb]
extended-description = "Webhookey receives requests as for example sent by Gitea's webhooks. Those requests are filtered against configurable filters. When a filter matches values from the header and the body can be passed to scripts which are then executed."
maintainer-scripts = "debian/"
systemd-units = { enable = false }
assets = [
["config.yml", "etc/webhookey/", "644"],
["target/release/webhookey", "usr/bin/", "755"],
["README.md", "usr/share/doc/cargo-deb/README", "644"],
["debian/service", "lib/systemd/system/webhookey.service", "644"],
]

View File

@ -6,10 +6,11 @@ After=network.target
[Service]
RestartSec=2s
Type=simple
User=webhookey
Group=webhookey
User=%u
Group=%g
ExecStart=webhookey
Restart=always
Environment=ROCKET_ADDRESS=127.0.0.1 ROCKET_PORT=8000
Environment=ROCKET_ADDRESS=127.0.0.1 ROCKET_PORT=8000 RUST_LOG=info
# Environment=ROCKET_ADDRESS=127.0.0.1 ROCKET_PORT=8000 ROCKET_TLS={certs="/path/to/certs.pem",key="/path/to/key.pem"}
[Install]