-
Notifications
You must be signed in to change notification settings - Fork 104
Expand file tree
/
Copy pathMakefile
More file actions
170 lines (117 loc) · 5.43 KB
/
Copy pathMakefile
File metadata and controls
170 lines (117 loc) · 5.43 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
.PHONY: test build doctor status policy-control-test
.PHONY: web-install web-build web-test control-build control-run menubar-build menubar-test gui-build gui-test gui-installer gui-notarize
.PHONY: lab-install lab-uninstall-root lab-check lab-up lab-status lab-test
.PHONY: lab-test-tun lab-test-tun-imported-profile lab-test-tun-imported-egress lab-test-tun-local-routing lab-test-tun-device-policy lab-down lab-destroy
.PHONY: real-device-start-off real-device-start-tun real-device-start-tun-proxy
.PHONY: real-device-stop real-device-status real-device-client-check
.PHONY: same-lan-start-tun same-lan-start-tun-proxy same-lan-start-tun-imported-egress
.PHONY: same-lan-stop same-lan-status same-lan-adb-check same-lan-adb-check-imported-egress
.PHONY: same-lan-start-wifi-dhcp-imported-egress same-lan-adb-check-wifi-dhcp-imported-egress
.PHONY: same-lan-stop-wifi-dhcp same-lan-status-wifi-dhcp
.PHONY: same-wifi-dhcp-start-imported-egress same-wifi-dhcp-adb-check-imported-egress
.PHONY: same-wifi-dhcp-start-device-policy same-wifi-dhcp-adb-check-device-policy same-wifi-dhcp-verify-device-policy-recovery
.PHONY: same-wifi-dhcp-stop same-wifi-dhcp-status
test:
go test ./...
build:
go build -o bin/omg ./cmd/omg
web-install:
cd web && pnpm install
web-build:
cd web && pnpm run build
web-test:
cd web && pnpm run test
control-build: web-build
go build -o bin/opensurge-control ./cmd/opensurge-control
go build -o bin/opensurge-helper ./cmd/opensurge-helper
go build -o bin/opensurge-install-config ./cmd/opensurge-install-config
control-run: control-build
./bin/opensurge-control --config examples/config.example.yaml
menubar-build:
./scripts/build-menubar-app.sh
menubar-test:
./scripts/check-menubar.sh
gui-build: control-build menubar-build
gui-test: test web-test menubar-test
./scripts/check-gui-packaging.sh
gui-installer:
./scripts/build-gui-installer.sh
gui-notarize:
@test -n "$(PKG)" || (echo "usage: make gui-notarize PKG=/path/to/OpenSurge.pkg" >&2; exit 1)
./scripts/notarize-gui-installer.sh "$(PKG)"
doctor:
go run ./cmd/omg doctor --config examples/config.example.yaml
status:
go run ./cmd/omg status --config examples/config.example.yaml
policy-control-test:
./tests/integration/policy-control.sh
lab-install:
./tests/lab/install-host-deps.sh
lab-uninstall-root:
./tests/lab/install-host-deps.sh --uninstall-root
lab-check:
./tests/lab/lab.sh check
lab-up:
./tests/lab/lab.sh up
lab-status:
./tests/lab/lab.sh status
lab-test:
./tests/lab/lab.sh test
lab-test-tun:
./tests/lab/lab.sh test-tun
lab-test-tun-imported-profile:
OMG_LAB_MIHOMO_PROFILE=tests/lab/mihomo-profile.imported-tun.yaml ./tests/lab/lab.sh test-tun
lab-test-tun-imported-egress:
OMG_LAB_MIHOMO_PROFILE=tests/lab/mihomo-profile.imported-tun-egress.yaml ./tests/lab/lab.sh test-tun
lab-test-tun-local-routing:
OMG_LAB_MIHOMO_PROFILE=tests/lab/mihomo-profile.imported-tun-egress.yaml OMG_LAB_LOCAL_ROUTING_TEST=true ./tests/lab/lab.sh test-tun
lab-test-tun-device-policy:
./tests/lab/lab.sh test-tun-device-policy
lab-down:
./tests/lab/lab.sh down
lab-destroy:
./tests/lab/lab.sh destroy
real-device-start-off:
./tests/real-device/smoke.sh start-off
real-device-start-tun:
./tests/real-device/smoke.sh start-tun
real-device-start-tun-proxy:
OMG_REAL_DEVICE_UPSTREAM_PROXY_ENABLED=true ./tests/real-device/smoke.sh start-tun
real-device-stop:
./tests/real-device/smoke.sh stop
real-device-status:
./tests/real-device/smoke.sh status
real-device-client-check:
./tests/real-device/smoke.sh client-check
same-lan-start-tun:
./tests/same-lan/smoke.sh start-tun
same-lan-start-tun-proxy:
OMG_SAME_LAN_UPSTREAM_PROXY_ENABLED=true ./tests/same-lan/smoke.sh start-tun
same-lan-start-tun-imported-egress:
OMG_SAME_LAN_IMPORTED_EGRESS=true ./tests/same-lan/smoke.sh start-tun-imported-egress
same-lan-stop:
./tests/same-lan/smoke.sh stop
same-lan-status:
./tests/same-lan/smoke.sh status
same-lan-adb-check:
./tests/same-lan/smoke.sh adb-check
same-lan-adb-check-imported-egress:
OMG_SAME_LAN_IMPORTED_EGRESS=true ./tests/same-lan/smoke.sh adb-check-imported-egress
same-lan-start-wifi-dhcp-imported-egress:
OMG_SAME_WIFI_DHCP_ENABLED=true OMG_SAME_LAN_IMPORTED_EGRESS=true ./tests/same-lan/smoke.sh start-wifi-dhcp-imported-egress
same-lan-adb-check-wifi-dhcp-imported-egress:
OMG_SAME_WIFI_DHCP_ENABLED=true OMG_SAME_LAN_IMPORTED_EGRESS=true ./tests/same-lan/smoke.sh adb-check-wifi-dhcp-imported-egress
same-lan-stop-wifi-dhcp:
OMG_SAME_WIFI_DHCP_ENABLED=true OMG_SAME_LAN_IMPORTED_EGRESS=true ./tests/same-lan/smoke.sh stop
same-lan-status-wifi-dhcp:
OMG_SAME_WIFI_DHCP_ENABLED=true ./tests/same-lan/smoke.sh status
same-wifi-dhcp-start-imported-egress: same-lan-start-wifi-dhcp-imported-egress
same-wifi-dhcp-adb-check-imported-egress: same-lan-adb-check-wifi-dhcp-imported-egress
same-wifi-dhcp-start-device-policy:
OMG_SAME_WIFI_DHCP_ENABLED=true OMG_SAME_LAN_IMPORTED_EGRESS=true OMG_SAME_WIFI_DEVICE_POLICY_ENABLED=true ./tests/same-lan/smoke.sh start-wifi-dhcp-device-policy
same-wifi-dhcp-adb-check-device-policy:
OMG_SAME_WIFI_DHCP_ENABLED=true OMG_SAME_LAN_IMPORTED_EGRESS=true OMG_SAME_WIFI_DEVICE_POLICY_ENABLED=true ./tests/same-lan/smoke.sh adb-check-wifi-dhcp-device-policy
same-wifi-dhcp-verify-device-policy-recovery:
OMG_SAME_WIFI_DHCP_ENABLED=true OMG_SAME_WIFI_DEVICE_POLICY_ENABLED=true ./tests/same-lan/smoke.sh verify-wifi-dhcp-device-policy-recovery
same-wifi-dhcp-stop: same-lan-stop-wifi-dhcp
same-wifi-dhcp-status: same-lan-status-wifi-dhcp