diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..bff29e6 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[build] +rustflags = ["--cfg", "tokio_unstable"] diff --git a/.drone.yml b/.drone.yml index 048ddd1..a74c95e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -366,3 +366,42 @@ depends_on: trigger: event: - tag + +--- + +kind: pipeline +type: docker +name: publish-crate + +platform: + arch: amd64 + +clone: + disable: true + +steps: +- name: clone + image: alpine/git:latest + user: root + commands: + - git clone $DRONE_GIT_HTTP_URL . + - git checkout $DRONE_COMMIT + - chown -R 991:991 . + +- name: publish + image: asonix/rust-builder:amd64-latest + pull: always + environment: + CRATES_IO_TOKEN: + from_secret: crates_io_token + commands: + - cargo publish --token $CRATES_IO_TOKEN + +depends_on: +- build-amd64 +- build-arm64v8 +- build-arm32v7 + +trigger: + event: + - tag diff --git a/Cargo.lock b/Cargo.lock index 50756ee..aa662c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,7 +11,7 @@ dependencies = [ "activitystreams-kinds", "chrono", "mime", - "serde 1.0.131", + "serde 1.0.132", "serde_json", "thiserror", "url", @@ -24,7 +24,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb8e19a0810cc25df3535061a08b7d8f8a734d309ea4411c57a9767e4a2ffa0e" dependencies = [ "activitystreams", - "serde 1.0.131", + "serde 1.0.132", "serde_json", ] @@ -34,7 +34,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0784e99afd032199d3ed70cefb8eb3a8d1aef15f7f2c4e68d033c4e12bb6079e" dependencies = [ - "serde 1.0.131", + "serde 1.0.132", "url", ] @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "actix-http" -version = "3.0.0-beta.15" +version = "3.0.0-beta.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ff7b149cc1b99967c22cb81c2c31f128ac88ed12bbf80c29c55a7511d46edb" +checksum = "6294c508c1413346857838356f53f45dbfd257ea31dca19470d9ce78750a7d37" dependencies = [ "actix-codec", "actix-rt", @@ -73,18 +73,17 @@ dependencies = [ "derive_more", "encoding_rs", "futures-core", - "futures-util", + "futures-task", "h2", "http", "httparse", "httpdate", - "itoa", + "itoa 0.4.8", "language-tags", "local-channel", "log", "mime", "percent-encoding", - "pin-project", "pin-project-lite", "rand 0.8.4", "sha-1", @@ -103,16 +102,16 @@ dependencies = [ [[package]] name = "actix-router" -version = "0.5.0-beta.2" +version = "0.5.0-beta.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36b95ce0d76d1aa2f98b681702807475ade0f99bd4552546a6843a966d42ea3d" +checksum = "ddd9f117b910fbcce6e9f45092ffd4ff017785a346d09e2d4fd049f4e20384f4" dependencies = [ "bytestring", "firestorm", "http", "log", "regex", - "serde 1.0.131", + "serde 1.0.132", ] [[package]] @@ -146,9 +145,9 @@ dependencies = [ [[package]] name = "actix-service" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3dc6a618b082974a08d7a4781d24d4691cba51500059bfebe6656a61ebfe1e" +checksum = "3b894941f818cfdc7ccc4b9e60fa7e53b5042a2e8567270f9147d5591893373a" dependencies = [ "futures-core", "paste", @@ -187,9 +186,9 @@ dependencies = [ [[package]] name = "actix-web" -version = "4.0.0-beta.14" +version = "4.0.0-beta.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9387ea044357f12b606b8fad0652d3804ba498954f66ae5c677236cb0bd47db4" +checksum = "4609cf57246040316642d4dc4c03d7f3d4a083a892122829dbd9e6ec8db7cd67" dependencies = [ "actix-codec", "actix-http", @@ -204,11 +203,10 @@ dependencies = [ "bytes", "cfg-if", "derive_more", - "either", "encoding_rs", "futures-core", "futures-util", - "itoa", + "itoa 0.4.8", "language-tags", "log", "mime", @@ -216,7 +214,7 @@ dependencies = [ "paste", "pin-project-lite", "regex", - "serde 1.0.131", + "serde 1.0.132", "serde_json", "serde_urlencoded", "smallvec", @@ -246,11 +244,17 @@ dependencies = [ "actix-rt", "actix-web", "awc", - "serde 1.0.131", + "serde 1.0.132", "serde_derive", "thiserror", ] +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" version = "0.7.6" @@ -383,9 +387,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "awc" -version = "3.0.0-beta.13" +version = "3.0.0-beta.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d6c84166873707ee2e689d14aebf5eacf1629c45f8f3f5c0fd3638038c3044" +checksum = "8c7f4bbe98c31efbf5182545d1b0a423df909ee27281c66f3c9aaeb58120cf8b" dependencies = [ "actix-codec", "actix-http", @@ -402,14 +406,14 @@ dependencies = [ "futures-util", "h2", "http", - "itoa", + "itoa 0.4.8", "log", "mime", "percent-encoding", "pin-project-lite", "rand 0.8.4", "rustls", - "serde 1.0.131", + "serde 1.0.132", "serde_json", "serde_urlencoded", "tokio", @@ -438,7 +442,7 @@ dependencies = [ "background-jobs-core", "chrono", "num_cpus", - "serde 1.0.131", + "serde 1.0.132", "serde_json", "thiserror", "tokio", @@ -458,7 +462,7 @@ dependencies = [ "async-mutex", "async-trait", "chrono", - "serde 1.0.131", + "serde 1.0.132", "serde_json", "thiserror", "tracing", @@ -505,6 +509,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d36a02058e76b040de25a4464ba1c80935655595b661505c8b39b664828b95" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" version = "3.8.0" @@ -559,7 +572,7 @@ dependencies = [ "libc", "num-integer", "num-traits 0.2.14", - "serde 1.0.131", + "serde 1.0.132", "time 0.1.44", "winapi", ] @@ -588,13 +601,47 @@ dependencies = [ "lazy_static", "nom 5.1.2", "rust-ini", - "serde 1.0.131", + "serde 1.0.132", "serde-hjson", "serde_json", "toml", "yaml-rust", ] +[[package]] +name = "console-api" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033fddce299c93dd44ae21d5f5a6e749baa5d103784bcdde65701c07272a9fde" +dependencies = [ + "prost 0.9.0", + "prost-types 0.9.0", + "tonic 0.6.2", + "tonic-build 0.6.2", + "tracing-core", +] + +[[package]] +name = "console-subscriber" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2380cc150266375aeda8f9aeadc5527395c1a8807ecf9fa97a46d1bb760ec5b" +dependencies = [ + "console-api", + "futures", + "hdrhistogram", + "humantime", + "serde 1.0.132", + "serde_json", + "thread_local", + "tokio", + "tokio-stream", + "tonic 0.6.2", + "tracing", + "tracing-core", + "tracing-subscriber", +] + [[package]] name = "const-oid" version = "0.6.2" @@ -670,13 +717,23 @@ dependencies = [ ] [[package]] -name = "dashmap" -version = "4.0.2" +name = "crypto-common" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77a43b28d0668df09411cb0bc9a8c2adc40f9a048afe863e05fd43251e8e39c" +checksum = "683d6b536309245c849479fba3da410962a43ed8e51c26b729208ec0ac2798d0" +dependencies = [ + "generic-array", +] + +[[package]] +name = "dashmap" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b799062aaf67eb976af3bdca031ee6f846d2f0a5710ddbb0d2efee33f3cc4760" dependencies = [ "cfg-if", "num_cpus", + "parking_lot", ] [[package]] @@ -711,6 +768,17 @@ dependencies = [ "generic-array", ] +[[package]] +name = "digest" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b697d66081d42af4fba142d56918a3cb21dc8eb63372c6b85d14f44fb9c5979b" +dependencies = [ + "block-buffer 0.10.0", + "crypto-common", + "generic-array", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -750,6 +818,24 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +[[package]] +name = "fixedbitset" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" + +[[package]] +name = "flate2" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +dependencies = [ + "cfg-if", + "crc32fast", + "libc", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -794,9 +880,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd0210d8c325c245ff06fd95a3b13689a1a276ac8cfa8e8720cb840bfb84b9e" +checksum = "28560757fe2bb34e79f907794bb6b22ae8b0e5c669b638a1132f2592b19035b4" dependencies = [ "futures-channel", "futures-core", @@ -809,9 +895,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc8cd39e3dbf865f7340dce6a2d401d24fd37c6fe6c4f0ee0de8bfca2252d27" +checksum = "ba3dda0b6588335f360afc675d0564c17a77a2bda81ca178a4b6081bd86c7f0b" dependencies = [ "futures-core", "futures-sink", @@ -819,15 +905,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629316e42fe7c2a0b9a65b47d159ceaa5453ab14e8f0a3c5eedbb8cd55b4a445" +checksum = "d0c8ff0461b82559810cdccfde3215c3f373807f5e5232b71479bff7bb2583d7" [[package]] name = "futures-executor" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b808bf53348a36cab739d7e04755909b9fcaaa69b7d7e588b37b6ec62704c97" +checksum = "29d6d2ff5bb10fb95c85b8ce46538a2e5f5e7fdc755623a7d4529ab8a4ed9d2a" dependencies = [ "futures-core", "futures-task", @@ -836,15 +922,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e481354db6b5c353246ccf6a728b0c5511d752c08da7260546fc0933869daa11" +checksum = "b1f9d34af5a1aac6fb380f735fe510746c38067c5bf16c7fd250280503c971b2" [[package]] name = "futures-macro" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89f17b21645bc4ed773c69af9c9a0effd4a3f1a3876eadd453469f8854e7fdd" +checksum = "6dbd947adfffb0efc70599b3ddcf7b5597bb5fa9e245eb99f62b3a5f7bb8bd3c" dependencies = [ "proc-macro2", "quote", @@ -853,21 +939,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "996c6442437b62d21a32cd9906f9c41e7dc1e19a9579843fad948696769305af" +checksum = "e3055baccb68d74ff6480350f8d6eb8fcfa3aa11bdc1a1ae3afdd0514617d508" [[package]] name = "futures-task" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dabf1872aaab32c886832f2276d2f5399887e2bd613698a02359e4ea83f8de12" +checksum = "6ee7c6485c30167ce4dfb83ac568a849fe53274c831081476ee13e0dce1aad72" [[package]] name = "futures-util" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d22213122356472061ac0f1ab2cee28d2bac8491410fd68c2af53d1cedb83e" +checksum = "d9b5cf40b47a271f77a8b1bec03ca09044d99d2372c0de244e66430761127164" dependencies = [ "futures-channel", "futures-core", @@ -950,6 +1036,19 @@ dependencies = [ "ahash", ] +[[package]] +name = "hdrhistogram" +version = "7.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6490be71f07a5f62b564bc58e36953f675833df11c7e4a0647bee7a07ca1ec5e" +dependencies = [ + "base64", + "byteorder", + "flate2", + "nom 7.1.0", + "num-traits 0.2.14", +] + [[package]] name = "heck" version = "0.3.3" @@ -990,7 +1089,7 @@ checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" dependencies = [ "bytes", "fnv", - "itoa", + "itoa 0.4.8", ] [[package]] @@ -1016,9 +1115,9 @@ dependencies = [ [[package]] name = "http-signature-normalization-actix" -version = "0.5.0-beta.13" +version = "0.5.0-beta.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50acff51d5302549a51df60751052b71e4d5f2530fe7c664902f94906c03dc09" +checksum = "f5aa97e6c2ee1450ccb3a6d8edbb91fb8423ea6d5650bc234245b5ff7a599084" dependencies = [ "actix-http", "actix-rt", @@ -1048,6 +1147,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "hyper" version = "0.14.16" @@ -1063,7 +1168,7 @@ dependencies = [ "http-body", "httparse", "httpdate", - "itoa", + "itoa 0.4.8", "pin-project-lite", "socket2", "tokio", @@ -1129,6 +1234,12 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +[[package]] +name = "itoa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + [[package]] name = "js-sys" version = "0.3.55" @@ -1168,9 +1279,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.111" +version = "0.2.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e167738f1866a7ec625567bae89ca0d44477232a4f7c52b1c7f2adc2c98804f" +checksum = "1b03d17f364a3a042d5e5d46b053bbbf82c92c9430c592dd4c064dc6ee997125" [[package]] name = "libm" @@ -1198,9 +1309,9 @@ dependencies = [ [[package]] name = "local-waker" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f9a2d3e27ce99ce2c3aad0b09b1a7b916293ea9b2bf624c13fe646fadd8da4" +checksum = "902eb695eb0591864543cbfbf6d742510642a605a61fc5e97fe6ceb5a30ac4fb" [[package]] name = "lock_api" @@ -1222,9 +1333,9 @@ dependencies = [ [[package]] name = "lru" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c748cfe47cb8da225c37595b3108bea1c198c84aaae8ea0ba76d01dda9fc803" +checksum = "469898e909a1774d844793b347135a0cd344ca2f69d082013ecb8061a2229a3a" dependencies = [ "hashbrown", ] @@ -1309,6 +1420,22 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +dependencies = [ + "adler", + "autocfg 1.0.1", +] + [[package]] name = "mio" version = "0.7.14" @@ -1380,6 +1507,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "nom" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" +dependencies = [ + "memchr", + "minimal-lexical", + "version_check", +] + [[package]] name = "nom_locate" version = "3.0.2" @@ -1425,7 +1563,7 @@ dependencies = [ "num-iter", "num-traits 0.2.14", "rand 0.8.4", - "serde 1.0.131", + "serde 1.0.132", "smallvec", "zeroize", ] @@ -1493,9 +1631,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "opaque-debug" @@ -1532,11 +1670,11 @@ dependencies = [ "futures", "http", "opentelemetry", - "prost", + "prost 0.8.0", "thiserror", "tokio", - "tonic", - "tonic-build", + "tonic 0.5.2", + "tonic-build 0.5.2", ] [[package]] @@ -1591,7 +1729,17 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" dependencies = [ - "fixedbitset", + "fixedbitset 0.2.0", + "indexmap", +] + +[[package]] +name = "petgraph" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" +dependencies = [ + "fixedbitset 0.4.0", "indexmap", ] @@ -1727,9 +1875,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37d2df5df740e582f28f8560cf425f52bb267d872fe58358eadb554909f07a" +checksum = "2f84e92c0f7c9d58328b85a78557813e4bd845130db68d7184635344399423b1" dependencies = [ "unicode-xid", ] @@ -1741,7 +1889,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.8.0", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive 0.9.0", ] [[package]] @@ -1755,9 +1913,29 @@ dependencies = [ "itertools", "log", "multimap", - "petgraph", - "prost", - "prost-types", + "petgraph 0.5.1", + "prost 0.8.0", + "prost-types 0.8.0", + "tempfile", + "which", +] + +[[package]] +name = "prost-build" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph 0.6.0", + "prost 0.9.0", + "prost-types 0.9.0", + "regex", "tempfile", "which", ] @@ -1775,6 +1953,19 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.8.0" @@ -1782,7 +1973,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b" dependencies = [ "bytes", - "prost", + "prost 0.8.0", +] + +[[package]] +name = "prost-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" +dependencies = [ + "bytes", + "prost 0.9.0", ] [[package]] @@ -1928,7 +2129,7 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "relay" -version = "0.3.9" +version = "0.3.10" dependencies = [ "activitystreams", "activitystreams-ext", @@ -1943,6 +2144,7 @@ dependencies = [ "base64", "chrono", "config", + "console-subscriber", "dashmap", "dotenv", "futures-util", @@ -1955,7 +2157,7 @@ dependencies = [ "rsa", "rsa-magic-public-key", "ructe", - "serde 1.0.131", + "serde 1.0.132", "serde_json", "sha2", "sled", @@ -2004,7 +2206,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e05c2603e2823634ab331437001b411b9ed11660fbc4066f3908c84a9439260d" dependencies = [ "byteorder", - "digest", + "digest 0.9.0", "lazy_static", "num-bigint-dig", "num-integer", @@ -2123,9 +2325,9 @@ checksum = "9dad3f759919b92c3068c696c15c3d17238234498bbdcc80f2c469606f948ac8" [[package]] name = "serde" -version = "1.0.131" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ad69dfbd3e45369132cc64e6748c2d65cdfb001a2b1c232d128b4ad60561c1" +checksum = "8b9875c23cf305cd1fd7eb77234cbb705f21ea6a72c637a5c6db5fe4b8e7f008" dependencies = [ "serde_derive", ] @@ -2144,9 +2346,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.131" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b710a83c4e0dff6a3d511946b95274ad9ca9e5d3ae497b63fda866ac955358d2" +checksum = "ecc0db5cb2556c0e558887d9bbdcf6ac4471e83ff66cf696e5419024d1606276" dependencies = [ "proc-macro2", "quote", @@ -2155,13 +2357,13 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ffa0837f2dfa6fb90868c2b5468cad482e175f7dad97e7421951e663f2b527" +checksum = "bcbd0344bc6533bc7ec56df11d42fb70f1b912351c0825ccb7211b59d8af7cf5" dependencies = [ - "itoa", + "itoa 1.0.1", "ryu", - "serde 1.0.131", + "serde 1.0.132", ] [[package]] @@ -2171,9 +2373,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" dependencies = [ "form_urlencoded", - "itoa", + "itoa 0.4.8", "ryu", - "serde 1.0.131", + "serde 1.0.132", ] [[package]] @@ -2182,24 +2384,22 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ - "block-buffer", + "block-buffer 0.9.0", "cfg-if", "cpufeatures", - "digest", + "digest 0.9.0", "opaque-debug", ] [[package]] name = "sha2" -version = "0.9.8" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69f9a4c9740d74c5baa3fd2e547f9525fa8088a8a958e0ca2409a514e33f5fa" +checksum = "900d964dd36bb15bcf2f2b35694c072feab74969a54f2bbeec7a2d725d2bdcb6" dependencies = [ - "block-buffer", "cfg-if", "cpufeatures", - "digest", - "opaque-debug", + "digest 0.10.1", ] [[package]] @@ -2296,7 +2496,7 @@ dependencies = [ "parking_lot", "phf_shared", "precomputed-hash", - "serde 1.0.131", + "serde 1.0.132", ] [[package]] @@ -2456,7 +2656,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad" dependencies = [ - "itoa", + "itoa 0.4.8", "libc", ] @@ -2477,11 +2677,10 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" +checksum = "fbbf1c778ec206785635ce8ad57fe52b3009ae9e0c9f574a728f3049d3e55838" dependencies = [ - "autocfg 1.0.1", "bytes", "libc", "memchr", @@ -2492,6 +2691,7 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "tokio-macros", + "tracing", "winapi", ] @@ -2507,9 +2707,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9efc1aba077437943f7515666aa2b882dfabfbfdf89c819ea75a8d6e9eaba5e" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2", "quote", @@ -2518,9 +2718,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4baa378e417d780beff82bf54ceb0d195193ea6a00c14e22359e7f39456b5689" +checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b" dependencies = [ "rustls", "tokio", @@ -2558,7 +2758,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ - "serde 1.0.131", + "serde 1.0.132", ] [[package]] @@ -2580,8 +2780,39 @@ dependencies = [ "hyper-timeout", "percent-encoding", "pin-project", - "prost", - "prost-derive", + "prost 0.8.0", + "prost-derive 0.8.0", + "tokio", + "tokio-stream", + "tokio-util", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + +[[package]] +name = "tonic" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +dependencies = [ + "async-stream", + "async-trait", + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.9.0", + "prost-derive 0.9.0", "tokio", "tokio-stream", "tokio-util", @@ -2599,7 +2830,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12b52d07035516c2b74337d2ac7746075e7dcae7643816c1b12c5ff8a7484c08" dependencies = [ "proc-macro2", - "prost-build", + "prost-build 0.8.0", + "quote", + "syn", +] + +[[package]] +name = "tonic-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" +dependencies = [ + "proc-macro2", + "prost-build 0.9.0", "quote", "syn", ] @@ -2652,9 +2895,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.5.0-beta.5" +version = "0.5.0-beta.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13030b85c40d37169eee20eec527f7e87724e6128efa2ae791d6ffdd4046d32f" +checksum = "940f76971e1a1ca2c64e8f915aec14acbc61a5b1c1c177dedf64eb8dd41b204d" dependencies = [ "actix-web", "pin-project", @@ -2676,9 +2919,9 @@ dependencies = [ [[package]] name = "tracing-awc" -version = "0.1.0-beta.14" +version = "0.1.0-beta.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67d8a6f1eeb0b85e61a55c0c46ca45c7b487946d7df2e81997a9282e102ebe96" +checksum = "cd5fa893d29a9725a2ee8b35e2d0eeb02d64b11be3b6cc1bf7ed5e838ea80777" dependencies = [ "actix-http", "actix-service", @@ -2821,7 +3064,7 @@ dependencies = [ "idna", "matches", "percent-encoding", - "serde 1.0.131", + "serde 1.0.132", ] [[package]] @@ -2837,7 +3080,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" dependencies = [ "getrandom 0.2.3", - "serde 1.0.131", + "serde 1.0.132", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index cd4e508..592c9b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "relay" description = "A simple activitypub relay" -version = "0.3.9" +version = "0.3.10" authors = ["asonix "] license-file = "LICENSE" readme = "README.md" @@ -25,7 +25,8 @@ awc = { version = "3.0.0-beta.6", default-features = false, features = ["rustls" base64 = "0.13" chrono = "0.4.19" config = "0.11.0" -dashmap = "4.0.2" +console-subscriber = "0.1" +dashmap = "5.0.0" dotenv = "0.15.0" futures-util = "0.3.17" lru = "0.7.0" @@ -37,7 +38,7 @@ rsa = "0.5" rsa-magic-public-key = "0.4.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -sha2 = "0.9" +sha2 = "0.10" sled = "0.34.6" structopt = "0.3.12" thiserror = "1.0" diff --git a/docker/drone/Dockerfile b/docker/drone/Dockerfile index bc94e59..561eded 100644 --- a/docker/drone/Dockerfile +++ b/docker/drone/Dockerfile @@ -1,6 +1,6 @@ ARG REPO_ARCH -FROM asonix/rust-runner:$REPO_ARCH-latest +FROM asonix/rust-runner:latest-linux-$REPO_ARCH COPY relay /usr/local/bin/relay diff --git a/src/main.rs b/src/main.rs index 07e3d4e..38291c3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,12 +3,13 @@ use activitystreams::url::Url; use actix_web::{web, App, HttpServer}; +use console_subscriber::ConsoleLayer; use opentelemetry::{sdk::Resource, KeyValue}; use opentelemetry_otlp::WithExportConfig; use tracing_actix_web::TracingLogger; use tracing_error::ErrorLayer; use tracing_log::LogTracer; -use tracing_subscriber::{fmt::format::FmtSpan, layer::SubscriberExt, EnvFilter}; +use tracing_subscriber::{filter::Targets, fmt::format::FmtSpan, layer::SubscriberExt, Layer}; mod apub; mod args; @@ -37,16 +38,24 @@ fn init_subscriber( ) -> Result<(), anyhow::Error> { LogTracer::init()?; - let env_filter = EnvFilter::try_from_default_env().unwrap_or_else(|_| EnvFilter::new("info")); + let targets: Targets = std::env::var("RUST_LOG") + .unwrap_or_else(|_| "info".into()) + .parse()?; let format_layer = tracing_subscriber::fmt::layer() - .with_span_events(FmtSpan::CLOSE) - .pretty(); + .with_span_events(FmtSpan::NEW | FmtSpan::CLOSE) + .with_filter(targets.clone()); + + let console_layer = ConsoleLayer::builder() + .with_default_env() + .server_addr(([0, 0, 0, 0], 6669)) + .event_buffer_capacity(1024 * 1024) + .spawn(); let subscriber = tracing_subscriber::Registry::default() - .with(env_filter) - .with(ErrorLayer::default()) - .with(format_layer); + .with(console_layer) + .with(format_layer) + .with(ErrorLayer::default()); if let Some(url) = opentelemetry_url { let tracer = @@ -62,7 +71,9 @@ fn init_subscriber( ) .install_batch(opentelemetry::runtime::Tokio)?; - let otel_layer = tracing_opentelemetry::layer().with_tracer(tracer); + let otel_layer = tracing_opentelemetry::layer() + .with_tracer(tracer) + .with_filter(targets); let subscriber = subscriber.with(otel_layer); tracing::subscriber::set_global_default(subscriber)?; diff --git a/src/requests.rs b/src/requests.rs index 72c24c9..b04b301 100644 --- a/src/requests.rs +++ b/src/requests.rs @@ -168,7 +168,7 @@ impl Requests { client: Rc::new(RefCell::new( Client::builder() .wrap(Tracing) - .header("User-Agent", user_agent.clone()) + .add_default_header(("User-Agent", user_agent.clone())) .finish(), )), consecutive_errors: Rc::new(AtomicUsize::new(0)), @@ -187,7 +187,7 @@ impl Requests { warn!("{} consecutive errors, rebuilding http client", count); *self.client.borrow_mut() = Client::builder() .wrap(Tracing) - .header("User-Agent", self.user_agent.clone()) + .add_default_header(("User-Agent", self.user_agent.clone())) .finish(); self.reset_err(); } diff --git a/src/routes/nodeinfo.rs b/src/routes/nodeinfo.rs index ec15e08..b1d27cb 100644 --- a/src/routes/nodeinfo.rs +++ b/src/routes/nodeinfo.rs @@ -15,7 +15,8 @@ pub(crate) async fn well_known(config: web::Data) -> impl Responder { kind: None, }], }) - .with_header(("Content-Type", "application/jrd+json")) + .customize() + .insert_header(("Content-Type", "application/jrd+json")) } #[derive(serde::Serialize)]