diff --git a/Cargo.lock b/Cargo.lock index d828cbef0..9b39c7647 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,12 +196,52 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" +[[package]] +name = "async-compat" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f68a707c1feb095d8c07f8a65b9f506b117d30af431cab89374357de7c11461b" +dependencies = [ + "futures-core", + "futures-io", + "once_cell", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-trait" +version = "0.1.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "awaitable" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70af449c9a763cb655c6a1e5338b42d99c67190824ff90658c1e30be844c0775" +dependencies = [ + "awaitable-error", + "cfg-if 1.0.0", +] + +[[package]] +name = "awaitable-error" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5b3469636cdf8543cceab175efca534471f36eee12fb8374aba00eb5e7e7f8a" + [[package]] name = "backoff" version = "0.4.0" @@ -213,6 +253,18 @@ dependencies = [ "rand", ] +[[package]] +name = "backon" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c1a6197b2120bb2185a267f6515038558b019e92b832bb0320e96d66268dcf9" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "pin-project", + "tokio", +] + [[package]] name = "backtrace" version = "0.3.69" @@ -242,9 +294,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "binrw" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1b8720bedc0a503fd5c90bef3fbdc397144ac7efcc5610b30bde08083d7495" +checksum = "173901312e9850391d4d7c1318c4e099fdc037d61870fca427429830efdb4e5f" dependencies = [ "array-init", "binrw_derive", @@ -253,9 +305,9 @@ dependencies = [ [[package]] name = "binrw_derive" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0741a1b1a70a36a1e7fb0316bba0828f6487a3b6e577353cf974b59fbbb92081" +checksum = "cb515fdd6f8d3a357c8e19b8ec59ef53880807864329b1cb1cba5c53bf76557e" dependencies = [ "either", "owo-colors", @@ -307,6 +359,12 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.5.0" @@ -353,9 +411,9 @@ checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" [[package]] name = "cachedir" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e236bf5873ea57ec2877445297f4da008916bfae51567131acfc54a073d694f3" +checksum = "4703f3937077db8fa35bee3c8789343c1aec2585f0146f09d658d4ccc0e8d873" dependencies = [ "tempfile", ] @@ -395,8 +453,10 @@ checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", + "wasm-bindgen", "windows-targets 0.48.5", ] @@ -412,9 +472,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", "clap_derive", @@ -422,9 +482,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -491,6 +551,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "concurrent_arena" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c529c2d4ecc249ae15d317c9a8b9e7d86f87e80d4417de6cfa8f4d6030f37daf" +dependencies = [ + "arc-swap", + "parking_lot", + "triomphe", +] + [[package]] name = "console" version = "0.15.7" @@ -586,9 +657,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -630,9 +701,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if 1.0.0", ] @@ -789,6 +860,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] @@ -813,6 +885,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_destructure2" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -864,6 +947,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -921,6 +1005,15 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] + [[package]] name = "duct" version = "0.13.6" @@ -986,18 +1079,18 @@ dependencies = [ [[package]] name = "enum-map" -version = "2.7.1" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed40247825a1a0393b91b51d475ea1063a6cbbf0847592e7f13fb427aca6a716" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" dependencies = [ "enum-map-derive", ] [[package]] name = "enum-map-derive" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7933cd46e720348d29ed1493f89df9792563f272f96d8f13d18afe03b32f8cb8" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", @@ -1053,16 +1146,22 @@ checksum = "f69037fe1b785e84986b4f2cbcf647381876a00671d25ceef715d7812dd7e1dd" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall", + "windows-sys 0.52.0", ] +[[package]] +name = "flagset" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52a7e408202050813e6f1d9addadcaafef3dca7530c7ddfb005d4081cce6779" + [[package]] name = "flate2" version = "1.0.28" @@ -1081,9 +1180,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1103,6 +1202,21 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" +[[package]] +name = "futures" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.29" @@ -1110,6 +1224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -1118,6 +1233,17 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +[[package]] +name = "futures-executor" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.29" @@ -1147,12 +1273,19 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +[[package]] +name = "futures-timer" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" + [[package]] name = "futures-util" version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1191,8 +1324,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1209,15 +1344,15 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -1281,6 +1416,15 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.11" @@ -1390,9 +1534,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1400,17 +1544,16 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata 0.4.3", "same-file", - "thread_local", "walkdir", "winapi-util", ] @@ -1465,6 +1608,21 @@ dependencies = [ "generic-array", ] +[[package]] +name = "insta" +version = "1.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d64600be34b2fcfc267740a243fa7744441bb4947a619ac4e5bb6507f35fbfc" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "serde", + "similar", + "toml 0.5.11", + "yaml-rust", +] + [[package]] name = "instant" version = "0.1.12" @@ -1489,15 +1647,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.0" @@ -1553,11 +1702,29 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonwebtoken" +version = "9.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7ea04a7c5c055c175f189b6dc6ba036fd62306b58c66c9f6389036c503a3f4" +dependencies = [ + "base64", + "js-sys", + "pem", + "ring", + "serde", + "serde_json", + "simple_asn1", +] + [[package]] name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "libc" @@ -1565,6 +1732,12 @@ version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "libmimalloc-sys" version = "0.1.35" @@ -1583,9 +1756,15 @@ checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ "bitflags 2.4.1", "libc", - "redox_syscall 0.4.1", + "redox_syscall", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.4.11" @@ -1617,6 +1796,16 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if 1.0.0", + "digest", +] + [[package]] name = "memchr" version = "2.6.4" @@ -1710,6 +1899,66 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.17" @@ -1717,6 +1966,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1755,9 +2005,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -1766,35 +2016,174 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "option-ext" -version = "0.2.0" +name = "opendal" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +checksum = "c04ac25bc94e2b572a0f41bcc650cb39dd09255efce72b68eb5dc188b018c52a" +dependencies = [ + "anyhow", + "async-compat", + "async-trait", + "backon", + "base64", + "bytes", + "chrono", + "dirs", + "flagset", + "futures", + "http", + "log", + "md-5", + "once_cell", + "openssh", + "openssh-sftp-client", + "parking_lot", + "percent-encoding", + "pin-project", + "quick-xml 0.30.0", + "reqsign", + "reqwest", + "serde", + "serde_json", + "sha2", + "tokio", + "uuid", +] [[package]] -name = "os_pipe" -version = "1.1.4" +name = "openssh" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +checksum = "8274f2bf1fc3785406a3ff07c92c15590c00e84efb883da77b671562ca9a6115" dependencies = [ + "dirs", "libc", - "windows-sys 0.48.0", + "once_cell", + "shell-escape", + "tempfile", + "thiserror", + "tokio", + "tokio-pipe", ] [[package]] -name = "overload" -version = "0.1.1" +name = "openssh-sftp-client" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "5111bd8df89c0c7e64bf815710cafb05eff787f82e335244035ba685cf829b47" +dependencies = [ + "bytes", + "derive_destructure2", + "futures-core", + "once_cell", + "openssh", + "openssh-sftp-client-lowlevel", + "openssh-sftp-error", + "pin-project", + "scopeguard", + "tokio", + "tokio-io-utility", + "tokio-util", + "tracing", +] [[package]] -name = "owo-colors" +name = "openssh-sftp-client-lowlevel" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a84f1a52761901fcf5b10885544085348a872e57294531ec9188145d9a83042" +dependencies = [ + "awaitable", + "bytes", + "concurrent_arena", + "derive_destructure2", + "openssh-sftp-error", + "openssh-sftp-protocol", + "pin-project", + "tokio", + "tokio-io-utility", +] + +[[package]] +name = "openssh-sftp-error" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a5aea093d714df10186f481a6003e3f906f6fc8360c026737a841f4f182996" +dependencies = [ + "awaitable-error", + "openssh", + "openssh-sftp-protocol-error", + "ssh_format_error", + "thiserror", + "tokio", +] + +[[package]] +name = "openssh-sftp-protocol" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf38532d784978966f95d241226223823f351d5bb2a4bebcf6b20b9cb1e393e0" +dependencies = [ + "bitflags 2.4.1", + "num-derive", + "num-traits", + "openssh-sftp-protocol-error", + "serde", + "ssh_format", + "vec-strings", +] + +[[package]] +name = "openssh-sftp-protocol-error" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0719269eb3f037866ae07ec89cb44ed2c1d63b72b2390cef8e1aa3016a956ff8" +dependencies = [ + "serde", + "thiserror", + "vec-strings", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-multimap" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4d6a8c22fc714f0c2373e6091bf6f5e9b37b1bc0b1184874b7e0a4e303d318f" +dependencies = [ + "dlv-list", + "hashbrown 0.14.2", +] + +[[package]] +name = "os_pipe" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ae859aa07428ca9a929b936690f8b12dc5f11dd8c6992a18ca93919f28bc177" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owo-colors" version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" @@ -1828,7 +2217,7 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] @@ -1852,11 +2241,50 @@ dependencies = [ "hmac", ] +[[package]] +name = "pem" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8fcc794035347fb64beda2d3b462595dd2753e3f268d89c5aae77e8cf2c310" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] [[package]] name = "pin-project-lite" @@ -1870,6 +2298,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + [[package]] name = "pkcs8" version = "0.10.2" @@ -1973,6 +2412,26 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" +dependencies = [ + "memchr", + "serde", +] + +[[package]] +name = "quick-xml" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "quote" version = "1.0.33" @@ -2032,15 +2491,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -2105,11 +2555,49 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +[[package]] +name = "relative-path" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" + +[[package]] +name = "reqsign" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce87f66ba6c6acef277a729f989a0eca946cb9ce6a15bcc036bda0f72d4b9fd" +dependencies = [ + "anyhow", + "async-trait", + "base64", + "chrono", + "form_urlencoded", + "getrandom", + "hex", + "hmac", + "home", + "http", + "jsonwebtoken", + "log", + "once_cell", + "percent-encoding", + "quick-xml 0.31.0", + "rand", + "reqwest", + "rsa", + "rust-ini", + "serde", + "serde_json", + "sha1", + "sha2", + "tokio", +] + [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "base64", "bytes", @@ -2185,11 +2673,70 @@ dependencies = [ "cc", "getrandom", "libc", - "spin", + "spin 0.9.8", "untrusted", "windows-sys 0.48.0", ] +[[package]] +name = "rsa" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ef35bf3e7fe15a53c4ab08a998e42271eab13eb0db224126bc7bc4c4bad96d" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rstest" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97eeab2f3c0a199bc4be135c36c924b6590b88c377d416494288c14f2db30199" +dependencies = [ + "futures", + "futures-timer", + "rstest_macros", + "rustc_version", +] + +[[package]] +name = "rstest_macros" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605" +dependencies = [ + "cfg-if 1.0.0", + "glob", + "proc-macro2", + "quote", + "regex", + "relative-path", + "rustc_version", + "syn 2.0.39", + "unicode-ident", +] + +[[package]] +name = "rust-ini" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -2223,7 +2770,8 @@ dependencies = [ "gethostname", "humantime", "indicatif", - "itertools 0.12.0", + "insta", + "itertools", "jemallocator-global", "libc", "log", @@ -2232,27 +2780,71 @@ dependencies = [ "once_cell", "pretty_assertions", "rhai", + "rstest", + "rustic_backend", "rustic_core", "rustic_testing", "self_update", "semver", "serde", "serde_json", + "serde_path_to_error", "serde_with", "simplelog", "tempfile", "thiserror", "toml 0.8.8", + "toml_edit", +] + +[[package]] +name = "rustic_backend" +version = "0.1.0" +dependencies = [ + "aho-corasick", + "anyhow", + "backoff", + "binrw", + "bytes", + "cached", + "clap", + "derive_setters", + "displaydoc", + "filetime", + "hex", + "humantime", + "ignore", + "itertools", + "log", + "merge", + "nix", + "once_cell", + "opendal", + "rand", + "rayon", + "reqwest", + "rustic_core", + "serde", + "serde-aux", + "serde_derive", + "serde_json", + "serde_with", + "shell-words", + "strum", + "strum_macros", + "thiserror", + "tokio", + "url", + "walkdir", ] [[package]] name = "rustic_core" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5932066f9e144fc15043c4e0b9a82bfa16c83910243318bdafbb38496c1518a" dependencies = [ "aes256ctr_poly1305aes", "aho-corasick", + "anyhow", "backoff", "binrw", "bytes", @@ -2277,10 +2869,11 @@ dependencies = [ "humantime", "ignore", "integer-sqrt", - "itertools 0.11.0", + "itertools", "log", "merge", "nix", + "opendal", "pariter", "path-dedot", "rand", @@ -2487,7 +3080,7 @@ dependencies = [ "hyper", "indicatif", "log", - "quick-xml", + "quick-xml 0.23.1", "regex", "reqwest", "self-replace", @@ -2510,18 +3103,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde-aux" -version = "4.2.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3dfe1b7eb6f9dcf011bd6fad169cdeaae75eda0d61b1a99a3f015b41b0cae39" +checksum = "184eba62ebddb71658697c8b08822edee89970bf318c5362189f0de27f85b498" dependencies = [ "chrono", "serde", @@ -2530,9 +3123,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -2550,6 +3143,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.4" @@ -2600,6 +3203,17 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + [[package]] name = "sha2" version = "0.10.8" @@ -2640,12 +3254,27 @@ dependencies = [ "winapi", ] +[[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + [[package]] name = "shell-words" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + [[package]] name = "signature" version = "2.0.0" @@ -2653,6 +3282,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" dependencies = [ "digest", + "rand_core", +] + +[[package]] +name = "similar" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" + +[[package]] +name = "simple_asn1" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +dependencies = [ + "num-bigint", + "num-traits", + "thiserror", + "time", ] [[package]] @@ -2716,6 +3364,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spin" version = "0.9.8" @@ -2732,6 +3386,32 @@ dependencies = [ "der", ] +[[package]] +name = "ssh_format" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ab31081d1c9097c327ec23550858cb5ffb4af6b866c1ef4d728455f01f3304" +dependencies = [ + "bytes", + "serde", + "ssh_format_error", +] + +[[package]] +name = "ssh_format_error" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be3c6519de7ca611f71ef7e8a56eb57aa1c818fecb5242d0a0f39c83776c210c" +dependencies = [ + "serde", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -2843,7 +3523,7 @@ checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if 1.0.0", "fastrand 2.0.1", - "redox_syscall 0.4.1", + "redox_syscall", "rustix", "windows-sys 0.48.0", ] @@ -2867,20 +3547,26 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "thin-vec" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" + [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" dependencies = [ "proc-macro2", "quote", @@ -2964,10 +3650,43 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", + "signal-hook-registry", "socket2 0.5.5", + "tokio-macros", "windows-sys 0.48.0", ] +[[package]] +name = "tokio-io-utility" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d672654d175710e52c7c41f6aec77c62b3c0954e2a7ebce9049d1e94ed7c263" +dependencies = [ + "bytes", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "tokio-pipe" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f213a84bffbd61b8fa0ba8a044b4bbe35d471d0b518867181e82bd5c15542784" +dependencies = [ + "libc", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -3007,6 +3726,7 @@ version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -3113,6 +3833,17 @@ dependencies = [ "tracing-log 0.2.0", ] +[[package]] +name = "triomphe" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +dependencies = [ + "arc-swap", + "serde", + "stable_deref_trait", +] + [[package]] name = "try-lock" version = "0.2.4" @@ -3176,9 +3907,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -3197,12 +3928,32 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +dependencies = [ + "getrandom", + "serde", +] + [[package]] name = "valuable" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "vec-strings" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8509489e2a7ee219522238ad45fd370bec6808811ac15ac6b07453804e77659" +dependencies = [ + "serde", + "thin-vec", +] + [[package]] name = "version_check" version = "0.9.4" @@ -3396,6 +4147,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -3426,6 +4186,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -3438,6 +4213,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -3450,6 +4231,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -3462,6 +4249,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -3474,6 +4267,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -3486,6 +4285,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -3498,6 +4303,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -3510,6 +4321,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.5.19" @@ -3550,6 +4367,15 @@ dependencies = [ "glob", ] +[[package]] +name = "yaml-rust" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "yansi" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index cc8a8a6e8..39d79c754 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,6 +51,7 @@ rustdoc-args = ["--document-private-items", "--generate-link-to-definition"] [dependencies] abscissa_core = { workspace = true } +rustic_backend = { workspace = true } rustic_core = { workspace = true } # errors @@ -63,6 +64,7 @@ log = { workspace = true } # serialization serde = { workspace = true } serde_json = { workspace = true } +serde_path_to_error = { workspace = true } serde_with = { workspace = true } # other dependencies @@ -84,7 +86,7 @@ humantime = { workspace = true } indicatif = { workspace = true } itertools = { workspace = true } jemallocator-global = { version = "0.3.2", optional = true } -mimalloc = { version = "0.1.39", default_features = false, optional = true } +mimalloc = { version = "0.1.39", default-features = false, optional = true } rhai = { workspace = true } simplelog = { workspace = true } @@ -92,17 +94,25 @@ simplelog = { workspace = true } abscissa_core = { workspace = true, features = ["testing"] } aho-corasick = { workspace = true } dircmp = { workspace = true } +insta = { version = "1.34.0", features = ["toml"] } once_cell = { workspace = true } pretty_assertions = { workspace = true } +rstest = { workspace = true } rustic_testing = { path = "crates/rustic_testing" } tempfile = { workspace = true } -toml = { workspace = true } +toml = { workspace = true, features = ["parse", "preserve_order"] } +toml_edit = { workspace = true, features = ["serde"] } [target.'cfg(not(windows))'.dependencies] libc = "0.2.150" [workspace.dependencies] -rustic_core = { version = "0.1.2", features = ["cli"] } -abscissa_core = { version = "0.7.0", default-features = false, features = ["application"] } +rustic_core = { path = "../rustic_core/crates/core", version = "0.1.2", features = ["cli"] } +rustic_backend = { path = "../rustic_core/crates/backends", version = "0.1.0", features = ["cli"] } +# rustic_core = { version = "0.1.2", features = ["cli"] } + +abscissa_core = { version = "0.7.0", default-features = false, features = [ + "application", +] } # logging log = "0.4" @@ -116,6 +126,8 @@ anyhow = "1" serde = { version = "1", features = ["serde_derive"] } serde_with = { version = "3.4", features = ["base64"] } serde_json = "1" +serde_path_to_error = "0.1.14" +toml_edit = { version = "0.21.0", features = ["serde"] } # other dependencies aho-corasick = "1.1.2" @@ -145,7 +157,7 @@ quickcheck = "1" quickcheck_macros = "1" tempfile = "3.8" pretty_assertions = "1.4" -toml = "0.8" +toml = { version = "0.8", features = ["parse", "preserve_order"] } dircmp = "0.2" # cargo-binstall support @@ -200,6 +212,11 @@ lto = true debug-assertions = false codegen-units = 1 +# Faster insta testing runs +[profile.dev.package] +insta = { opt-level = 3 } +similar = { opt-level = 3 } + # Allows quick RPM file generation, if "cargo-generate-rpm" is installed: # cargo build --release; cargo generate-rpm # will result in a file like target/generate-rpm/rustic-rs-0.6.1-1.x86_64.rpm diff --git a/config/README.md b/config/README.md index 7790f4c1f..aa7b162bd 100644 --- a/config/README.md +++ b/config/README.md @@ -64,14 +64,26 @@ rustic. config file as a possible source of errors if you encounter problems. They could possibly shadow other values that you have already set. +### Backend Options + +| Attribute | Description | Default Value | Example Value | Environment Variable | +| ---------- | ------------------------------------- | ------------- | ------------- | -------------------- | +| repository | The path to the repository. Required. | Not set | "/tmp/rustic" | RUSTIC_REPOSITORY | +| repo-hot | The path to the hot repository. | Not set | | RUSTIC_REPO_HOT | + +### Backend Options (Additional) + +| Attribute | Description | Default Value | Example Value | +| ------------------- | ---------------------------------------------------------------------- | ------------- | ------------------------------ | +| post-create-command | Command to execute after creating a snapshot in the **local backend**. | Not set | "par2create -qq -n1 -r5 %file" | +| post-delete-command | Command to execute after deleting a snapshot in the **local backend**. | Not set | "sh -c \"rm -f %file*.par2\"" | + ### Repository Options | Attribute | Description | Default Value | Example Value | Environment Variable | | ---------------- | ---------------------------------------------------------- | ------------------------ | ---------------------- | ----------------------- | | cache-dir | Path to the cache directory. | ~/.cache/rustic/$REPO_ID | ~/.cache/my_own_cache/ | RUSTIC_CACHE_DIR | | no-cache | If true, disables caching. | false | | RUSTIC_NO_CACHE | -| repository | The path to the repository. Required. | Not set | "/tmp/rustic" | RUSTIC_REPOSITORY | -| repo-hot | The path to the hot repository. | Not set | | RUSTIC_REPO_HOT | | password | The password for the repository. | Not set | "mySecretPassword" | RUSTIC_PASSWORD | | password-file | Path to a file containing the password for the repository. | Not set | | RUSTIC_PASSWORD_FILE | | password-command | Command to retrieve the password for the repository. | Not set | | RUSTIC_PASSWORD_COMMAND | @@ -79,13 +91,6 @@ possibly shadow other values that you have already set. | warm-up-command | Command to warm up the repository. | Not set | | | | warm-up-wait | The wait time for warming up the repository. | Not set | | | -### Repository Options (Additional) - -| Attribute | Description | Default Value | Example Value | -| ------------------- | ------------------------------------------------------------------ | ------------- | ------------------------------ | -| post-create-command | Command to execute after creating a snapshot in the local backend. | Not set | "par2create -qq -n1 -r5 %file" | -| post-delete-command | Command to execute after deleting a snapshot in the local backend. | Not set | "sh -c \"rm -f %file*.par2\"" | - ### Snapshot-Filter Options | Attribute | Description | Default Value | Example Value | @@ -160,17 +165,24 @@ source-individual section. **Note**: Copy-targets are simply repositories with the same defaults as within the repository section. -| Attribute | Description | Default Value | Example Value | -| ------------------- | ---------------------------------------------------------------------- | ------------------------ | ---------------------- | -| cache-dir | Path to the cache directory for the target repository. | ~/.cache/rustic/$REPO_ID | ~/.cache/my_own_cache/ | -| no-cache | If true, disables caching for the target repository. | false | | -| password | The password for the target repository. | Not set | | -| password-file | Path to a file containing the password for the target repository. | Not set | | -| password-command | Command to retrieve the password for the target repository. | Not set | | -| post-create-command | Command to execute after creating a snapshot in the target repository. | Not set | | -| post-delete-command | Command to execute after deleting a snapshot in the target repository. | Not set | | -| repository | The path or URL to the target repository. | Not set | | -| repo-hot | The path or URL to the hot target repository. | Not set | | -| warm-up | If true, warms up the target repository by file access. | Not set | | -| warm-up-command | Command to warm up the target repository. | Not set | | -| warm-up-wait | The wait time for warming up the target repository. | Not set | | +#### Copy Target Backends + +| Attribute | Description | Default Value | Example Value | +| ------------------- | ---------------------------------------------------------------------- | ------------- | ------------------------------ | +| repository | The path or URL to the target repository. | Not set | | +| repo-hot | The path or URL to the hot target repository. | Not set | | +| post-create-command | Command to execute after creating a snapshot in the **local backend**. | Not set | "par2create -qq -n1 -r5 %file" | +| post-delete-command | Command to execute after deleting a snapshot in the **local backend**. | Not set | "sh -c \"rm -f %file*.par2\"" | + +#### Copy Target Options + +| Attribute | Description | Default Value | Example Value | +| ---------------- | ----------------------------------------------------------------- | ------------------------ | ---------------------- | +| cache-dir | Path to the cache directory for the target repository. | ~/.cache/rustic/$REPO_ID | ~/.cache/my_own_cache/ | +| no-cache | If true, disables caching for the target repository. | false | | +| password | The password for the target repository. | Not set | | +| password-file | Path to a file containing the password for the target repository. | Not set | | +| password-command | Command to retrieve the password for the target repository. | Not set | | +| warm-up | If true, warms up the target repository by file access. | Not set | | +| warm-up-command | Command to warm up the target repository. | Not set | | +| warm-up-wait | The wait time for warming up the target repository. | Not set | | diff --git a/config/copy_example.toml b/config/copy_example.toml index 1e7e67df1..f7c571a48 100644 --- a/config/copy_example.toml +++ b/config/copy_example.toml @@ -4,18 +4,27 @@ # See "rustic copy --help" for options how to select or filter snapshots to copy. # [repository] specified the source repository -[repository] +[backend] repository = "/tmp/repo" + +# [repository] specified the source repository +[repository] password = "test" # you can specify multiple targets -[[copy.targets]] -repository = "/tmp/repo2" +[[copy]] +[[copy.options]] password = "test" no-cache = true -[[copy.targets]] -repository = "rclone:ovh:backup" -repo-hot = "clone:ovh:backup-hot" +[[copy.backend]] +repository = "/tmp/repo2" + +[[copy]] +[[copy.options]] password-file = "/root/key-rustic-ovh" cache-dir = "/var/lib/cache/rustic" # explicitly specify cache dir for remote repository + +[[copy.backend]] +repository = "rclone|ovh:backup" +repo-hot = "rclone|ovh:backup-hot" diff --git a/config/full.toml b/config/full.toml index c28ca65ec..21ab96631 100644 --- a/config/full.toml +++ b/config/full.toml @@ -21,10 +21,20 @@ dry-run = false # This is only an example how to set an rclone env variable. Default: No variables are defined. RCLONE_XXX = "true" -# Repository options: These options define which backend to use and which password to use. -[repository] +# Backend options: These options define which backend to use and which password to use. +[backend] repository = "/repo/rustic" # Must be set repo-hot = "/my/hot/repo" # Default: not set + +# Additional backend options - depending on backend. These can be only set in the config file. +[backend.options] +post-create-command = "par2create -qq -n1 -r5 %file" # Only local backend; Default: not set +post-delete-command = "sh -c \"rm -f %file*.par2\"" # Only local backend; Default: not set +retry = "default" # Only rest/rclone backend; Allowed values: "false"/"off", "default" or number of retries +timeout = "10min" # Only rest/rclone backend + +# Repository options: These options define which repository settings and passwords to use. +[repository] # one of the three password options must be set password = "mySecretPassword" password-file = "/my/password.txt" @@ -36,13 +46,6 @@ warm-up = false warm-up-command = "warmup.sh %id" # Default: not set warm-up-wait = "10min" # Default: not set -# Additional repository options - depending on backend. These can be only set in the config file. -[repository.options] -post-create-command = "par2create -qq -n1 -r5 %file" # Only local backend; Default: not set -post-delete-command = "sh -c \"rm -f %file*.par2\"" # Only local backend; Default: not set -retry = "default" # Only rest/rclone backend; Allowed values: "false"/"off", "default" or number of retries -timeout = "10min" # Only rest/rclone backend - # Snapshot-filter options: These options apply to all commands that use snapshot filters [snapshot-filter] filter-host = ["host2", "host2"] # Default: no host filter @@ -150,9 +153,8 @@ keep-within-yearly = "10 years" # Multiple targets are available for the copy command. Each specify a repository with exactly identical options as in # the [repository] section. -[[copy.targets]] -repository = "/repo/rustic" # Must be set -repo-hot = "/my/hot/repo" # Default: not set +[[copy]] +[[copy.options]] # one of the three password options must be set password = "mySecretPassword" password-file = "/my/password.txt" @@ -164,6 +166,11 @@ warm-up = false warm-up-command = "warmup.sh %id" # Default: not set warm-up-wait = "10min" # Default: not set -[[copy.targets]] +[[copy.backend]] +repository = "/repo/rustic" # Must be set +repo-hot = "/my/hot/repo" # Default: not set + +[[copy]] +[[copy.backend]] repository = "/repo/rustic2" # Must be set # ... diff --git a/config/local.toml b/config/local.toml index 9b378e821..a119ea813 100644 --- a/config/local.toml +++ b/config/local.toml @@ -3,8 +3,10 @@ # backup usage: "rustic -P local backup # cleanup: "rustic -P local forget --prune # -[repository] +[backend] repository = "/backup/rustic" + +[repository] password-file = "/root/key-rustic" no-cache = true # no cache needed for local repository diff --git a/config/ovh-hot-cold.toml b/config/ovh-hot-cold.toml index ee490b0d1..03db4caa6 100644 --- a/config/ovh-hot-cold.toml +++ b/config/ovh-hot-cold.toml @@ -4,9 +4,11 @@ # backup usage: "rustic -P ovh-hot-cold backup # cleanup: "rustic -P ovh-hot-cold forget --prune # -[repository] +[backend] repository = "rclone:ovh:backup-home" repo-hot = "rclone:ovh:backup-home-hot" + +[repository] password-file = "/root/key-rustic-ovh" cache-dir = "/var/lib/cache/rustic" # explicitly specify cache dir for remote repository warm-up = true # cold storage needs warm-up, just trying to access a file is sufficient to start the warm-up diff --git a/config/par2.toml b/config/par2.toml index 55ad07cb5..4f9f5948b 100644 --- a/config/par2.toml +++ b/config/par2.toml @@ -2,14 +2,16 @@ # error correction files using par2create to a local repository. # The commands can use the variable %file, %type and %id which are replaced by the filename, the # file type and the file id before calling the command. -[repository] +[backend] repository = "/tmp/repo" -password = "test" -[repository.options] +[backend.options] # after saving a file in the repo, this command is called post-create-command = "par2create -qq -n1 -r5 %file" # after removing a file from the repo, this command is called. # Note that we want to use a "*" in the rm command, hence we have to call sh to resolve the wildcard! post-delete-command = "sh -c \"rm -f %file*.par2\"" + +[repository] +password = "test" diff --git a/config/rustic.toml b/config/rustic.toml index 850821984..b5e6acc0e 100644 --- a/config/rustic.toml +++ b/config/rustic.toml @@ -10,9 +10,11 @@ log-level = "debug" log-file = "/log/rustic.log" +[backend] +repository = "/tmp/rustic" + # repository options: These options define which backend to use and which password to use. [repository] -repository = "/tmp/rustic" password = "mySecretPassword" # snapshot-filter options: These options apply to all commands that use snapshot filters diff --git a/config/simple.toml b/config/simple.toml index 72acb8fc2..a1e78d3de 100644 --- a/config/simple.toml +++ b/config/simple.toml @@ -1,3 +1,5 @@ -[repository] +[backend] repository = "/tmp/repo" + +[repository] password = "test" diff --git a/src/commands.rs b/src/commands.rs index 50460378d..d319abbe2 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -243,7 +243,10 @@ impl Configurable for EntryPoint { /// [`RepositoryErrorKind::FromSplitError`]: crate::error::RepositoryErrorKind::FromSplitError fn open_repository(config: &Arc) -> Result> { let po = config.global.progress_options; - let repo = Repository::new_with_progress(&config.repository, po)?; + + let backends = config.backend.to_backends()?; + + let repo = Repository::new_with_progress(&config.repository, backends, po)?; match repo.password()? { // if password is given, directly return the result of find_key_in_backend and don't retry Some(pass) => { diff --git a/src/commands/backup.rs b/src/commands/backup.rs index 6dbf570ec..3a8f23b3b 100644 --- a/src/commands/backup.rs +++ b/src/commands/backup.rs @@ -130,9 +130,10 @@ impl Runnable for BackupCmd { impl BackupCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); + let backends = config.backend.to_backends()?; let po = config.global.progress_options; - let repo = Repository::new_with_progress(&config.repository, po)?; + let repo = Repository::new_with_progress(&config.repository, backends, po)?; // Initialize repository if --init is set and it is not yet initialized let repo = if self.init && repo.config_id()?.is_none() { if config.global.dry_run { @@ -224,7 +225,7 @@ impl BackupCmd { .ignore_save_opts(opts.ignore_save_opts) .ignore_filter_opts(opts.ignore_filter_opts) .dry_run(config.global.dry_run); - let snap = repo.backup(&backup_opts, source.clone(), opts.snap_opts.to_snapshot()?)?; + let snap = repo.backup(&backup_opts, &source, opts.snap_opts.to_snapshot()?)?; if opts.json { let mut stdout = std::io::stdout(); diff --git a/src/commands/copy.rs b/src/commands/copy.rs index fb7d5afd4..d178177e6 100644 --- a/src/commands/copy.rs +++ b/src/commands/copy.rs @@ -8,9 +8,10 @@ use anyhow::{bail, Result}; use log::{error, info}; use merge::Merge; +use rustic_backend::BackendOptions; use serde::Deserialize; -use rustic_core::{CopySnapshot, Id, KeyOptions, Repository, RepositoryOptions}; +use rustic_core::{overwrite, CopySnapshot, Id, KeyOptions, Repository, RepositoryOptions}; /// `copy` subcommand #[derive(clap::Parser, Command, Debug)] @@ -30,10 +31,14 @@ pub(crate) struct CopyCmd { /// Target repository options #[derive(Default, Clone, Debug, Deserialize, Merge)] -pub struct Targets { +pub struct TargetOptions { /// Target repositories - #[merge(strategy = merge::vec::overwrite_empty)] - targets: Vec, + #[merge(strategy = overwrite)] + options: RepositoryOptions, + + /// Backend options + #[merge(strategy = overwrite)] + backend: BackendOptions, } impl Runnable for CopyCmd { @@ -49,8 +54,8 @@ impl CopyCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - if config.copy.targets.is_empty() { - status_err!("no [[copy.targets]] section in config file found!"); + if config.copy.is_empty() { + status_err!("no [[copy]] section in config file found!"); RUSTIC_APP.shutdown(Shutdown::Crash); } @@ -64,9 +69,15 @@ impl CopyCmd { snapshots.sort_unstable(); let poly = repo.config().poly()?; - for target_opt in &config.copy.targets { - let repo_dest = - Repository::new_with_progress(target_opt, config.global.progress_options)?; + for target_opt in &config.copy { + let repo_dest = { + let backends = target_opt.backend.to_backends()?; + Repository::new_with_progress( + &target_opt.options, + backends, + config.global.progress_options, + )? + }; let repo_dest = if self.init && repo_dest.config_id()?.is_none() { if config.global.dry_run { diff --git a/src/commands/init.rs b/src/commands/init.rs index d770e62db..146a22265 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -33,9 +33,10 @@ impl Runnable for InitCmd { impl InitCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); + let backends = config.backend.to_backends()?; let po = config.global.progress_options; - let repo = Repository::new_with_progress(&config.repository, po)?; + let repo = Repository::new_with_progress(&config.repository, backends, po)?; // Note: This is again checked in repo.init_with_password(), however we want to inform // users before they are prompted to enter a password diff --git a/src/commands/key.rs b/src/commands/key.rs index f00cede3e..310fb414f 100644 --- a/src/commands/key.rs +++ b/src/commands/key.rs @@ -60,10 +60,14 @@ impl AddCmd { // create new "artificial" repo using the given password options let repo_opts = RepositoryOptions { password_file: self.new_password_file.clone(), - repository: Some(String::new()), // fake repository to make Repository::new() not bail ..Default::default() }; - let repo_newpass = Repository::new(&repo_opts)?; + // TODO: fake repository to make Repository::new() not bail?? + // String::new() was passed before!? + // Should we implemented default on RepositoryBackends? + // And make .repository optional? + let backends = config.backend.to_backends()?; + let repo_newpass = Repository::new(&repo_opts, backends)?; let pass = repo_newpass .password() diff --git a/src/commands/repoinfo.rs b/src/commands/repoinfo.rs index 887c42976..fbf6ae68d 100644 --- a/src/commands/repoinfo.rs +++ b/src/commands/repoinfo.rs @@ -50,11 +50,13 @@ impl RepoInfoCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); + let backends = config.backend.to_backends()?; + let infos = Infos { files: (!self.only_index) .then(|| { let po = config.global.progress_options; - let repo = Repository::new_with_progress(&config.repository, po)?; + let repo = Repository::new_with_progress(&config.repository, backends, po)?; repo.infos_files() }) .transpose()?, diff --git a/src/config.rs b/src/config.rs index 254669924..67285c0b9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -18,11 +18,12 @@ use abscissa_core::FrameworkError; use clap::Parser; use itertools::Itertools; use log::Level; +use rustic_backend::BackendOptions; use rustic_core::RepositoryOptions; use serde::{Deserialize, Serialize}; use crate::{ - commands::{backup::BackupCmd, copy::Targets, forget::ForgetOptions}, + commands::{backup::BackupCmd, copy::TargetOptions, forget::ForgetOptions}, config::progress_options::ProgressOptions, filtering::SnapshotFilter, }; @@ -40,6 +41,9 @@ pub struct RusticConfig { #[clap(flatten, next_help_heading = "Global options")] pub global: GlobalOptions, + #[clap(flatten, next_help_heading = "Backend options")] + pub backend: BackendOptions, + /// Repository options #[clap(flatten, next_help_heading = "Repository options")] pub repository: RepositoryOptions, @@ -54,7 +58,8 @@ pub struct RusticConfig { /// Copy options #[clap(skip)] - pub copy: Targets, + #[merge(strategy = merge::vec::overwrite_empty)] + pub copy: Vec, /// Forget options #[clap(skip)] diff --git a/tests/config.rs b/tests/config.rs index 0993067ea..cfbf17657 100644 --- a/tests/config.rs +++ b/tests/config.rs @@ -1,31 +1,15 @@ //! Configuration file tests -use log::LevelFilter; +use anyhow::Result; +use rstest::*; use rustic_rs::RusticConfig; -use std::{error::Error, fs, path::PathBuf, str::FromStr}; +use std::{fs, path::PathBuf}; -type Result = std::result::Result>; - -fn get_config_file_path() -> PathBuf { - ["config", "full.toml"].iter().collect() -} -/// Ensure `full.toml` parses as a valid config file -#[test] -fn parse_full_toml_example() -> Result<()> { - let output = std::process::Command::new("cargo") - .args(["locate-project", "--workspace", "--message-format", "plain"]) - .output()?; - let root = PathBuf::from_str(String::from_utf8(output.stdout)?.as_str())?; - let root_dir = root.parent().unwrap(); - let config_path = root_dir.join(get_config_file_path()); +/// Ensure `configs` parse as a valid config files +#[rstest] +fn test_parse_rustic_configs_is_ok(#[files("config/*.toml")] config_path: PathBuf) -> Result<()> { let toml_string = fs::read_to_string(config_path)?; - let config: RusticConfig = toml::from_str(&toml_string)?; - - assert_eq!( - LevelFilter::from_str(config.global.log_level.unwrap().as_str())?, - LevelFilter::Info - ); - assert!(!config.global.dry_run); + let _ = toml::from_str::(&toml_string)?; Ok(()) }