diff --git a/gateway/src/https_server.rs b/gateway/src/https_server.rs index 741b4f4e6..0d9da281a 100644 --- a/gateway/src/https_server.rs +++ b/gateway/src/https_server.rs @@ -13,7 +13,6 @@ use axum::routing::get; use axum::Router; use axum_server::tls_rustls::RustlsConfig; use clap::Args; -use common::enums::ZtmType; use regex::Regex; use tower::ServiceBuilder; use tower_http::cors::{Any, CorsLayer}; @@ -22,6 +21,7 @@ use tower_http::trace::TraceLayer; use ceres::lfs::LfsConfig; use ceres::protocol::{SmartProtocol, TransportProtocol}; +use common::enums::ZtmType; use common::config::Config; use common::model::{CommonOptions, GetParams}; use jupiter::context::Context; diff --git a/gateway/src/relay_server.rs b/gateway/src/relay_server.rs index a946f3d17..440e59b91 100644 --- a/gateway/src/relay_server.rs +++ b/gateway/src/relay_server.rs @@ -6,12 +6,6 @@ use axum::extract::{Query, State}; use axum::http::{Request, Response, StatusCode, Uri}; use axum::routing::get; use axum::Router; -use common::config::{Config, ZTMConfig}; -use gemini::ztm::{ - connect_ztm_hub, create_ztm_certificate, create_ztm_service, delete_ztm_certificate, -}; -use gemini::RelayGetParams; -use jupiter::context::Context; use regex::Regex; use tower::ServiceBuilder; use tower_http::cors::{Any, CorsLayer}; @@ -21,6 +15,14 @@ use tower_http::trace::TraceLayer; use crate::api_service; use crate::api_service::router::ApiServiceState; +use common::config::{Config, ZTMConfig}; +use gemini::RelayGetParams; +use jupiter::context::Context; +use gemini::ztm::{ + connect_ztm_hub, create_ztm_certificate, create_ztm_service, delete_ztm_certificate, +}; + + pub async fn run_relay_server(config: Config, host: String, port: u16) { let app = app(config.clone(), host.clone(), port).await; diff --git a/gemini/src/ztm/mod.rs b/gemini/src/ztm/mod.rs index e102ad219..4d43f15c4 100644 --- a/gemini/src/ztm/mod.rs +++ b/gemini/src/ztm/mod.rs @@ -1,7 +1,8 @@ -use common::config::ZTMConfig; use reqwest::{header::CONTENT_TYPE, Client}; use serde::{Deserialize, Serialize}; +use common::config::ZTMConfig; + #[derive(Deserialize, Serialize, Debug)] pub struct ZTMUserPermit { pub ca: String, diff --git a/mega/src/cli.rs b/mega/src/cli.rs index 023daada4..73e4d335e 100644 --- a/mega/src/cli.rs +++ b/mega/src/cli.rs @@ -12,10 +12,20 @@ use common::{ use crate::commands::{builtin, builtin_exec}; +/// This function is responsible for parsing command line arguments. +/// It uses the `cli` function to get the matches for the command line arguments. +/// If the matches are not found, it will exit the program. +/// +/// # Returns +/// +/// This function returns a `MegaResult`. If the parsing is successful, it will return the result. +/// If there is an error during the parsing, it will return an error. pub fn parse() -> MegaResult { let matches = cli().try_get_matches().unwrap_or_else(|e| e.exit()); + // Get the current directory let current_dir = env::current_dir()?; + // Get the path to the config file in the current directory let config_path = current_dir.join("config.toml"); let config = if let Some(path) = matches.get_one::("config").cloned() { diff --git a/scorpio/Cargo.toml b/scorpio/Cargo.toml index 62a89f2e4..b08b4d624 100644 --- a/scorpio/Cargo.toml +++ b/scorpio/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" [dependencies] fuser = "0.14.0" libc = "0.2.155" -tracing = { workspace = true } +tracing = { workspace = true } \ No newline at end of file diff --git a/scorpio/README.md b/scorpio/README.md index 7e06292db..097503777 100644 --- a/scorpio/README.md +++ b/scorpio/README.md @@ -1,8 +1,16 @@ -## Scorpio Module +## Scorpio - FUSE Support for Mega/Monorepo Client ->**FUSE Support for Mega/Monorepo Client.♏** +### What's the Fuse? -🚧 Developing annd Coming Soon... - -## Fuse? FUSE is the abbreviation for "FileSystem in Userspace". + +### Why the Mega Need a FUSE? + + +### How to Use? + + +### How to Contribute? + + +### Reference