diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-02-11 21:44:05 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-02-11 21:44:05 +0800 |
| commit | 762e3119401fbee25ec18fee2ff220d9b12d48e8 (patch) | |
| tree | 26dee88ae37f7d184b693a1a97dad0c89fd0db66 | |
| parent | 2f10e0d94c61916dd36a03df2576223b135b6ccd (diff) | |
Add sheet system and reorganize workspace
- Add new "sheet" crate to workspace
- Rename "systems/asset" to "systems/_asset"
- Reorder workspace members and dependencies for clarity
- Update constants with new paths for auth and rules
- Add conditional compilation for system module
| -rw-r--r-- | Cargo.lock | 4 | ||||
| -rw-r--r-- | Cargo.toml | 51 | ||||
| -rw-r--r-- | src/lib.rs | 1 | ||||
| -rw-r--r-- | systems/_asset/Cargo.toml (renamed from systems/asset/Cargo.toml) | 0 | ||||
| -rw-r--r-- | systems/_asset/macros/Cargo.toml (renamed from systems/asset/macros/Cargo.toml) | 0 | ||||
| -rw-r--r-- | systems/_asset/macros/src/lib.rs (renamed from systems/asset/macros/src/lib.rs) | 0 | ||||
| -rw-r--r-- | systems/_asset/src/asset.rs (renamed from systems/asset/src/asset.rs) | 0 | ||||
| -rw-r--r-- | systems/_asset/src/error.rs (renamed from systems/asset/src/error.rs) | 0 | ||||
| -rw-r--r-- | systems/_asset/src/lib.rs (renamed from systems/asset/src/lib.rs) | 0 | ||||
| -rw-r--r-- | systems/_asset/src/rw.rs (renamed from systems/asset/src/rw.rs) | 0 | ||||
| -rw-r--r-- | systems/_asset/test/Cargo.toml (renamed from systems/asset/test/Cargo.toml) | 0 | ||||
| -rw-r--r-- | systems/_asset/test/src/lib.rs (renamed from systems/asset/test/src/lib.rs) | 0 | ||||
| -rw-r--r-- | systems/_constants/src/lib.rs | 28 | ||||
| -rw-r--r-- | systems/sheet/Cargo.toml | 6 | ||||
| -rw-r--r-- | systems/sheet/src/lib.rs | 1 |
15 files changed, 54 insertions, 37 deletions
@@ -1371,6 +1371,10 @@ dependencies = [ ] [[package]] +name = "sheet" +version = "0.1.0" + +[[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -6,12 +6,15 @@ authors = ["Weicao-CatilGrass (GitHub)"] [features] all = [ + "utils", + "lib", +] +utils = [ "cfg_file", "data_struct", "sha1_hash", "tcp_connection", "string_proc", - "lib", ] cfg_file = [] data_struct = [] @@ -22,38 +25,30 @@ lib = [] [workspace] members = [ + "docs", + "ffi", + "systems/_asset", + "systems/_asset/macros", + "systems/_asset/test", + "systems/_constants", + "systems/_constants/macros", + "systems/action", + "systems/action/action_macros", + "systems/sheet", "utils/cfg_file", "utils/cfg_file/cfg_file_derive", "utils/cfg_file/cfg_file_test", - "utils/data_struct", - "utils/sha1_hash", - + "utils/string_proc", "utils/tcp_connection", "utils/tcp_connection/tcp_connection_test", - "utils/string_proc", - - "systems/asset", - "systems/asset/macros", - "systems/asset/test", - - "systems/action", - "systems/action/action_macros", - - "systems/_constants", - "systems/_constants/macros", - # LEGACY AREA "legacy_data", "legacy_data/tests", "legacy_actions", # LEGACY AREA - - "docs", - - "ffi", ] [workspace.package] @@ -83,6 +78,12 @@ chrono = "0.4" toml = "0.9" [dependencies] +# ffi +jvlib = { path = "ffi" } + +# Documents +vcs_docs = { path = "docs" } + # Utils cfg_file = { path = "utils/cfg_file" } data_struct = { path = "utils/data_struct" } @@ -91,15 +92,9 @@ tcp_connection = { path = "utils/tcp_connection" } string_proc = { path = "utils/string_proc" } # Systems -asset_system = { path = "systems/asset" } -action_system = { path = "systems/action" } +asset_system = { path = "systems/_asset" } constants = { path = "systems/_constants" } - -# ffi -jvlib = { path = "ffi" } - -# Documents -vcs_docs = { path = "docs" } +action_system = { path = "systems/action" } # Legacy vcs_data = { path = "legacy_data" } @@ -14,6 +14,7 @@ pub mod lib { pub use vcs_docs::*; } +#[cfg(feature = "lib")] pub mod system { pub mod constants { pub use constants::*; diff --git a/systems/asset/Cargo.toml b/systems/_asset/Cargo.toml index 5e86bbd..5e86bbd 100644 --- a/systems/asset/Cargo.toml +++ b/systems/_asset/Cargo.toml diff --git a/systems/asset/macros/Cargo.toml b/systems/_asset/macros/Cargo.toml index d4142f2..d4142f2 100644 --- a/systems/asset/macros/Cargo.toml +++ b/systems/_asset/macros/Cargo.toml diff --git a/systems/asset/macros/src/lib.rs b/systems/_asset/macros/src/lib.rs index 1535af0..1535af0 100644 --- a/systems/asset/macros/src/lib.rs +++ b/systems/_asset/macros/src/lib.rs diff --git a/systems/asset/src/asset.rs b/systems/_asset/src/asset.rs index a3b1c6a..a3b1c6a 100644 --- a/systems/asset/src/asset.rs +++ b/systems/_asset/src/asset.rs diff --git a/systems/asset/src/error.rs b/systems/_asset/src/error.rs index 5dc529f..5dc529f 100644 --- a/systems/asset/src/error.rs +++ b/systems/_asset/src/error.rs diff --git a/systems/asset/src/lib.rs b/systems/_asset/src/lib.rs index ac4317f..ac4317f 100644 --- a/systems/asset/src/lib.rs +++ b/systems/_asset/src/lib.rs diff --git a/systems/asset/src/rw.rs b/systems/_asset/src/rw.rs index 784d44d..784d44d 100644 --- a/systems/asset/src/rw.rs +++ b/systems/_asset/src/rw.rs diff --git a/systems/asset/test/Cargo.toml b/systems/_asset/test/Cargo.toml index 3ac0779..3ac0779 100644 --- a/systems/asset/test/Cargo.toml +++ b/systems/_asset/test/Cargo.toml diff --git a/systems/asset/test/src/lib.rs b/systems/_asset/test/src/lib.rs index 4aad777..4aad777 100644 --- a/systems/asset/test/src/lib.rs +++ b/systems/_asset/test/src/lib.rs diff --git a/systems/_constants/src/lib.rs b/systems/_constants/src/lib.rs index 8be9cd8..03ca845 100644 --- a/systems/_constants/src/lib.rs +++ b/systems/_constants/src/lib.rs @@ -15,15 +15,29 @@ pub mod server { #[constants_macros::constants("server_file")] pub mod files { c! { CONFIG = "./config.toml" } + + // Storage location for keys and passwords + c! { KEY = "./auth/key/{member_name}.pem" } + c! { PASSWORD = "./auth/pswd/{member_name}.pswd" } + + // Only Key holders are allowed to initiate Join Request c! { JOIN_REQUEST_KEY = "./.temp/join_requests/{member_name}.pem" } - c! { KEY = "./key/{member_name}.pem" } + + // User metadata is stored here + // Typically includes: + // - Nickname + // - Email + // - Other information + // + // Facilitates queries by other members c! { MEMBER_METADATA = "./meta/{member_name}.toml" } } /// Directory path constants #[constants_macros::constants("server_dir")] pub mod dirs { - c! { KEYS = "./key/" } + c! { KEYS = "./auth/key/" } + c! { PASSWORDS = "./auth/pswd/" } c! { JOIN_REQUEST_KEYS = "./.temp/join_requests/" } c! { MEMBER_METADATAS = "./meta/" } c! { VAULTS = "./v/" } @@ -47,11 +61,8 @@ pub mod vault { // Member sheet backup, only used to temporarily store a member's local workspace file structure, fully controlled by the corresponding member c! { MEMBER_SHEET_BACKUP = "./_member/{member_name}/backups/{sheet_name}.sheet" } - // Share sent to a reference sheet, selectively merged into that reference sheet by a Host - c! { SHARE_TO_REF = "./req/{ref_sheet_name}/{share_id}.sheet" } - - // Share sent to a specific member, fully controlled by that member, who can optionally merge it into any of their own sheets - c! { SHARE_TO_MEMBER = "./_member/{member_name}/shares/{share_id}.sheet" } + // ### Rules ### + c! { IGNORE_RULE_SCRIPT = "./rules/ignore/{script_name}.lua" } // ### Storages ### c! { CHANGE_FILE = "./changes/CURRENT" } @@ -74,10 +85,9 @@ pub mod vault { #[constants_macros::constants("vault_dir")] pub mod dirs { c! { REFSHEETS = "./ref/" } - c! { SHARES_TO_REF = "./req/{ref_sheet_name}/" } c! { MEMBER = "./_member/{member_name}/" } c! { MEMBER_SHEET_BACKUPS = "./_member/{member_name}/backups/" } - c! { MEMBER_SHARES = "./_member/{member_name}/shares/" } + c! { IGNORE_RULES = "./rules/ignore/" } c! { CHANGES = "./changes/" } } } diff --git a/systems/sheet/Cargo.toml b/systems/sheet/Cargo.toml new file mode 100644 index 0000000..89c439b --- /dev/null +++ b/systems/sheet/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "sheet" +edition = "2024" +version.workspace = true + +[dependencies] diff --git a/systems/sheet/src/lib.rs b/systems/sheet/src/lib.rs new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/systems/sheet/src/lib.rs @@ -0,0 +1 @@ + |
