summaryrefslogtreecommitdiff
path: root/systems/_constants/src
diff options
context:
space:
mode:
Diffstat (limited to 'systems/_constants/src')
-rw-r--r--systems/_constants/src/lib.rs82
1 files changed, 41 insertions, 41 deletions
diff --git a/systems/_constants/src/lib.rs b/systems/_constants/src/lib.rs
index c9dee11..1fac6f8 100644
--- a/systems/_constants/src/lib.rs
+++ b/systems/_constants/src/lib.rs
@@ -14,14 +14,14 @@ pub mod server {
/// File constants
#[constants_macros::constants("server_file")]
pub mod files {
- c! { CONFIG = "./config.toml" }
+ c! { CONFIG = "config.toml" }
// Storage location for keys and passwords
- c! { KEY = "./auth/key/{member_name}.pem" }
- c! { PASSWORD = "./auth/pswd/{member_name}.pswd" }
+ 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! { JOIN_REQUEST_KEY = ".temp/join_requests/{member_name}.pem" }
// User metadata is stored here
// Typically includes:
@@ -30,17 +30,17 @@ pub mod server {
// - Other information
//
// Facilitates queries by other members
- c! { MEMBER_METADATA = "./meta/{member_name}.toml" }
+ c! { MEMBER_METADATA = "meta/{member_name}.toml" }
}
/// Directory path constants
#[constants_macros::constants("server_dir")]
pub mod dirs {
- c! { KEYS = "./auth/key/" }
- c! { PASSWORDS = "./auth/pswd/" }
- c! { JOIN_REQUEST_KEYS = "./.temp/join_requests/" }
- c! { MEMBER_METADATAS = "./meta/" }
- c! { VAULTS = "./v/" }
+ c! { KEYS = "auth/key/" }
+ c! { PASSWORDS = "auth/pswd/" }
+ c! { JOIN_REQUEST_KEYS = ".temp/join_requests/" }
+ c! { MEMBER_METADATAS = "meta/" }
+ c! { VAULTS = "v/" }
}
}
@@ -61,44 +61,44 @@ pub mod vault {
#[constants_macros::constants("vault_file")]
pub mod files {
// ### Configs ###
- c! { CONFIG = "./vault.toml" }
+ c! { CONFIG = "vault.toml" }
// ### Sheets ###
// Reference sheet
- c! { REFSHEET = "./ref/{ref_sheet_name}.sheet" }
+ c! { REFSHEET = "ref/{ref_sheet_name}.sheet" }
// 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" }
+ c! { MEMBER_SHEET_BACKUP = "_member/{member_name}/backups/{sheet_name}.sheet" }
// ### Rules ###
- c! { IGNORE_RULE_SCRIPT = "./rules/ignore/{script_name}.lua" }
+ c! { IGNORE_RULE_SCRIPT = "rules/ignore/{script_name}.lua" }
// ### Storages ###
- c! { CHANGE_FILE = "./changes/CURRENT" }
- c! { CHANGE_FILE_BACKUP = "./changes/backup.{index}" }
+ c! { CHANGE_FILE = "changes/CURRENT" }
+ c! { CHANGE_FILE_BACKUP = "changes/backup.{index}" }
// Whether an index is locked; if the file exists, the member name written inside is the current holder
- c! { INDEX_LOCK = "./index/{index_slice_1}/{index_slice_2}/{index_name}/LOCK" }
+ c! { INDEX_LOCK = "index/{index_slice_1}/{index_slice_2}/{index_name}/LOCK" }
// Index version sequence
- c! { INDEX_VER = "./index/{index_slice_1}/{index_slice_2}/{index_name}/ver" }
+ c! { INDEX_VER = "index/{index_slice_1}/{index_slice_2}/{index_name}/ver" }
// Index
- c! { INDEX = "./index/{index_slice_1}/{index_slice_2}/{index_name}/{version}.index" }
+ c! { INDEX = "index/{index_slice_1}/{index_slice_2}/{index_name}/{version}.index" }
// Object, file chunk
- c! { OBJ = "./obj/{obj_hash_slice_1}/{obj_hash_slice_2}/{obj_hash}" }
+ c! { OBJ = "obj/{obj_hash_slice_1}/{obj_hash_slice_2}/{obj_hash}" }
}
/// Directory path constants
#[constants_macros::constants("vault_dir")]
pub mod dirs {
- c! { REFSHEETS = "./ref/" }
- c! { MEMBER = "./_member/{member_name}/" }
- c! { MEMBER_SHEET_BACKUPS = "./_member/{member_name}/backups/" }
- c! { IGNORE_RULES = "./rules/ignore/" }
- c! { CHANGES = "./changes/" }
+ c! { REFSHEETS = "ref/" }
+ c! { MEMBER = "_member/{member_name}/" }
+ c! { MEMBER_SHEET_BACKUPS = "_member/{member_name}/backups/" }
+ c! { IGNORE_RULES = "rules/ignore/" }
+ c! { CHANGES = "changes/" }
}
}
@@ -109,30 +109,30 @@ pub mod workspace {
#[constants_macros::constants("workspace_file")]
pub mod files {
// ### Config ###
- c! { CONFIG = "./.jv/workspace.toml" }
+ c! { CONFIG = ".jv/workspace.toml" }
// ### Sheets ###
// Records the latest state of local physical files, used to calculate deviations
- c! { LOCAL_STATUS = "./.jv/sheets/{account}/{sheet}.local" }
+ c! { LOCAL_STATUS = ".jv/sheets/{account}/{sheet}.local" }
// Personal sheet, represents the desired file structure, held only by the member, can be backed up to the vault
- c! { SHEET = "./.jv/sheets/{account}/{sheet}.sheet" }
+ c! { SHEET = ".jv/sheets/{account}/{sheet}.sheet" }
// Draft file, when switching to another sheet, fully records modified but untracked files
- c! { DRAFTED_FILE = "./.jv/drafts/{account}_{sheet}/{mapping}" }
+ c! { DRAFTED_FILE = ".jv/drafts/{account}_{sheet}/{mapping}" }
// Working file
- c! { WORKING_FILE = "./{mapping}" }
+ c! { WORKING_FILE = "{mapping}" }
}
/// Directory path constants
#[constants_macros::constants("workspace_dir")]
pub mod dirs {
- c! { WORKSPACE = "./.jv" }
- c! { VAULT_MIRROR = "./.jv/UPSTREAM/" }
- c! { LOCAL_SHEETS = "./.jv/sheets/{account}/" }
- c! { DRAFT_AREA = "./.jv/drafts/{account}_{sheet}/" }
- c! { WORKING_AREA = "./" }
+ c! { WORKSPACE = ".jv" }
+ c! { VAULT_MIRROR = ".jv/UPSTREAM/" }
+ c! { LOCAL_SHEETS = ".jv/sheets/{account}/" }
+ c! { DRAFT_AREA = ".jv/drafts/{account}_{sheet}/" }
+ c! { WORKING_AREA = "" }
}
}
@@ -143,22 +143,22 @@ pub mod user {
#[constants_macros::constants("user_file")]
pub mod files {
// Upstream public key, stored after initial login, used to verify the trustworthiness of that upstream
- c! { UPSTREAM_PUB = "./upstreams/{upstream_addr}.pem" }
+ c! { UPSTREAM_PUB = "upstreams/{upstream_addr}.pem" }
// Account private key, stored only locally, used for login authentication
- c! { PRIVATE_KEY = "./private/{account}.pem" }
+ c! { PRIVATE_KEY = "private/{account}.pem" }
// Account public key, automatically generated from the private key and stored,
// will be placed into the server's "join request list" upon initial login (if server.toml permits this action)
// The server administrator can optionally approve this request
- c! { PUBLIC_KEY = "./public/{account}.pem" }
+ c! { PUBLIC_KEY = "public/{account}.pem" }
}
/// Directory path constants
#[constants_macros::constants("user_dir")]
pub mod dirs {
- c! { UPSTREAM_PUBS = "./upstreams/" }
- c! { PRIVATE_KEYS = "./private/" }
- c! { PUBLIC_KEYS = "./public/" }
+ c! { UPSTREAM_PUBS = "upstreams/" }
+ c! { PRIVATE_KEYS = "private/" }
+ c! { PUBLIC_KEYS = "public/" }
}
}