diff --git a/.cargo/audit.toml b/.cargo/audit.toml new file mode 100644 index 000000000..0b1189335 --- /dev/null +++ b/.cargo/audit.toml @@ -0,0 +1,6 @@ +[advisories] +ignore = [ + # FIXME!: See https://github.com/RustCrypto/RSA/issues/19#issuecomment-1822995643. + # There is no workaround available yet. + "RUSTSEC-2023-0071", +] diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 73dee4ddd..9f2b3be90 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -30,6 +30,7 @@ jobs: - uses: rustsec/audit-check@dd51754d4e59da7395a4cd9b593f0ff2d61a9b95 # v1.4.1 with: token: ${{ secrets.GITHUB_TOKEN }} + ignore: RUSTSEC-2023-0071 # rsa thingy, ignored for now cargo-deny: name: Run cargo-deny diff --git a/Cargo.lock b/Cargo.lock index cb68e92ab..5bfcfdcb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -180,9 +180,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca87830a3e3fb156dc96cfbd31cb620265dd053be734723f22b760d6cc3c3051" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arc-swap" @@ -196,12 +196,39 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" +[[package]] +name = "async-trait" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[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 +240,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" @@ -230,9 +269,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -272,9 +311,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -303,9 +342,15 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -321,9 +366,9 @@ checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" [[package]] name = "cached" -version = "0.46.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c8c50262271cdf5abc979a5f76515c234e764fa025d1ba4862c0f0bcda0e95" +checksum = "69b0116662497bc24e4b177c90eaf8870e39e2714c3fcfa296327a93f593fc21" dependencies = [ "cached_proc_macro", "cached_proc_macro_types", @@ -347,9 +392,9 @@ dependencies = [ [[package]] name = "cached_proc_macro_types" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" +checksum = "ade8366b8bd5ba243f0a58f036cc0ca8a2f069cff1a2351ef1cac6b083e16fc0" [[package]] name = "cachedir" @@ -390,15 +435,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", "serde", - "windows-targets 0.48.5", + "wasm-bindgen", + "windows-targets 0.52.0", ] [[package]] @@ -413,9 +460,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.12" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -423,9 +470,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.12" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -436,9 +483,9 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.5" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a51919c5608a32e34ea1d6be321ad070065e17613e168c5b6977024290f2630b" +checksum = "df631ae429f6613fcd3a7c1adbdb65f637271e561b03680adaa6573015dfb106" dependencies = [ "clap", ] @@ -452,7 +499,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -492,17 +539,28 @@ 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" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] @@ -555,9 +613,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -573,11 +631,10 @@ dependencies = [ [[package]] name = "crossbeam" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb9105919ca8e40d437fc9cbb8f1975d916f1bd28afe795a48aae32a2cc8920" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ - "cfg-if 1.0.0", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", @@ -587,54 +644,46 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if 1.0.0", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if 1.0.0", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.17" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if 1.0.0", "crossbeam-utils", ] [[package]] name = "crossbeam-queue" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if 1.0.0", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crossterm" @@ -642,7 +691,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f476fe445d41c9e991fd07515a6f463074b782242ccf4a5b7b1d1012e70824df" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "crossterm_winapi", "libc", "parking_lot", @@ -708,7 +757,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -756,7 +805,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -778,7 +827,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -788,6 +837,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", + "pem-rfc7468", "zeroize", ] @@ -812,6 +862,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.48", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -834,7 +895,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -863,6 +924,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", "subtle", ] @@ -917,7 +979,16 @@ checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", +] + +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", ] [[package]] @@ -990,18 +1061,7 @@ version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" dependencies = [ - "enum-map-derive 0.17.0", -] - -[[package]] -name = "enum-map-derive" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7933cd46e720348d29ed1493f89df9792563f272f96d8f13d18afe03b32f8cb8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.43", + "enum-map-derive", ] [[package]] @@ -1012,7 +1072,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -1074,6 +1134,12 @@ dependencies = [ "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" @@ -1114,6 +1180,20 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.30" @@ -1121,6 +1201,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -1143,7 +1224,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -1164,6 +1245,7 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1197,13 +1279,15 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1227,7 +1311,7 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -1270,9 +1354,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -1292,6 +1376,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" @@ -1411,15 +1504,15 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747ad1b4ae841a78e8aba0d63adbfbeaea26b517b63705d47856b73015d27060" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ "crossbeam-deque", "globset", "log", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "same-file", "walkdir", "winapi-util", @@ -1499,15 +1592,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" @@ -1565,18 +1649,36 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" 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" @@ -1584,6 +1686,12 @@ version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +[[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" @@ -1600,16 +1708,16 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -1636,6 +1744,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.7.1" @@ -1705,7 +1823,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if 1.0.0", "libc", ] @@ -1720,6 +1838,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" @@ -1727,6 +1905,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1775,6 +1954,131 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "opendal" +version = "0.44.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4af824652d4d2ffabf606d337a071677ae621b05622adf35df9562f69d9b4498" +dependencies = [ + "anyhow", + "async-trait", + "backon", + "base64", + "bytes", + "chrono", + "flagset", + "futures", + "getrandom", + "http", + "log", + "md-5", + "once_cell", + "openssh", + "openssh-sftp-client", + "percent-encoding", + "quick-xml 0.30.0", + "reqsign", + "reqwest", + "serde", + "serde_json", + "sha2", + "tokio", + "uuid", +] + +[[package]] +name = "openssh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab71dc3fc68747816c7eecdffcede064d6bac9621fd658bf1ab5414e91558a3" +dependencies = [ + "libc", + "once_cell", + "shell-escape", + "tempfile", + "thiserror", + "tokio", + "tokio-pipe", +] + +[[package]] +name = "openssh-sftp-client" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +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 = "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.2", + "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" @@ -1787,6 +2091,16 @@ 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.3", +] + [[package]] name = "os_pipe" version = "1.1.5" @@ -1856,17 +2170,56 @@ dependencies = [ name = "pbkdf2" version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest", + "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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ - "digest", - "hmac", + "pin-project-internal", ] [[package]] -name = "percent-encoding" -version = "2.3.1" +name = "pin-project-internal" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] [[package]] name = "pin-project-lite" @@ -1880,6 +2233,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" @@ -1892,9 +2256,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "platforms" @@ -1967,9 +2331,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.72" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a293318316cf6478ec1ad2a21c49390a8d5b5eae9fab736467d93fbc0edc29c5" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1983,11 +2347,31 @@ 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.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a37c9326af5ed140c86a46655b5278de879853be5573c01df185b6f49a580a" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2024,9 +2408,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -2034,9 +2418,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -2064,13 +2448,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.5", "regex-syntax 0.8.2", ] @@ -2085,9 +2469,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -2106,6 +2490,38 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +[[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.23" @@ -2156,7 +2572,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3625f343d89990133d013e39c46e350915178cf94f1bec9f49b0cbef98a3e3c" dependencies = [ "ahash", - "bitflags 2.4.1", + "bitflags 2.4.2", "instant", "num-traits", "once_cell", @@ -2174,7 +2590,7 @@ checksum = "853977598f084a492323fe2f7896b4100a86284ee8473612de60021ea341310f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2186,11 +2602,41 @@ dependencies = [ "cc", "getrandom", "libc", - "spin", + "spin 0.9.8", "untrusted", "windows-sys 0.48.0", ] +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[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" @@ -2224,7 +2670,7 @@ dependencies = [ "gethostname", "humantime", "indicatif", - "itertools 0.12.0", + "itertools", "jemallocator-global", "libc", "log", @@ -2233,6 +2679,7 @@ dependencies = [ "once_cell", "pretty_assertions", "rhai", + "rustic_backend", "rustic_core", "rustic_testing", "self_update", @@ -2246,15 +2693,45 @@ dependencies = [ "toml 0.8.8", ] +[[package]] +name = "rustic_backend" +version = "0.1.0" +source = "git+https://github.com/rustic-rs/rustic_core.git#27499dbf4c2381f4075a2acb3b16cccdde9d65e5" +dependencies = [ + "aho-corasick", + "anyhow", + "backoff", + "bytes", + "clap", + "derive_setters", + "displaydoc", + "hex", + "humantime", + "itertools", + "log", + "merge", + "opendal", + "rand", + "rayon", + "reqwest", + "rustic_core", + "serde", + "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" +source = "git+https://github.com/rustic-rs/rustic_core.git#27499dbf4c2381f4075a2acb3b16cccdde9d65e5" dependencies = [ "aes256ctr_poly1305aes", - "aho-corasick", - "backoff", + "anyhow", "binrw", "bytes", "bytesize", @@ -2266,19 +2743,18 @@ dependencies = [ "derivative", "derive_more", "derive_setters", - "directories", "dirs", "displaydoc", "dunce", "enum-map", - "enum-map-derive 0.15.0", + "enum-map-derive", "filetime", "gethostname", "hex", "humantime", "ignore", "integer-sqrt", - "itertools 0.11.0", + "itertools", "log", "merge", "nix", @@ -2286,7 +2762,6 @@ dependencies = [ "path-dedot", "rand", "rayon", - "reqwest", "scrypt", "serde", "serde-aux", @@ -2296,7 +2771,6 @@ dependencies = [ "sha2", "shell-words", "thiserror", - "url", "walkdir", "xattr", "zstd", @@ -2313,11 +2787,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", @@ -2488,7 +2962,7 @@ dependencies = [ "hyper", "indicatif", "log", - "quick-xml", + "quick-xml 0.23.1", "regex", "reqwest", "self-replace", @@ -2502,27 +2976,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde-aux" -version = "4.3.1" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184eba62ebddb71658697c8b08822edee89970bf318c5362189f0de27f85b498" +checksum = "a86348501c129f3ad50c2f4635a01971f76974cd8a3f335988a0f1581c082765" dependencies = [ "chrono", "serde", @@ -2531,20 +3005,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" dependencies = [ "itoa", "ryu", @@ -2574,9 +3048,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.4.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64cd236ccc1b7a29e7e2739f27c0b2dd199804abc4290e32f59f3b68d6405c23" +checksum = "f5c9fdb6b00a489875b22efd4b78fe2b363b72265cc5f6eb2e2b9ee270e6140c" dependencies = [ "base64", "chrono", @@ -2591,14 +3065,25 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.4.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93634eb5f75a2323b16de4748022ac4297f9e76b6dced2be287a099f41b5e788" +checksum = "dbff351eb4b33600a2e138dfa0b10b65a238ea8ff8fb2387c422c5022a3e8298" dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", +] + +[[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]] @@ -2641,12 +3126,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.2.0" @@ -2657,6 +3157,18 @@ dependencies = [ "rand_core", ] +[[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]] name = "simplelog" version = "0.12.1" @@ -2679,9 +3191,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" dependencies = [ "serde", ] @@ -2708,6 +3220,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" @@ -2724,6 +3242,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" @@ -2752,7 +3296,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2774,9 +3318,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.43" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -2859,24 +3403,30 @@ 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.53" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cd5904763bad08ad5513ddbb12cf2ae273ca53fa9f68e843e236ec6dfccc09" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.53" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcf4a824cce0aeacd6f38ae6f24234c8e80d68632338ebaa1443b5df9e29e19" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2956,10 +3506,43 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", + "signal-hook-registry", "socket2", + "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.48", +] + +[[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" @@ -3052,7 +3635,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -3105,6 +3688,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.5" @@ -3119,9 +3713,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -3189,12 +3783,32 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +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" @@ -3237,9 +3851,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3247,24 +3861,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3274,9 +3888,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3284,22 +3898,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-streams" @@ -3316,9 +3930,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -3370,15 +3984,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -3397,21 +4002,6 @@ dependencies = [ "windows-targets 0.52.0", ] -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - [[package]] name = "windows-targets" version = "0.48.5" @@ -3442,12 +4032,6 @@ dependencies = [ "windows_x86_64_msvc 0.52.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -3460,12 +4044,6 @@ 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -3478,12 +4056,6 @@ 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -3496,12 +4068,6 @@ 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -3514,12 +4080,6 @@ 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -3532,12 +4092,6 @@ 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -3550,12 +4104,6 @@ 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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -3570,9 +4118,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.31" +version = "0.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" +checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" dependencies = [ "memchr", ] @@ -3589,9 +4137,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys", @@ -3633,7 +4181,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index b776fdf12..19364cd0b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,6 +52,7 @@ rustdoc-args = ["--document-private-items", "--generate-link-to-definition"] [dependencies] abscissa_core = { workspace = true } +rustic_backend = { workspace = true } rustic_core = { workspace = true } # errors @@ -102,8 +103,9 @@ toml = { workspace = true } [target.'cfg(not(windows))'.dependencies] libc = "0.2.152" [workspace.dependencies] -rustic_core = { version = "0.1.2", features = ["cli"] } abscissa_core = { version = "0.7.0", default-features = false, features = ["application"] } +rustic_backend = { git = "https://github.com/rustic-rs/rustic_core.git", features = ["cli"] } +rustic_core = { git = "https://github.com/rustic-rs/rustic_core.git", features = ["cli"] } # logging log = "0.4" diff --git a/config/full.toml b/config/full.toml index c28ca65ec..2e519cf77 100644 --- a/config/full.toml +++ b/config/full.toml @@ -81,6 +81,7 @@ one-file-system = false exclude-larger-than = "100MB" # Default: not set json = false init = false +skip-identical-parent = false # Backup options for specific sources - all above options are also available here and replace them for the given source [[backup.sources]] @@ -112,6 +113,7 @@ one-file-system = false exclude-larger-than = "100MB" # Default: not set json = false init = false +skip-identical-parent = false [[backup.sources]] source = "/path/to/source2 /second/path" # multiple local paths are allowd within one source diff --git a/src/commands.rs b/src/commands.rs index 6ff90ec9d..b0b113fe7 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -26,7 +26,6 @@ pub(crate) mod tag; use std::fs::File; use std::path::PathBuf; use std::str::FromStr; -use std::sync::Arc; use crate::{ commands::{ @@ -36,7 +35,7 @@ use crate::{ repair::RepairCmd, repoinfo::RepoInfoCmd, restore::RestoreCmd, self_update::SelfUpdateCmd, show_config::ShowConfigCmd, snapshots::SnapshotCmd, tag::TagCmd, }, - config::{progress_options::ProgressOptions, RusticConfig}, + config::{progress_options::ProgressOptions, AllRepositoryOptions, RusticConfig}, {Application, RUSTIC_APP}, }; @@ -223,11 +222,24 @@ impl Configurable for EntryPoint { } } -/// Open the repository with the given config +/// Get the repository with the given options /// /// # Arguments /// -/// * `config` - The config file +/// * `repo_opts` - The repository options +/// +fn get_repository(repo_opts: &AllRepositoryOptions) -> Result> { + let po = RUSTIC_APP.config().global.progress_options; + let backends = repo_opts.be.to_backends()?; + let repo = Repository::new_with_progress(&repo_opts.repo, backends, po)?; + Ok(repo) +} + +/// Open the repository with the given options +/// +/// # Arguments +/// +/// * `repo_opts` - The repository options /// /// # Errors /// @@ -242,9 +254,10 @@ impl Configurable for EntryPoint { /// [`RepositoryErrorKind::PasswordCommandParsingFailed`]: crate::error::RepositoryErrorKind::PasswordCommandParsingFailed /// [`RepositoryErrorKind::ReadingPasswordFromCommandFailed`]: crate::error::RepositoryErrorKind::ReadingPasswordFromCommandFailed /// [`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)?; +fn open_repository( + repo_opts: &AllRepositoryOptions, +) -> Result> { + let repo = get_repository(repo_opts)?; 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..df53d2ddc 100644 --- a/src/commands/backup.rs +++ b/src/commands/backup.rs @@ -3,24 +3,22 @@ use std::path::PathBuf; use crate::{ - commands::open_repository, + commands::{get_repository, init::init}, helpers::bytes_size_to_string, - {status_err, Application, RUSTIC_APP}, + status_err, Application, RUSTIC_APP, }; + use abscissa_core::{Command, Runnable, Shutdown}; use anyhow::{bail, Context, Result}; use log::{debug, info, warn}; - use merge::Merge; use serde::Deserialize; use rustic_core::{ BackupOptions, ConfigOptions, KeyOptions, LocalSourceFilterOptions, LocalSourceSaveOptions, - ParentOptions, PathList, Repository, SnapshotOptions, + ParentOptions, PathList, SnapshotOptions, }; -use super::init::init; - /// `backup` subcommand #[derive(Clone, Command, Default, Debug, clap::Parser, Deserialize, Merge)] #[serde(default, rename_all = "kebab-case", deny_unknown_fields)] @@ -52,6 +50,11 @@ pub struct BackupCmd { #[serde(flatten)] ignore_save_opts: LocalSourceSaveOptions, + /// Don't scan the backup source for its size - this disables ETA estimation for backup. + #[clap(long)] + #[merge(strategy = merge::bool::overwrite_false)] + pub no_scan: bool, + /// Output generated snapshot in json format #[clap(long)] #[merge(strategy = merge::bool::overwrite_false)] @@ -130,9 +133,7 @@ impl Runnable for BackupCmd { impl BackupCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - - let po = config.global.progress_options; - let repo = Repository::new_with_progress(&config.repository, po)?; + let repo = get_repository(&config.repository)?; // 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 { @@ -143,7 +144,7 @@ impl BackupCmd { } init(repo, &self.key_opts, &self.config_opts)? } else { - open_repository(&config)? + repo.open()? } .to_indexed_ids()?; @@ -223,8 +224,9 @@ impl BackupCmd { .parent_opts(opts.parent_opts) .ignore_save_opts(opts.ignore_save_opts) .ignore_filter_opts(opts.ignore_filter_opts) + .no_scan(opts.no_scan) .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/cat.rs b/src/commands/cat.rs index 2a085eedb..c7176cae4 100644 --- a/src/commands/cat.rs +++ b/src/commands/cat.rs @@ -59,7 +59,7 @@ impl Runnable for CatCmd { impl CatCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; let data = match &self.cmd { CatSubCmd::Config => repo.cat_file(FileType::Config, "")?, diff --git a/src/commands/check.rs b/src/commands/check.rs index 7de32d048..9393630f8 100644 --- a/src/commands/check.rs +++ b/src/commands/check.rs @@ -26,7 +26,7 @@ impl Runnable for CheckCmd { impl CheckCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; repo.check(self.opts)?; Ok(()) } diff --git a/src/commands/config.rs b/src/commands/config.rs index bee33aa8e..a201dfd5d 100644 --- a/src/commands/config.rs +++ b/src/commands/config.rs @@ -28,7 +28,7 @@ impl Runnable for ConfigCmd { impl ConfigCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; let changed = repo.apply_config(&self.config_opts)?; diff --git a/src/commands/copy.rs b/src/commands/copy.rs index fb7d5afd4..3a9ef4d9c 100644 --- a/src/commands/copy.rs +++ b/src/commands/copy.rs @@ -1,16 +1,18 @@ //! `copy` subcommand use crate::{ - commands::open_repository, helpers::table_with_titles, status_err, Application, RUSTIC_APP, + commands::{get_repository, open_repository}, + config::AllRepositoryOptions, + helpers::table_with_titles, + status_err, Application, RUSTIC_APP, }; use abscissa_core::{Command, Runnable, Shutdown}; use anyhow::{bail, Result}; use log::{error, info}; - use merge::Merge; use serde::Deserialize; -use rustic_core::{CopySnapshot, Id, KeyOptions, Repository, RepositoryOptions}; +use rustic_core::{CopySnapshot, Id, KeyOptions}; /// `copy` subcommand #[derive(clap::Parser, Command, Debug)] @@ -33,7 +35,7 @@ pub(crate) struct CopyCmd { pub struct Targets { /// Target repositories #[merge(strategy = merge::vec::overwrite_empty)] - targets: Vec, + targets: Vec, } impl Runnable for CopyCmd { @@ -54,7 +56,7 @@ impl CopyCmd { RUSTIC_APP.shutdown(Shutdown::Crash); } - let repo = open_repository(&config)?.to_indexed()?; + let repo = open_repository(&config.repository)?.to_indexed()?; let mut snapshots = if self.ids.is_empty() { repo.get_matching_snapshots(|sn| config.snapshot_filter.matches(sn))? } else { @@ -65,8 +67,7 @@ impl CopyCmd { 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)?; + let repo_dest = get_repository(target_opt)?; let repo_dest = if self.init && repo_dest.config_id()?.is_none() { if config.global.dry_run { diff --git a/src/commands/diff.rs b/src/commands/diff.rs index 584ddc41c..f839fbd3e 100644 --- a/src/commands/diff.rs +++ b/src/commands/diff.rs @@ -11,7 +11,7 @@ use anyhow::{bail, Context, Result}; use rustic_core::{ repofile::{BlobType, Node, NodeType}, IndexedFull, LocalDestination, LocalSource, LocalSourceFilterOptions, LocalSourceSaveOptions, - LsOptions, ReadSourceEntry, Repository, RusticResult, + LsOptions, ReadSource, ReadSourceEntry, Repository, RusticResult, }; /// `diff` subcommand @@ -50,8 +50,7 @@ impl Runnable for DiffCmd { impl DiffCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - - let repo = open_repository(&config)?.to_indexed()?; + let repo = open_repository(&config.repository)?.to_indexed()?; let (id1, path1) = arg_to_snap_path(&self.snap1, ""); let (id2, path2) = arg_to_snap_path(&self.snap2, path1); @@ -92,6 +91,7 @@ impl DiffCmd { &self.ignore_opts, &[&path2], )? + .entries() .map(|item| -> RusticResult<_> { let ReadSourceEntry { path, node, .. } = item?; let path = if is_dir { diff --git a/src/commands/dump.rs b/src/commands/dump.rs index a90cc996e..ea546d2f1 100644 --- a/src/commands/dump.rs +++ b/src/commands/dump.rs @@ -25,8 +25,7 @@ impl Runnable for DumpCmd { impl DumpCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - - let repo = open_repository(&config)?.to_indexed()?; + let repo = open_repository(&config.repository)?.to_indexed()?; let node = repo.node_from_snapshot_path(&self.snap, |sn| config.snapshot_filter.matches(sn))?; diff --git a/src/commands/forget.rs b/src/commands/forget.rs index f54724179..6ce30ee0a 100644 --- a/src/commands/forget.rs +++ b/src/commands/forget.rs @@ -99,7 +99,7 @@ impl Runnable for ForgetCmd { impl ForgetCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; let group_by = config.forget.group_by.unwrap_or_default(); diff --git a/src/commands/init.rs b/src/commands/init.rs index d770e62db..718cbf480 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -2,11 +2,10 @@ use abscissa_core::{status_err, Command, Runnable, Shutdown}; use anyhow::{bail, Result}; - -use crate::{Application, RUSTIC_APP}; - use dialoguer::Password; +use crate::{commands::get_repository, Application, RUSTIC_APP}; + use rustic_core::{ConfigOptions, KeyOptions, OpenStatus, Repository}; /// `init` subcommand @@ -33,9 +32,7 @@ impl Runnable for InitCmd { impl InitCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - - let po = config.global.progress_options; - let repo = Repository::new_with_progress(&config.repository, po)?; + let repo = get_repository(&config.repository)?; // 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..7d71aa929 100644 --- a/src/commands/key.rs +++ b/src/commands/key.rs @@ -9,7 +9,7 @@ use anyhow::Result; use dialoguer::Password; use log::info; -use rustic_core::{KeyOptions, Repository, RepositoryOptions}; +use rustic_core::{KeyOptions, RepositoryOptions}; /// `key` subcommand #[derive(clap::Parser, Command, Debug)] @@ -27,10 +27,18 @@ enum KeySubCmd { #[derive(clap::Parser, Debug)] pub(crate) struct AddCmd { + /// New password + #[clap(long)] + pub(crate) new_password: Option, + /// File from which to read the new password #[clap(long)] pub(crate) new_password_file: Option, + /// Command to get the new password from + #[clap(long)] + pub(crate) new_password_command: Option, + /// Key options #[clap(flatten)] pub(crate) key_opts: KeyOptions, @@ -54,19 +62,18 @@ impl Runnable for AddCmd { impl AddCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); + let repo = open_repository(&config.repository)?; - let repo = open_repository(&config)?; - - // create new "artificial" repo using the given password options - let repo_opts = RepositoryOptions { + // create new Repository options which just contain password information + let pass_opts = RepositoryOptions { + password: self.new_password.clone(), password_file: self.new_password_file.clone(), - repository: Some(String::new()), // fake repository to make Repository::new() not bail + password_command: self.new_password_command.clone(), ..Default::default() }; - let repo_newpass = Repository::new(&repo_opts)?; - let pass = repo_newpass - .password() + let pass = pass_opts + .evaluate_password() .map_err(|err| err.into()) .transpose() .unwrap_or_else(|| -> Result<_> { diff --git a/src/commands/list.rs b/src/commands/list.rs index 4605bd2d9..4d4bb4894 100644 --- a/src/commands/list.rs +++ b/src/commands/list.rs @@ -28,8 +28,7 @@ impl Runnable for ListCmd { impl ListCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; let tpe = match self.tpe.as_str() { // special treatment for listing blobs: read the index and display it diff --git a/src/commands/ls.rs b/src/commands/ls.rs index c5caefaa7..f8232d378 100644 --- a/src/commands/ls.rs +++ b/src/commands/ls.rs @@ -91,8 +91,7 @@ impl Summary { impl LsCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - - let repo = open_repository(&config)?.to_indexed()?; + let repo = open_repository(&config.repository)?.to_indexed()?; let node = repo.node_from_snapshot_path(&self.snap, |sn| config.snapshot_filter.matches(sn))?; diff --git a/src/commands/merge.rs b/src/commands/merge.rs index 2ee7415f8..aa102f349 100644 --- a/src/commands/merge.rs +++ b/src/commands/merge.rs @@ -41,7 +41,7 @@ impl Runnable for MergeCmd { impl MergeCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?.to_indexed_ids()?; + let repo = open_repository(&config.repository)?.to_indexed_ids()?; let snapshots = if self.ids.is_empty() { repo.get_matching_snapshots(|sn| config.snapshot_filter.matches(sn))? diff --git a/src/commands/prune.rs b/src/commands/prune.rs index 7e4353974..3fdc83d63 100644 --- a/src/commands/prune.rs +++ b/src/commands/prune.rs @@ -31,7 +31,7 @@ impl Runnable for PruneCmd { impl PruneCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; let pruner = repo.prune_plan(&self.opts)?; diff --git a/src/commands/repair.rs b/src/commands/repair.rs index 265f0207e..aa7b8d80d 100644 --- a/src/commands/repair.rs +++ b/src/commands/repair.rs @@ -60,7 +60,7 @@ impl Runnable for IndexSubCmd { impl IndexSubCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; repo.repair_index(&self.opts, config.global.dry_run)?; Ok(()) } @@ -78,7 +78,7 @@ impl Runnable for SnapSubCmd { impl SnapSubCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?.to_indexed()?; + let repo = open_repository(&config.repository)?.to_indexed()?; let snaps = if self.ids.is_empty() { repo.get_all_snapshots()? } else { diff --git a/src/commands/repoinfo.rs b/src/commands/repoinfo.rs index 887c42976..16750f6cf 100644 --- a/src/commands/repoinfo.rs +++ b/src/commands/repoinfo.rs @@ -1,15 +1,16 @@ //! `repoinfo` subcommand use crate::{ - commands::open_repository, helpers::bytes_size_to_string, status_err, Application, RUSTIC_APP, + commands::{get_repository, open_repository}, + helpers::{bytes_size_to_string, table_right_from}, + status_err, Application, RUSTIC_APP, }; use abscissa_core::{Command, Runnable, Shutdown}; use serde::Serialize; -use crate::helpers::table_right_from; use anyhow::Result; -use rustic_core::{IndexInfos, RepoFileInfo, RepoFileInfos, Repository}; +use rustic_core::{IndexInfos, RepoFileInfo, RepoFileInfos}; /// `repoinfo` subcommand #[derive(clap::Parser, Command, Debug)] @@ -52,15 +53,14 @@ impl RepoInfoCmd { let infos = Infos { files: (!self.only_index) - .then(|| { - let po = config.global.progress_options; - let repo = Repository::new_with_progress(&config.repository, po)?; - repo.infos_files() + .then(|| -> Result<_> { + let repo = get_repository(&config.repository)?; + Ok(repo.infos_files()?) }) .transpose()?, index: (!self.only_files) .then(|| -> Result<_> { - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; Ok(repo.infos_index()?) }) .transpose()?, diff --git a/src/commands/restore.rs b/src/commands/restore.rs index 46a2504d2..56959d914 100644 --- a/src/commands/restore.rs +++ b/src/commands/restore.rs @@ -52,7 +52,7 @@ impl RestoreCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); let dry_run = config.global.dry_run; - let repo = open_repository(&config)?.to_indexed()?; + let repo = open_repository(&config.repository)?.to_indexed()?; let node = repo.node_from_snapshot_path(&self.snap, |sn| config.snapshot_filter.matches(sn))?; diff --git a/src/commands/snapshots.rs b/src/commands/snapshots.rs index e91ca9ff7..2b4e0821f 100644 --- a/src/commands/snapshots.rs +++ b/src/commands/snapshots.rs @@ -58,7 +58,7 @@ impl Runnable for SnapshotCmd { impl SnapshotCmd { fn inner_run(&self) -> Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; let groups = repo.get_snapshot_group(&self.ids, self.group_by, |sn| { config.snapshot_filter.matches(sn) diff --git a/src/commands/tag.rs b/src/commands/tag.rs index d7855b334..850a62ede 100644 --- a/src/commands/tag.rs +++ b/src/commands/tag.rs @@ -71,7 +71,7 @@ impl Runnable for TagCmd { impl TagCmd { fn inner_run(&self) -> anyhow::Result<()> { let config = RUSTIC_APP.config(); - let repo = open_repository(&config)?; + let repo = open_repository(&config.repository)?; let snapshots = if self.ids.is_empty() { repo.get_matching_snapshots(|sn| config.snapshot_filter.matches(sn))? diff --git a/src/config.rs b/src/config.rs index 254669924..b31ad919c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -18,6 +18,7 @@ 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}; @@ -42,7 +43,7 @@ pub struct RusticConfig { /// Repository options #[clap(flatten, next_help_heading = "Repository options")] - pub repository: RepositoryOptions, + pub repository: AllRepositoryOptions, /// Snapshot filter options #[clap(flatten, next_help_heading = "Snapshot filter options")] @@ -61,6 +62,20 @@ pub struct RusticConfig { pub forget: ForgetOptions, } +#[derive(Clone, Default, Debug, Parser, Deserialize, Merge)] +#[serde(default, rename_all = "kebab-case")] +pub struct AllRepositoryOptions { + /// Repository options + #[clap(flatten)] + #[serde(flatten)] + pub repo: RepositoryOptions, + + /// Backend options + #[clap(flatten)] + #[serde(flatten)] + pub be: BackendOptions, +} + impl RusticConfig { /// Merge a profile into the current config by reading the corresponding config file. /// Also recursively merge all profiles given within this config file.