Skip to content

Commit 022b5b8

Browse files
committed
add long form to all cli argument + docs update
1 parent aa8a804 commit 022b5b8

File tree

8 files changed

+31
-28
lines changed

8 files changed

+31
-28
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "tunneler"
3-
version = "0.4.0"
3+
version = "0.4.1"
44
authors = ["Daniel Segal <[email protected]>"]
55
edition = "2018"
66
license = "MIT"

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,14 @@ docker run -e LOCAL_PORT=45301 \
3232
```
3333
### Option 2: locally compiled binary
3434
```sh
35-
READ_TIMEOUT_IN_MILLISECONDS=100 \
36-
IDLE_CLIENT_TIMEOUT_IN_MILLISECONDS=30000 \
37-
TUNNELED_TYPE=tcp \
38-
LOG_LEVEL=debug \
39-
./target/debug/client 1.1.1.1 53 dns
35+
./target/release/client \
36+
--tunneled-type tcp \
37+
--remote-address 1.1.1.1 \
38+
--remote-port 53 \
39+
--log-level debug \
40+
dns \
41+
--read-timeout-in-milliseconds 100 \
42+
--idle-client-timeout-in-milliseconds 30000
4043
```
4144
Run docker image or compiled binary with `--help` for more information
4245

@@ -45,8 +48,8 @@ This repo contains a few server deployment examples using Docker Compose:
4548
* Speed Test - iperf3 server exposed via all supported tunnels, allow you to compare tunnels speed.
4649
* Authoritative DNS - Redis server exposed via DNS tunnel on port UDP/53. Since tunnel does not verify clients, Redis
4750
authentication is needed.
48-
* Pipeline - Redis server exposed via TLS tunnel that itself exposed via DNS tunnel. on port UDP/53. Since tunnel does
49-
verify clients, Redis authentication is not used.
51+
* Pipeline - Redis server exposed via TLS tunnel that itself exposed via DNS tunnel. Since tunnel does verify clients,
52+
Redis authentication is not used.
5053

5154
You can run each example locally or deploy it using Terraform and Ansible. See more information [here](examples/README.md).
5255

examples/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ CA_CERT=../../pki/ca.crt \
2828
CERT=../../pki/client.crt \
2929
KEY=../../pki/client.key \
3030
SERVER_HOSTNAME=server.tunneler \
31-
../../target/debug/client tls
31+
../../target/release/client tls
3232
```
3333
Then, run the service client. for example, for Speed Test run:
3434
```sh
@@ -74,7 +74,7 @@ TUNNELED_TYPE=tcp \
7474
CLIENT_SUFFIX=.dlemel8.xyz \
7575
READ_TIMEOUT_IN_MILLISECONDS=100 \
7676
IDLE_CLIENT_TIMEOUT_IN_MILLISECONDS=30000 \
77-
../target/debug/client dns
77+
../target/release/client dns
7878
```
7979
Then, run the service client. for example, for Authoritative DNS run:
8080
```sh

examples/authoritative_dns/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ TUNNELED_TYPE=tcp \
1919
READ_TIMEOUT_IN_MILLISECONDS=100 \
2020
IDLE_CLIENT_TIMEOUT_IN_MILLISECONDS=30000 \
2121
LOG_LEVEL=debug \
22-
../../target/debug/client dns
22+
../../target/release/client dns
2323
```
2424

