diff --git a/Cargo.lock b/Cargo.lock index c56456a..9922f14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -37,7 +37,7 @@ dependencies = [ [[package]] name = "albatross" -version = "0.6.1" +version = "0.7.0" dependencies = [ "anvil-region", "chrono 0.4.41", @@ -53,7 +53,7 @@ dependencies = [ "ssh2", "structopt", "tar", - "thiserror", + "thiserror 2.0.12", ] [[package]] @@ -182,6 +182,28 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +[[package]] +name = "aws-lc-rs" +version = "1.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.39.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a25cf98105baa966497416dbd42565ce3a8cf8dbfd59803ec9ad46f3126399" +dependencies = [ + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "backtrace" version = "0.3.75" @@ -217,11 +239,11 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" dependencies = [ - "serde", + "serde_core", ] [[package]] @@ -263,19 +285,34 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cc" -version = "1.2.30" +version = "1.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deec109607ca693028562ed836a5f1c4b8bd77755c4e132fc5ce11b0b6211ae7" +checksum = "43c5703da9466b66a946814e1adf53ea2c90f10063b86290cc9eb67ce3478a20" dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.2.25" @@ -315,12 +352,31 @@ dependencies = [ "vec_map", ] +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + [[package]] name = "colorchoice" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr 2.7.5", +] + [[package]] name = "config" version = "0.15.13" @@ -379,6 +435,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -459,6 +525,12 @@ dependencies = [ "const-random", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "either" version = "1.15.0" @@ -535,12 +607,6 @@ dependencies = [ "synstructure 0.12.6", ] -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - [[package]] name = "filetime" version = "0.2.25" @@ -553,6 +619,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + [[package]] name = "flate2" version = "1.1.2" @@ -575,21 +647,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -599,6 +656,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "ftp" version = "3.0.1" @@ -677,8 +740,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.1+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -688,9 +753,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", + "js-sys", "libc", "r-efi", "wasi 0.14.2+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -836,22 +903,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - [[package]] name = "hyper-util" version = "0.1.16" @@ -1025,7 +1076,7 @@ version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.0", "cfg-if", "libc", ] @@ -1082,6 +1133,60 @@ dependencies = [ "syn 2.0.104", ] +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys 0.3.1", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + +[[package]] +name = "jni-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41a652e1f9b6e0275df1f15b32661cf0d4b78d4d87ddec5e0c3c20f097433258" +dependencies = [ + "jni-sys 0.4.1", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.104", +] + +[[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.3", + "libc", +] + [[package]] name = "js-sys" version = "0.3.77" @@ -1137,7 +1242,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4488594b9328dee448adb906d8b126d9b7deb7cf5c22161ee591610bb1be83c0" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.0", "libc", "redox_syscall", ] @@ -1202,6 +1307,12 @@ version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + [[package]] name = "memchr" version = "0.1.11" @@ -1254,23 +1365,6 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "native-tls" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "num" version = "0.1.43" @@ -1332,37 +1426,11 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" -[[package]] -name = "openssl" -version = "0.10.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8505734d46c8ab1e19a1dce3aef597ad87dcb4c37e7188231769bd6bd51cebf8" -dependencies = [ - "bitflags 2.9.1", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.104", -] - [[package]] name = "openssl-probe" -version = "0.1.6" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "openssl-sys" @@ -1428,7 +1496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db05f56d34358a8b1066f67cbb203ee3e7ed2ba674a6263a1d5ec6db2204323" dependencies = [ "memchr 2.7.5", - "thiserror", + "thiserror 2.0.12", "ucd-trie", ] @@ -1507,6 +1575,15 @@ dependencies = [ "zerovec", ] +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1540,6 +1617,62 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quinn" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +dependencies = [ + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2 0.6.0", + "thiserror 2.0.12", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.3.3", + "lru-slab", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror 2.0.12", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2 0.6.0", + "tracing", + "windows-sys 0.60.2", +] + [[package]] name = "quote" version = "1.0.40" @@ -1561,13 +1694,42 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" +[[package]] +name = "rand" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ec095654a25171c2124e9e3393a930bddbffdc939556c914957a4c3e0a87166" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.3", +] + [[package]] name = "redox_syscall" version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e8af0dde094006011e6a740d4879319439489813bd0bcdc7d821beaeeff48ec" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.0", ] [[package]] @@ -1620,9 +1782,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.22" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531" +checksum = "ab3f43e3283ab1488b624b44b0e988d0acea0b3214e694730a055cb6b2efa801" dependencies = [ "base64 0.22.1", "bytes", @@ -1636,21 +1798,21 @@ dependencies = [ "http-body-util", "hyper", "hyper-rustls", - "hyper-tls", "hyper-util", "js-sys", "log", "mime", - "native-tls", "percent-encoding", "pin-project-lite", + "quinn", + "rustls", "rustls-pki-types", + "rustls-platform-verifier", "serde", "serde_json", - "serde_urlencoded", "sync_wrapper", "tokio", - "tokio-native-tls", + "tokio-rustls", "tower", "tower-http", "tower-service", @@ -1681,7 +1843,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", - "bitflags 2.9.1", + "bitflags 2.11.0", "serde", "serde_derive", ] @@ -1702,13 +1864,19 @@ version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" +[[package]] +name = "rustc-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe" + [[package]] name = "rustix" version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11181fbabf243db407ef8df94a6ce0b2f9a733bd8be4ad02b4eda9602296cac8" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.0", "errno", "libc", "linux-raw-sys", @@ -1721,6 +1889,7 @@ version = "0.23.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2491382039b29b9b11ff08b76ff6c97cf287671dbb74f0be44bda389fffe9bd1" dependencies = [ + "aws-lc-rs", "once_cell", "rustls-pki-types", "rustls-webpki", @@ -1728,21 +1897,62 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pki-types" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ + "web-time", "zeroize", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d99feebc72bae7ab76ba994bb5e121b8d83d910ca40b36e0921f53becc41784" +dependencies = [ + "core-foundation 0.10.1", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.60.2", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" + [[package]] name = "rustls-webpki" version = "0.103.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a17884ae0c1b773f1ccd2bd4a8c72f16da897310a98b0e84bf349ad5ead92fc" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -1760,6 +1970,15 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.27" @@ -1777,12 +1996,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "security-framework" -version = "2.11.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 2.9.1", - "core-foundation", + "bitflags 2.11.0", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -1790,9 +2009,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.14.0" +version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", @@ -1800,18 +2019,28 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.219" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", @@ -1839,18 +2068,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - [[package]] name = "sha2" version = "0.10.9" @@ -1906,7 +2123,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2f84d13b3b8a0d4e91a2629911e951db1bb8671512f5c09d7d4ba34500ba68c8" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.0", "libc", "libssh2-sys", "parking_lot", @@ -2014,8 +2231,8 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.9.1", - "core-foundation", + "bitflags 2.11.0", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -2040,19 +2257,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "tempfile" -version = "3.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" -dependencies = [ - "fastrand", - "getrandom 0.3.3", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -2062,13 +2266,33 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + [[package]] name = "thiserror" version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl", + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", ] [[package]] @@ -2131,6 +2355,21 @@ dependencies = [ "zerovec", ] +[[package]] +name = "tinyvec" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + [[package]] name = "tokio" version = "1.46.1" @@ -2148,16 +2387,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.2" @@ -2229,11 +2458,11 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.0", "bytes", "futures-util", "http", @@ -2371,6 +2600,16 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -2482,6 +2721,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "web-time" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-root-certs" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "804f18a4ac2676ffb4e8b5b5fa9ae38af06df08162314f96a68d2a363e21a8ca" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "winapi" version = "0.2.8" @@ -2510,6 +2768,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.60.2", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2586,6 +2853,15 @@ dependencies = [ "windows-link", ] +[[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.52.0" @@ -2613,6 +2889,21 @@ dependencies = [ "windows-targets 0.53.2", ] +[[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.52.6" @@ -2645,6 +2936,12 @@ dependencies = [ "windows_x86_64_msvc 0.53.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.52.6" @@ -2657,6 +2954,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" +[[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.52.6" @@ -2669,6 +2972,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" +[[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.52.6" @@ -2693,6 +3002,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" +[[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.52.6" @@ -2705,6 +3020,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" +[[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.52.6" @@ -2717,6 +3038,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" +[[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.52.6" @@ -2729,6 +3056,12 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" +[[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.52.6" @@ -2756,7 +3089,7 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.9.1", + "bitflags 2.11.0", ] [[package]] @@ -2810,6 +3143,26 @@ dependencies = [ "synstructure 0.13.2", ] +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.104", +] + [[package]] name = "zerofrom" version = "0.1.6" diff --git a/Cargo.toml b/Cargo.toml index 65a5d2f..d5986b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "albatross" -version = "0.6.1" +version = "0.7.0" authors = ["Joey Hines "] edition = "2024" @@ -15,7 +15,7 @@ chrono = "0.4" regex = "1.3.9" flate2 = "1.0.14" tar = "0.4.28" -reqwest = { version = "0.12.22", features = ["blocking", "json"] } +reqwest = { version = "0.13.2", features = ["blocking", "json"] } discord-hooks-rs = { git = "https://github.com/joeyahines/discord-hooks-rs" } anvil-region = "0.8.1" ssh2 = "0.9.1" diff --git a/README.md b/README.md index 250910e..87196d8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Backups can also be transferred to a remote server using SFTP. ## Help ``` -albatross 0.4.0 +albatross 0.7.0 Backup your Minecraft Server! USAGE: @@ -25,10 +25,7 @@ SUBCOMMANDS: backup Backup a server export Export a backup as a single player world help Prints this message or the help of the given subcommand(s) - restore Restore certain chunks from a backup - -Process finished with exit code 1 - + restore Restore certain chunks from a backup``` ``` ## Examples @@ -49,6 +46,44 @@ Restoring a range of chunks (from -2,-2 to 2,2): `albatorss -c test.toml restore world backups/04-11-20_01.51.27_backup.tar.gz sp.tar.gz` (-2,-2) -u (2,2) ## Config + +### For Minecraft Versions After 26.1 +```toml +[backup] +# Minecraft sever directory +minecraft_dir = "/home/mc/server" +# Optional Discord webhook +discord_webhook = "https://discordapp.com/api/webhooks/" +# Number of backups to keep +backups_to_keep = 10 + +[backup.output_config] +# Directory to place backups +path = "./backups" + +[world_26_plus_config] +world_name = "world" + +[[world_26_plus_config.dimensions]] +# world name +world_name = "minecraft/overworld" +# world save radius (in blocks) +save_radius = 1000 + +[[world_26_plus_config.dimensions]] +# world name +world_name = "minecraft/the_end" +# world save radius (in blocks) +save_radius = 1000 + +[[world_26_plus_config.dimensions]] +# world name +world_name = "minecraft/the_nether" +# world save radius (in blocks) +save_radius = 1000 +``` + +### For Minecraft Versions Before 26.1 ```toml # Local Backup Config [backup] diff --git a/src/backup.rs b/src/backup.rs index db0f4d7..15b845f 100644 --- a/src/backup.rs +++ b/src/backup.rs @@ -1,6 +1,8 @@ -use crate::config::{AlbatrossConfig, RemoteBackupConfig, WorldConfig, WorldType}; +use crate::config::{ + AlbatrossConfig, RemoteBackupConfig, World26PlusConfig, WorldConfig, WorldType, +}; use crate::discord::send_webhook; -use crate::error::Result; +use crate::error::{AlbatrossError, Result}; use crate::region::Region; use crate::remote::RemoteBackupSite; use crate::remote::file::FileBackup; @@ -43,22 +45,35 @@ pub fn backup_file(file_name: &str, world_path: &Path, backup_path: &Path) -> Re pub fn backup_dir(dir_name: &str, world_path: &Path, backup_path: &Path) -> Result { let src_dir = world_path.join(dir_name); - if !src_dir.exists() { + if !src_dir.exists() || !src_dir.is_dir() { warn!("Directory '{dir_name}' does not exist in '{world_path:?}'"); return Ok(0); } - let backup_dir = backup_path.join(dir_name); - create_dir(&backup_dir)?; + let backup_dir_path = backup_path.join(dir_name); + create_dir(&backup_dir_path)?; let mut file_count = 0; for entry in src_dir.read_dir()? { let entry = entry?; - let mut target = backup_dir.clone(); - target.push(entry.file_name()); + let mut target = backup_dir_path.clone(); - copy(entry.path(), target)?; - file_count += 1; + if entry.path().is_dir() { + let sub_dir = entry.file_name(); + let world_path = world_path.join(dir_name); + let backup_path = backup_path.join(dir_name); + + if !backup_path.exists() { + create_dir(&backup_path)?; + } + + file_count += backup_dir(sub_dir.to_str().unwrap(), &world_path, &backup_path)?; + } else { + target.push(entry.file_name()); + + copy(entry.path(), target)?; + file_count += 1; + } } Ok(file_count) @@ -94,14 +109,15 @@ pub fn backup_region( let entry = entry?; let file_name = entry.file_name().to_str().unwrap().to_string(); - if let Ok(region) = Region::try_from(file_name) { - if region.x.abs() <= save_radius && region.y.abs() <= save_radius { - let mut target = backup_dir.clone(); - target.push(entry.file_name()); + if let Ok(region) = Region::try_from(file_name) + && region.x.abs() <= save_radius + && region.y.abs() <= save_radius + { + let mut target = backup_dir.clone(); + target.push(entry.file_name()); - copy(entry.path(), target)?; - count += 1; - } + copy(entry.path(), target)?; + count += 1; } } @@ -270,7 +286,7 @@ pub fn do_remote_backup( /// * `cfg` - config file pub fn do_backup(cfg: AlbatrossConfig, output: Option) -> Result<()> { let server_base_dir = cfg.backup.minecraft_dir.clone(); - let worlds = cfg.world_config.clone().expect("No worlds configured"); + let timer = Instant::now(); let time_str = Utc::now().format("%d-%m-%y_%H.%M.%S").to_string(); let backup_name = format!("{time_str}_backup.tar.gz"); let mut output_archive = match output { @@ -284,15 +300,21 @@ pub fn do_backup(cfg: AlbatrossConfig, output: Option) -> Result<()> { create_dir_all(tmp_dir.clone())?; - let timer = Instant::now(); - send_webhook("**Albatross is swooping in to backup your worlds!**", &cfg); - backup_worlds(&cfg, server_base_dir, worlds, &tmp_dir).map_err(|e| { - send_webhook("Failed to copy worlds to backup location", &cfg); - error!("Failed to copy worlds: {e}"); - e - })?; + let backup_res = if let Some(worlds) = &cfg.world_config { + backup_worlds(&cfg, server_base_dir, worlds, &tmp_dir) + } else if let Some(world_config) = &cfg.world_26_plus_config { + backup_v26_plus_world_format(&cfg, world_config, &tmp_dir) + } else { + Err(AlbatrossError::MissingConfig) + }; + + if let Err(err) = backup_res { + send_webhook("Failed to backup worlds", &cfg); + error!("Failed to backup worlds: {err}"); + return Err(err); + } compress_backup(&tmp_dir, &output_archive).map_err(|e| { send_webhook("Failed to compress backup", &cfg); @@ -302,8 +324,7 @@ pub fn do_backup(cfg: AlbatrossConfig, output: Option) -> Result<()> { remove_dir_all(&tmp_dir)?; - let mut local_backup = - FileBackup::new(&cfg.backup.output_config, cfg.backup.backups_to_keep).unwrap(); + let mut local_backup = FileBackup::new(&cfg.backup.output_config, cfg.backup.backups_to_keep)?; match local_backup.cleanup() { Ok(backups_removed) => { @@ -342,10 +363,81 @@ pub fn do_backup(cfg: AlbatrossConfig, output: Option) -> Result<()> { Ok(()) } +/// Backup a dimension +/// +/// # Param +/// * `world_path` - path to the world folder +/// * `backup_path` - path to the backup folder +/// * `world_config` - world config options +pub fn backup_dimension( + world_path: &Path, + backup_path: &Path, + world_config: &WorldConfig, +) -> Result { + let dimension_path = Path::new("dimensions").join(&world_config.world_name); + let backup_path = backup_path.join(&dimension_path); + let src_path = world_path.join(dimension_path); + create_dir_all(backup_path.as_path())?; + + backup_dir("data", &src_path, &backup_path)?; + let region_count = backup_region("region", world_config.save_radius, &src_path, &backup_path)?; + Ok(region_count) +} + +/// Backup v26.1 + version +/// +/// # Param +/// * `world_path` - path to the world folder +/// * `backup_path` - path to the backup folder +/// * `world_config` - world config options +pub fn backup_v26_plus_world_format( + cfg: &AlbatrossConfig, + world_config: &World26PlusConfig, + tmp_dir: &Path, +) -> Result<()> { + let world_path = cfg.backup.minecraft_dir.join(&world_config.world_name); + let backup_path = tmp_dir.join(&world_config.world_name); + + if !backup_path.exists() { + create_dir(&backup_path)?; + } + + send_webhook( + format!("Starting backup **{}**", world_config.world_name).as_str(), + cfg, + ); + + // Backup common files + backup_dir("data", &world_path, &backup_path)?; + backup_dir("datapacks", &world_path, &backup_path)?; + backup_file("level.dat", &world_path, &backup_path)?; + backup_file("level.dat_old", &world_path, &backup_path).ok(); + backup_file("session.lock", &world_path, &backup_path).ok(); + let player_count = backup_dir("players", &world_path, &backup_path)?; + send_webhook(format!("Backed up {player_count} players").as_str(), cfg); + info!("Backed up {player_count} players"); + + for world_config in &world_config.dimensions { + send_webhook( + format!("Starting backup of **{}**", world_config.world_name).as_str(), + cfg, + ); + info!( + "Starting backup of dimension **{}**", + world_config.world_name + ); + let region_count = backup_dimension(&world_path, &backup_path, world_config)?; + send_webhook(format!("{region_count} regions backed up.").as_str(), cfg); + info!("{region_count} regions backed up.") + } + + Ok(()) +} + fn backup_worlds( cfg: &AlbatrossConfig, server_base_dir: PathBuf, - worlds: Vec, + worlds: &[WorldConfig], tmp_dir: &Path, ) -> Result<()> { for world in worlds { @@ -360,15 +452,15 @@ fn backup_worlds( let webhook_msg = match world_type { WorldType::Overworld => { let (region_count, player_count) = - backup_overworld(&world_dir.clone(), tmp_dir, &world)?; + backup_overworld(&world_dir.clone(), tmp_dir, world)?; format!("{region_count} regions and {player_count} player files backed up.") } WorldType::Nether => { - let region_count = backup_nether(&world_dir, tmp_dir, &world)?; + let region_count = backup_nether(&world_dir, tmp_dir, world)?; format!("{region_count} regions backed up.") } WorldType::End => { - let region_count = backup_end(&world_dir, tmp_dir, &world)?; + let region_count = backup_end(&world_dir, tmp_dir, world)?; format!("{region_count} regions backed up.") } }; diff --git a/src/config/mod.rs b/src/config/mod.rs index 25cba8b..8f606bb 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -64,11 +64,19 @@ pub struct RemoteBackupConfig { pub file: Option, } +/// Config for individual world configuration +#[derive(Debug, Deserialize, Clone)] +pub struct World26PlusConfig { + pub world_name: String, + pub dimensions: Vec, +} + /// Configs #[derive(Debug, Deserialize, Clone)] pub struct AlbatrossConfig { pub backup: BackupConfig, pub world_config: Option>, + pub world_26_plus_config: Option, pub remote: Option, } diff --git a/src/error.rs b/src/error.rs index 33bdb1a..8e19b35 100644 --- a/src/error.rs +++ b/src/error.rs @@ -11,6 +11,7 @@ pub enum AlbatrossError { ChronoParseError(chrono::ParseError), NoSSHAuth, FTPError(ftp::FtpError), + MissingConfig, } impl std::error::Error for AlbatrossError {} @@ -27,6 +28,7 @@ impl std::fmt::Display for AlbatrossError { AlbatrossError::ChronoParseError(e) => write!(f, "Unable to parse time: {e}"), AlbatrossError::NoSSHAuth => write!(f, "No SSH auth methods provided in the config"), AlbatrossError::FTPError(e) => write!(f, "FTP error: {e}"), + AlbatrossError::MissingConfig => write!(f, "Missing world config"), } } } diff --git a/src/main.rs b/src/main.rs index 5f09440..8697856 100644 --- a/src/main.rs +++ b/src/main.rs @@ -74,64 +74,60 @@ fn main() { let cfg = AlbatrossConfig::new(opt.config_path.into_os_string().to_str().unwrap()) .expect("Config error"); - if cfg.world_config.is_some() { - match opt.sub_command { - SubCommand::Backup { output } => { - info!("Starting backup"); - match do_backup(cfg, output) { - Ok(_) => info!("Backup complete!"), - Err(e) => info!("Error doing backup: {e:?}"), - }; - } - SubCommand::Export { - input_backup, - output, - } => { - info!("Starting export"); - match convert_backup_to_sp(&cfg, &input_backup, &output) { - Ok(_) => info!("Export complete!"), - Err(e) => info!("Error exporting backup: {e:?}"), - }; - } - SubCommand::Restore { - server_directory, - world_name, - backup_path, - chunk, - upper_bound, - } => { - info!("Starting restore"); + match opt.sub_command { + SubCommand::Backup { output } => { + info!("Starting backup"); + match do_backup(cfg, output) { + Ok(_) => info!("Backup complete!"), + Err(e) => info!("Error doing backup: {e:?}"), + }; + } + SubCommand::Export { + input_backup, + output, + } => { + info!("Starting export"); + match convert_backup_to_sp(&cfg, &input_backup, &output) { + Ok(_) => info!("Export complete!"), + Err(e) => info!("Error exporting backup: {e:?}"), + }; + } + SubCommand::Restore { + server_directory, + world_name, + backup_path, + chunk, + upper_bound, + } => { + info!("Starting restore"); - let server_directory = match server_directory { - Some(dir) => dir, - None => cfg.backup.minecraft_dir, - }; + let server_directory = match server_directory { + Some(dir) => dir, + None => cfg.backup.minecraft_dir, + }; - if let Some(upper_bound) = upper_bound { - match restore_range_from_backup( - world_name.as_str(), - chunk, - upper_bound, - &backup_path, - &server_directory, - ) { - Ok(count) => info!("Restored {count} chunks!"), - Err(e) => info!("Error restoring backup: {e:?}"), - }; - } else { - match restore_chunk_from_backup( - world_name.as_str(), - chunk, - &backup_path, - &server_directory, - ) { - Ok(_) => info!("Restored chunk!"), - Err(e) => info!("Error restoring backup: {e:?}"), - }; - } + if let Some(upper_bound) = upper_bound { + match restore_range_from_backup( + world_name.as_str(), + chunk, + upper_bound, + &backup_path, + &server_directory, + ) { + Ok(count) => info!("Restored {count} chunks!"), + Err(e) => info!("Error restoring backup: {e:?}"), + }; + } else { + match restore_chunk_from_backup( + world_name.as_str(), + chunk, + &backup_path, + &server_directory, + ) { + Ok(_) => info!("Restored chunk!"), + Err(e) => info!("Error restoring backup: {e:?}"), + }; } } - } else { - info!("No worlds specified in config file!") } }