-
-
Notifications
You must be signed in to change notification settings - Fork 42
/
Cargo.toml
332 lines (303 loc) · 12.4 KB
/
Cargo.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
[package]
# Note: some of these values are also used when building Debian packages below.
name = "krill"
version = "0.14.5-dev"
edition = "2021"
rust-version = "1.74"
authors = ["NLnet Labs <[email protected]>"]
description = "Resource Public Key Infrastructure (RPKI) daemon"
homepage = "https://www.nlnetlabs.nl/projects/rpki/krill/"
repository = "https://github.com/NLnetLabs/krill"
keywords = ["rpki", "routing-security", "bgp"]
readme = "README.md"
license = "MPL-2.0"
exclude = [
"test-resources/*",
"tests/*",
".github/*",
"docker/*",
"pkg/*",
"Dockerfile",
]
[dependencies]
backoff = { version = "0.4.0", optional = true }
base64 = "0.22.1"
basic-cookies = { version = "0.1", optional = true }
bytes = "1"
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4.5.7", features = ["cargo", "derive", "env", "wrap_help"]}
cryptoki = { version = "0.7", optional = true }
fern = { version = "0.6.2", features = ["syslog-6"] }
futures-util = "0.3"
fslock = "0.2.1"
hex = "0.4"
http-body-util = "0.1"
hyper = { version = "1.3.1", features = ["server"] }
hyper-util = { version = "0.1", features = [ "server" ] }
intervaltree = "0.2.6"
jmespatch = { version = "0.3", features = ["sync"], optional = true }
kmip = { version = "0.4.2", package = "kmip-protocol", features = [ "tls-with-openssl" ], optional = true }
kvx = { version = "0.9.3", features = ["macros"] }
libflate = "2.1.0"
log = "0.4"
once_cell = { version = "1.7.2", optional = true }
openidconnect = { version = "2.0.0", optional = true, default-features = false }
openssl = { version = "0.10", features = ["v110"] }
oso = { version = "0.12", optional = true, default-features = false }
percent-encoding = "2.3.1"
pin-project-lite = "0.2.4"
r2d2 = { version = "0.8.9", optional = true }
rand = "0.8"
regex = { version = "1.5.5", optional = true, default-features = false, features = [ "std" ] }
reqwest = { version = "0.12.5", features = ["json"] }
rpassword = { version = "7.3.1", optional = true }
rpki = { version = "0.18.4", features = ["ca", "compat", "rrdp"], git = "https://github.com/NLnetLabs/rpki-rs.git" }
rustls-pemfile = "2.1.2"
scrypt = { version = "0.11", optional = true, default-features = false }
secrecy = { version = "0.8", features = ["serde"] }
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread", "signal", "time" ] }
tokio-rustls = { version = "0.26", default-features = false, features = [ "ring", "logging", "tls12" ] }
toml = "0.8.14"
unicode-normalization = { version = "0.1", optional = true }
url = { version = "2.3.1", features = ["serde"] }
urlparse = { version = "0.7", optional = true }
uuid = { version = "1.1", features = ["v4"] }
# Disable compiler optimizations for the pkcs11 crate because otherwise with a release build the
# `pReserved = ptr::null_mut()` assignment done by `CK_C_INITIALIZE_ARGS::default()` appears to be optimized out. This
# causes SoftHSMv2 to fail with error CKR_ARGUMENTS_BAD and to log to syslog "SoftHSM.cpp(436): pReserved must be set to
# NULL_PTR". Disabling optimizations for the pkcs11 crate "solves" this problem.
# [profile.release.package.pkcs11]
# opt-level = 0
[target.'cfg(unix)'.dependencies]
syslog = "6.1.1"
[features]
default = ["multi-user", "hsm"]
hsm = ["backoff", "kmip", "once_cell", "cryptoki", "r2d2"]
multi-user = [
"basic-cookies",
"jmespatch/sync",
"regex",
"oso",
"openidconnect",
"rpassword",
"scrypt",
"unicode-normalization",
"urlparse",
]
static-openssl = ["openssl/vendored"]
# Preview features - not ready for production use
rta = []
# Internal features - not for external use
all = ["multi-user", "rta", "static-openssl"]
hsm-tests-kmip = ["hsm"]
hsm-tests-pkcs11 = ["hsm"]
[dev-dependencies]
regex = "1.5.5"
stderrlog = "0.6"
tempfile = "3.10.1"
urlparse = "0.7"
# Make sure that Krill crashes on panics, rather than losing threads and
# limping on in a bad state.
[profile.release]
panic = "abort"
# ------------------------------------------------------------------------------
# START DEBIAN PACKAGING
#
# Configurations for the cargo-deb cargo plugin which builds Debian packages in
# target/debian/ when invoked with: cargo deb. Tested with cargo-deb v1.23.1.
# Use `--variant` to select which section below to use. Variant sections inherit
# and override the settings in the base [package.metadata.deb] section. The
# configs vary because of differing degrees of OpenSSL and systemd support
# across operating systems.
#
# Note that as the postinst script uses the adduser command we declare a
# dependency on the adduser package to keep the lintian tool happy.
# Note: krill.conf is deliberately NOT specified as a "conf-file" because it is
# generated.
#
# The GitHub Actions pkg.yml workflow definition file uses these configurations
# to build and test Ubuntu/Debian packages for Krill.
#
# See:
# - https://github.com/mmstick/cargo-deb
# - https://lintian.debian.org/tags/systemd-service-file-outside-lib.html
# - https://www.debian.org/doc/debian-policy/ch-files.html#behavior
# - .github/workflows/pkg.yml
[package.metadata.deb]
name = "krill"
priority = "optional"
section = "net"
extended-description-file = "pkg/debian/description.txt"
license-file = ["LICENSE", "0"]
depends = "$auto, passwd, libssl1.1"
maintainer-scripts = "pkg/debian/"
changelog = "target/debian/changelog" # this will be generated by the pkg workflow
copyright = "Copyright (c) 2019, NLnet Labs. All rights reserved."
assets = [
[
"target/release/krill",
"/usr/bin/krill",
"755",
],
[
"target/release/krillc",
"/usr/bin/krillc",
"755",
],
[
"defaults/krill.conf",
"/usr/share/doc/krill/krill.conf",
"644",
],
[
"doc/krill.1",
"/usr/share/man/man1/krill.1",
"644",
],
[
"doc/krillc.1",
"/usr/share/man/man1/krillc.1",
"644",
],
[
"pkg/common/krill.service.preset",
"/lib/systemd/system-preset/50-krill.preset",
"644",
],
]
systemd-units = { unit-name = "krill", unit-scripts = "pkg/common", enable = false }
# Packaging configuration for the `krillup` binary rather than Krill itself. As
# we want the built binary to match that built for Krill we want the same
# dynamic or static OpenSSL linking too. Rather than inherit from
# [package.metadata.deb] and override fields to build a different package (which
# cargo deb variants weren't intended for), instead we use the same approach
# that we are forced to use for `cargo generate-rpm` (see below) where the the
# `pkg` GitHub Actions workflow renames the `package.metadata.deb` section out
# of the way and renames this section to `package.metadata.deb` to use it as the
# base configuration instead.
[package.metadata.deb_alt_base_krillup]
name = "krillup"
priority = "optional"
section = "net"
extended-description-file = "pkg/debian/description-krillup.txt"
license-file = ["LICENSE", "0"]
depends = "$auto, passwd, libssl1.1"
changelog = "target/debian/changelog" # this will be generated by the pkg workflow
copyright = "Copyright (c) 2019, NLnet Labs. All rights reserved."
assets = [
[
"target/release/krillup",
"/usr/bin/krillup",
"755",
],
[
"doc/krillup.1",
"/usr/share/man/man1/krillup.1",
"644",
],
]
[package.metadata.deb_alt_base_krillta]
name = "krillta"
priority = "optional"
section = "net"
extended-description-file = "pkg/debian/description-krillta.txt"
license-file = ["LICENSE", "0"]
depends = "$auto, passwd, libssl1.1"
changelog = "target/debian/changelog" # this will be generated by the pkg workflow
copyright = "Copyright (c) 2023, NLnet Labs. All rights reserved."
assets = [
[
"target/release/krillta",
"/usr/bin/krillta",
"755",
],
[
"doc/krillta.1",
"/usr/share/man/man1/krillta.1",
"644",
],
]
# Variant of the Debian packaging configuration that:
# a) statically links with OpenSSL when building a Debian package because the
# newest OpenSSL available on Ubuntu 16.04 at the time of writing is 1.0.2g
# (see: https://packages.ubuntu.com/xenial/openssl) while Krill requires
# OpenSSL >= 1.1.0.
# b) uses a simpler systemd service unit file because Ubuntu 16.04 doesn't
# support newer features supported by Ubuntu 18.04 and 20.04.
[package.metadata.deb.variants.ubuntu-xenial]
features = ["static-openssl"]
depends = "$auto, passwd"
[package.metadata.deb.variants.ubuntu-bionic]
[package.metadata.deb.variants.ubuntu-focal]
[package.metadata.deb.variants.ubuntu-jammy]
depends = "$auto, passwd, libssl3"
[package.metadata.deb.variants.debian-stretch]
features = ["static-openssl"]
depends = "$auto, passwd"
[package.metadata.deb.variants.debian-buster]
[package.metadata.deb.variants.debian-bullseye]
[package.metadata.deb.variants.debian-bookworm]
depends = "$auto, passwd, libssl3"
# Cross compilation variants:
# Note: we have to specifiy dependencies manually because we don't run cargo-deb
# on the target platform and so it cannot determine the dependencies correctly
# for us.
[package.metadata.deb.variants.debian-buster-aarch64-unknown-linux-gnu]
depends = "adduser, passwd, libc6 (>= 2.28), libssl1.1"
[package.metadata.deb.variants.debian-buster-arm-unknown-linux-gnueabihf]
depends = "adduser, passwd, libc6 (>= 2.28), libssl1.1"
[package.metadata.deb.variants.debian-bullseye-armv7-unknown-linux-gnueabihf]
depends = "adduser, passwd, libc6 (>= 2.28), libssl1.1"
# END DEBIAN PACKAGING
# ------------------------------------------------------------------------------
# ------------------------------------------------------------------------------
# START RPM PACKAGING
#
# Configurations for the cargo-generate-rpm cargo plugin which builds RPM
# packages in target/generate-rpm/ when invoked with: cargo generate-rpm
#
[package.metadata.generate-rpm]
name = "krill"
# See: https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing
license = "MPLv2.0"
assets = [
{ source = "target/release/krill", dest = "/usr/bin/krill", mode = "755" },
{ source = "target/release/krillc", dest = "/usr/bin/krillc", mode = "755" },
{ source = "target/rpm/krill.service", dest = "/lib/systemd/system/krill.service", mode = "644" },
{ source = "defaults/krill.conf", dest = "/usr/share/doc/krill/krill.conf", mode = "644", doc = true },
{ source = "doc/krill.1", dest = "/usr/share/man/man1/krill.1", mode = "644", doc = true },
{ source = "doc/krillc.1", dest = "/usr/share/man/man1/krillc.1", mode = "644", doc = true },
{ source = "pkg/common/krill.service.preset", dest = "/lib/systemd/system-preset/50-krill.preset", mode = "644" },
]
# These get set using cargo-generate-rpm --set-metadata at package build time.
#post_install_script = ...
#pre_uninstall_script = ...
#post_uninstall_script = ...
# Ensure that the useradd tool is present by depending on its package
[package.metadata.generate-rpm.requires]
shadow-utils = "*"
# A variant of the RPM packaging configuration that package the `krillup` binary
# instead of Krill itself. The `cargo generate-rpm` command doesn't itself know
# how to use this alternate configuration, instead the `pkg` GitHub Actions
# workflow renames the `package.metadata.generate-rpm` section out of the way
# and renames this section to `package.metadata.generate-rpm` to use it instead.
[package.metadata.generate-rpm-alt-base-krillup]
name = "krillup"
# See: https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing
license = "MPLv2.0"
assets = [
{ source = "target/release/krillup", dest = "/usr/bin/krillup", mode = "755" },
{ source = "doc/krillup.1", dest = "/usr/share/man/man1/krillup.1", mode = "644", doc = true },
]
[package.metadata.generate-rpm-alt-base-krillta]
name = "krillta"
# See: https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing
license = "MPLv2.0"
assets = [
{ source = "target/release/krillta", dest = "/usr/bin/krillta", mode = "755" },
{ source = "doc/krillta.1", dest = "/usr/share/man/man1/krillta.1", mode = "644", doc = true },
]
# END RPM PACKAGING
# ------------------------------------------------------------------------------