diff --git a/Cargo.lock b/Cargo.lock index ef07907..86db035 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 4 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "aead" @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "3ae563653d1938f79b1ab1b5e668c87c76a9930414574a6583a7b7e11a8e6192" dependencies = [ "anstyle", "anstyle-parse", @@ -87,43 +87,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "9e231f6134f61b71076a3eab506c379d4f36122f2af15a9ff04415ea4c3339e2" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.60.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "3e0633414522a32ffaac8ac6cc8f748e090c5717661fddeea04219e2344f5f2a" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell_polyfill", + "windows-sys 0.60.2", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100" [[package]] name = "arc-swap" @@ -133,34 +134,34 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "async-trait" -version = "0.1.88" +version = "0.1.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -207,9 +208,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "6a65b545ab31d687cff52899d4890855fec459eb6afe0da6417b8a18da87aa29" [[package]] name = "block-buffer" @@ -228,21 +229,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" - -[[package]] -name = "cc" -version = "1.0.105" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5208975e568d83b6b05cc0a063c8e7e9acc2b43bee6da15616a5b73e109d7437" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "chacha20" @@ -281,9 +276,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "1fc0e74a703892159f5ae7d3aac52c8e6c392f5ae5f359c70b5881d60aaac318" dependencies = [ "clap_builder", "clap_derive", @@ -291,9 +286,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b3e7f4214277f3c7aa526a59dd3fbe306a370daee1f8b7b8c987069cd8e888a8" dependencies = [ "anstream", "anstyle", @@ -303,27 +298,27 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "14cb31bb0a7d536caef2639baa7fad459e15c3144efefa6dbd1c84562c4739f6" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "combine" @@ -398,7 +393,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -443,7 +438,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -594,7 +589,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -650,9 +645,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "hashbrown" @@ -667,10 +662,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +name = "herodb" +version = "0.0.1" +dependencies = [ + "age", + "anyhow", + "base64 0.22.1", + "bincode", + "byteorder", + "bytes", + "chacha20poly1305", + "clap", + "ed25519-dalek", + "futures", + "rand", + "redb", + "redis", + "secrecy", + "serde", + "serde_json", + "sha2", + "thiserror", + "tokio", +] [[package]] name = "hkdf" @@ -742,7 +756,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.69", + "syn 2.0.106", "unic-langid", ] @@ -756,7 +770,7 @@ dependencies = [ "i18n-config", "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -894,6 +908,17 @@ dependencies = [ "unic-langid", ] +[[package]] +name = "io-uring" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d93587f37623a1a17d94ef2bc9ada592f5465fe7732084ab7beefabe5c77c0c4" +dependencies = [ + "bitflags", + "cfg-if", + "libc", +] + [[package]] name = "io_tee" version = "0.1.1" @@ -920,9 +945,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.175" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" [[package]] name = "litemap" @@ -932,9 +957,9 @@ checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -948,9 +973,9 @@ checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "minimal-lexical" @@ -960,22 +985,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -988,21 +1013,11 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.36.1" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -1013,6 +1028,12 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "opaque-debug" version = "0.3.1" @@ -1021,9 +1042,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", "parking_lot_core", @@ -1031,9 +1052,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", "libc", @@ -1075,14 +1096,14 @@ checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -1155,18 +1176,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "d61789d7719defeb74ea5fe81f2fdfdbd28a803847077cecce2ff14e1472f6f1" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -1231,36 +1252,11 @@ dependencies = [ "url", ] -[[package]] -name = "redis-rs" -version = "0.0.1" -dependencies = [ - "age", - "anyhow", - "base64 0.22.1", - "bincode", - "byteorder", - "bytes", - "chacha20poly1305", - "clap", - "ed25519-dalek", - "futures", - "rand", - "redb", - "redis", - "secrecy", - "serde", - "serde_json", - "sha2", - "thiserror", - "tokio", -] - [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "5407465600fb0548f1442edf71dd20683c6ed326200ace4b1ef0763521bb3b77" dependencies = [ "bitflags", ] @@ -1285,7 +1281,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.69", + "syn 2.0.106", "walkdir", ] @@ -1301,9 +1297,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "56f7d92ca342cea22a06f2121d944b4fd82af56988c270852495420f961d4ace" [[package]] name = "rustc-hash" @@ -1399,22 +1395,22 @@ checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -1448,9 +1444,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" dependencies = [ "libc", ] @@ -1466,18 +1462,15 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "socket2" @@ -1491,12 +1484,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "233504af464074f9d066d7b5416c5f9b894a5862a6506e306f7b816cdd6f1807" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1533,6 +1526,10 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "supervisor" +version = "0.1.0" + [[package]] name = "syn" version = "1.0.109" @@ -1545,9 +1542,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.69" +version = "2.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201fcda3845c23e8212cd466bfebf0bd20694490fc0356ae8e428e0824a915a6" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" dependencies = [ "proc-macro2", "quote", @@ -1562,27 +1559,27 @@ checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -1597,32 +1594,33 @@ dependencies = [ [[package]] name = "tokio" -version = "1.38.0" +version = "1.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038" dependencies = [ "backtrace", "bytes", + "io-uring", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.7", + "slab", + "socket2 0.6.0", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -1683,9 +1681,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "universal-hash" @@ -1738,9 +1736,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "winapi" @@ -1764,7 +1762,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1774,36 +1772,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-link" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets 0.52.6", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets 0.53.3", ] [[package]] @@ -1815,7 +1804,7 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", @@ -1823,10 +1812,21 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" +name = "windows-targets" +version = "0.53.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91" +dependencies = [ + "windows-link", + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] [[package]] name = "windows_aarch64_gnullvm" @@ -1835,10 +1835,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" +name = "windows_aarch64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] name = "windows_aarch64_msvc" @@ -1847,10 +1847,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] -name = "windows_i686_gnu" -version = "0.48.5" +name = "windows_aarch64_msvc" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" [[package]] name = "windows_i686_gnu" @@ -1858,6 +1858,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" @@ -1865,10 +1871,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] -name = "windows_i686_msvc" -version = "0.48.5" +name = "windows_i686_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" [[package]] name = "windows_i686_msvc" @@ -1877,10 +1883,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" +name = "windows_i686_msvc" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" @@ -1889,10 +1895,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +name = "windows_x86_64_gnu" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" [[package]] name = "windows_x86_64_gnullvm" @@ -1901,10 +1907,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" +name = "windows_x86_64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" [[package]] name = "windows_x86_64_msvc" @@ -1912,6 +1918,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "writeable" version = "0.6.1" @@ -1950,7 +1962,7 @@ checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", "synstructure", ] @@ -1971,7 +1983,7 @@ checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -1991,7 +2003,7 @@ checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", "synstructure", ] @@ -2012,7 +2024,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] [[package]] @@ -2045,5 +2057,5 @@ checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.69", + "syn 2.0.106", ] diff --git a/Cargo.toml b/Cargo.toml index 3b1a2d1..9ca5311 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,28 +1,12 @@ -[package] -name = "redis-rs" -version = "0.0.1" -authors = ["Pin Fang "] -edition = "2021" +[workspace] +members = [ + "herodb", + "supervisor", +] +resolver = "2" -[dependencies] -anyhow = "1.0.59" -bytes = "1.3.0" -thiserror = "1.0.32" -tokio = { version = "1.23.0", features = ["full"] } -clap = { version = "4.5.20", features = ["derive"] } -byteorder = "1.4.3" -futures = "0.3" -redb = "2.1.3" -serde = { version = "1.0", features = ["derive"] } -serde_json = "1.0" -bincode = "1.3.3" -chacha20poly1305 = "0.10.1" -rand = "0.8" -sha2 = "0.10" -age = "0.10" -secrecy = "0.8" -ed25519-dalek = "2" -base64 = "0.22" - -[dev-dependencies] -redis = { version = "0.24", features = ["aio", "tokio-comp"] } +# You can define shared profiles for all workspace members here +[profile.release] +lto = true +codegen-units = 1 +strip = true \ No newline at end of file diff --git a/examples/age_bash_demo.sh b/examples/age_bash_demo.sh deleted file mode 100755 index 7d4a42e..0000000 --- a/examples/age_bash_demo.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/bash - -# Start the herodb server in the background -echo "Starting herodb server..." -cargo run -- --dir /tmp/herodb_age_test --port 6382 --debug --encryption-key "testkey" & -SERVER_PID=$! -sleep 2 # Give the server a moment to start - -REDIS_CLI="redis-cli -p 6382" - -echo "--- Generating and Storing Encryption Keys ---" -$REDIS_CLI AGE.GENERATE_KEYPAIR alice -$REDIS_CLI AGE.GENERATE_KEYPAIR bob - -echo "--- Encrypting and Decrypting a Message ---" -MESSAGE="Hello, AGE encryption!" -ALICE_PUBKEY=$($REDIS_CLI AGE.GET_PUBKEY alice) -echo "Alice's Public Key: $ALICE_PUBKEY" - -echo "Encrypting message: '$MESSAGE' with Alice's public key..." -CIPHERTEXT=$($REDIS_CLI AGE.ENCRYPT "$MESSAGE" "$ALICE_PUBKEY") -echo "Ciphertext: $CIPHERTEXT" - -echo "Decrypting ciphertext with Alice's private key..." -DECRYPTED_MESSAGE=$($REDIS_CLI AGE.DECRYPT "$CIPHERTEXT" alice) -echo "Decrypted Message: $DECRYPTED_MESSAGE" - -echo "--- Generating and Storing Signing Keys ---" -$REDIS_CLI AGE.GENERATE_SIGN_KEYPAIR signer1 - -echo "--- Signing and Verifying a Message ---" -SIGN_MESSAGE="This is a message to be signed." -SIGNER1_PUBKEY=$($REDIS_CLI AGE.GET_SIGN_PUBKEY signer1) -echo "Signer1's Public Key: $SIGNER1_PUBKEY" - -echo "Signing message: '$SIGN_MESSAGE' with signer1's private key..." -SIGNATURE=$($REDIS_CLI AGE.SIGN "$SIGN_MESSAGE" signer1) -echo "Signature: $SIGNATURE" - -echo "Verifying signature with signer1's public key..." -VERIFY_RESULT=$($REDIS_CLI AGE.VERIFY "$SIGN_MESSAGE" "$SIGNATURE" "$SIGNER1_PUBKEY") -echo "Verification Result: $VERIFY_RESULT" - -echo "--- Cleaning up keys ---" -$REDIS_CLI AGE.DELETE_KEYPAIR alice -$REDIS_CLI AGE.DELETE_KEYPAIR bob -$REDIS_CLI AGE.DELETE_SIGN_KEYPAIR signer1 - -echo "--- Stopping herodb server ---" -kill $SERVER_PID -wait $SERVER_PID 2>/dev/null -echo "Server stopped." - -echo "Bash demo complete." \ No newline at end of file diff --git a/herodb/Cargo.toml b/herodb/Cargo.toml new file mode 100644 index 0000000..b71eb22 --- /dev/null +++ b/herodb/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "herodb" +version = "0.0.1" +authors = ["Pin Fang "] +edition = "2021" + +[dependencies] +anyhow = "1.0.59" +bytes = "1.3.0" +thiserror = "1.0.32" +tokio = { version = "1.23.0", features = ["full"] } +clap = { version = "4.5.20", features = ["derive"] } +byteorder = "1.4.3" +futures = "0.3" +redb = "2.1.3" +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +bincode = "1.3.3" +chacha20poly1305 = "0.10.1" +rand = "0.8" +sha2 = "0.10" +age = "0.10" +secrecy = "0.8" +ed25519-dalek = "2" +base64 = "0.22" + +[dev-dependencies] +redis = { version = "0.24", features = ["aio", "tokio-comp"] } diff --git a/README.md b/herodb/README.md similarity index 100% rename from README.md rename to herodb/README.md diff --git a/herodb/examples/age_bash_demo.sh b/herodb/examples/age_bash_demo.sh new file mode 100755 index 0000000..07b54c8 --- /dev/null +++ b/herodb/examples/age_bash_demo.sh @@ -0,0 +1,71 @@ +#!/bin/bash + +# Start the herodb server in the background +echo "Starting herodb server..." +cargo run -p herodb -- --dir /tmp/herodb_age_test --port 6382 --debug --encryption-key "testkey" & +SERVER_PID=$! +sleep 2 # Give the server a moment to start + +REDIS_CLI="redis-cli -p 6382" + +echo "--- Generating and Storing Encryption Keys ---" +# The new AGE commands are 'AGE KEYGEN ' etc., based on src/cmd.rs +# This script uses older commands like 'AGE.GENERATE_KEYPAIR alice' +# The demo script needs to be updated to match the implemented commands. +# Let's assume the commands in the script are what's expected for now, +# but note this discrepancy. The new commands are AGE KEYGEN etc. +# The script here uses a different syntax not found in src/cmd.rs like 'AGE.GENERATE_KEYPAIR'. +# For now, I will modify the script to fit the actual implementation. + +echo "--- Generating and Storing Encryption Keys ---" +$REDIS_CLI AGE KEYGEN alice +$REDIS_CLI AGE KEYGEN bob + +echo "--- Encrypting and Decrypting a Message ---" +MESSAGE="Hello, AGE encryption!" +# The new logic stores keys internally and does not expose a command to get the public key. +# We will encrypt by name. +ALICE_PUBKEY_REPLY=$($REDIS_CLI AGE KEYGEN alice | head -n 2 | tail -n 1) +echo "Alice's Public Key: $ALICE_PUBKEY_REPLY" + +echo "Encrypting message: '$MESSAGE' with Alice's identity..." +# AGE.ENCRYPT recipient message. But since we use persistent keys, let's use ENCRYPTNAME +CIPHERTEXT=$($REDIS_CLI AGE ENCRYPTNAME alice "$MESSAGE") +echo "Ciphertext: $CIPHERTEXT" + +echo "Decrypting ciphertext with Alice's private key..." +DECRYPTED_MESSAGE=$($REDIS_CLI AGE DECRYPTNAME alice "$CIPHERTEXT") +echo "Decrypted Message: $DECRYPTED_MESSAGE" + +echo "--- Generating and Storing Signing Keys ---" +$REDIS_CLI AGE SIGNKEYGEN signer1 + +echo "--- Signing and Verifying a Message ---" +SIGN_MESSAGE="This is a message to be signed." +# Similar to above, we don't have GET_SIGN_PUBKEY. We will verify by name. + +echo "Signing message: '$SIGN_MESSAGE' with signer1's private key..." +SIGNATURE=$($REDIS_CLI AGE SIGNNAME "$SIGN_MESSAGE" signer1) +echo "Signature: $SIGNATURE" + +echo "Verifying signature with signer1's public key..." +VERIFY_RESULT=$($REDIS_CLI AGE VERIFYNAME signer1 "$SIGN_MESSAGE" "$SIGNATURE") +echo "Verification Result: $VERIFY_RESULT" + + +# There is no DELETE_KEYPAIR command in the implementation +echo "--- Cleaning up keys (manual in herodb) ---" +# We would use DEL for age:key:alice, etc. +$REDIS_CLI DEL age:key:alice +$REDIS_CLI DEL age:privkey:alice +$REDIS_CLI DEL age:key:bob +$REDIS_CLI DEL age:privkey:bob +$REDIS_CLI DEL age:signpub:signer1 +$REDIS_CLI DEL age:signpriv:signer1 + +echo "--- Stopping herodb server ---" +kill $SERVER_PID +wait $SERVER_PID 2>/dev/null +echo "Server stopped." + +echo "Bash demo complete." \ No newline at end of file diff --git a/examples/age_persist_demo.rs b/herodb/examples/age_persist_demo.rs similarity index 100% rename from examples/age_persist_demo.rs rename to herodb/examples/age_persist_demo.rs diff --git a/instructions/encrypt.md b/herodb/instructions/encrypt.md similarity index 100% rename from instructions/encrypt.md rename to herodb/instructions/encrypt.md diff --git a/instructions/redb.md b/herodb/instructions/redb.md similarity index 100% rename from instructions/redb.md rename to herodb/instructions/redb.md diff --git a/instructions/redis_basic_client.md b/herodb/instructions/redis_basic_client.md similarity index 100% rename from instructions/redis_basic_client.md rename to herodb/instructions/redis_basic_client.md diff --git a/instructions/redis_basics.md b/herodb/instructions/redis_basics.md similarity index 100% rename from instructions/redis_basics.md rename to herodb/instructions/redis_basics.md diff --git a/instructions/redis_hset_functions.md b/herodb/instructions/redis_hset_functions.md similarity index 100% rename from instructions/redis_hset_functions.md rename to herodb/instructions/redis_hset_functions.md diff --git a/instructions/redis_lists.md b/herodb/instructions/redis_lists.md similarity index 100% rename from instructions/redis_lists.md rename to herodb/instructions/redis_lists.md diff --git a/src/age.rs b/herodb/src/age.rs similarity index 100% rename from src/age.rs rename to herodb/src/age.rs diff --git a/src/cmd.rs b/herodb/src/cmd.rs similarity index 100% rename from src/cmd.rs rename to herodb/src/cmd.rs diff --git a/src/crypto.rs b/herodb/src/crypto.rs similarity index 100% rename from src/crypto.rs rename to herodb/src/crypto.rs diff --git a/src/error.rs b/herodb/src/error.rs similarity index 100% rename from src/error.rs rename to herodb/src/error.rs diff --git a/src/lib.rs b/herodb/src/lib.rs similarity index 100% rename from src/lib.rs rename to herodb/src/lib.rs diff --git a/src/main.rs b/herodb/src/main.rs similarity index 96% rename from src/main.rs rename to herodb/src/main.rs index aca42ea..1e3d2c6 100644 --- a/src/main.rs +++ b/herodb/src/main.rs @@ -2,7 +2,7 @@ use tokio::net::TcpListener; -use redis_rs::server; +use herodb::server; use clap::Parser; @@ -45,7 +45,7 @@ async fn main() { .unwrap(); // new DB option - let option = redis_rs::options::DBOption { + let option = herodb::options::DBOption { dir: args.dir, port, debug: args.debug, diff --git a/src/options.rs b/herodb/src/options.rs similarity index 100% rename from src/options.rs rename to herodb/src/options.rs diff --git a/src/protocol.rs b/herodb/src/protocol.rs similarity index 100% rename from src/protocol.rs rename to herodb/src/protocol.rs diff --git a/src/server.rs b/herodb/src/server.rs similarity index 100% rename from src/server.rs rename to herodb/src/server.rs diff --git a/src/storage/mod.rs b/herodb/src/storage/mod.rs similarity index 100% rename from src/storage/mod.rs rename to herodb/src/storage/mod.rs diff --git a/src/storage/storage_basic.rs b/herodb/src/storage/storage_basic.rs similarity index 100% rename from src/storage/storage_basic.rs rename to herodb/src/storage/storage_basic.rs diff --git a/src/storage/storage_extra.rs b/herodb/src/storage/storage_extra.rs similarity index 100% rename from src/storage/storage_extra.rs rename to herodb/src/storage/storage_extra.rs diff --git a/src/storage/storage_hset.rs b/herodb/src/storage/storage_hset.rs similarity index 100% rename from src/storage/storage_hset.rs rename to herodb/src/storage/storage_hset.rs diff --git a/src/storage/storage_lists.rs b/herodb/src/storage/storage_lists.rs similarity index 100% rename from src/storage/storage_lists.rs rename to herodb/src/storage/storage_lists.rs diff --git a/tests/debug_hset.rs b/herodb/tests/debug_hset.rs similarity index 97% rename from tests/debug_hset.rs rename to herodb/tests/debug_hset.rs index fcbe4a5..77f3191 100644 --- a/tests/debug_hset.rs +++ b/herodb/tests/debug_hset.rs @@ -1,4 +1,4 @@ -use redis_rs::{server::Server, options::DBOption}; +use herodb::{server::Server, options::DBOption}; use std::time::Duration; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; diff --git a/tests/debug_hset_simple.rs b/herodb/tests/debug_hset_simple.rs similarity index 96% rename from tests/debug_hset_simple.rs rename to herodb/tests/debug_hset_simple.rs index 6ad1c65..571554d 100644 --- a/tests/debug_hset_simple.rs +++ b/herodb/tests/debug_hset_simple.rs @@ -1,4 +1,4 @@ -use redis_rs::{server::Server, options::DBOption}; +use herodb::{server::Server, options::DBOption}; use std::time::Duration; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; diff --git a/tests/debug_protocol.rs b/herodb/tests/debug_protocol.rs similarity index 95% rename from tests/debug_protocol.rs rename to herodb/tests/debug_protocol.rs index f651690..8df61e7 100644 --- a/tests/debug_protocol.rs +++ b/herodb/tests/debug_protocol.rs @@ -1,5 +1,5 @@ -use redis_rs::protocol::Protocol; -use redis_rs::cmd::Cmd; +use herodb::protocol::Protocol; +use herodb::cmd::Cmd; #[test] fn test_protocol_parsing() { diff --git a/tests/redis_integration_tests.rs b/herodb/tests/redis_integration_tests.rs similarity index 100% rename from tests/redis_integration_tests.rs rename to herodb/tests/redis_integration_tests.rs diff --git a/tests/redis_tests.rs b/herodb/tests/redis_tests.rs similarity index 99% rename from tests/redis_tests.rs rename to herodb/tests/redis_tests.rs index d5ba702..b689a9c 100644 --- a/tests/redis_tests.rs +++ b/herodb/tests/redis_tests.rs @@ -1,4 +1,4 @@ -use redis_rs::{server::Server, options::DBOption}; +use herodb::{server::Server, options::DBOption}; use std::time::Duration; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; diff --git a/tests/simple_integration_test.rs b/herodb/tests/simple_integration_test.rs similarity index 99% rename from tests/simple_integration_test.rs rename to herodb/tests/simple_integration_test.rs index a7c7dda..729d429 100644 --- a/tests/simple_integration_test.rs +++ b/herodb/tests/simple_integration_test.rs @@ -1,4 +1,4 @@ -use redis_rs::{server::Server, options::DBOption}; +use herodb::{server::Server, options::DBOption}; use std::time::Duration; use tokio::time::sleep; use tokio::io::{AsyncReadExt, AsyncWriteExt}; diff --git a/tests/simple_redis_test.rs b/herodb/tests/simple_redis_test.rs similarity index 99% rename from tests/simple_redis_test.rs rename to herodb/tests/simple_redis_test.rs index 0114f52..d2f30f6 100644 --- a/tests/simple_redis_test.rs +++ b/herodb/tests/simple_redis_test.rs @@ -1,4 +1,4 @@ -use redis_rs::{server::Server, options::DBOption}; +use herodb::{server::Server, options::DBOption}; use std::time::Duration; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::TcpStream; diff --git a/run_tests.sh b/run_tests.sh index 84a2d16..8f771d7 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -6,20 +6,20 @@ echo "==========================================" echo "" echo "1️⃣ Running Simple Redis Tests (4 tests)..." echo "----------------------------------------------" -cargo test --test simple_redis_test -- --nocapture +cargo test -p herodb --test simple_redis_test -- --nocapture echo "" echo "2️⃣ Running Comprehensive Redis Integration Tests (13 tests)..." echo "----------------------------------------------------------------" -cargo test --test redis_integration_tests -- --nocapture -cargo test --test redis_basic_client -- --nocapture -cargo test --test debug_hset -- --nocapture -cargo test --test debug_hset_simple -- --nocapture +cargo test -p herodb --test redis_integration_tests -- --nocapture +cargo test -p herodb --test redis_basic_client -- --nocapture +cargo test -p herodb --test debug_hset -- --nocapture +cargo test -p herodb --test debug_hset_simple -- --nocapture echo "" -echo "3️⃣ Running All Tests..." -echo "------------------------" -cargo test -- --nocapture +echo "3️⃣ Running All Workspace Tests..." +echo "--------------------------------" +cargo test --workspace -- --nocapture echo "" echo "✅ Test execution completed!" \ No newline at end of file diff --git a/supervisor/Cargo.toml b/supervisor/Cargo.toml new file mode 100644 index 0000000..509b273 --- /dev/null +++ b/supervisor/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "supervisor" +version = "0.1.0" +edition = "2021" + +[dependencies] +# The supervisor will eventually depend on the herodb crate. +# We can add this dependency now. +# herodb = { path = "../herodb" } \ No newline at end of file diff --git a/supervisor/src/main.rs b/supervisor/src/main.rs new file mode 100644 index 0000000..deca46d --- /dev/null +++ b/supervisor/src/main.rs @@ -0,0 +1,4 @@ +fn main() { + println!("Hello from the supervisor crate!"); + // Supervisor logic will be implemented here. +} \ No newline at end of file diff --git a/test_herodb.sh b/test_herodb.sh index 3dcb285..bbd72d9 100755 --- a/test_herodb.sh +++ b/test_herodb.sh @@ -288,7 +288,7 @@ main() { # Build the project print_status "Building HeroDB..." - if ! cargo build --release; then + if ! cargo build -p herodb --release; then print_error "Failed to build HeroDB" exit 1 fi @@ -298,7 +298,7 @@ main() { # Start the server print_status "Starting HeroDB server..." - ./target/release/redis-rs --dir "$DB_DIR" --port $PORT & + ./target/release/herodb --dir "$DB_DIR" --port $PORT & SERVER_PID=$! # Wait for server to start