-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
107 lines (94 loc) · 2.7 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
format:
cargo fmt
lint: format
cargo clippy --tests --workspace --all-targets --all-features -- -D warnings
test:
cargo test -- --nocapture
build:
@cargo build
build_docker:
docker build -t simple-tunnel -f Dockerfile .
build_docker_crypto:
docker build -t simple-tunnel -f Dockerfile --build-arg crypto=1 .
build_macos_notifications:
@cargo-bundle bundle --features notifications
@codesign --force --sign app-signer -o runtime \
--entitlements macos_bundle/com.example.simple.tunnel.xcent \
--timestamp\=none --generate-entitlement-der \
target/debug/bundle/osx/tunnel.app
run_dns_server:
docker run --rm -it \
--name dns-server \
-p 12400:53/udp \
-v "${PWD}/coredns/Corefile:/Corefile" \
-v "${PWD}/coredns/core.db:/core.db" \
coredns/coredns -conf /Corefile
run_docker_server:
docker run --rm -it \
--name simple-tunnel-server \
--cap-add=NET_ADMIN \
--device /dev/net/tun \
--memory=0.5g \
--memory-swap=0.5g \
--cpus=1 \
-e RUST_LOG=$(log_level) \
-e SERVER=1 \
--entrypoint="./run_tun_docker.sh" \
simple-tunnel
run_docker_server_crypto:
docker run --rm -it \
--name simple-tunnel-server \
--cap-add=NET_ADMIN \
--device /dev/net/tun \
--memory=0.5g \
--memory-swap=0.5g \
--cpus=1 \
-e RUST_LOG=$(log_level) \
-e TUNNEL_PRIVATE_KEY=RFLMRBysWs2qoDMM70xF87mPTrpTxLNTZwQwIWsIw8o= \
-e CLIENT_PUBLIC_KEY=O+0h1KDgpw6vxQY1GUFfHhyScNpjd7EuebQvUK5L8dM= \
-e SERVER=1 \
--entrypoint="./run_tun_docker.sh" \
simple-tunnel
run_docker_client:
docker run --rm -it \
--name simple-tunnel-client \
--cap-add=NET_ADMIN \
--device /dev/net/tun \
--memory=0.5g \
--memory-swap=0.5g \
--cpus=1 \
-p 8888:8888 \
-e RUST_LOG=$(log_level) \
-e CLIENT=1 \
-e SERVER_DOCKER_IP=$(shell ./scripts/get_simple_tunnel_server_ip.sh) \
-e DNS_SERVER_IP=$(shell ./scripts/get_dns_server_ip.sh) \
-e ROUTING=$(routing) \
--entrypoint="./run_tun_docker.sh" \
simple-tunnel
run_docker_client_crypto:
docker run --rm -it \
--name simple-tunnel-client \
--cap-add=NET_ADMIN \
--device /dev/net/tun \
--memory=0.5g \
--memory-swap=0.5g \
--cpus=1 \
-p 8888:8888 \
-e RUST_LOG=$(log_level) \
-e TUNNEL_PRIVATE_KEY=6zZqJBS0o2/3pIRP6S659ZPr06RiAsCBKG15xHcb1OE= \
-e CLIENT_PUBLIC_KEY=bB438yE82JeVSg3GNuinl/Sbi7Da188qjoCflkpbG9w= \
-e CLIENT=1 \
-e SERVER_DOCKER_IP=$(shell ./acripts/get_simple_tunnel_server_ip.sh) \
-e DNS_SERVER_IP=$(shell ./scripts/get_dns_server_ip.sh) \
-e ROUTING=$(routing) \
--entrypoint="./run_tun_docker.sh" \
simple-tunnel
run_benchmarks:
cd benchmarks && go run main.go run constant \
-c 50 \
--max-duration 60s \
--max-iterations 10000 \
--rate 50/s \
$(name)
check_updates:
cargo outdated --color always -R