2525
Then, run Redis client and direct it to the tunnel local port, for example:
@@ -37,7 +37,7 @@ TUNNELED_TYPE=tcp \
3737
CLIENT_SUFFIX=.dlemel8.xyz \
3838
READ_TIMEOUT_IN_MILLISECONDS=100 \
3939
IDLE_CLIENT_TIMEOUT_IN_MILLISECONDS=30000 \
40-
../../target/debug/client dns
40+
../../target/release/client dns
4141
```
4242

4343
Then, run Redis client and direct it to the tunnel local port, for example:

examples/pipeline/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ LOG_LEVEL=debug \
2020
TUNNELED_TYPE=tcp \
2121
READ_TIMEOUT_IN_MILLISECONDS=100 \
2222
IDLE_CLIENT_TIMEOUT_IN_MILLISECONDS=30000 \
23-
../../target/debug/client dns
23+
../../target/release/client dns
2424

2525
LOCAL_PORT=8887 \
2626
REMOTE_PORT=8886 \
@@ -31,7 +31,7 @@ CA_CERT=../../pki/ca.crt \
3131
CERT=../../pki/client.crt \
3232
KEY=../../pki/client.key \
3333
SERVER_HOSTNAME=server.tunneler \
34-
../../target/debug/client tls
34+
../../target/release/client tls
3535
```
3636

3737
Then, run Redis client and direct it to the TLS tunnel local port, for example:

examples/speed_test/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ CA_CERT=../../pki/ca.crt \
3030
CERT=../../pki/client.crt \
3131
KEY=../../pki/client.key \
3232
SERVER_HOSTNAME=server.tunneler \
33-
../../target/debug/client tls
33+
../../target/release/client tls
3434
```
3535

3636
Then, run iperf3 client and direct it to the tunnel local port, for example:
@@ -50,7 +50,7 @@ TUNNELED_TYPE=tcp \
5050
LOG_LEVEL=debug \
5151
READ_TIMEOUT_IN_MILLISECONDS=100 \
5252
IDLE_CLIENT_TIMEOUT_IN_MILLISECONDS=30000 \
53-
../../target/debug/client dns
53+
../../target/release/client dns
5454

5555
LOCAL_PORT=8888 \
5656
REMOTE_PORT=53536 \
@@ -59,7 +59,7 @@ TUNNELED_TYPE=udp \
5959
LOG_LEVEL=debug \
6060
READ_TIMEOUT_IN_MILLISECONDS=100 \
6161
IDLE_CLIENT_TIMEOUT_IN_MILLISECONDS=30000 \
62-
../../target/debug/client dns
62+
../../target/release/client dns
6363
```
6464

6565
Then, run iperf3 client and direct it to the tunnels local port, for example:

src/common/cli.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ use trust_dns_resolver::Resolver;
1010
pub enum TunnelerType {
1111
Tcp,
1212
Dns {
13-
#[structopt(env)]
13+
#[structopt(long, env)]
1414
read_timeout_in_milliseconds: u64,
15-
#[structopt(env)]
15+
#[structopt(long, env)]
1616
idle_client_timeout_in_milliseconds: u64,
17-
#[structopt(default_value = "", env)]
17+
#[structopt(default_value = "", long, env)]
1818
client_suffix: String,
1919
},
2020
Tls {
21-
#[structopt(env)]
21+
#[structopt(long, env)]
2222
ca_cert: PathBuf,
23-
#[structopt(env)]
23+
#[structopt(long, env)]
2424
cert: PathBuf,
25-
#[structopt(env)]
25+
#[structopt(long, env)]
2626
key: PathBuf,
27-
#[structopt(env)]
27+
#[structopt(long, env)]
2828
server_hostname: String,
2929
},
3030
}
@@ -53,13 +53,13 @@ pub struct Cli {
5353
#[structopt(subcommand)]
5454
pub tunneler_type: TunnelerType,
5555

56-
#[structopt(env, possible_values = &TunneledType::variants(), case_insensitive = true)]
56+
#[structopt(long, env, possible_values = &TunneledType::variants(), case_insensitive = true)]
5757
pub tunneled_type: TunneledType,
5858

59-
#[structopt(env, parse(try_from_str = parse_or_resolve_ip))]
59+
#[structopt(long, env, parse(try_from_str = parse_or_resolve_ip))]
6060
pub remote_address: IpAddr,
6161

62-
#[structopt(env)]
62+
#[structopt(long, env)]
6363
pub remote_port: u16,
6464

6565
#[structopt(default_value = "0.0.0.0", long, env)]

0 commit comments

Comments
 (0)