diff --git a/.github/workflows/deploy-manually.yml b/.github/workflows/deploy-manually.yml index b6af1e3..2e3fd16 100644 --- a/.github/workflows/deploy-manually.yml +++ b/.github/workflows/deploy-manually.yml @@ -79,6 +79,8 @@ jobs: echo "> Extract $TAR_FILE" tar -xf $TAR_FILE -C ${{ env.DEPLOY_PATH }} + cd .bp/ + echo "Stop bp process" pm2 delete bp || true diff --git a/bp-cli/src/commands/generate.rs b/bp-cli/src/commands/generate.rs index 113fa8b..3cfa261 100644 --- a/bp-cli/src/commands/generate.rs +++ b/bp-cli/src/commands/generate.rs @@ -32,7 +32,7 @@ async fn handle(opts: GenerateOptions) -> Result<()> { client_opts.server_bind = Some("__some_where__:3000".parse().unwrap()); client_opts.bind = "0.0.0.0:3000".parse().unwrap(); - server_opts.key = "__some_key__".to_string(); + server_opts.key = Some("__some_key__".to_string()); let content = match ext { "yml" | "yaml" => match opts.config_type { diff --git a/bp-core/src/options/common.rs b/bp-core/src/options/common.rs index 59e1883..ea92e0a 100644 --- a/bp-core/src/options/common.rs +++ b/bp-core/src/options/common.rs @@ -70,7 +70,7 @@ impl Options { pub fn key(&self) -> String { match self { Self::Client(opts) => opts.key.clone().unwrap(), - Self::Server(opts) => opts.key.clone(), + Self::Server(opts) => opts.key.clone().unwrap(), } } diff --git a/bp-core/src/options/server.rs b/bp-core/src/options/server.rs index 05d1111..a80cdf3 100644 --- a/bp-core/src/options/server.rs +++ b/bp-core/src/options/server.rs @@ -14,9 +14,9 @@ pub struct ServerOptions { #[clap(short, long, default_value = DEFAULT_SERVICE_ADDRESS)] pub bind: Address, - /// Symmetric encryption key, required + /// Symmetric encryption key #[clap(short, long)] - pub key: String, + pub key: Option, /// Data encryption method, e.g, "plain" or "erp" #[clap(short, long, default_value = "erp")] diff --git a/e2e/src/run_all.rs b/e2e/src/run_all.rs index 7cc3b01..96e23aa 100644 --- a/e2e/src/run_all.rs +++ b/e2e/src/run_all.rs @@ -24,7 +24,7 @@ pub async fn run_all( let server = run_bp( Options::Server(ServerOptions { - key: key.clone().unwrap(), + key: key.clone(), ..server_opts_patch }), host, diff --git a/e2e/tests/udp_relay.rs b/e2e/tests/udp_relay.rs index 7079d87..d6f91a5 100644 --- a/e2e/tests/udp_relay.rs +++ b/e2e/tests/udp_relay.rs @@ -24,7 +24,7 @@ async fn test_udp_over_tcp() { async fn run_test(udp_over_tcp: bool) { let server_opts = Options::Server(ServerOptions { - key: "key".to_string(), + key: Some("key".to_string()), ..Default::default() }); diff --git a/usage/bp-server.txt b/usage/bp-server.txt index bc0913c..f6f3729 100644 --- a/usage/bp-server.txt +++ b/usage/bp-server.txt @@ -2,7 +2,7 @@ bp-server Run bp server USAGE: - bp server [OPTIONS] --key + bp server [OPTIONS] OPTIONS: -b, --bind Local service bind address [default: 127.0.0.1:1080] @@ -10,7 +10,7 @@ OPTIONS: --dns-server DNS server address [default: 8.8.8.8:53] -e, --encryption Data encryption method, e.g, "plain" or "erp" [default: erp] -h, --help Print help information - -k, --key Symmetric encryption key, required + -k, --key Symmetric encryption key --quic Enable QUIC for Transport Layer, [default: false] --tls Enable TLS for Transport Layer, [default: false] --tls-cert Certificate file for QUIC or TLS, [default: ]