diff options
| -rw-r--r-- | Cargo.lock | 1734 | ||||
| -rw-r--r-- | Cargo.toml | 33 | ||||
| -rw-r--r-- | src/apply.rs | 137 | ||||
| -rw-r--r-- | src/install.rs | 404 | ||||
| -rw-r--r-- | src/rootfs.rs | 199 | ||||
| -rw-r--r-- | src/sync.rs | 116 |
6 files changed, 2138 insertions, 485 deletions
@@ -3,6 +3,84 @@ version = 4 [[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "bytes", + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "aes-kw" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69fa2b352dcefb5f7f3a5fb840e02665d311d878955380515e4fd50095dd3d8c" +dependencies = [ + "aes", +] + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] name = "android_system_properties" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -68,6 +146,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" [[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", + "zeroize", +] + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "atomic-waker" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -80,16 +188,79 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bitfields" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef6e59298da389bc0649c7463856b34c6e17fe542f88939426ede4436c6b1195" +dependencies = [ + "bitfields-impl", +] + +[[package]] +name = "bitfields-impl" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c044f98f86f15414668d6c8187c7e4fadab1ad2b31680f648703e0fe07c555" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "thiserror", +] + +[[package]] name = "bitflags" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" +dependencies = [ + "serde_core", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] [[package]] name = "block-buffer" @@ -101,28 +272,101 @@ dependencies = [ ] [[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blowfish" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e412e2cd0f2b2d93e02543ceae7917b3c70331573df19ee046bcbc35e45e87d7" +dependencies = [ + "byteorder", + "cipher", +] + +[[package]] +name = "buffer-redux" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "431a9cc8d7efa49bc326729264537f5e60affce816c66edf434350778c9f4f54" +dependencies = [ + "memchr", +] + +[[package]] name = "bumpalo" version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] name = "bytes" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" [[package]] +name = "bzip2" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3a53fac24f34a81bc9954b5d6cfce0c21e18ec6959f44f56e8e90e4bb7c346c" +dependencies = [ + "libbz2-rs-sys", +] + +[[package]] +name = "camellia" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3264e2574e9ef2b53ce6f536dea83a69ac0bc600b762d1523ff83fe07230ce30" +dependencies = [ + "byteorder", + "cipher", +] + +[[package]] +name = "cast5" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b07d673db1ccf000e90f54b819db9e75a8348d6eb056e9b8ab53231b7a9911" +dependencies = [ + "cipher", +] + +[[package]] name = "cc" version = "1.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" dependencies = [ "find-msvc-tools", + "jobserver", + "libc", "shlex", ] [[package]] +name = "cfb-mode" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "738b8d467867f80a71351933f70461f5b56f24d5c93e0cf216e59229c968d330" +dependencies = [ + "cipher", +] + +[[package]] name = "cfg-if" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -143,11 +387,22 @@ dependencies = [ "iana-time-zone", "js-sys", "num-traits", + "serde", "wasm-bindgen", "windows-link", ] [[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] name = "clap" version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -188,6 +443,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" [[package]] +name = "cmac" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8543454e3c3f5126effff9cd44d562af4e31fb8ce1cc0d3dcd8f084515dbc1aa" +dependencies = [ + "cipher", + "dbl", + "digest", +] + +[[package]] name = "colorchoice" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -209,13 +475,26 @@ version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68578f196d2a33ff61b27fae256c3164f65e36382648e30666dde05b8cc9dfdf" dependencies = [ - "nom", + "async-trait", + "convert_case 0.6.0", + "json5", + "nom 7.1.3", "pathdiff", + "ron", "rust-ini", "serde", + "serde_json", + "toml", + "yaml-rust2", ] [[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] name = "const-random" version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -236,6 +515,24 @@ dependencies = [ ] [[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + +[[package]] name = "core-foundation" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -271,29 +568,230 @@ dependencies = [ ] [[package]] +name = "crc24" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd121741cf3eb82c08dd3023eb55bf2665e5f60ec20f89760cf836ae4562e6a0" + +[[package]] +name = "crc32fast" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +dependencies = [ + "cfg-if", +] + +[[package]] name = "crunchy" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] name = "crypto-common" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" dependencies = [ "generic-array", + "rand_core", "typenum", ] [[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "cx448" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c0cf476284b03eb6c10e78787b21c7abb7d7d43cb2f02532ba6b831ed892fa" +dependencies = [ + "crypto-bigint", + "elliptic-curve", + "pkcs8", + "rand_core", + "serdect 0.3.0", + "sha3", + "signature", + "subtle", + "zeroize", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "dbl" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2735a791158376708f9347fe8faba9667589d82427ef3aed6794a8981de3d9" +dependencies = [ + "generic-array", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn", +] + +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case 0.10.0", + "proc-macro2", + "quote", + "rustc_version", + "syn", + "unicode-xid", +] + +[[package]] +name = "des" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdd80ce8ce993de27e9f063a444a4d53ce8e8db4c1f00cc03af5ad5a9867a1e" +dependencies = [ + "cipher", +] + +[[package]] name = "digest" version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", + "const-oid", "crypto-common", + "subtle", ] [[package]] @@ -317,6 +815,99 @@ dependencies = [ ] [[package]] +name = "dsa" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48bc224a9084ad760195584ce5abb3c2c34a225fa312a128ad245a6b412b7689" +dependencies = [ + "digest", + "num-bigint-dig", + "num-traits", + "pkcs8", + "rfc6979", + "sha2", + "signature", + "zeroize", +] + +[[package]] +name = "eax" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9954fabd903b82b9d7a68f65f97dc96dd9ad368e40ccc907a7c19d53e6bfac28" +dependencies = [ + "aead", + "cipher", + "cmac", + "ctr", + "subtle", +] + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "base64ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "hkdf", + "pem-rfc7468", + "pkcs8", + "rand_core", + "sec1", + "serde_json", + "serdect 0.2.0", + "subtle", + "tap", + "zeroize", +] + +[[package]] name = "encoding_rs" version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -348,6 +939,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "bitvec", + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] name = "filetime" version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -365,6 +973,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] +name = "flate2" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" +dependencies = [ + "crc32fast", + "miniz_oxide", + "zlib-rs", +] + +[[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -395,6 +1014,12 @@ dependencies = [ ] [[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] name = "futures" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -490,6 +1115,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -499,10 +1125,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] [[package]] @@ -512,11 +1136,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", - "js-sys", "libc", "r-efi", "wasip2", - "wasm-bindgen", +] + +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + +[[package]] +name = "git2" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724" +dependencies = [ + "bitflags", + "libc", + "libgit2-sys", + "log", + "openssl-probe 0.1.6", + "openssl-sys", + "url", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", ] [[package]] @@ -543,6 +1201,10 @@ name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "hashbrown" @@ -551,12 +1213,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" [[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] name = "http" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -631,7 +1326,6 @@ dependencies = [ "tokio", "tokio-rustls", "tower-service", - "webpki-roots", ] [[package]] @@ -656,7 +1350,7 @@ version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "futures-channel", "futures-util", @@ -781,6 +1475,21 @@ dependencies = [ ] [[package]] +name = "idea" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "075557004419d7f2031b8bb7f44bb43e55a83ca7b63076a8fb8fe75753836477" +dependencies = [ + "cipher", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] name = "idna" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -812,6 +1521,15 @@ dependencies = [ ] [[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] name = "ipnet" version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -840,6 +1558,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] +name = "jobserver" +version = "0.1.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33" +dependencies = [ + "getrandom 0.3.4", + "libc", +] + +[[package]] name = "js-sys" version = "0.3.88" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -850,10 +1578,53 @@ dependencies = [ ] [[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", + "signature", +] + +[[package]] +name = "keccak" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb26cec98cce3a3d96cbb7bced3c4b16e3d13f27ec56dbd62cbc8f39cfb9d653" +dependencies = [ + "cpufeatures", +] + +[[package]] name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "libbz2-rs-sys" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3a6a8c165077efc8f3a971534c50ea6a1a18b329ef4a66e897a7e3a1494565f" [[package]] name = "libc" @@ -862,6 +1633,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] +name = "libgit2-sys" +version = "0.17.0+1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224" +dependencies = [ + "cc", + "libc", + "libssh2-sys", + "libz-sys", + "openssl-sys", + "pkg-config", +] + +[[package]] +name = "libm" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" + +[[package]] name = "libredox" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -873,6 +1664,32 @@ dependencies = [ ] [[package]] +name = "libssh2-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9" +dependencies = [ + "cc", + "libc", + "libz-sys", + "openssl-sys", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "libz-sys" +version = "1.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc3a226e576f50782b3305c5ccf458698f92798987f551c6a02efe8276721e22" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] name = "linux-raw-sys" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -891,12 +1708,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] -name = "lru-slab" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" - -[[package]] name = "lzma-sys" version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -908,6 +1719,16 @@ dependencies = [ ] [[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] name = "memchr" version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -926,6 +1747,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] +name = "miniz_oxide" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" +dependencies = [ + "adler2", + "simd-adler32", +] + +[[package]] name = "mio" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -945,7 +1776,7 @@ dependencies = [ "libc", "log", "openssl", - "openssl-probe", + "openssl-probe 0.2.1", "openssl-sys", "schannel", "security-framework", @@ -954,6 +1785,18 @@ dependencies = [ ] [[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags", + "cfg-if", + "cfg_aliases", + "libc", +] + +[[package]] name = "nom" version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -964,12 +1807,93 @@ dependencies = [ ] [[package]] +name = "nom" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e661dda6640fad38e827a6d4a310ff4763082116fe217f279885c97f511bb0b7" +dependencies = [ + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "serde", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] name = "num-traits" version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", +] + +[[package]] +name = "num_enum" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0bca838442ec211fa11de3a8b0e0e8f3a4522575b5c4c06ed722e005036f26" +dependencies = [ + "num_enum_derive", + "rustversion", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "680998035259dcfcafe653688bf2aa6d3e2dc05e98be6ab46afb089dc84f1df8" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ocb3" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c196e0276c471c843dd5777e7543a36a298a4be942a2a688d8111cd43390dedb" +dependencies = [ + "aead", + "cipher", + "ctr", + "subtle", ] [[package]] @@ -985,6 +1909,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] name = "openssl" version = "0.10.76" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1012,6 +1942,12 @@ dependencies = [ [[package]] name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-probe" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" @@ -1039,18 +1975,188 @@ dependencies = [ ] [[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p384" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe42f1670a52a47d448f14b6a5c61dd78fce51856e68edaa38f7ae3a46b8d6b6" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p521" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc9e2161f1f215afdfce23677034ae137bbd45016a880c2eb3ba8eb95f085b2" +dependencies = [ + "base16ct", + "ecdsa", + "elliptic-curve", + "primeorder", + "rand_core", + "sha2", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] name = "pathdiff" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[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.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] +name = "pest" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0848c601009d37dfa3430c4666e147e49cdcf1b92ecd3e63657d8a5f19da662" +dependencies = [ + "memchr", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11f486f1ea21e6c10ed15d5a7c77165d0ee443402f0780849d1768e7d9d6fe77" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8040c4647b13b210a963c1ed407c1ff4fdfa01c31d6d2a098218702e6664f94f" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" +dependencies = [ + "pest", + "sha2", +] + +[[package]] +name = "pgp" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaffe1ec22db286599c30ae6be75b37493b558735d86c8e59ec5c38794415fe4" +dependencies = [ + "aead", + "aes", + "aes-gcm", + "aes-kw", + "argon2", + "base64 0.22.1", + "bitfields", + "block-padding", + "blowfish", + "buffer-redux", + "byteorder", + "bytes", + "bzip2", + "camellia", + "cast5", + "cfb-mode", + "cipher", + "const-oid", + "crc24", + "curve25519-dalek", + "cx448", + "derive_builder", + "derive_more", + "des", + "digest", + "dsa", + "eax", + "ecdsa", + "ed25519-dalek", + "elliptic-curve", + "flate2", + "generic-array", + "hex", + "hkdf", + "idea", + "k256", + "log", + "md-5", + "nom 8.0.0", + "num-bigint-dig", + "num-traits", + "num_enum", + "ocb3", + "p256", + "p384", + "p521", + "rand", + "regex", + "replace_with", + "ripemd", + "rsa", + "sha1", + "sha1-checked", + "sha2", + "sha3", + "signature", + "smallvec", + "snafu", + "twofish", + "x25519-dalek", + "zeroize", +] + +[[package]] name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1063,12 +2169,45 @@ 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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] name = "pkg-config" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] name = "potential_utf" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1087,67 +2226,30 @@ dependencies = [ ] [[package]] -name = "proc-macro2" -version = "1.0.106" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quinn" -version = "0.11.9" +name = "primeorder" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e20a958963c291dc322d98411f541009df2ced7b5a4f2bd52337638cfccf20" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "bytes", - "cfg_aliases", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", - "thiserror", - "tokio", - "tracing", - "web-time", + "elliptic-curve", ] [[package]] -name = "quinn-proto" -version = "0.11.14" +name = "proc-macro-crate" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "434b42fec591c96ef50e21e886936e66d3cc3f737104fdb9b737c40ffb94c098" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" dependencies = [ - "bytes", - "getrandom 0.3.4", - "lru-slab", - "rand", - "ring", - "rustc-hash", - "rustls", - "rustls-pki-types", - "slab", - "thiserror", - "tinyvec", - "tracing", - "web-time", + "toml_edit 0.25.11+spec-1.1.0", ] [[package]] -name = "quinn-udp" -version = "0.5.14" +name = "proc-macro2" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addec6a0dcad8a8d96a771f815f0eaf55f9d1805756410b39f5fa81332574cbd" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.60.2", + "unicode-ident", ] [[package]] @@ -1166,20 +2268,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] name = "rand" -version = "0.9.2" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ + "libc", "rand_chacha", "rand_core", ] [[package]] name = "rand_chacha" -version = "0.9.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", "rand_core", @@ -1187,11 +2296,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.2.17", ] [[package]] @@ -1204,12 +2313,47 @@ dependencies = [ ] [[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "replace_with" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51743d3e274e2b18df81c4dc6caf8a5b8e15dbe799e0dca05c7617380094e884" + +[[package]] name = "reqwest" version = "0.12.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "encoding_rs", "futures-channel", @@ -1229,8 +2373,6 @@ dependencies = [ "native-tls", "percent-encoding", "pin-project-lite", - "quinn", - "rustls", "rustls-pki-types", "serde", "serde_json", @@ -1238,7 +2380,6 @@ dependencies = [ "sync_wrapper", "tokio", "tokio-native-tls", - "tokio-rustls", "tokio-util", "tower", "tower-http", @@ -1248,7 +2389,16 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", ] [[package]] @@ -1266,16 +2416,41 @@ dependencies = [ ] [[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.7", + "bitflags", + "serde", + "serde_derive", +] + +[[package]] name = "ror" -version = "1.0.0-r1" +version = "1.0.0-r2" dependencies = [ "ar", "chrono", "clap", "colored", "config", + "flate2", "futures", + "git2", + "nix", "once_cell", + "pgp", "reqwest", "semver", "serde", @@ -1287,6 +2462,27 @@ dependencies = [ "tokio", "walkdir", "xz2", + "zstd", +] + +[[package]] +name = "rsa" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", ] [[package]] @@ -1300,10 +2496,13 @@ dependencies = [ ] [[package]] -name = "rustc-hash" -version = "2.1.1" +name = "rustc_version" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] [[package]] name = "rustix" @@ -1325,7 +2524,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c665f33d38cea657d9614f766881e4d510e0eda4239891eea56b4cadcf01801b" dependencies = [ "once_cell", - "ring", "rustls-pki-types", "rustls-webpki", "subtle", @@ -1338,7 +2536,6 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" dependencies = [ - "web-time", "zeroize", ] @@ -1384,6 +2581,21 @@ dependencies = [ ] [[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect 0.2.0", + "subtle", + "zeroize", +] + +[[package]] name = "security-framework" version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1456,6 +2668,15 @@ dependencies = [ ] [[package]] +name = "serde_spanned" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf41e0cfaf7226dca15e8197172c295a782857fcb97fad1808a166870dee75a3" +dependencies = [ + "serde", +] + +[[package]] name = "serde_urlencoded" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1481,6 +2702,48 @@ dependencies = [ ] [[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "serdect" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f42f67da2385b51a5f9652db9c93d78aeaf7610bf5ec366080b6de810604af53" +dependencies = [ + "base16ct", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1-checked" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89f599ac0c323ebb1c6082821a54962b839832b03984598375bff3975b804423" +dependencies = [ + "digest", + "sha1", + "zeroize", +] + +[[package]] name = "sha2" version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1492,6 +2755,16 @@ dependencies = [ ] [[package]] +name = "sha3" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77fd7028345d415a4034cf8777cd4f8ab1851274233b45f84e3d955502d93874" +dependencies = [ + "digest", + "keccak", +] + +[[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1508,6 +2781,22 @@ dependencies = [ ] [[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "simd-adler32" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" + +[[package]] name = "slab" version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1520,6 +2809,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] +name = "snafu" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e84b3f4eacbf3a1ce05eac6763b4d629d60cbc94d632e4092c54ade71f1e1a2" +dependencies = [ + "snafu-derive", +] + +[[package]] +name = "snafu-derive" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1c97747dbf44bb1ca44a561ece23508e99cb592e862f22222dcf42f51d1e451" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "socket2" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1530,6 +2840,22 @@ dependencies = [ ] [[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] name = "stable_deref_trait" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1600,6 +2926,12 @@ dependencies = [ ] [[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] name = "tar" version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1663,21 +2995,6 @@ dependencies = [ ] [[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.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1738,6 +3055,77 @@ dependencies = [ ] [[package]] +name = "toml" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc1beb996b9d83529a9e75c17a1686767d148d70663143c7854d8b4a09ced362" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_edit 0.22.27", +] + +[[package]] +name = "toml_datetime" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cddaf88f4fbc13c51aebbf5f8eceb5c7c5a9da2ac40a13519eb5b0a0e8f11c" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.22.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fe8c660ae4257887cf66394862d21dbca4a6ddd26f04a3560410406a2f819a" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime 0.6.11", + "toml_write", + "winnow 0.7.15", +] + +[[package]] +name = "toml_edit" +version = "0.25.11+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b59c4d22ed448339746c59b905d24568fcbb3ab65a500494f7b8c3e97739f2b" +dependencies = [ + "indexmap", + "toml_datetime 1.1.1+spec-1.1.0", + "toml_parser", + "winnow 1.0.2", +] + +[[package]] +name = "toml_parser" +version = "1.1.2+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +dependencies = [ + "winnow 1.0.2", +] + +[[package]] +name = "toml_write" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" + +[[package]] name = "tower" version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1808,18 +3196,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] +name = "twofish" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a78e83a30223c757c3947cd144a31014ff04298d8719ae10d03c31c0448c8013" +dependencies = [ + "cipher", +] + +[[package]] name = "typenum" version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" [[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] name = "unicode-ident" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] +name = "unicode-segmentation" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9629274872b2bfaf8d66f5f15725007f635594914870f65218920345aa11aa8c" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + +[[package]] name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1984,25 +3409,6 @@ dependencies = [ ] [[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-roots" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" -dependencies = [ - "rustls-pki-types", -] - -[[package]] name = "winapi-util" version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2247,6 +3653,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" [[package]] +name = "winnow" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee1708bef14716a11bae175f579062d4554d95be2c6829f518df847b7b3fdd0" +dependencies = [ + "memchr", +] + +[[package]] name = "wit-bindgen" version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2259,6 +3683,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" [[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "x25519-dalek" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" +dependencies = [ + "curve25519-dalek", + "rand_core", + "serde", + "zeroize", +] + +[[package]] name = "xattr" version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2278,6 +3723,17 @@ dependencies = [ ] [[package]] +name = "yaml-rust2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + +[[package]] name = "yoke" version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2346,6 +3802,20 @@ name = "zeroize" version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85a5b4158499876c763cb03bc4e49185d3cccbabb15b33c627f7884f43db852e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "zerotrie" @@ -2381,7 +3851,41 @@ dependencies = [ ] [[package]] +name = "zlib-rs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be3d40e40a133f9c916ee3f9f4fa2d9d63435b5fbe1bfc6d9dae0aa0ada1513" + +[[package]] name = "zmij" version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.16+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" +dependencies = [ + "cc", + "pkg-config", +] @@ -1,27 +1,33 @@ [package] name = "ror" -version = "1.0.0-r1" +version = "1.0.0-r2" edition = "2024" authors = ["rorka900"] description = "RorkOS package manager" license = "AGPL-3.0" [dependencies] -clap = { version = "4.5", features = ["derive"] } -colored = "2.1" -serde = { version = "1.0", features = ["derive"] } +ar = "0.9" +chrono = { version = "0.4", features = ["serde"] } +clap = { version = "4", features = ["derive"] } +colored = "2" +config = { version = "0.14", features = ["ini"] } +flate2 = "1" +git2 = "0.19" +nix = { version = "0.29", features = ["mount", "process", "fs", "signal"] } +once_cell = "1" +reqwest = { version = "0.12", features = ["blocking", "json", "stream"] } +semver = "1" +pgp = "0.19.0" +serde = { version = "1", features = ["derive"] } +serde_json = "1" serde_yaml = "0.9" -serde_json = "1.0" -reqwest = { version = "0.12", features = ["blocking", "rustls-tls", "stream"] } -config = { version = "0.14", default-features = false, features = ["ini"] } -xz2 = "0.1" -tar = "0.4" sha2 = "0.10" -walkdir = "2" -chrono = "0.4" -semver = "1.0" -ar = "0.9" +tar = "0.4" tempfile = "3" +walkdir = "2" +xz2 = "0.1" +zstd = { version = "0.13", features = ["experimental"] } tokio = { version = "1", features = [ "rt-multi-thread", "macros", @@ -33,7 +39,6 @@ tokio = { version = "1", features = [ "fs", ] } futures = "0.3" -once_cell = "1" [profile.release] opt-level = "z" diff --git a/src/apply.rs b/src/apply.rs index 4e4ab44..2af85fe 100644 --- a/src/apply.rs +++ b/src/apply.rs @@ -1,4 +1,3 @@ - use std::collections::HashSet; use std::fs; use std::path::Path; @@ -10,6 +9,7 @@ use crate::group; use crate::install::{InstalledDB, load_package}; use crate::parallel; use crate::delete; +use crate::resolver; const DEFAULT_CONFIG_PATH: &str = "/etc/ror/system.yaml"; @@ -24,6 +24,8 @@ pub struct SystemConfig { #[serde(default)] #[allow(dead_code)] pub conflict_resolution: Option<String>, + #[serde(default)] + pub oss: bool, } #[derive(Debug, Deserialize, Default)] @@ -61,39 +63,39 @@ pub fn get_target_packages(sys_config: &SystemConfig, _cfg: &Config) -> Result<V if let Some(ref pkg) = sys_config.roles.init { match resolve_single_role(pkg, "init-system") { - Some(name) => { target.insert(name); } + Some(name) => target.insert(name), None => return Err(format!("Package '{}' does not provide init-system", pkg)), - } + }; } if let Some(ref pkg) = sys_config.roles.libc { match resolve_single_role(pkg, "libc") { - Some(name) => { target.insert(name); } + Some(name) => target.insert(name), None => return Err(format!("Package '{}' does not provide libc", pkg)), - } + }; } if let Some(ref pkg) = sys_config.roles.core { match resolve_single_role(pkg, "core-utils") { - Some(name) => { target.insert(name); } + Some(name) => target.insert(name), None => return Err(format!("Package '{}' does not provide core-utils", pkg)), - } + }; } if let Some(ref pkg) = sys_config.roles.udev { match resolve_single_role(pkg, "udev") { - Some(name) => { target.insert(name); } + Some(name) => target.insert(name), None => return Err(format!("Package '{}' does not provide udev", pkg)), - } + }; } if let Some(ref candidates) = sys_config.roles.sh { match resolve_list_role(candidates, "sh") { - Some(name) => { target.insert(name); } + Some(name) => target.insert(name), None => return Err("No package from sh list provides 'sh'".to_string()), - } + }; } if let Some(ref candidates) = sys_config.roles.su { match resolve_list_role(candidates, "su") { - Some(name) => { target.insert(name); } + Some(name) => target.insert(name), None => return Err("No package from su list provides 'su'".to_string()), - } + }; } for pkg in &sys_config.packages { @@ -108,11 +110,26 @@ pub fn get_target_packages(sys_config: &SystemConfig, _cfg: &Config) -> Result<V } } - Ok(target.into_iter().collect()) -} + let result: Vec<String> = target.into_iter().collect(); + + if sys_config.oss { + let mut non_oss = Vec::new(); + for pkg_name in &result { + match load_package(pkg_name) { + Some(pkg) if pkg.oss != Some(true) => non_oss.push(pkg_name.clone()), + None => non_oss.push(pkg_name.clone()), + _ => {} + } + } + if !non_oss.is_empty() { + return Err(format!( + "OSS policy is enabled but the following packages are not marked as open-source: {}", + non_oss.join(", ") + )); + } + } -fn resolve_dependencies(packages: &[String]) -> Result<Vec<String>, String> { - crate::rootfs::collect_install_order(packages) + Ok(result) } pub fn apply_system(cfg: &Config, dry_run: bool, custom_config: Option<&Path>) -> Result<(), String> { @@ -122,23 +139,41 @@ pub fn apply_system(cfg: &Config, dry_run: bool, custom_config: Option<&Path>) - let sys_config: SystemConfig = serde_yaml::from_str(&content) .map_err(|e| format!("Invalid YAML: {}", e))?; - let target_packages = get_target_packages(&sys_config, cfg)?; - let ordered = resolve_dependencies(&target_packages)?; - + let target_names = get_target_packages(&sys_config, cfg)?; let db = InstalledDB::load(); - let installed: HashSet<String> = db.packages.keys().cloned().collect(); - let target_set: HashSet<String> = ordered.iter().cloned().collect(); - let to_install: Vec<String> = target_set.difference(&installed).cloned().collect(); - let to_remove: Vec<String> = installed.difference(&target_set).cloned().collect(); + let mut outdated = HashSet::new(); + let required = resolver::collect_required_packages(&target_names, &db, &mut outdated) + .map_err(|e| format!("Dependency resolution failed: {}", e))?; + + let installed_set: HashSet<String> = db.packages.keys().cloned().collect(); + let mut to_remove: Vec<String> = installed_set.difference(&required).cloned().collect(); + + if let Err(conflict_err) = resolver::check_conflicts(&required, &db) { + let msg = conflict_err.to_string(); + eprintln!("{} {}", "[ror]".yellow().bold(), msg); + if let Some(pkg_conflict) = msg.split("'").nth(3) { + let pkg = pkg_conflict.to_string(); + if !to_remove.contains(&pkg) { + to_remove.push(pkg); + } + } else { + return Err(conflict_err); + } + } + + to_remove.sort(); + let to_install: Vec<String> = required.iter().cloned().collect(); println!("{} System apply plan:", "[ror]".blue().bold()); + if to_install.is_empty() && to_remove.is_empty() { println!("{} System is already in the desired state.", "[ror]".green()); return Ok(()); } + if !to_install.is_empty() { - println!("{} Install: {}", ">>>".green(), to_install.join(", ")); + println!("{} Install/upgrade: {}", ">>>".green(), to_install.join(", ")); } if !to_remove.is_empty() { println!("{} Remove: {}", ">>>".red(), to_remove.join(", ")); @@ -149,6 +184,23 @@ pub fn apply_system(cfg: &Config, dry_run: bool, custom_config: Option<&Path>) - return Ok(()); } + let mut skipped_remove = Vec::new(); + for pkg in &to_remove { + let can_remove = delete::check_critical_removal(pkg, &db).is_ok() + && !delete::has_dependents(pkg, &db, &required); + if can_remove { + println!("{} Removing {}...", ">>>".cyan(), pkg); + delete::remove_package(pkg); + } else { + skipped_remove.push(pkg.clone()); + eprintln!( + "{} Will not remove {} (critical role or still required)", + "[ror]".yellow(), + pkg + ); + } + } + if !to_install.is_empty() { let rt = tokio::runtime::Runtime::new() .map_err(|e| format!("Failed to create async runtime: {}", e))?; @@ -157,24 +209,35 @@ pub fn apply_system(cfg: &Config, dry_run: bool, custom_config: Option<&Path>) - std::sync::Arc::new(cfg.clone()), ))?; } - let mut skipped = Vec::new(); - for pkg in &to_remove { - let can_remove = delete::check_critical_removal(pkg, &db).is_ok() - && !delete::has_dependents(pkg, &db, &target_set); - if can_remove { - println!("{} Removing {}...", ">>>".cyan(), pkg); - delete::remove_package(pkg); + + let final_db = InstalledDB::load(); + let final_installed: HashSet<String> = final_db.packages.keys().cloned().collect(); + let final_required = { + let mut fresh_outdated = HashSet::new(); + resolver::collect_required_packages(&target_names, &final_db, &mut fresh_outdated) + .map_err(|e| format!("Re-resolution after install failed: {}", e))? + }; + let extra_remove: Vec<String> = final_installed.difference(&final_required).cloned().collect(); + + for pkg in extra_remove { + if delete::check_critical_removal(&pkg, &final_db).is_ok() + && !delete::has_dependents(&pkg, &final_db, &final_required) + { + println!("{} Removing extra {}...", ">>>".cyan(), pkg); + delete::remove_package(&pkg); } else { - skipped.push(pkg.clone()); + if !skipped_remove.contains(&pkg) { + skipped_remove.push(pkg); + } } } - if !skipped.is_empty() { + if !skipped_remove.is_empty() { println!( - "{} Skipped removal of {} (still required by other packages or protected): {}", + "{} Skipped removal of {} (still required or protected): {}", "[ror]".yellow().bold(), - skipped.len(), - skipped.join(", ") + skipped_remove.len(), + skipped_remove.join(", ") ); } diff --git a/src/install.rs b/src/install.rs index 3fe5c5c..e688076 100644 --- a/src/install.rs +++ b/src/install.rs @@ -1,8 +1,9 @@ use serde::{Deserialize, Serialize}; use std::fs; +use std::io::{BufReader, Read, Write}; use std::path::{Path, PathBuf}; +use std::ffi::CStr; use colored::Colorize; -use std::process::Command; use reqwest::blocking::Client; use sha2::{Sha256, Digest}; use walkdir::WalkDir; @@ -12,6 +13,9 @@ use std::os::unix::fs::symlink; use crate::config; use crate::progress::{Spinner, format_bytes}; use crate::debug; +use tar::Archive as TarArchive; +use zstd::stream::read::Decoder as ZstdDecoder; +use pgp::composed::{Deserializable, SignedPublicKey, DetachedSignature}; const REPO_ROOT: &str = "/var/ror/packages"; @@ -93,6 +97,8 @@ pub struct Package { pub depends: Vec<Dependency>, #[serde(default)] pub conflicts: Vec<String>, + #[serde(default)] + pub oss: Option<bool>, } #[derive(Debug, Serialize, Deserialize)] @@ -198,6 +204,95 @@ fn sort_mirrors_by_speed(mirrors: &[String]) -> Vec<String> { timed.into_iter().map(|(_, url)| url).collect() } +pub fn download_and_verify(url: &str, expected_sha: &str, _cfg: &config::Config) -> Result<PathBuf, String> { + debug!("Downloading {} (expected SHA256: {})", url, if expected_sha.is_empty() { "none" } else { expected_sha }); + let client = Client::builder() + .connect_timeout(std::time::Duration::from_secs(30)) + .build() + .map_err(|e| format!("Failed to build HTTP client: {}", e))?; + + let response = client + .get(url) + .send() + .map_err(|e| format!("Download failed: {}", e))?; + + if !response.status().is_success() { + return Err(format!("HTTP error: {}", response.status())); + } + + let total_size = response + .headers() + .get(reqwest::header::CONTENT_LENGTH) + .and_then(|v| v.to_str().ok()) + .and_then(|s| s.parse::<u64>().ok()); + + let tmp_dir = Path::new("/tmp/ror-download"); + fs::create_dir_all(tmp_dir).map_err(|e| format!("Failed to create tmp dir: {}", e))?; + + let file_name = url.split('/').last().unwrap_or("archive.tmp"); + let file_path = tmp_dir.join(file_name); + + { + let mut file = fs::File::create(&file_path) + .map_err(|e| format!("Failed to create temp file: {}", e))?; + let mut hasher = Sha256::new(); + let mut reader = response; + let mut buf = [0u8; 65536]; + let mut downloaded: u64 = 0; + + loop { + let n = reader + .read(&mut buf) + .map_err(|e| format!("Failed to read response body: {}", e))?; + if n == 0 { + break; + } + hasher.update(&buf[..n]); + file.write_all(&buf[..n]) + .map_err(|e| format!("Failed to write to temp file: {}", e))?; + downloaded += n as u64; + + match total_size { + Some(total) if total > 0 => { + let pct = downloaded * 40 / total; + let bar = format!( + "{}>{}", + "=".repeat(pct.saturating_sub(1) as usize), + " ".repeat((40 - pct) as usize) + ); + eprint!( + "\r\x1b[K\x1b[36m[{}]\x1b[0m {} / {}", + bar, + format_bytes(downloaded), + format_bytes(total) + ); + } + _ => { + eprint!("\r\x1b[K{} downloaded", format_bytes(downloaded)); + } + } + std::io::stderr().flush().ok(); + } + + eprintln!("\r\x1b[K\x1b[32m✓\x1b[0m Downloaded {}", format_bytes(downloaded)); + + if !expected_sha.is_empty() { + let hash = format!("{:x}", hasher.finalize()); + if hash != expected_sha { + let _ = fs::remove_file(&file_path); + debug!("SHA256 mismatch: expected {}, got {}", expected_sha, hash); + return Err(format!( + "SHA256 mismatch: expected {}, got {}", + expected_sha, hash + )); + } + debug!("SHA256 verified successfully"); + } + } + + Ok(file_path) +} + pub fn extract_deb(archive_path: &Path, dest_root: &Path) -> Result<Vec<String>, String> { debug!("Extracting .deb archive {:?} to {:?}", archive_path, dest_root); let file = fs::File::open(archive_path).map_err(|e| e.to_string())?; @@ -209,7 +304,7 @@ pub fn extract_deb(archive_path: &Path, dest_root: &Path) -> Result<Vec<String>, let identifier = std::str::from_utf8(entry.header().identifier()).unwrap_or(""); if identifier.contains("data.tar") { - let reader: Box<dyn std::io::Read> = if identifier.ends_with(".xz") { + let reader: Box<dyn Read> = if identifier.ends_with(".xz") { Box::new(xz2::read::XzDecoder::new(entry)) } else { Box::new(entry) @@ -317,65 +412,32 @@ pub fn find_package_with_repo(pkg_name: &str) -> Option<(PathBuf, String)> { None } -pub fn verify_gpg_signature(archive_path: &Path, asc_path: &Path, pubkey_path: &Path) -> Result<(), String> { - debug!("Verifying GPG signature for {:?}", archive_path); - if !pubkey_path.exists() { - return Err(format!( - "GPG public key not found: {}", - pubkey_path.display() - )); - } - - if !asc_path.exists() { - return Err(format!( - "GPG signature not found: {} -- cannot verify package", - asc_path.display() - )); - } - - let tmp_keyring = Path::new("/tmp/ror-gpg-keyring.gpg"); - let import = Command::new("gpg") - .args([ - "--batch", - "--no-default-keyring", - "--keyring", tmp_keyring.to_str().unwrap(), - "--import", pubkey_path.to_str().unwrap(), - ]) - .output() - .map_err(|e| format!("Failed to run gpg --import: {}", e))?; +pub fn verify_gpg_signature( + archive_path: &Path, + asc_path: &Path, + pubkey_path: &Path, +) -> Result<(), String> { + let key_bytes = fs::read(pubkey_path) + .map_err(|e| format!("Cannot read key: {}", e))?; + let public_key = SignedPublicKey::from_bytes(BufReader::new(&key_bytes[..])) + .map_err(|e| format!("Invalid public key: {}", e))?; - if !import.status.success() { - return Err(format!( - "Failed to import GPG key {}: {}", - pubkey_path.display(), - String::from_utf8_lossy(&import.stderr) - )); - } + let sig_bytes = fs::read(asc_path) + .map_err(|e| format!("Cannot read signature: {}", e))?; + let signature = DetachedSignature::from_bytes(BufReader::new(&sig_bytes[..])) + .map_err(|e| format!("Invalid signature format: {}", e))?; - let verify = Command::new("gpg") - .args([ - "--batch", - "--no-default-keyring", - "--keyring", tmp_keyring.to_str().unwrap(), - "--verify", asc_path.to_str().unwrap(), - archive_path.to_str().unwrap(), - ]) - .output() - .map_err(|e| format!("Failed to run gpg --verify: {}", e))?; + let mut data = Vec::new(); + fs::File::open(archive_path) + .map_err(|e| format!("Cannot open archive: {}", e))? + .read_to_end(&mut data) + .map_err(|e| format!("Cannot read archive: {}", e))?; - let _ = fs::remove_file(tmp_keyring); + signature.verify(&public_key, &data) + .map_err(|e| format!("GPG signature verification failed: {}", e))?; - if verify.status.success() { - debug!("GPG signature verification succeeded"); - Ok(()) - } else { - Err(format!( - "GPG signature verification failed for {}: {}", - archive_path.display(), - String::from_utf8_lossy(&verify.stderr).lines().next().unwrap_or("unknown error") - )) - } + Ok(()) } pub fn install_package(pkg_name: &str, cfg: &config::Config) { @@ -428,6 +490,8 @@ pub fn install_package_with_result(pkg_name: &str, cfg: &config::Config) -> Resu debug!("Loaded package metadata for {} version {}", pkg.name, pkg.version); + check_oss_policy(&pkg)?; + if pkg.binaries.is_empty() { return Err("No binary packages defined".to_string()); } @@ -607,112 +671,10 @@ pub fn install_package_with_result(pkg_name: &str, cfg: &config::Config) -> Resu }) } -pub fn download_and_verify(url: &str, expected_sha: &str, _cfg: &config::Config) -> Result<PathBuf, String> { - debug!("Downloading {} (expected SHA256: {})", url, if expected_sha.is_empty() { "none" } else { expected_sha }); - let client = Client::builder() - .connect_timeout(std::time::Duration::from_secs(30)) - .build() - .map_err(|e| format!("Failed to build HTTP client: {}", e))?; - - let response = client - .get(url) - .send() - .map_err(|e| format!("Download failed: {}", e))?; - - if !response.status().is_success() { - return Err(format!("HTTP error: {}", response.status())); - } - - let total_size = response - .headers() - .get(reqwest::header::CONTENT_LENGTH) - .and_then(|v| v.to_str().ok()) - .and_then(|s| s.parse::<u64>().ok()); - - let tmp_dir = Path::new("/tmp/ror-download"); - fs::create_dir_all(tmp_dir).map_err(|e| format!("Failed to create tmp dir: {}", e))?; - - let file_name = url.split('/').last().unwrap_or("archive.tmp"); - let file_path = tmp_dir.join(file_name); - - { - use std::io::Write; - let mut file = fs::File::create(&file_path) - .map_err(|e| format!("Failed to create temp file: {}", e))?; - let mut hasher = Sha256::new(); - let mut reader = response; - let mut buf = [0u8; 65536]; - let mut downloaded: u64 = 0; - - loop { - use std::io::Read; - let n = reader - .read(&mut buf) - .map_err(|e| format!("Failed to read response body: {}", e))?; - if n == 0 { - break; - } - hasher.update(&buf[..n]); - file.write_all(&buf[..n]) - .map_err(|e| format!("Failed to write to temp file: {}", e))?; - downloaded += n as u64; - - match total_size { - Some(total) if total > 0 => { - let pct = downloaded * 40 / total; - let bar = format!( - "{}>{}", - "=".repeat(pct.saturating_sub(1) as usize), - " ".repeat((40 - pct) as usize) - ); - eprint!( - "\r\x1b[K\x1b[36m[{}]\x1b[0m {} / {}", - bar, - format_bytes(downloaded), - format_bytes(total) - ); - } - _ => { - eprint!("\r\x1b[K{} downloaded", format_bytes(downloaded)); - } - } - use std::io::stderr; - stderr().flush().ok(); - } - - eprintln!("\r\x1b[K\x1b[32m✓\x1b[0m Downloaded {}", format_bytes(downloaded)); - - if !expected_sha.is_empty() { - let hash = format!("{:x}", hasher.finalize()); - if hash != expected_sha { - let _ = fs::remove_file(&file_path); - debug!("SHA256 mismatch: expected {}, got {}", expected_sha, hash); - return Err(format!( - "SHA256 mismatch: expected {}, got {}", - expected_sha, hash - )); - } - debug!("SHA256 verified successfully"); - } - } - - Ok(file_path) -} - pub fn extract_native(archive_path: &Path, target_dir: &Path) -> Result<Vec<String>, String> { - debug!("Extracting native tar archive {:?} to {:?}", archive_path, target_dir); - let status = Command::new("tar") - .arg("-xf") - .arg(archive_path) - .arg("-C") - .arg(target_dir) - .status() - .map_err(|e| format!("Failed to execute tar: {}", e))?; - - if !status.success() { - return Err(format!("tar failed with exit code {:?}", status.code())); - } - + let file = fs::File::open(archive_path).map_err(|e| e.to_string())?; + let mut tar = TarArchive::new(file); + tar.unpack(target_dir).map_err(|e| format!("Tar unpack failed: {}", e))?; let mut files = Vec::new(); for entry in WalkDir::new(target_dir).into_iter().filter_map(|e| e.ok()) { if entry.file_type().is_file() || entry.file_type().is_symlink() { @@ -720,28 +682,16 @@ pub fn extract_native(archive_path: &Path, target_dir: &Path) -> Result<Vec<Stri files.push(rel_path.to_string_lossy().to_string()); } } - debug!("Extracted {} files/dirs", files.len()); Ok(files) } pub fn extract_ror(archive_path: &Path, dict_path: &Path, target_dir: &Path) -> Result<Vec<String>, String> { - debug!("Extracting .ror archive {:?} using dictionary {:?}", archive_path, dict_path); - let zstd_arg = format!("zstd -D {}", dict_path.display()); - - let status = Command::new("tar") - .arg("-I") - .arg(&zstd_arg) - .arg("-xf") - .arg(archive_path) - .arg("-C") - .arg(target_dir) - .status() - .map_err(|e| format!("Failed to execute tar for .ror: {}", e))?; - - if !status.success() { - return Err(format!("tar .ror failed with exit code {:?}", status.code())); - } - + let file = fs::File::open(archive_path).map_err(|e| e.to_string())?; + let dict_data = fs::read(dict_path).map_err(|e| e.to_string())?; + let decoder = ZstdDecoder::with_dictionary(BufReader::new(file), &dict_data) + .map_err(|e| format!("Zstd decoder with dictionary failed: {}", e))?; + let mut tar = TarArchive::new(decoder); + tar.unpack(target_dir).map_err(|e| format!("Tar unpack failed: {}", e))?; let mut files = Vec::new(); for entry in WalkDir::new(target_dir).into_iter().filter_map(|e| e.ok()) { if entry.file_type().is_file() || entry.file_type().is_symlink() { @@ -749,26 +699,14 @@ pub fn extract_ror(archive_path: &Path, dict_path: &Path, target_dir: &Path) -> files.push(rel_path.to_string_lossy().to_string()); } } - debug!("Extracted {} files from .ror", files.len()); Ok(files) } pub fn extract_sror(archive_path: &Path, target_dir: &Path) -> Result<Vec<String>, String> { - debug!("Extracting .sror archive {:?} to {:?}", archive_path, target_dir); - let status = Command::new("tar") - .arg("-I") - .arg("zstd") - .arg("-xf") - .arg(archive_path) - .arg("-C") - .arg(target_dir) - .status() - .map_err(|e| format!("Failed to execute tar for .sror: {}", e))?; - - if !status.success() { - return Err(format!("tar .sror failed with exit code {:?}", status.code())); - } - + let file = fs::File::open(archive_path).map_err(|e| e.to_string())?; + let decoder = ZstdDecoder::new(BufReader::new(file)).map_err(|e| format!("Zstd decoder failed: {}", e))?; + let mut tar = TarArchive::new(decoder); + tar.unpack(target_dir).map_err(|e| format!("Tar unpack failed: {}", e))?; let mut files = Vec::new(); for entry in WalkDir::new(target_dir).into_iter().filter_map(|e| e.ok()) { if entry.file_type().is_file() || entry.file_type().is_symlink() { @@ -776,7 +714,6 @@ pub fn extract_sror(archive_path: &Path, target_dir: &Path) -> Result<Vec<String files.push(rel_path.to_string_lossy().to_string()); } } - debug!("Extracted {} files from .sror", files.len()); Ok(files) } @@ -845,21 +782,50 @@ pub fn install_files_with_root(source_dir: &Path, root: &Path, files: &[String]) } pub fn run_commands(steps: &str, work_dir: &Path) -> Result<(), String> { - debug!("Running commands: {}", steps); if steps.trim().is_empty() { return Ok(()); } - let status = Command::new("sh") - .current_dir(work_dir) - .arg("-c") - .arg(steps) - .status() - .map_err(|e| format!("Failed to execute sh -c: {}", e))?; - if status.success() { - debug!("Commands executed successfully"); - Ok(()) - } else { - Err(format!("Command failed with exit code {:?}", status.code())) + use nix::unistd::{fork, ForkResult, chdir, execve}; + use nix::sys::wait::{waitpid, WaitStatus}; + use std::ffi::CString; + + let script = format!("#!/bin/sh\nset -e\n{}", steps); + let tmp_script = "/tmp/ror-install-step.sh"; + fs::write(tmp_script, &script).map_err(|e| format!("Cannot write script: {}", e))?; + + match unsafe { fork() } { + Ok(ForkResult::Child) => { + if chdir(work_dir).is_err() { std::process::exit(1); } + let shell = CString::new("/bin/sh").unwrap(); + let arg0 = CString::new("sh").unwrap(); + let arg1 = CString::new(tmp_script).unwrap(); + let _ = execve::<&CStr, &CStr>(&shell, &[&arg0, &arg1], &[]); + std::process::exit(1); + } + Ok(ForkResult::Parent { child }) => { + match waitpid(child, None) { + Ok(WaitStatus::Exited(_, code)) => { + let _ = fs::remove_file(tmp_script); + if code == 0 { + Ok(()) + } else { + Err(format!("Install script failed with code {}", code)) + } + } + Ok(_) => { + let _ = fs::remove_file(tmp_script); + Err("Install script terminated by signal".to_string()) + } + Err(e) => { + let _ = fs::remove_file(tmp_script); + Err(format!("waitpid failed: {}", e)) + } + } + } + Err(e) => { + let _ = fs::remove_file(tmp_script); + Err(format!("Fork failed: {}", e)) + } } } @@ -884,6 +850,28 @@ pub fn load_package(pkg_name: &str) -> Option<Package> { serde_yaml::from_str(&content).ok() } +fn check_oss_policy(pkg: &Package) -> Result<(), String> { + const SYSTEM_YAML: &str = "/etc/ror/system.yaml"; + let Ok(content) = fs::read_to_string(SYSTEM_YAML) else { + return Ok(()); + }; + #[derive(serde::Deserialize)] + struct OssCheck { + #[serde(default)] + oss: bool, + } + let Ok(check) = serde_yaml::from_str::<OssCheck>(&content) else { + return Ok(()); + }; + if check.oss && pkg.oss != Some(true) { + return Err(format!( + "Package '{}' is not marked as open-source (oss: true) but system policy requires it", + pkg.name + )); + } + Ok(()) +} + pub fn install_local_package(archive_path: &Path, cfg: &config::Config) { debug!("Starting local install from {:?}", archive_path); match install_local_package_with_result(archive_path, cfg) { diff --git a/src/rootfs.rs b/src/rootfs.rs index b408741..027cce1 100644 --- a/src/rootfs.rs +++ b/src/rootfs.rs @@ -1,14 +1,12 @@ use crate::apply::SystemConfig; -use std::collections::{HashMap, HashSet, VecDeque}; +use std::collections::HashMap; use std::fs; -use std::path::Path; -use std::process::Command; +use std::path::{Path}; use std::os::unix::fs::symlink; use std::sync::{Arc, Mutex}; use std::thread; use colored::Colorize; use serde::Serialize; -use serde_json; use crate::config; use crate::progress::ProgressBar; use chrono::Local; @@ -17,7 +15,14 @@ use crate::install::{ extract_native, extract_ror, install_files_with_root, select_binary_for_arch, InstalledDB, InstalledPackage, }; - +use nix::mount::{mount, umount2, MntFlags, MsFlags}; +use nix::unistd::{chroot, chdir, fork, ForkResult, execve}; +use nix::sys::wait::{waitpid, WaitStatus}; +use std::io::Write; +use std::ffi::CString; +use std::ffi::CStr; +use std::collections::HashSet; +use std::collections::VecDeque; struct DownloadTask { pkg_name: String, urls: Vec<String>, @@ -167,7 +172,6 @@ fn download_parallel( total, task.pkg_name ); - use std::io::Write; std::io::stderr().flush().ok(); break; } @@ -283,7 +287,7 @@ fn setup_usr_merge(target_dir: &Path) -> Result<(), String> { ("lib", "usr/lib"), ("lib64", "usr/lib64"), ("sbin", "usr/sbin"), -] { + ] { symlink(target, target_dir.join(link)) .map_err(|e| format!("Failed to create symlink {} -> {}: {}", link, target, e))?; } @@ -329,27 +333,29 @@ fn mount_virtual_fs(root_dir: &Path) -> Result<(), String> { ("proc", "proc", "proc", false), ("sysfs", "sys", "sysfs", false), ]; - for (src, rel, fstype, bind) in mounts { let target = root_dir.join(rel); fs::create_dir_all(&target) .map_err(|e| format!("Failed to create mountpoint {}: {}", rel, e))?; - let status = if *bind { - Command::new("mount") - .args(["--bind", src, target.to_str().unwrap()]) - .status() + if *bind { + mount( + Some(Path::new(src)), + &target, + None::<&str>, + MsFlags::MS_BIND | MsFlags::MS_REC, + None::<&Path>, + ) } else { - Command::new("mount") - .args(["-t", fstype, src, target.to_str().unwrap()]) - .status() - }; - - match status { - Ok(s) if s.success() => {} - Ok(_) => eprintln!("{} Warning: failed to mount {} (non-fatal)", "[ror]".yellow(), rel), - Err(e) => eprintln!("{} Warning: mount {}: {} (non-fatal)", "[ror]".yellow(), rel, e), + mount( + Some(Path::new(src)), + &target, + Some(*fstype), + MsFlags::empty(), + None::<&Path>, + ) } + .map_err(|e| format!("Failed to mount {}: {}", rel, e))?; } Ok(()) } @@ -358,7 +364,7 @@ fn umount_virtual_fs(root_dir: &Path) { for rel in &["dev/pts", "dev/shm", "dev", "proc", "sys"] { let target = root_dir.join(rel); if target.exists() { - let _ = Command::new("umount").args(["-l", target.to_str().unwrap()]).status(); + let _ = umount2(&target, MntFlags::MNT_DETACH); } } } @@ -378,39 +384,56 @@ const SHELL_CANDIDATES: &[(&str, Option<&str>)] = &[ ]; fn find_working_shell(root_dir: &Path) -> Option<(&'static str, Option<&'static str>)> { - for &(shell_path, subcmd) in SHELL_CANDIDATES { - if !root_dir.join(shell_path.trim_start_matches('/')).exists() { + for (shell_path, subcmd) in SHELL_CANDIDATES { + let full = root_dir.join(shell_path.trim_start_matches('/')); + if !full.exists() { continue; } - - let mut cmd = Command::new("chroot"); - cmd.arg(root_dir).arg(shell_path); - if let Some(sub) = subcmd { - cmd.arg(sub); + let test_script = "exit 0"; + let script_path = root_dir.join(".ror-shell-test.sh"); + if fs::write(&script_path, format!("#!/bin/sh\n{}", test_script)).is_err() { + continue; } - cmd.arg("-c").arg("exit 0"); - - match cmd.output() { - Ok(out) if out.status.success() => return Some((shell_path, subcmd)), - Ok(out) => { - let stderr = String::from_utf8_lossy(&out.stderr); - eprintln!( - "{} Shell {} failed in chroot ({}), trying next...", - "[ror]".yellow(), - shell_path, - stderr.lines().next().unwrap_or("unknown error").trim() - ); + match unsafe { fork() } { + Ok(ForkResult::Child) => { + if chroot(root_dir).is_err() { std::process::exit(1); } + if chdir("/").is_err() { std::process::exit(1); } + let shell_c = CString::new(*shell_path).unwrap(); + let arg0 = CString::new(*shell_path).unwrap(); + let args = if let Some(sub) = subcmd { + let sub_c = CString::new(*sub).unwrap(); + let script_c = CString::new(".ror-shell-test.sh").unwrap(); + vec![arg0, sub_c, script_c] + } else { + let script_c = CString::new(".ror-shell-test.sh").unwrap(); + vec![arg0, script_c] + }; + let args_refs: Vec<&CStr> = args.iter().map(|s| s.as_c_str()).collect(); + let _ = execve::<&CStr, &CStr>(&shell_c, &args_refs, &[]); + std::process::exit(1); } - Err(e) => { - eprintln!("{} Cannot test shell {}: {}, trying next...", "[ror]".yellow(), shell_path, e); + Ok(ForkResult::Parent { child }) => { + match waitpid(child, None) { + Ok(WaitStatus::Exited(_, 0)) => { + let _ = fs::remove_file(&script_path); + return Some((*shell_path, *subcmd)); + } + Ok(_) => { + let _ = fs::remove_file(&script_path); + } + Err(_) => { + let _ = fs::remove_file(&script_path); + } + } } + Err(_) => { let _ = fs::remove_file(&script_path); } } } None } fn run_install_steps_in_chroot( - pkg_name: &str, + _pkg_name: &str, steps: &str, root_dir: &Path, shell: &str, @@ -418,29 +441,70 @@ fn run_install_steps_in_chroot( ) -> Result<(), String> { let script_rel = "/.ror-install-steps.sh"; let script_host = root_dir.join(script_rel.trim_start_matches('/')); - fs::write(&script_host, format!("#!/bin/sh\nset -e\n{}", steps)) - .map_err(|e| format!("Failed to write install script: {}", e))?; - - let mut cmd = Command::new("chroot"); - cmd.arg(root_dir).arg(shell); - if let Some(sub) = subcmd { - cmd.arg(sub); + .map_err(|e| format!("Failed to write script: {}", e))?; + + match unsafe { fork() } { + Ok(ForkResult::Child) => { + if chroot(root_dir).is_err() { std::process::exit(1); } + if chdir("/").is_err() { std::process::exit(1); } + let shell_c = CString::new(shell).unwrap(); + let arg0 = CString::new(shell).unwrap(); + let script_c = CString::new(script_rel).unwrap(); + let args = if let Some(sub) = subcmd { + let sub_c = CString::new(sub).unwrap(); + vec![arg0, sub_c, script_c] + } else { + vec![arg0, script_c] + }; + let _ = execve::<&CStr, &CStr>(&shell_c, &args.iter().map(|s| s.as_ref()).collect::<Vec<_>>(), &[]); + std::process::exit(1); + } + Ok(ForkResult::Parent { child }) => { + match waitpid(child, None) { + Ok(WaitStatus::Exited(_, code)) => { + let _ = fs::remove_file(&script_host); + if code == 0 { + Ok(()) + } else { + Err(format!("install_steps failed with exit code {}", code)) + } + } + Ok(_) => { + let _ = fs::remove_file(&script_host); + Err("install_steps terminated by signal".to_string()) + } + Err(e) => { + let _ = fs::remove_file(&script_host); + Err(format!("waitpid failed: {}", e)) + } + } + } + Err(e) => { + let _ = fs::remove_file(&script_host); + Err(format!("Fork failed: {}", e)) + } } - cmd.arg(script_rel); - - let status = cmd.status() - .map_err(|e| format!("Failed to execute chroot for {}: {}", pkg_name, e))?; - - let _ = fs::remove_file(&script_host); +} - if status.success() { - Ok(()) - } else { - Err(format!( - "install_steps for '{}' failed with exit code {:?}", - pkg_name, status.code() - )) +fn run_ldconfig_in_root(root_dir: &Path) -> Result<(), String> { + match unsafe { fork() } { + Ok(ForkResult::Child) => { + if chroot(root_dir).is_err() { std::process::exit(1); } + if chdir("/").is_err() { std::process::exit(1); } + let ldconfig = CString::new("/sbin/ldconfig").unwrap(); + let arg0 = CString::new("ldconfig").unwrap(); + let _ = execve::<&CString, &CStr>(&ldconfig, &[&arg0], &[]); + std::process::exit(1); + } + Ok(ForkResult::Parent { child }) => { + match waitpid(child, None) { + Ok(WaitStatus::Exited(_, 0)) => Ok(()), + Ok(_) => Err("ldconfig terminated abnormally".to_string()), + Err(e) => Err(format!("waitpid ldconfig failed: {}", e)), + } + } + Err(e) => Err(format!("Fork for ldconfig failed: {}", e)), } } @@ -649,9 +713,10 @@ pub fn build_rootfs( if !ld_conf.exists() { let _ = fs::write(&ld_conf, "/usr/lib\n/usr/lib64\n"); } - match Command::new("ldconfig").arg("-r").arg(target_dir).status() { - Ok(s) if s.success() => println!("{} ldconfig done.", ">>>".green()), - _ => eprintln!("{} ldconfig failed (non-fatal)", "[ror]".yellow()), + if let Err(e) = run_ldconfig_in_root(target_dir) { + eprintln!("{} ldconfig failed: {} (non-fatal)", "[ror]".yellow(), e); + } else { + println!("{} ldconfig done.", ">>>".green()); } } diff --git a/src/sync.rs b/src/sync.rs index 3734a03..d717694 100644 --- a/src/sync.rs +++ b/src/sync.rs @@ -1,69 +1,97 @@ use colored::*; -use std::path::Path; -use std::process::Command; +use std::path::{Path}; +use git2::{Repository, RemoteCallbacks, FetchOptions, build::RepoBuilder}; use crate::config::Config; -const REPOS_DIR: &str = "/var/ror/packages"; +const REPOS_DIR: &str = "/var/ror/packages"; pub fn run_sync(cfg: &Config) { if cfg.repositories.is_empty() { eprintln!("{} No repositories configured.", "[ror]".red().bold()); return; } - for (name, repo) in &cfg.repositories { println!("{} Syncing repository '{}'...", "[ror]".blue().bold(), name); let repo_path = Path::new(REPOS_DIR).join(name); - if repo_path.exists() { println!("{} Updating {}...", ">>>".green(), name); - let status = Command::new("git") - .args(&["-C", repo_path.to_str().unwrap(), "pull"]) - .status() - .expect("Failed to execute git pull"); - - if !status.success() && repo.mirror.is_some() { - eprintln!("{} Pull failed, trying mirror...", "[ror]".red()); - let mirror_url = repo.mirror.as_ref().unwrap(); - let mirror_status = Command::new("git") - .args(&["-C", repo_path.to_str().unwrap(), "pull", mirror_url]) - .status() - .expect("Failed to execute git pull from mirror"); - if mirror_status.success() { - println!("{} Updated from mirror.", ">>>".green()); - } else { - eprintln!("{} Mirror also failed.", "[ror]".red()); - } - } else if !status.success() { - eprintln!("{} Git pull failed, no mirror configured.", "[ror]".red()); + if let Err(e) = pull_or_clone(&repo_path, &repo.url) { + eprintln!("{} {}", "[ror]".red(), e); } else { println!("{} Repository updated.", ">>>".green()); } } else { println!("{} Cloning {}...", ">>>".green(), name); - let primary_url = &repo.url; - let mut status = Command::new("git") - .args(&["clone", primary_url, repo_path.to_str().unwrap()]) - .status() - .expect("Failed to execute git clone"); - - if !status.success() && repo.mirror.is_some() { - eprintln!("{} Clone from primary failed, trying mirror...", "[ror]".red()); - let mirror_url = repo.mirror.as_ref().unwrap(); - status = Command::new("git") - .args(&["clone", mirror_url, repo_path.to_str().unwrap()]) - .status() - .expect("Failed to execute git clone from mirror"); - if status.success() { - println!("{} Cloned from mirror.", ">>>".green()); - } else { - eprintln!("{} Mirror also failed.", "[ror]".red()); - } - } else if !status.success() { - eprintln!("{} Git clone failed.", "[ror]".red()); + if let Err(e) = clone_repo(name, &repo.url, repo.mirror.as_deref()) { + eprintln!("{} {}", "[ror]".red(), e); } else { println!("{} Repository cloned.", ">>>".green()); } } } } + +fn clone_repo(name: &str, primary: &str, mirror: Option<&str>) -> Result<(), String> { + let path = Path::new(REPOS_DIR).join(name); + let cb = RemoteCallbacks::new(); + let mut fo = FetchOptions::new(); + fo.remote_callbacks(cb); + let result = RepoBuilder::new() + .fetch_options(fo) + .clone(primary, &path); + if result.is_err() { + if let Some(mirror_url) = mirror { + let cb2 = RemoteCallbacks::new(); + let mut fo2 = FetchOptions::new(); + fo2.remote_callbacks(cb2); + RepoBuilder::new() + .fetch_options(fo2) + .clone(mirror_url, &path) + .map_err(|e| format!("Failed to clone from primary and mirror: {}", e))?; + } else { + return Err(format!("Clone failed: {}", result.err().unwrap())); + } + } + Ok(()) +} + +fn pull_or_clone(repo_path: &Path, primary: &str) -> Result<(), String> { + let repo = Repository::open(repo_path) + .map_err(|e| format!("Cannot open repository: {}", e))?; + let mut remote = repo.find_remote("origin") + .or_else(|_| { + repo.remote_set_url("origin", primary)?; + repo.find_remote("origin") + }) + .map_err(|e| format!("Remote error: {}", e))?; + let cb = RemoteCallbacks::new(); + let mut fo = FetchOptions::new(); + fo.remote_callbacks(cb); + remote.fetch(&["refs/heads/*:refs/heads/*"], Some(&mut fo), None) + .map_err(|e| format!("Fetch failed: {}", e))?; + let fetch_head = repo.find_reference("FETCH_HEAD") + .map_err(|e| format!("FETCH_HEAD missing: {}", e))?; + let fetch_commit = repo.reference_to_annotated_commit(&fetch_head) + .map_err(|e| format!("Annotated commit error: {}", e))?; + let (analysis, _) = repo.merge_analysis(&[&fetch_commit]) + .map_err(|e| format!("Merge analysis failed: {}", e))?; + if analysis.is_fast_forward() { + let mut refname = "refs/heads/master".to_string(); + if let Ok(head) = repo.head() { + if let Some(name) = head.name() { + refname = name.to_string(); + } + } + let mut reference = repo.find_reference(&refname) + .map_err(|e| format!("Reference not found: {}", e))?; + reference.set_target(fetch_commit.id(), "fast-forward merge") + .map_err(|e| format!("Set target failed: {}", e))?; + repo.set_head(&refname) + .map_err(|e| format!("Set head failed: {}", e))?; + repo.checkout_head(Some(git2::build::CheckoutBuilder::new().force())) + .map_err(|e| format!("Checkout failed: {}", e))?; + } else if analysis.is_normal() { + return Err("Non-fast-forward update requires manual merge".to_string()); + } + Ok(()) +} |