mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-26 08:57:26 +02:00
Compare commits
911 commits
dev
...
v2-before-
Author | SHA1 | Date | |
---|---|---|---|
|
7d951783ca | ||
|
ec76f6e1d2 | ||
|
c943d0e807 | ||
|
a1ceccaf6e | ||
|
326a871fac | ||
|
e462750bdd | ||
|
7c599fe83e | ||
|
d7e4404c17 | ||
|
441f4986ac | ||
|
d70cfe6850 | ||
|
4ed77e0c0f | ||
|
f8e3251efe | ||
|
1bb43476e8 | ||
|
387d293793 | ||
|
bd96e53bcc | ||
|
bab9a7f508 | ||
|
31eb950750 | ||
|
31ef205828 | ||
|
a7350bc312 | ||
|
0e396526e4 | ||
|
8e5f8140a2 | ||
|
8f746f5099 | ||
|
bc8aa6c359 | ||
|
00714f5f2e | ||
|
d20470d30f | ||
|
c2d14599c5 | ||
|
896656115f | ||
|
72114e4cf8 | ||
|
2abf2c5695 | ||
|
fe01352412 | ||
|
782f15f8c9 | ||
|
e0492a7e69 | ||
|
cb147a3e8a | ||
|
f97e9e1f5d | ||
|
f1b6cb2ace | ||
|
27939a5233 | ||
|
7d5ba6f739 | ||
|
37360d5e2e | ||
|
ae13983b10 | ||
|
78670aea58 | ||
|
d0cc3ac333 | ||
|
4273d89373 | ||
|
9ef780e05c | ||
|
9da0b43d2d | ||
|
7c929099b3 | ||
|
ea2f95ed70 | ||
|
fc39894541 | ||
|
1fc4dce835 | ||
|
0c56d7c769 | ||
|
1f2a107d1d | ||
|
4474303b01 | ||
|
3b773da8bc | ||
|
7efaab2af1 | ||
|
064cb6dad7 | ||
|
d5afba2610 | ||
|
b4d0307d9e | ||
|
71b72a1ef2 | ||
|
b0e8bac310 | ||
|
9a501a76d1 | ||
|
becc4aa8ea | ||
|
95d7970f34 | ||
|
81530e5990 | ||
|
825b19aedc | ||
|
0f04b5afc7 | ||
|
189dea7c96 | ||
|
85ef9535d5 | ||
|
71a2206c5d | ||
|
641d1a52c8 | ||
|
407f737212 | ||
|
0d58865061 | ||
|
cfb0bc4f8e | ||
|
dfe230be8b | ||
|
75ecfffd52 | ||
|
883cbd182d | ||
|
866a20e85b | ||
|
a19bc1e826 | ||
|
a117c92a1e | ||
|
65ef40b091 | ||
|
15f5125c8c | ||
|
e5f2314055 | ||
|
f018fefeb4 | ||
|
04d8c3dd79 | ||
|
7994e3aa78 | ||
|
1eacbdf374 | ||
|
492e78e2cf | ||
|
8b1c691a5e | ||
|
b02fc1f28b | ||
|
ecf1fe9aa5 | ||
|
7e341ed397 | ||
|
e5e6f82a8e | ||
|
eca929faef | ||
|
b027a83789 | ||
|
1ad0fbdb76 | ||
|
8f1e6a2fde | ||
|
451e6be180 | ||
|
7b869684c6 | ||
|
0d764f5a3d | ||
|
899f0c9749 | ||
|
727aa8e71f | ||
|
404b7a5493 | ||
|
befc50ac3a | ||
|
94c35d395e | ||
|
7883e5d8ad | ||
|
97cd184211 | ||
|
c17ac16728 | ||
|
b696ab12b8 | ||
|
e7ccd74a9e | ||
|
676a3444cd | ||
|
bd0299f392 | ||
|
e213317532 | ||
|
206524b9e6 | ||
|
7a458e0138 | ||
|
9db9211ed3 | ||
|
2ee550bbfd | ||
|
9029570452 | ||
|
6af39da61a | ||
|
ad692b07c3 | ||
|
3f4809457f | ||
|
53b85a2bbb | ||
|
92d2bbc63c | ||
|
536be73006 | ||
|
115187204f | ||
|
b482064a55 | ||
|
722a50f7be | ||
|
623213ea0b | ||
|
0589c4ab6a | ||
|
46c4a11a7a | ||
|
16d27dfddb | ||
|
aee344fe47 | ||
|
696c77f5c8 | ||
|
8921914098 | ||
|
f33574dfbc | ||
|
e2bc081740 | ||
|
a6d7f7cac2 | ||
|
c714112e00 | ||
|
bae91724a1 | ||
|
daef6a24d1 | ||
|
661ebfee94 | ||
|
73d0e2e7e0 | ||
|
917cc58560 | ||
|
1eea80194b | ||
|
d569217ff5 | ||
|
d823725eb6 | ||
|
f08d20560b | ||
|
c0385466e2 | ||
|
c22b002226 | ||
|
9aac1fc47f | ||
|
39d4fadf90 | ||
|
4968afb89a | ||
|
8b45018f28 | ||
|
007b3bd10b | ||
|
5e1b7f2ba6 | ||
|
40820ddea9 | ||
|
4fbc29158d | ||
|
6e1115ea03 | ||
|
d5d1f4a313 | ||
|
1e65aad95b | ||
|
495ac17346 | ||
|
2f82db97ed | ||
|
35f3d16084 | ||
|
29dfe240e4 | ||
|
aa9ca845e8 | ||
|
05a3831acb | ||
|
9a7d26cd9e | ||
|
ab36607a48 | ||
|
02a810b8d6 | ||
|
2d1ca5f346 | ||
|
65aca7d84a | ||
|
d3a9ce95bc | ||
|
ee53f056ce | ||
|
f3defdf3a6 | ||
|
6d88a13407 | ||
|
9722bdef75 | ||
|
f87e41abee | ||
|
d7c6f8ae3f | ||
|
4d80f7c41d | ||
|
de00486b80 | ||
|
c2664033bc | ||
|
f96a9f63ea | ||
|
78b18f2bdb | ||
|
8bb0753f62 | ||
|
0c5d1a793c | ||
|
34692489cb | ||
|
52b619b38f | ||
|
9009a864ab | ||
|
09a8b66d3b | ||
|
7c6f5e2c37 | ||
|
930bd91598 | ||
|
050615f2d2 | ||
|
05cc4ea36a | ||
|
4cafc1b776 | ||
|
fb559434b6 | ||
|
02493d473f | ||
|
1abcb5adf5 | ||
|
1b8703db95 | ||
|
517a171a6c | ||
|
b126bf727a | ||
|
cfc2a43f51 | ||
|
0477e16860 | ||
|
cc13bf1049 | ||
|
a66b4a6f5e | ||
|
f989758159 | ||
|
ade8373c0c | ||
|
fa4ecea095 | ||
|
7ae9c6d55c | ||
|
b369d4b9a1 | ||
|
ea5bb43cf9 | ||
|
6ea60bc429 | ||
|
b094278b64 | ||
|
f21384e499 | ||
|
620fa9ab54 | ||
|
d8c83dbb08 | ||
|
992d1471b8 | ||
|
27b14aefcd | ||
|
a7fee6b02f | ||
|
cea297b69d | ||
|
c348bfff30 | ||
|
224c468aa3 | ||
|
a472aafb3e | ||
|
b165b9dd4f | ||
|
7d388e0c79 | ||
|
4036657e32 | ||
|
d50c6ee1ce | ||
|
143f4bef9f | ||
|
765dc413db | ||
|
423b0d891c | ||
|
3db0e9d068 | ||
|
1f3f9bc341 | ||
|
e84bfca5a5 | ||
|
bd488a08f8 | ||
|
3c6448a717 | ||
|
0a2dfc719a | ||
|
f0fc4713d8 | ||
|
b2132aa975 | ||
|
7739984c56 | ||
|
034188b0ee | ||
|
98ea27ecb0 | ||
|
8d2a0f764b | ||
|
6c43e0b946 | ||
|
77342f8571 | ||
|
e808b4b45f | ||
|
86d91cb625 | ||
|
3f21e59ab4 | ||
|
3669cac3c9 | ||
|
b919f5a95b | ||
|
5e6484ff5a | ||
|
ecb09aa2e1 | ||
|
346d4b572b | ||
|
1a38dfdbde | ||
|
69f1c8701b | ||
|
9daf4540de | ||
|
f447608d6b | ||
|
001fb54b15 | ||
|
ffc786d796 | ||
|
a1649d6cda | ||
|
541b2cbef0 | ||
|
5166aa6913 | ||
|
b88000c349 | ||
|
49eefe7e78 | ||
|
bfdac7a8f0 | ||
|
d9dd77bc6e | ||
|
e46a342e17 | ||
|
760607f58a | ||
|
35b5780907 | ||
|
51159601b0 | ||
|
4cb35a2975 | ||
|
405250ce79 | ||
|
81b11168c9 | ||
|
066cdfe2ac | ||
|
062189b589 | ||
|
a11d0027ce | ||
|
c9ae7e811f | ||
|
47ec246520 | ||
|
42104cfc4c | ||
|
1bab9b202f | ||
|
74ce98f39b | ||
|
3268effabf | ||
|
96965647bc | ||
|
808ab715d9 | ||
|
fa1e16085b | ||
|
dd46e56af2 | ||
|
d8d871745e | ||
|
09c9e338bc | ||
|
df9483408d | ||
|
cb342bfb12 | ||
|
04266a1180 | ||
|
86eda5fe65 | ||
|
bc1fa3bf20 | ||
|
e63920404c | ||
|
4833478eee | ||
|
c8b6850520 | ||
|
938cbba449 | ||
|
c8f640f3f2 | ||
|
2272189955 | ||
|
736edeeed0 | ||
|
bf33368add | ||
|
40d48c969c | ||
|
17f0dc9ba2 | ||
|
016d85b169 | ||
|
2bceabdfa5 | ||
|
d18c33d6df | ||
|
e2ca065f28 | ||
|
fe28501126 | ||
|
73795d05eb | ||
|
af846f7e3f | ||
|
a0374da4f3 | ||
|
4e44fa009c | ||
|
3dd2c94f4e | ||
|
6da8f2bb05 | ||
|
e21fcb8104 | ||
|
3c11c13af4 | ||
|
d3cf7b2202 | ||
|
03bcdf74a8 | ||
|
45b90a0dfa | ||
|
9babfcb9b6 | ||
|
1b2a4f00f2 | ||
|
90b5acfca6 | ||
|
741f7814c2 | ||
|
a4ae4941c3 | ||
|
8a6ef33c4a | ||
|
5ac2596429 | ||
|
5dac2e82a7 | ||
|
8e29acd664 | ||
|
1d29bc3e8e | ||
|
dc1ef0c49e | ||
|
1003455160 | ||
|
20ae12d385 | ||
|
dcc686a3a7 | ||
|
89c27c112a | ||
|
3621fe8897 | ||
|
33269cd29d | ||
|
1970dab13d | ||
|
a5390b1bc8 | ||
|
864e33cf2d | ||
|
b9bf6d1242 | ||
|
caad356b93 | ||
|
964c235ecf | ||
|
c881094202 | ||
|
6051c973d3 | ||
|
1f9717250c | ||
|
8ebbbc33cc | ||
|
98bcff1928 | ||
|
cef708c8ad | ||
|
a925e2d783 | ||
|
a1193f0e30 | ||
|
f209037efe | ||
|
b99dd7d916 | ||
|
aad21cf395 | ||
|
d537428421 | ||
|
996589894d | ||
|
d3777b3eb4 | ||
|
52e1f5502d | ||
|
664a128e9e | ||
|
666d44b14a | ||
|
b533c300d8 | ||
|
78d223d709 | ||
|
2b0127c26d | ||
|
16a3c14c53 | ||
|
c65391a344 | ||
|
fbf4ae823b | ||
|
3d6d9c5808 | ||
|
64c533c189 | ||
|
7fd78a87d1 | ||
|
b9f60fc3c2 | ||
|
afa01074c5 | ||
|
1f85b0402e | ||
|
b3314cd34f | ||
|
9428fc53f6 | ||
|
0d05e4bcae | ||
|
87da45b3f5 | ||
|
cbf174f96d | ||
|
0aa78d0ecb | ||
|
a87d4f1864 | ||
|
c0e86de6db | ||
|
60fa07bff2 | ||
|
1df7f21f5f | ||
|
674edab814 | ||
|
369df245e3 | ||
|
1f2e94a51d | ||
|
3f32cffc40 | ||
|
3914964a35 | ||
|
bedf63e257 | ||
|
d151d731a6 | ||
|
2d862f1d32 | ||
|
f92fca03a0 | ||
|
b5c01999b8 | ||
|
e9da35bac3 | ||
|
d3a7468e83 | ||
|
f3540a5c7c | ||
|
8cf6808c50 | ||
|
274db26339 | ||
|
490b9c4d79 | ||
|
2da096944d | ||
|
83f830618f | ||
|
cdbb86b830 | ||
|
483b47474d | ||
|
1d314858ef | ||
|
37d4e83fad | ||
|
c7f3f3add9 | ||
|
1c7baa544b | ||
|
3408839b33 | ||
|
a7409486bb | ||
|
cf24ed4108 | ||
|
8a379ba0a1 | ||
|
4b20638568 | ||
|
eebe2046f0 | ||
|
1e457dbd76 | ||
|
a20aebaaf8 | ||
|
5463c70aaf | ||
|
24e30a684b | ||
|
05e52493a4 | ||
|
d8f1e01b77 | ||
|
da5b11bf2d | ||
|
b824ea7bcf | ||
|
b96ea5ae03 | ||
|
fbd3e10488 | ||
|
51f0882849 | ||
|
416068f68e | ||
|
a8db4a8d2d | ||
|
6b49148d4e | ||
|
77e59818a3 | ||
|
6262374205 | ||
|
ed8271530f | ||
|
8e4d7c56d8 | ||
|
0598315d68 | ||
|
05e5d08959 | ||
|
ca33eaf28d | ||
|
13e86fdb6c | ||
|
ffbd18f4ef | ||
|
fabb0f734a | ||
|
1e59d92df3 | ||
|
ecd09946e6 | ||
|
789b8b8454 | ||
|
f107a71796 | ||
|
066b4c27a4 | ||
|
fbfa99fac5 | ||
|
c5bd21a23e | ||
|
1c7e1da4d1 | ||
|
5cec5fe6b1 | ||
|
ea0961dfd2 | ||
|
f20905b08a | ||
|
83e79e1a1b | ||
|
c6a7b5774c | ||
|
27ab88db1e | ||
|
1b71b6d01a | ||
|
dcb3d49d35 | ||
|
5c14a072d5 | ||
|
4eb491065b | ||
|
b87e8d8e41 | ||
|
a58f11e601 | ||
|
547f39bb49 | ||
|
df99f5e3f3 | ||
|
15e88a8b7e | ||
|
61b72d42b8 | ||
|
56bf504ec2 | ||
|
1f02250dd8 | ||
|
5d0c6db19c | ||
|
4af3467757 | ||
|
87890565f3 | ||
|
d603a73715 | ||
|
55b0555aa0 | ||
|
1a2378a3d4 | ||
|
c6ce6b46ce | ||
|
f109f2e612 | ||
|
8f8e3f4960 | ||
|
1d885cf810 | ||
|
5275a34b0b | ||
|
c3b5c45fea | ||
|
565a686be7 | ||
|
12cfb6501d | ||
|
de1b54821e | ||
|
320c8429c2 | ||
|
a4e24c8390 | ||
|
0589964f99 | ||
|
1affb6814c | ||
|
b70ab0d354 | ||
|
4a9266feef | ||
|
1e0a930d23 | ||
|
46d3780e89 | ||
|
311c98e24e | ||
|
9ad8dd3700 | ||
|
0dc476518b | ||
|
8c8a3c58ec | ||
|
a0ac4a744e | ||
|
3448e6fc76 | ||
|
e5c7366e71 | ||
|
e236d6f743 | ||
|
5db0d9438c | ||
|
08e06f9b8f | ||
|
018fe04163 | ||
|
f21ecb3762 | ||
|
60de5ed3dd | ||
|
df4b1e9b12 | ||
|
c3d3605f70 | ||
|
a9003d16f2 | ||
|
84619a7788 | ||
|
db127887b6 | ||
|
e0588b89b2 | ||
|
7d2eceef01 | ||
|
e5e444c7ae | ||
|
4b083b8c41 | ||
|
245d92b40c | ||
|
931ad1aca8 | ||
|
5e488d3aa0 | ||
|
cc52835ce3 | ||
|
7d11522768 | ||
|
417cdc17dc | ||
|
c537955c65 | ||
|
a0efea8e0f | ||
|
df346a6df6 | ||
|
cdc6c42375 | ||
|
d5b9a54c55 | ||
|
59da359b06 | ||
|
91ce4c4ea6 | ||
|
e9656ecf11 | ||
|
5c6bf9d0a4 | ||
|
0de194dab3 | ||
|
33bb61c63d | ||
|
e6273b3300 | ||
|
d7b31fe014 | ||
|
5aae5f95bf | ||
|
bba1324145 | ||
|
182561f7e6 | ||
|
41871c8b1e | ||
|
ff655292fb | ||
|
782b75a64e | ||
|
0c58901469 | ||
|
73b23f1b16 | ||
|
5a29f9ba2d | ||
|
03190c5a55 | ||
|
dab968ed96 | ||
|
b598263261 | ||
|
eef70e198b | ||
|
89c41f88a4 | ||
|
53b7c8f725 | ||
|
d471142908 | ||
|
3ff9ffd5d4 | ||
|
2558bd1b9b | ||
|
95d0944b9f | ||
|
6e72b6fb37 | ||
|
0c9be4de14 | ||
|
b53b7f4950 | ||
|
b2f0b35608 | ||
|
cba7a5d4d7 | ||
|
8e1a88c2fb | ||
|
ee5a988f14 | ||
|
f814a07ab3 | ||
|
a5aea2f3bb | ||
|
7291ac2093 | ||
|
790fe50fac | ||
|
83eacdfada | ||
|
2fbeaaf148 | ||
|
57710cbc38 | ||
|
8bae0acaf9 | ||
|
ef64e6a336 | ||
|
9642ff5fb9 | ||
|
263798d1c3 | ||
|
3fbfad5585 | ||
|
627533cf48 | ||
|
19899de5a6 | ||
|
c1b2c7903c | ||
|
3b94ef99ae | ||
|
6267c67888 | ||
|
23d6a3aacd | ||
|
72361fb1c8 | ||
|
b55f98b813 | ||
|
5a4d681af8 | ||
|
a16a0a8ce5 | ||
|
203df51752 | ||
|
47b4efd49b | ||
|
14fab11081 | ||
|
4c55f3eaa5 | ||
|
891bf99894 | ||
|
22e95b3bcb | ||
|
4da315fab2 | ||
|
507ba7d26a | ||
|
68ac884d47 | ||
|
e2f3996843 | ||
|
57ade250af | ||
|
c3e0f262d1 | ||
|
b9911d0db7 | ||
|
d1b780c7be | ||
|
1711cced3e | ||
|
63e6693255 | ||
|
9b8d191bb1 | ||
|
6db2b8c66d | ||
|
47a08ccbd4 | ||
|
7fc78129f4 | ||
|
c4504fd3ff | ||
|
e4799ff8c4 | ||
|
f680924585 | ||
|
b0d222768a | ||
|
4303c43db7 | ||
|
3b3e6d2bfc | ||
|
7061f13b24 | ||
|
5175636d36 | ||
|
570032484f | ||
|
9c37fc1a5f | ||
|
105023bd87 | ||
|
8a9669f130 | ||
|
e5bd230fb0 | ||
|
e3d47e588a | ||
|
f4a5abeed9 | ||
|
a7e38d2b00 | ||
|
84ba396ed3 | ||
|
6683280a37 | ||
|
1edf680464 | ||
|
4df090469a | ||
|
3c63f58532 | ||
|
64c8171e13 | ||
|
b6175bd408 | ||
|
b44bd19c53 | ||
|
536bc59abb | ||
|
70d5da1e2a | ||
|
90d4d79828 | ||
|
ccc9be2d4d | ||
|
3341c4a670 | ||
|
bcb9df9cdf | ||
|
2eef9d22e6 | ||
|
5e35346f17 | ||
|
bb53ee9567 | ||
|
9934a856dd | ||
|
24904c5083 | ||
|
6ce4663a31 | ||
|
fbf74d3baa | ||
|
b540181990 | ||
|
02a6b15e6b | ||
|
b34aa10bf8 | ||
|
e0ddbc2f28 | ||
|
ed2024285d | ||
|
ae2120eb96 | ||
|
3ceb2257e5 | ||
|
624efde7e4 | ||
|
50009fef6f | ||
|
dde937e197 | ||
|
07a480b37a | ||
|
9f5bccec30 | ||
|
ade52bf81e | ||
|
71c766a3b2 | ||
|
eef66aee9a | ||
|
e245eb1eb5 | ||
|
e08fc81397 | ||
|
9f9032ae36 | ||
|
063a16fcd6 | ||
|
0db4151492 | ||
|
e44d7a553f | ||
|
53a2de98de | ||
|
2deaaeef28 | ||
|
1f9e16f63e | ||
|
87fe69c27c | ||
|
2d1eeda188 | ||
|
5c06d40358 | ||
|
31e193756d | ||
|
5aa744db84 | ||
|
0ad82dad80 | ||
|
99c36ed2f2 | ||
|
44878e583a | ||
|
0723a85ab3 | ||
|
d8dae365f6 | ||
|
bccb86a401 | ||
|
592e743349 | ||
|
fb6161e9ac | ||
|
787277d282 | ||
|
540ee69773 | ||
|
0d2c87fe4e | ||
|
2460de9713 | ||
|
0d32f42d26 | ||
|
277497684e | ||
|
f4a83e516c | ||
|
d2eb1ed9a5 | ||
|
a3ec5846df | ||
|
b6047899a8 | ||
|
3516070b6e | ||
|
56ec87e00e | ||
|
fe0b896665 | ||
|
e4721417e6 | ||
|
45f5b3b648 | ||
|
3123102211 | ||
|
c6141ffbc7 | ||
|
c0e92d06a5 | ||
|
274b2682d6 | ||
|
171d661b84 | ||
|
5cea8da664 | ||
|
44dd52d08f | ||
|
70648d006d | ||
|
43e6a9e9ee | ||
|
0599c1710b | ||
|
abf218a9cd | ||
|
55f4f9aaeb | ||
|
82b7e1dbcb | ||
|
e8f8b0f8e5 | ||
|
7566d4fbab | ||
|
3a0d385119 | ||
|
a465afa83d | ||
|
185e90c40f | ||
|
e29c2d0260 | ||
|
acf6425ae9 | ||
|
5e8d49de0f | ||
|
1f9456a462 | ||
|
a7d8285c3a | ||
|
5f1dc4b851 | ||
|
b1c22949c5 | ||
|
29be175743 | ||
|
b6c5ba264b | ||
|
8e7e3c2b11 | ||
|
0e7df129d8 | ||
|
50709cbd21 | ||
|
fd6e8d8c5c | ||
|
2e7496130c | ||
|
9666ab5797 | ||
|
4c08ac7873 | ||
|
5435ec7545 | ||
|
8764d50179 | ||
|
62cdb8dc94 | ||
|
9918a1092f | ||
|
7d89511fda | ||
|
795b6d13d1 | ||
|
8328b6f657 | ||
|
9994e591bd | ||
|
b27a38e55e | ||
|
f6d747a5a0 | ||
|
b7da7574d1 | ||
|
dbad9585cd | ||
|
2d7a97bb94 | ||
|
da19da0360 | ||
|
ee7361ee2e | ||
|
6e3e09bed4 | ||
|
86762d2b40 | ||
|
ef12c5af99 | ||
|
933404b1dd | ||
|
ccec49e444 | ||
|
e5f1bf81f7 | ||
|
0e627f4f68 | ||
|
d33f7d2bf5 | ||
|
e07a019615 | ||
|
34ca3012e6 | ||
|
62634ca2da | ||
|
846c96e8d5 | ||
|
63775723c1 | ||
|
2f7d3e655a | ||
|
b19634d7e4 | ||
|
a92967a7c1 | ||
|
8915b88de5 | ||
|
7bca81464b | ||
|
b974ece24f | ||
|
b1c8e6ad59 | ||
|
64f7185e3a | ||
|
807cc9afc3 | ||
|
0adf306dd4 | ||
|
db0f602e86 | ||
|
17ec47f5c0 | ||
|
cf831d9cd3 | ||
|
5e3c633f74 | ||
|
4e4b27b6ab | ||
|
c0c9590904 | ||
|
24c9577e39 | ||
|
59ee0cfe88 | ||
|
1977b9b764 | ||
|
6f9d1fc14c | ||
|
8ac59ae2be | ||
|
46db37e06c | ||
|
9d1207b339 | ||
|
6e730cfad1 | ||
|
199b3345a0 | ||
|
b7f504b8a4 | ||
|
1b459b0560 | ||
|
40803a4dc1 | ||
|
6f22570648 | ||
|
8203547cfc | ||
|
dad160209e | ||
|
8faaaec710 | ||
|
012fba617d | ||
|
9ca495229b | ||
|
e63f624d3a | ||
|
e1dd413266 | ||
|
b9ef09dd58 | ||
|
990333e7ec | ||
|
ec9582f3f2 | ||
|
ea65386e15 | ||
|
a0fd4ad23f | ||
|
b6d7a95028 | ||
|
1d8f3cee62 | ||
|
5ba6e21967 | ||
|
52f7f6e6cf | ||
|
9fd5ec673b | ||
|
e905b3c963 | ||
|
f12370c348 | ||
|
b727e2a67a | ||
|
8e87319925 | ||
|
1ab29b1ab0 | ||
|
52d55e34e6 | ||
|
c79360f58b | ||
|
8057c826bc | ||
|
6f6138c500 | ||
|
903a18db1d | ||
|
0731f3f1a9 | ||
|
37047a39f9 | ||
|
91d0cbe892 | ||
|
b66431bc29 | ||
|
0e18b14087 | ||
|
31bd413166 | ||
|
95a6fce2b4 | ||
|
0b5472f9fb | ||
|
5280d28505 | ||
|
67a9898a99 | ||
|
fe8815f80f | ||
|
3a21fdc304 | ||
|
83d723eb79 | ||
|
6e771607c0 | ||
|
e73b220104 | ||
|
5c1fc43610 | ||
|
cfbd7e3bf5 | ||
|
c8ca1cfa3c | ||
|
5cfbb0a423 | ||
|
900ec143a8 | ||
|
7bda3d0f74 | ||
|
7650786fb5 | ||
|
ca60d08621 | ||
|
b34218c8c2 | ||
|
b14a59629c | ||
|
0914bf8cf0 | ||
|
7bdca83de3 | ||
|
846f03504e | ||
|
01e8fd0b07 | ||
|
7f301c44b7 | ||
|
51a25fdec9 | ||
|
2b681c37ac | ||
|
cb4ebfdbd2 | ||
|
206c85222c | ||
|
18071e038e | ||
|
39f7ce15ad | ||
|
e39b42bbd3 | ||
|
607d8f72e8 | ||
|
c483f75fb4 | ||
|
81f0175251 | ||
|
f753519729 | ||
|
f39693f97e | ||
|
f83ae0e39e | ||
|
521d371b5d | ||
|
b23d551d00 | ||
|
1b20cc6075 | ||
|
2043e12ac2 | ||
|
9461bc948f | ||
|
9740ab8bd6 | ||
|
6947a6b1d4 | ||
|
4da8036222 | ||
|
e6b4006c70 | ||
|
8f5f7f1baa | ||
|
573d3eea87 | ||
|
eb84eec0f4 | ||
|
d7a31088ba | ||
|
a028e04ab9 | ||
|
a0520536df | ||
|
af137fd5d3 | ||
|
f7bc9f01c9 | ||
|
e4ce1ffd85 | ||
|
2384b49156 | ||
|
f5e71f64ed | ||
|
927ef22cf8 | ||
|
b6eaec1278 | ||
|
c7d1eb71da | ||
|
7d41d267a3 | ||
|
0ead65ad2d | ||
|
8c5481a3d5 | ||
|
741258051e | ||
|
0f4fc8635b | ||
|
d02d3f72fe | ||
|
710b69fc75 | ||
|
4fae382ffd | ||
|
68b94a3188 | ||
|
8e04f83232 | ||
|
cc9fd9f8ce | ||
|
1e8fcf1344 | ||
|
809c8305b1 | ||
|
652c7e8f37 | ||
|
beebca98fe | ||
|
ce67abc32f | ||
|
52cc482521 | ||
|
5eacad444d | ||
|
e8155cbbeb | ||
|
663376e385 | ||
|
3c590994db | ||
|
14c8564893 | ||
|
91a37f8868 | ||
|
1a2ff884b3 | ||
|
0298719be0 | ||
|
d0746da5e2 | ||
|
5b1cf33b1b | ||
|
54a1bbd016 | ||
|
455cd5551b | ||
|
b3e1783658 | ||
|
906c83af83 | ||
|
f9900cc6fb | ||
|
8e20187d8c | ||
|
28dac7ff0e | ||
|
e385b3d377 | ||
|
7e5c68c553 | ||
|
39ad7bc741 | ||
|
c2f9aab068 | ||
|
7e105343e2 | ||
|
fe2215df00 | ||
|
640bbaabbf | ||
|
da2965cb4e | ||
|
94ba242c33 | ||
|
debd5a5c5e | ||
|
98bbb84a63 | ||
|
9d908a11ed | ||
|
4d599e2f9f | ||
|
d3b33e5512 | ||
|
c8487cc395 | ||
|
0b3b5f6174 |
2015 changed files with 104969 additions and 410954 deletions
|
@ -1,75 +0,0 @@
|
||||||
---
|
|
||||||
BasedOnStyle: LLVM
|
|
||||||
BreakBeforeBraces: Stroustrup
|
|
||||||
IndentWidth: 4
|
|
||||||
TabWidth: 4
|
|
||||||
AlignAfterOpenBracket: AlwaysBreak
|
|
||||||
AlignConsecutiveMacros: 'true'
|
|
||||||
AlignConsecutiveAssignments: 'false'
|
|
||||||
AlignConsecutiveDeclarations: 'false'
|
|
||||||
AlignEscapedNewlines: Right
|
|
||||||
AlignOperands: 'true'
|
|
||||||
AlignTrailingComments: 'true'
|
|
||||||
AllowAllArgumentsOnNextLine: 'false'
|
|
||||||
AllowAllConstructorInitializersOnNextLine: 'false'
|
|
||||||
AllowAllParametersOfDeclarationOnNextLine: 'false'
|
|
||||||
AllowShortBlocksOnASingleLine: 'true'
|
|
||||||
AllowShortCaseLabelsOnASingleLine: 'false'
|
|
||||||
AllowShortFunctionsOnASingleLine: None
|
|
||||||
AllowShortIfStatementsOnASingleLine: Never
|
|
||||||
AlwaysBreakAfterReturnType: None
|
|
||||||
BinPackArguments: 'false'
|
|
||||||
BinPackParameters: 'false'
|
|
||||||
BreakBeforeBinaryOperators: NonAssignment
|
|
||||||
BreakBeforeTernaryOperators: 'true'
|
|
||||||
BreakConstructorInitializers: BeforeComma
|
|
||||||
BreakInheritanceList: BeforeComma
|
|
||||||
CompactNamespaces: 'false'
|
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: 'true'
|
|
||||||
ConstructorInitializerIndentWidth: '4'
|
|
||||||
ContinuationIndentWidth: '4'
|
|
||||||
Cpp11BracedListStyle: 'false'
|
|
||||||
FixNamespaceComments: 'true'
|
|
||||||
IncludeBlocks: Regroup
|
|
||||||
IndentCaseLabels: 'true'
|
|
||||||
IndentPPDirectives: None
|
|
||||||
IndentWrappedFunctionNames: 'false'
|
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: 'false'
|
|
||||||
MaxEmptyLinesToKeep: '1'
|
|
||||||
NamespaceIndentation: None
|
|
||||||
PointerAlignment: Left
|
|
||||||
ReflowComments: 'true'
|
|
||||||
SortIncludes: 'true'
|
|
||||||
SortUsingDeclarations: 'true'
|
|
||||||
SpaceAfterCStyleCast: 'false'
|
|
||||||
SpaceAfterLogicalNot: 'true'
|
|
||||||
SpaceAfterTemplateKeyword: 'true'
|
|
||||||
SpaceBeforeAssignmentOperators: 'true'
|
|
||||||
SpaceBeforeCpp11BracedList: 'true'
|
|
||||||
SpaceBeforeCtorInitializerColon: 'true'
|
|
||||||
SpaceBeforeInheritanceColon: 'true'
|
|
||||||
SpaceBeforeParens: ControlStatements
|
|
||||||
SpaceBeforeRangeBasedForLoopColon: 'true'
|
|
||||||
SpaceInEmptyParentheses: 'false'
|
|
||||||
SpacesBeforeTrailingComments: '3'
|
|
||||||
SpacesInAngles: 'false'
|
|
||||||
SpacesInCStyleCastParentheses: 'false'
|
|
||||||
SpacesInContainerLiterals: 'true'
|
|
||||||
SpacesInParentheses: 'false'
|
|
||||||
SpacesInSquareBrackets: 'false'
|
|
||||||
UseTab: 'Always'
|
|
||||||
|
|
||||||
---
|
|
||||||
Language: Cpp
|
|
||||||
Standard: Cpp03
|
|
||||||
ColumnLimit: '240'
|
|
||||||
---
|
|
||||||
Language: ObjC
|
|
||||||
ColumnLimit: '240'
|
|
||||||
---
|
|
||||||
Language: Java
|
|
||||||
ColumnLimit: '240'
|
|
||||||
---
|
|
||||||
Language: CSharp
|
|
||||||
ColumnLimit: '240'
|
|
||||||
...
|
|
6
.clangd
6
.clangd
|
@ -1,6 +0,0 @@
|
||||||
CompileFlags:
|
|
||||||
Add:
|
|
||||||
- "-std=c++17"
|
|
||||||
- "-I../ext"
|
|
||||||
- "-I../ext/prometheus-cpp-lite-1.0/core/include"
|
|
||||||
- "-I../ext/prometheus-cpp-lite-1.0/simpleapi/include"
|
|
|
@ -1,2 +1,3 @@
|
||||||
.git/
|
.git/
|
||||||
workspace/
|
build/
|
||||||
|
!build/zerotier
|
||||||
|
|
256
.drone.jsonnet
256
.drone.jsonnet
|
@ -1,256 +0,0 @@
|
||||||
//
|
|
||||||
// tweakables
|
|
||||||
//
|
|
||||||
|
|
||||||
local registry = "084037375216.dkr.ecr.us-east-2.amazonaws.com";
|
|
||||||
local build_channel = "zerotier-builds";
|
|
||||||
local release_channel = "zerotier-releases";
|
|
||||||
|
|
||||||
local targets = [
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el9", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el8", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el7", "isas": [ "386", "amd64", "ppc64le"], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "amazon", "name": "amzn2", "isas": [ "amd64", "arm64" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "amazon", "name": "amzn2022", "isas": [ "amd64", "arm64" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "fedora", "name": "fc38", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "fedora", "name": "fc37", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "fedora", "name": "fc36", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "jammy", "isas": [ "armv7", "amd64", "arm64", "ppc64le", "s390x", "riscv64" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "focal", "isas": [ "armv7", "amd64", "arm64", "ppc64le", "s390x", "riscv64" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "bionic", "isas": [ "386", "armv7", "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "xenial", "isas": [ "386", "armv7", "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "trusty", "isas": [ "386", "armv7", "amd64", "arm64" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "bookworm", "isas": [ "386", "armv7", "amd64", "arm64", "mips64le", "ppc64le", "s390x" ], "events": [ "tag"] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "bullseye", "isas": [ "386", "armv7", "amd64", "arm64", "mips64le", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "buster", "isas": [ "386", "armv7", "amd64", "arm64" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "stretch", "isas": [ "386", "armv7", "amd64", "arm64" ], "events": [ "tag" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "jessie", "isas": [ "386", "armv7", "amd64" ], "events": [ "tag" ] },
|
|
||||||
|
|
||||||
// { "os": "windows", distro: "windows", "name": "windows", "isas": [ "amd64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
// { "os": "darwin", distro: "darwin", "name": "darwin", "isas": [ "amd64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
local less_targets = [
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el9", "isas": [ "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el8", "isas": [ "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "jammy", "isas": [ "armv7", "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "focal", "isas": [ "armv7", "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
local native_targets = [
|
|
||||||
{ "os": "linux", distro: "debian", "name": "bullseye", "isas": [ "386", "armv7", "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
];
|
|
||||||
|
|
||||||
local master_targets = [
|
|
||||||
//
|
|
||||||
// copypasta from here
|
|
||||||
//
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el9", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el8", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "redhat", "name": "el7", "isas": [ "386", "amd64", "ppc64le"], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "amazon", "name": "amzn2", "isas": [ "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "amazon", "name": "amzn2022", "isas": [ "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "fedora", "name": "fc38", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "fedora", "name": "fc37", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "fedora", "name": "fc36", "isas": [ "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "jammy", "isas": [ "armv7", "amd64", "arm64", "ppc64le", "s390x", "riscv64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "focal", "isas": [ "armv7", "amd64", "arm64", "ppc64le", "s390x", "riscv64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "bionic", "isas": [ "386", "armv7", "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "xenial", "isas": [ "386", "armv7", "amd64", "arm64", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "ubuntu", "name": "trusty", "isas": [ "386", "armv7", "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "sid", "isas": [ "386", "armv7", "amd64", "arm64", "mips64le", "ppc64le", "s390x", "riscv64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "bookworm", "isas": [ "386", "armv7", "amd64", "arm64", "mips64le", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "bullseye", "isas": [ "386", "armv7", "amd64", "arm64", "mips64le", "ppc64le", "s390x" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "buster", "isas": [ "386", "armv7", "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "stretch", "isas": [ "386", "armv7", "amd64", "arm64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "linux", distro: "debian", "name": "jessie", "isas": [ "386", "armv7", "amd64" ], "events": [ "push", "tag", "custom" ] },
|
|
||||||
{ "os": "windows", distro: "windows", "name": "win2k22", "isas": [ "amd64" ], "events": [ "push", "tag", "custom" ] }
|
|
||||||
];
|
|
||||||
|
|
||||||
//
|
|
||||||
// functions
|
|
||||||
//
|
|
||||||
|
|
||||||
local pipeline_type(os) = if os == "darwin" then "exec" else "docker";
|
|
||||||
local builder_image(os) = if os == "linux" then registry + "/honda-builder" else registry + "/windows-builder";
|
|
||||||
local tester_image(os) = if os == "linux" then registry + "/honda-builder" else registry + "/windows-tester";
|
|
||||||
local build_step_volumes(os) = if os == "linux" then [ { name: "zerotier-builds", path: "/zerotier-builds" } ] else [];
|
|
||||||
local release_step_volumes(os) = if os == "linux" then [ { name: "zerotier-releases", path: "/zerotier-releases" } ] else [];
|
|
||||||
local host_volumes(os) = if os == "linux" then [
|
|
||||||
{ name: "zerotier-builds", host: { path: "/zerotier-builds" } },
|
|
||||||
{ name: "zerotier-releases", host: { path: "/zerotier-releases" } },
|
|
||||||
] else [];
|
|
||||||
|
|
||||||
local index_image(distro) =
|
|
||||||
if distro == "debian" || distro == "ubuntu" then
|
|
||||||
registry + "/apt-builder"
|
|
||||||
else if distro == "redhat" || distro == "fedora" || distro == "amazon" then
|
|
||||||
registry + "/dnf-builder"
|
|
||||||
else if distro == "windows" then
|
|
||||||
registry + "/msi-builder"
|
|
||||||
;
|
|
||||||
|
|
||||||
local copy_commands(os, distro, name, isa, version) =
|
|
||||||
if os == "linux" then [
|
|
||||||
std.join(" ", [ "./ci/scripts/publish.sh", name, distro, isa, version, "${DRONE_BUILD_EVENT}" ])
|
|
||||||
]
|
|
||||||
else if os == "windows" then [
|
|
||||||
"C:\\scripts\\fix-ec2-metadata.ps1",
|
|
||||||
"Get-ChildItem windows",
|
|
||||||
// "aws s3 cp windows\\bytey-SetupFiles\\bytey.msi s3://zerotier-builds/windows/" + version + "/bytey.msi",
|
|
||||||
] else if os == "darwin" then [
|
|
||||||
"echo hello"
|
|
||||||
]
|
|
||||||
;
|
|
||||||
|
|
||||||
local index_commands(os, channel, distro, name, isas) =
|
|
||||||
if os == "linux" then
|
|
||||||
[ "/usr/local/bin/index " + channel + " " + distro + " " + name + " " + std.join(" ", isas) ]
|
|
||||||
else if os == "windows" then
|
|
||||||
[ "Get-ChildItem -Recurse windows" ]
|
|
||||||
;
|
|
||||||
|
|
||||||
local build_commands(os, distro, name, isa, version) =
|
|
||||||
if os == "linux" then
|
|
||||||
[ std.join(" ", [ "./ci/scripts/build.sh", name, distro, isa, version, "${DRONE_BUILD_EVENT}" ]) ]
|
|
||||||
else
|
|
||||||
if os == "windows" then
|
|
||||||
[ "windows/build.ps1", "windows/package.ps1" ]
|
|
||||||
else
|
|
||||||
if os == "darwin" then
|
|
||||||
[ "whoami" ]
|
|
||||||
;
|
|
||||||
|
|
||||||
local test_commands(os, distro, name, isa, version) =
|
|
||||||
if os == "linux" then
|
|
||||||
[ std.join(" ", [ "./ci/scripts/test.sh", name, distro, isa, version, "${DRONE_BUILD_EVENT}" ]) ]
|
|
||||||
else
|
|
||||||
if os == "windows" then
|
|
||||||
[ "windows/testpackage.ps1 " + version ]
|
|
||||||
;
|
|
||||||
|
|
||||||
//
|
|
||||||
// render
|
|
||||||
//
|
|
||||||
|
|
||||||
local Build(os, distro, name, isa, events) = {
|
|
||||||
"kind": "pipeline",
|
|
||||||
"type": pipeline_type(os),
|
|
||||||
"name": std.join(" ", [ name, isa, "build" ]),
|
|
||||||
"pull": "always",
|
|
||||||
"clone": { "depth": 1, [ if os == "darwin" then "disable" ]: true },
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"name": "build",
|
|
||||||
"image": builder_image(os),
|
|
||||||
"commands": build_commands(os, distro, name, isa, "100.0.0+${DRONE_COMMIT_SHA:0:8}"),
|
|
||||||
"when": { "event": [ "push" ]},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "release",
|
|
||||||
"image": builder_image(os),
|
|
||||||
"commands": build_commands(os, distro, name, isa, "${DRONE_TAG}"),
|
|
||||||
"when": { "event": [ "tag" ]},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "copy build",
|
|
||||||
"image": builder_image(os),
|
|
||||||
"commands": copy_commands(os, distro, name, isa, "100.0.0+${DRONE_COMMIT_SHA:0:8}"),
|
|
||||||
"volumes": build_step_volumes(os),
|
|
||||||
"when": { "event": [ "push" ]},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "copy relase",
|
|
||||||
"image": builder_image(os),
|
|
||||||
"commands": copy_commands(os, distro, name, isa, "${DRONE_TAG}"),
|
|
||||||
"volumes": release_step_volumes(os),
|
|
||||||
"when": { "event": [ "tag" ]},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"volumes": host_volumes(os),
|
|
||||||
"platform": { "os": os, [ if isa == "arm64" || isa == "armv7" then "arch" ]: "arm64" },
|
|
||||||
"trigger": { "event": events }
|
|
||||||
};
|
|
||||||
|
|
||||||
local Test(os, distro, name, isa, events) = {
|
|
||||||
"kind": "pipeline",
|
|
||||||
"type": pipeline_type(os),
|
|
||||||
"name": std.join(" ", [ name, isa, "test"]),
|
|
||||||
"pull": "always",
|
|
||||||
"clone": { "depth": 1 },
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"name": "test build",
|
|
||||||
"image": tester_image(os),
|
|
||||||
"volumes": build_step_volumes(os),
|
|
||||||
"commands": test_commands(os, distro, name, isa, "100.0.0+${DRONE_COMMIT_SHA:0:8}"),
|
|
||||||
"when": { "event": [ "push" ]},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "test release",
|
|
||||||
"image": tester_image(os),
|
|
||||||
"volumes": release_step_volumes(os),
|
|
||||||
"commands": test_commands(os, distro, name, isa, "${DRONE_TAG}"),
|
|
||||||
"when": { "event": [ "tag" ]},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"volumes": host_volumes(os),
|
|
||||||
"platform": { "os": os, [ if isa == "arm64" || isa == "armv7" then "arch" ]: "arm64" },
|
|
||||||
"depends_on": [ std.join(" ", [ name, "index" ]) ],
|
|
||||||
"trigger": { "event": events }
|
|
||||||
};
|
|
||||||
|
|
||||||
local Index(p) = {
|
|
||||||
"kind": "pipeline",
|
|
||||||
"type": pipeline_type(p.os),
|
|
||||||
"name": std.join(" ", [ p.name, "index" ]),
|
|
||||||
"pull": "always",
|
|
||||||
"clone": { "depth": 1 },
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"name": "index build",
|
|
||||||
"image": index_image(p.distro),
|
|
||||||
"commands": index_commands(p.os, "zerotier-builds", p.distro, p.name, p.isas),
|
|
||||||
"volumes": build_step_volumes(p.os),
|
|
||||||
"environment":{ "GPG_PRIVATE_KEY": { from_secret: "gpg-private-key" }},
|
|
||||||
"when": { "event": [ "push" ]},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "index release",
|
|
||||||
"image": index_image(p.distro),
|
|
||||||
"commands": index_commands(p.os, "zerotier-releases", p.distro, p.name, p.isas),
|
|
||||||
"volumes": release_step_volumes(p.os),
|
|
||||||
"environment":{ "GPG_PRIVATE_KEY": { from_secret: "gpg-private-key" }},
|
|
||||||
"when": { "event": [ "tag" ]},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"volumes": host_volumes(p.os),
|
|
||||||
"platform": { "os": p.os },
|
|
||||||
depends_on: std.flattenArrays([ [ std.join(" ", [ p.name, isa, "build" ]) ] for isa in p.isas ]),
|
|
||||||
"trigger": { "event": p.events }
|
|
||||||
};
|
|
||||||
|
|
||||||
//
|
|
||||||
// print
|
|
||||||
//
|
|
||||||
|
|
||||||
std.flattenArrays([
|
|
||||||
[
|
|
||||||
Build(p.os, p.distro, p.name, isa, p.events)
|
|
||||||
for isa in p.isas
|
|
||||||
] +
|
|
||||||
[
|
|
||||||
Index(p)
|
|
||||||
]
|
|
||||||
for p in native_targets
|
|
||||||
]) +
|
|
||||||
std.flattenArrays([
|
|
||||||
[
|
|
||||||
Test(p.os, p.distro, p.name, isa, p.events)
|
|
||||||
for isa in p.isas
|
|
||||||
]
|
|
||||||
for p in native_targets
|
|
||||||
])
|
|
||||||
|
|
465
.drone.yml
465
.drone.yml
|
@ -1,465 +0,0 @@
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye 386 build
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian 386 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: build
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian 386 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: release
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian 386 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian 386 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy relase
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye armv7 build
|
|
||||||
platform:
|
|
||||||
arch: arm64
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian armv7 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: build
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian armv7 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: release
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian armv7 100.0.0+${DRONE_COMMIT_SHA:0:8}
|
|
||||||
${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian armv7 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy relase
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye amd64 build
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian amd64 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: build
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian amd64 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: release
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian amd64 100.0.0+${DRONE_COMMIT_SHA:0:8}
|
|
||||||
${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian amd64 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy relase
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye arm64 build
|
|
||||||
platform:
|
|
||||||
arch: arm64
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian arm64 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: build
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/build.sh bullseye debian arm64 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: release
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian arm64 100.0.0+${DRONE_COMMIT_SHA:0:8}
|
|
||||||
${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/publish.sh bullseye debian arm64 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: copy relase
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
depends_on:
|
|
||||||
- bullseye 386 build
|
|
||||||
- bullseye armv7 build
|
|
||||||
- bullseye amd64 build
|
|
||||||
- bullseye arm64 build
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye index
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- /usr/local/bin/index zerotier-builds debian bullseye 386 armv7 amd64 arm64
|
|
||||||
environment:
|
|
||||||
GPG_PRIVATE_KEY:
|
|
||||||
from_secret: gpg-private-key
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/apt-builder
|
|
||||||
name: index build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- /usr/local/bin/index zerotier-releases debian bullseye 386 armv7 amd64 arm64
|
|
||||||
environment:
|
|
||||||
GPG_PRIVATE_KEY:
|
|
||||||
from_secret: gpg-private-key
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/apt-builder
|
|
||||||
name: index release
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
depends_on:
|
|
||||||
- bullseye index
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye 386 test
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian 386 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian 386 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test release
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
depends_on:
|
|
||||||
- bullseye index
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye armv7 test
|
|
||||||
platform:
|
|
||||||
arch: arm64
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian armv7 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian armv7 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test release
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
depends_on:
|
|
||||||
- bullseye index
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye amd64 test
|
|
||||||
platform:
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian amd64 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian amd64 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test release
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
clone:
|
|
||||||
depth: 1
|
|
||||||
depends_on:
|
|
||||||
- bullseye index
|
|
||||||
kind: pipeline
|
|
||||||
name: bullseye arm64 test
|
|
||||||
platform:
|
|
||||||
arch: arm64
|
|
||||||
os: linux
|
|
||||||
pull: always
|
|
||||||
steps:
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian arm64 100.0.0+${DRONE_COMMIT_SHA:0:8} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test build
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-builds
|
|
||||||
path: /zerotier-builds
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- commands:
|
|
||||||
- ./ci/scripts/test.sh bullseye debian arm64 ${DRONE_TAG} ${DRONE_BUILD_EVENT}
|
|
||||||
image: 084037375216.dkr.ecr.us-east-2.amazonaws.com/honda-builder
|
|
||||||
name: test release
|
|
||||||
volumes:
|
|
||||||
- name: zerotier-releases
|
|
||||||
path: /zerotier-releases
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- tag
|
|
||||||
trigger:
|
|
||||||
event:
|
|
||||||
- push
|
|
||||||
- tag
|
|
||||||
- custom
|
|
||||||
type: docker
|
|
||||||
volumes:
|
|
||||||
- host:
|
|
||||||
path: /zerotier-builds
|
|
||||||
name: zerotier-builds
|
|
||||||
- host:
|
|
||||||
path: /zerotier-releases
|
|
||||||
name: zerotier-releases
|
|
||||||
---
|
|
||||||
kind: signature
|
|
||||||
hmac: 887a3ef78d3fe8f0149911e1e4876401dd7dd313b36eb893e791fa42f45d7768
|
|
||||||
|
|
||||||
...
|
|
4
.gitattributes
vendored
4
.gitattributes
vendored
|
@ -1,4 +0,0 @@
|
||||||
ext/bin/tap-windows-ndis6/x64/zttap300.inf eol=crlf
|
|
||||||
ext/bin/tap-windows-ndis6/x64.old/zttap300.inf eol=crlf
|
|
||||||
ext/bin/tap-windows-ndis6/x86/zttap300.inf eol=crlf
|
|
||||||
windows/TapDriver6/zttap300.inf eol=crlf
|
|
46
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
46
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
|
||||||
|
---
|
||||||
|
**Alternative, faster ways to get help**
|
||||||
|
If you have just started using ZeroTier, here are some places to get help:
|
||||||
|
- my.zerotier.com has a _Community_ tab. It's a live chat with other users and the developers.
|
||||||
|
- [ZeroTier Knowledge Base](https://zerotier.atlassian.net/wiki/spaces/SD/overview)
|
||||||
|
- www.zerotier.com has a Contact Us button
|
||||||
|
- email contact@zerotier.com
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Create a Network '...'
|
||||||
|
2. Install zerotier-one '....'
|
||||||
|
3. '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots or console output to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
- OS: [e.g. Mac, Linux, Windows, BSD]
|
||||||
|
- OS/Distribution Version
|
||||||
|
- ZeroTier Version [e.g. 1.2.4]
|
||||||
|
- Hardware [e.g. raspberry pi 3]
|
||||||
|
|
||||||
|
**Smartphone (please complete the following information):**
|
||||||
|
- Device: [e.g. iPhone6]
|
||||||
|
- OS: [e.g. iOS8.1]
|
||||||
|
- Version [e.g. 1.2.4]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
|
- ZeroTier Network Configuration
|
||||||
|
- Router Config
|
||||||
|
- Firewall Config (try turning the firewall off)
|
||||||
|
- General Network Environment: [ e.g Home, University Campus, Corporate LAN ]
|
||||||
|
|
31
.github/ISSUE_TEMPLATE/bugs-and-issues.md
vendored
31
.github/ISSUE_TEMPLATE/bugs-and-issues.md
vendored
|
@ -1,31 +0,0 @@
|
||||||
---
|
|
||||||
name: Bugs and Issues
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: ''
|
|
||||||
labels: NEEDS TRIAGE
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Before filing a Bug Report
|
|
||||||
|
|
||||||
_Using these will ensure you get quicker support, and make this space available for code-related issues. Thank you!_
|
|
||||||
|
|
||||||
- [Docs Site](https://docs.zerotier.com/zerotier/troubleshooting) => Troubleshooting, quickstarts, and more advanced topics.
|
|
||||||
- [Discuss Forum](https://discuss.zerotier.com/) => Our discussion forum for users and support to mutually resolve issues & suggest ideas.
|
|
||||||
- [Reddit](https://www.reddit.com/r/zerotier/) => Our subreddit, which we monitor regularly and is fairly active.
|
|
||||||
- [Knowledge Base](https://zerotier.atlassian.net/wiki/spaces/SD/overview) => Older wiki.
|
|
||||||
|
|
||||||
If you are having a connection issue, it's much easier to diagnose through the discussion forum or the ticket system.
|
|
||||||
|
|
||||||
|
|
||||||
# If you still want to file a Bug Report
|
|
||||||
|
|
||||||
## Please let us know
|
|
||||||
|
|
||||||
- What you expect to be happening.
|
|
||||||
- What is actually happening?
|
|
||||||
- Any steps to reproduce the error.
|
|
||||||
- Any relevant console output or screenshots.
|
|
||||||
- What operating system and ZeroTier version. Please try the latest ZeroTier release.
|
|
||||||
|
|
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
14
.github/ISSUE_TEMPLATE/feature_request.md
vendored
|
@ -1,13 +1,17 @@
|
||||||
---
|
---
|
||||||
name: Feature request
|
name: Feature request
|
||||||
about: Suggest an idea for this project
|
about: Suggest an idea for this project
|
||||||
title: "[Feature Request] "
|
|
||||||
labels: suggestion
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
If there is something you'd like to have added to ZeroTier, to go to https://discuss.zerotier.com/c/feature-requests/ instead. Issues there can be voted on and discussed in-depth.
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
Thank you!
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
|
|
15
.github/ISSUE_TEMPLATE/game-connection-issue.md
vendored
15
.github/ISSUE_TEMPLATE/game-connection-issue.md
vendored
|
@ -1,15 +0,0 @@
|
||||||
---
|
|
||||||
name: Game Connection Issue
|
|
||||||
about: Game issues are better served by forum posts
|
|
||||||
title: Please go to our Discuss or Reddit for game-related issues. Thanks!
|
|
||||||
labels: wontfix
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Are you having trouble connecting to a game on your virtual network after installing ZeroTier?
|
|
||||||
|
|
||||||
- [ ] Yes
|
|
||||||
- [ ] No
|
|
||||||
|
|
||||||
If you answered yes, then it is very likely that your question would be better answered on our [Community Forums](https://discuss.zerotier.com) or [Reddit](https://www.reddit.com/r/zerotier/) community; we monitor both regularly. We also have extensive documentation on our [Knowledge Base](https://zerotier.atlassian.net/wiki/spaces/SD/overview). Thank you!
|
|
126
.github/workflows/build.yml
vendored
126
.github/workflows/build.yml
vendored
|
@ -1,126 +0,0 @@
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_ubuntu:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: gitconfig
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf input
|
|
||||||
# git config --global core.eol lf
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
targets: x86_64-unknown-linux-gnu
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- name: Set up cargo cache
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
continue-on-error: false
|
|
||||||
with:
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
|
|
||||||
shared-key: ${{ runner.os }}-cargo-
|
|
||||||
workspaces: |
|
|
||||||
rustybits/
|
|
||||||
|
|
||||||
- name: make
|
|
||||||
run: make
|
|
||||||
- name: selftest
|
|
||||||
run: |
|
|
||||||
make selftest
|
|
||||||
./zerotier-selftest
|
|
||||||
- name: 'Tar files' # keeps permissions (execute)
|
|
||||||
run: tar -cvf zerotier-one.tar zerotier-one
|
|
||||||
- name: Archive production artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: zerotier-one-ubuntu-x64
|
|
||||||
path: zerotier-one.tar
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
build_macos:
|
|
||||||
runs-on: macos-latest
|
|
||||||
steps:
|
|
||||||
- name: gitconfig
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf input
|
|
||||||
# git config --global core.eol lf
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install Rust aarch64
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: aarch64-apple-darwin
|
|
||||||
components: rustfmt, clippy
|
|
||||||
- name: Install Rust x86_64
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: x86_64-apple-darwin
|
|
||||||
components: rustfmt, clippy
|
|
||||||
- name: Set up cargo cache
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
continue-on-error: false
|
|
||||||
with:
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
|
|
||||||
shared-key: ${{ runner.os }}-cargo-
|
|
||||||
workspaces: |
|
|
||||||
rustybits/
|
|
||||||
- name: make
|
|
||||||
run: make
|
|
||||||
- name: selftest
|
|
||||||
run: |
|
|
||||||
make selftest
|
|
||||||
./zerotier-selftest
|
|
||||||
- name: 'Tar files' # keeps permissions (execute)
|
|
||||||
run: tar -cvf zerotier-one.tar zerotier-one
|
|
||||||
- name: Archive production artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: zerotier-one-mac
|
|
||||||
path: zerotier-one.tar
|
|
||||||
retention-days: 7
|
|
||||||
|
|
||||||
|
|
||||||
build_windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- name: gitconfig
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf true
|
|
||||||
# git config --global core.eol lf
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Install Rust
|
|
||||||
uses: dtolnay/rust-toolchain@stable
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: aarch64-apple-darwin
|
|
||||||
components: rustfmt, clippy
|
|
||||||
- name: Set up cargo cache
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
continue-on-error: false
|
|
||||||
with:
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('rustybits//Cargo.lock') }}
|
|
||||||
shared-key: ${{ runner.os }}-cargo-
|
|
||||||
workspaces: |
|
|
||||||
rustybits/
|
|
||||||
|
|
||||||
- name: setup msbuild
|
|
||||||
uses: microsoft/setup-msbuild@v2
|
|
||||||
- name: msbuild
|
|
||||||
run: |
|
|
||||||
msbuild windows\ZeroTierOne.sln /m /p:Configuration=Release /property:Platform=x64 /t:ZeroTierOne
|
|
||||||
- name: Archive production artifacts
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: zerotier-one-windows
|
|
||||||
path: windows/Build
|
|
||||||
retention-days: 7
|
|
497
.github/workflows/validate-linux.sh
vendored
497
.github/workflows/validate-linux.sh
vendored
|
@ -1,497 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# This test script joins Earth and pokes some stuff
|
|
||||||
|
|
||||||
TEST_NETWORK=8056c2e21c000001
|
|
||||||
RUN_LENGTH=30
|
|
||||||
TEST_FINISHED=false
|
|
||||||
ZTO_VER=$(git describe --tags $(git rev-list --tags --max-count=1))
|
|
||||||
ZTO_COMMIT=$(git rev-parse HEAD)
|
|
||||||
ZTO_COMMIT_SHORT=$(git rev-parse --short HEAD)
|
|
||||||
TEST_DIR_PREFIX="$ZTO_VER-$ZTO_COMMIT_SHORT-test-results"
|
|
||||||
|
|
||||||
TEST_OK=0
|
|
||||||
TEST_FAIL=1
|
|
||||||
|
|
||||||
echo "Performing test on: $ZTO_VER-$ZTO_COMMIT_SHORT"
|
|
||||||
TEST_FILEPATH_PREFIX="$TEST_DIR_PREFIX/$ZTO_COMMIT_SHORT"
|
|
||||||
mkdir $TEST_DIR_PREFIX
|
|
||||||
|
|
||||||
# How long we will wait for ZT to come online before considering it a failure
|
|
||||||
MAX_WAIT_SECS=30
|
|
||||||
|
|
||||||
ZT_PORT_NODE_1=9996
|
|
||||||
ZT_PORT_NODE_2=9997
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Multi-node connectivity and performance test #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
test() {
|
|
||||||
|
|
||||||
echo -e "\nPerforming pre-flight checks"
|
|
||||||
|
|
||||||
check_exit_on_invalid_identity
|
|
||||||
|
|
||||||
echo -e "\nRunning test for $RUN_LENGTH seconds"
|
|
||||||
|
|
||||||
export NS1="ip netns exec ns1"
|
|
||||||
export NS2="ip netns exec ns2"
|
|
||||||
|
|
||||||
export ZT1="$NS1 ./zerotier-cli -p9996 -D$(pwd)/node1"
|
|
||||||
# Specify custom port on one node to ensure that feature works
|
|
||||||
export ZT2="$NS2 ./zerotier-cli -p9997 -D$(pwd)/node2"
|
|
||||||
|
|
||||||
echo -e "\nSetting up network namespaces..."
|
|
||||||
echo "Setting up ns1"
|
|
||||||
|
|
||||||
ip netns add ns1
|
|
||||||
$NS1 ip link set dev lo up
|
|
||||||
ip link add veth0 type veth peer name veth1
|
|
||||||
ip link set veth1 netns ns1
|
|
||||||
ip addr add 192.168.0.1/24 dev veth0
|
|
||||||
ip link set dev veth0 up
|
|
||||||
|
|
||||||
$NS1 ip addr add 192.168.0.2/24 dev veth1
|
|
||||||
$NS1 ip link set dev veth1 up
|
|
||||||
|
|
||||||
# Add default route
|
|
||||||
$NS1 ip route add default via 192.168.0.1
|
|
||||||
|
|
||||||
iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 \
|
|
||||||
-o eth0 -j MASQUERADE
|
|
||||||
iptables -A FORWARD -i eth0 -o veth0 -j ACCEPT
|
|
||||||
iptables -A FORWARD -o eth0 -i veth0 -j ACCEPT
|
|
||||||
|
|
||||||
echo "Setting up ns2"
|
|
||||||
ip netns add ns2
|
|
||||||
$NS2 ip link set dev lo up
|
|
||||||
ip link add veth2 type veth peer name veth3
|
|
||||||
ip link set veth3 netns ns2
|
|
||||||
ip addr add 192.168.1.1/24 dev veth2
|
|
||||||
ip link set dev veth2 up
|
|
||||||
|
|
||||||
$NS2 ip addr add 192.168.1.2/24 dev veth3
|
|
||||||
$NS2 ip link set dev veth3 up
|
|
||||||
$NS2 ip route add default via 192.168.1.1
|
|
||||||
|
|
||||||
iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 \
|
|
||||||
-o eth0 -j MASQUERADE
|
|
||||||
iptables -A FORWARD -i eth0 -o veth2 -j ACCEPT
|
|
||||||
iptables -A FORWARD -o eth0 -i veth2 -j ACCEPT
|
|
||||||
|
|
||||||
# Allow forwarding
|
|
||||||
sysctl -w net.ipv4.ip_forward=1
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Memory Leak Check #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
export FILENAME_MEMORY_LOG="$TEST_FILEPATH_PREFIX-memory.log"
|
|
||||||
|
|
||||||
echo -e "\nStarting a ZeroTier instance in each namespace..."
|
|
||||||
|
|
||||||
export time_test_start=$(date +%s)
|
|
||||||
|
|
||||||
# Spam the CLI as ZeroTier is starting
|
|
||||||
spam_cli 100
|
|
||||||
|
|
||||||
echo "Starting memory leak check"
|
|
||||||
$NS1 sudo valgrind --demangle=yes --exit-on-first-error=yes \
|
|
||||||
--error-exitcode=1 \
|
|
||||||
--xml=yes \
|
|
||||||
--xml-file=$FILENAME_MEMORY_LOG \
|
|
||||||
--leak-check=full \
|
|
||||||
./zerotier-one node1 -p$ZT_PORT_NODE_1 -U >>node_1.log 2>&1 &
|
|
||||||
|
|
||||||
# Second instance, not run in memory profiler
|
|
||||||
# Don't set up internet access until _after_ zerotier is running
|
|
||||||
# This has been a source of stuckness in the past.
|
|
||||||
$NS2 ip addr del 192.168.1.2/24 dev veth3
|
|
||||||
$NS2 sudo ./zerotier-one node2 -U -p$ZT_PORT_NODE_2 >>node_2.log 2>&1 &
|
|
||||||
|
|
||||||
sleep 10; # New HTTP control plane is a bit sluggish, so we delay here
|
|
||||||
|
|
||||||
check_bind_to_correct_ports $ZT_PORT_NODE_1
|
|
||||||
check_bind_to_correct_ports $ZT_PORT_NODE_2
|
|
||||||
|
|
||||||
$NS2 ip addr add 192.168.1.2/24 dev veth3
|
|
||||||
$NS2 ip route add default via 192.168.1.1
|
|
||||||
|
|
||||||
echo -e "\nPing from host to namespaces"
|
|
||||||
|
|
||||||
ping -c 3 192.168.0.1
|
|
||||||
ping -c 3 192.168.1.1
|
|
||||||
|
|
||||||
echo -e "\nPing from namespace to host"
|
|
||||||
|
|
||||||
$NS1 ping -c 3 192.168.0.1
|
|
||||||
$NS1 ping -c 3 192.168.0.1
|
|
||||||
$NS2 ping -c 3 192.168.0.2
|
|
||||||
$NS2 ping -c 3 192.168.0.2
|
|
||||||
|
|
||||||
echo -e "\nPing from ns1 to ns2"
|
|
||||||
|
|
||||||
$NS1 ping -c 3 192.168.0.1
|
|
||||||
|
|
||||||
echo -e "\nPing from ns2 to ns1"
|
|
||||||
|
|
||||||
$NS2 ping -c 3 192.168.0.1
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Online Check #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
echo "Waiting for ZeroTier to come online before attempting test..."
|
|
||||||
node1_online=false
|
|
||||||
node2_online=false
|
|
||||||
both_instances_online=false
|
|
||||||
time_zt_node1_start=$(date +%s)
|
|
||||||
time_zt_node2_start=$(date +%s)
|
|
||||||
|
|
||||||
for ((s = 0; s <= $MAX_WAIT_SECS; s++)); do
|
|
||||||
node1_online="$($ZT1 -j info | jq '.online' 2>/dev/null)"
|
|
||||||
node2_online="$($ZT2 -j info | jq '.online' 2>/dev/null)"
|
|
||||||
echo "Checking for online status: try #$s, node1:$node1_online, node2:$node2_online"
|
|
||||||
if [[ "$node2_online" == "true" && "$node1_online" == "true" ]]; then
|
|
||||||
export both_instances_online=true
|
|
||||||
export time_to_both_nodes_online=$(date +%s)
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
echo -e "\n\nContents of ZeroTier home paths:"
|
|
||||||
|
|
||||||
ls -lga node1
|
|
||||||
tree node1
|
|
||||||
ls -lga node2
|
|
||||||
tree node2
|
|
||||||
|
|
||||||
echo -e "\n\nRunning ZeroTier processes:"
|
|
||||||
echo -e "\nNode 1:\n"
|
|
||||||
$NS1 ps aux | grep zerotier-one
|
|
||||||
echo -e "\nNode 2:\n"
|
|
||||||
$NS2 ps aux | grep zerotier-one
|
|
||||||
|
|
||||||
echo -e "\n\nStatus of each instance:"
|
|
||||||
|
|
||||||
echo -e "\n\nNode 1:\n"
|
|
||||||
$ZT1 status
|
|
||||||
echo -e "\n\nNode 2:\n"
|
|
||||||
$ZT2 status
|
|
||||||
|
|
||||||
if [[ "$both_instances_online" != "true" ]]; then
|
|
||||||
exit_test_and_generate_report $TEST_FAIL "one or more nodes failed to come online"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\nJoining networks"
|
|
||||||
|
|
||||||
$ZT1 join $TEST_NETWORK
|
|
||||||
$ZT2 join $TEST_NETWORK
|
|
||||||
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
node1_ip4=$($ZT1 get $TEST_NETWORK ip4)
|
|
||||||
node2_ip4=$($ZT2 get $TEST_NETWORK ip4)
|
|
||||||
|
|
||||||
echo "node1_ip4=$node1_ip4"
|
|
||||||
echo "node2_ip4=$node2_ip4"
|
|
||||||
|
|
||||||
echo -e "\nPinging each node"
|
|
||||||
|
|
||||||
PING12_FILENAME="$TEST_FILEPATH_PREFIX-ping-1-to-2.txt"
|
|
||||||
PING21_FILENAME="$TEST_FILEPATH_PREFIX-ping-2-to-1.txt"
|
|
||||||
|
|
||||||
$NS1 ping -c 16 $node2_ip4 >$PING12_FILENAME
|
|
||||||
$NS2 ping -c 16 $node1_ip4 >$PING21_FILENAME
|
|
||||||
|
|
||||||
ping_loss_percent_1_to_2=$(cat $PING12_FILENAME |
|
|
||||||
grep "packet loss" | awk '{print $6}' | sed 's/%//')
|
|
||||||
ping_loss_percent_2_to_1=$(cat $PING21_FILENAME |
|
|
||||||
grep "packet loss" | awk '{print $6}' | sed 's/%//')
|
|
||||||
|
|
||||||
# Normalize loss value
|
|
||||||
export ping_loss_percent_1_to_2=$(echo "scale=2; $ping_loss_percent_1_to_2/100.0" | bc)
|
|
||||||
export ping_loss_percent_2_to_1=$(echo "scale=2; $ping_loss_percent_2_to_1/100.0" | bc)
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# CLI Check #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
echo "Testing basic CLI functionality..."
|
|
||||||
|
|
||||||
spam_cli 10
|
|
||||||
|
|
||||||
$ZT1 join $TEST_NETWORK
|
|
||||||
|
|
||||||
$ZT1 -h
|
|
||||||
$ZT1 -v
|
|
||||||
$ZT1 status
|
|
||||||
$ZT1 info
|
|
||||||
$ZT1 listnetworks
|
|
||||||
$ZT1 peers
|
|
||||||
$ZT1 listpeers
|
|
||||||
|
|
||||||
$ZT1 -j status
|
|
||||||
$ZT1 -j info
|
|
||||||
$ZT1 -j listnetworks
|
|
||||||
$ZT1 -j peers
|
|
||||||
$ZT1 -j listpeers
|
|
||||||
|
|
||||||
$ZT1 dump
|
|
||||||
|
|
||||||
$ZT1 get $TEST_NETWORK allowDNS
|
|
||||||
$ZT1 get $TEST_NETWORK allowDefault
|
|
||||||
$ZT1 get $TEST_NETWORK allowGlobal
|
|
||||||
$ZT1 get $TEST_NETWORK allowManaged
|
|
||||||
$ZT1 get $TEST_NETWORK bridge
|
|
||||||
$ZT1 get $TEST_NETWORK broadcastEnabled
|
|
||||||
$ZT1 get $TEST_NETWORK dhcp
|
|
||||||
$ZT1 get $TEST_NETWORK id
|
|
||||||
$ZT1 get $TEST_NETWORK mac
|
|
||||||
$ZT1 get $TEST_NETWORK mtu
|
|
||||||
$ZT1 get $TEST_NETWORK name
|
|
||||||
$ZT1 get $TEST_NETWORK netconfRevision
|
|
||||||
$ZT1 get $TEST_NETWORK nwid
|
|
||||||
$ZT1 get $TEST_NETWORK portDeviceName
|
|
||||||
$ZT1 get $TEST_NETWORK portError
|
|
||||||
$ZT1 get $TEST_NETWORK status
|
|
||||||
$ZT1 get $TEST_NETWORK type
|
|
||||||
|
|
||||||
# Test an invalid command
|
|
||||||
$ZT1 get $TEST_NETWORK derpderp
|
|
||||||
|
|
||||||
# TODO: Validate JSON
|
|
||||||
|
|
||||||
# Performance Test
|
|
||||||
|
|
||||||
export FILENAME_PERF_JSON="$TEST_FILEPATH_PREFIX-iperf.json"
|
|
||||||
|
|
||||||
echo -e "\nBeginning performance test:"
|
|
||||||
|
|
||||||
echo -e "\nStarting server:"
|
|
||||||
|
|
||||||
echo "$NS1 iperf3 -s &"
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
echo -e "\nStarting client:"
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
echo "$NS2 iperf3 --json -c $node1_ip4 > $FILENAME_PERF_JSON"
|
|
||||||
|
|
||||||
cat $FILENAME_PERF_JSON
|
|
||||||
|
|
||||||
# Let ZeroTier idle long enough for various timers
|
|
||||||
|
|
||||||
echo -e "\nIdling ZeroTier for $RUN_LENGTH seconds..."
|
|
||||||
sleep $RUN_LENGTH
|
|
||||||
|
|
||||||
echo -e "\nLeaving networks"
|
|
||||||
|
|
||||||
$ZT1 leave $TEST_NETWORK
|
|
||||||
$ZT2 leave $TEST_NETWORK
|
|
||||||
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
exit_test_and_generate_report $TEST_OK "completed test"
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Generate report #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
exit_test_and_generate_report() {
|
|
||||||
|
|
||||||
echo -e "\nStopping memory check..."
|
|
||||||
sudo pkill -15 -f valgrind
|
|
||||||
sleep 10
|
|
||||||
|
|
||||||
time_test_end=$(date +%s)
|
|
||||||
|
|
||||||
echo "Exiting test with reason: $2 ($1)"
|
|
||||||
|
|
||||||
# Collect ZeroTier dump files
|
|
||||||
|
|
||||||
echo -e "\nCollecting ZeroTier dump files"
|
|
||||||
|
|
||||||
node1_id=$($ZT1 -j status | jq -r .address)
|
|
||||||
node2_id=$($ZT2 -j status | jq -r .address)
|
|
||||||
|
|
||||||
$ZT1 dump
|
|
||||||
mv zerotier_dump.txt "$TEST_FILEPATH_PREFIX-node-dump-$node1_id.txt"
|
|
||||||
|
|
||||||
$ZT2 dump
|
|
||||||
mv zerotier_dump.txt "$TEST_FILEPATH_PREFIX-node-dump-$node2_id.txt"
|
|
||||||
|
|
||||||
# Copy ZeroTier stdout/stderr logs
|
|
||||||
|
|
||||||
cp node_1.log "$TEST_FILEPATH_PREFIX-node-log-$node1_id.txt"
|
|
||||||
cp node_2.log "$TEST_FILEPATH_PREFIX-node-log-$node2_id.txt"
|
|
||||||
|
|
||||||
# Generate report
|
|
||||||
|
|
||||||
cat $FILENAME_MEMORY_LOG
|
|
||||||
|
|
||||||
DEFINITELY_LOST=$(xmlstarlet sel -t -v '/valgrindoutput/error/xwhat' \
|
|
||||||
$FILENAME_MEMORY_LOG | grep "definitely" | awk '{print $1;}')
|
|
||||||
POSSIBLY_LOST=$(xmlstarlet sel -t -v '/valgrindoutput/error/xwhat' \
|
|
||||||
$FILENAME_MEMORY_LOG | grep "possibly" | awk '{print $1;}')
|
|
||||||
|
|
||||||
# Generate coverage report artifact and summary
|
|
||||||
|
|
||||||
FILENAME_COVERAGE_JSON="$TEST_FILEPATH_PREFIX-coverage.json"
|
|
||||||
FILENAME_COVERAGE_HTML="$TEST_FILEPATH_PREFIX-coverage.html"
|
|
||||||
|
|
||||||
echo -e "\nGenerating coverage test report..."
|
|
||||||
|
|
||||||
gcovr -r . --exclude ext --json-summary $FILENAME_COVERAGE_JSON \
|
|
||||||
--html >$FILENAME_COVERAGE_HTML
|
|
||||||
|
|
||||||
cat $FILENAME_COVERAGE_JSON
|
|
||||||
|
|
||||||
COVERAGE_LINE_COVERED=$(cat $FILENAME_COVERAGE_JSON | jq .line_covered)
|
|
||||||
COVERAGE_LINE_TOTAL=$(cat $FILENAME_COVERAGE_JSON | jq .line_total)
|
|
||||||
COVERAGE_LINE_PERCENT=$(cat $FILENAME_COVERAGE_JSON | jq .line_percent)
|
|
||||||
|
|
||||||
COVERAGE_LINE_COVERED="${COVERAGE_LINE_COVERED:-0}"
|
|
||||||
COVERAGE_LINE_TOTAL="${COVERAGE_LINE_TOTAL:-0}"
|
|
||||||
COVERAGE_LINE_PERCENT="${COVERAGE_LINE_PERCENT:-0}"
|
|
||||||
|
|
||||||
# Default values
|
|
||||||
|
|
||||||
DEFINITELY_LOST="${DEFINITELY_LOST:-0}"
|
|
||||||
POSSIBLY_LOST="${POSSIBLY_LOST:-0}"
|
|
||||||
ping_loss_percent_1_to_2="${ping_loss_percent_1_to_2:-100.0}"
|
|
||||||
ping_loss_percent_2_to_1="${ping_loss_percent_2_to_1:-100.0}"
|
|
||||||
time_to_both_nodes_online="${time_to_both_nodes_online:--1}"
|
|
||||||
|
|
||||||
# Summarize and emit json for trend reporting
|
|
||||||
|
|
||||||
FILENAME_SUMMARY="$TEST_FILEPATH_PREFIX-summary.json"
|
|
||||||
|
|
||||||
time_length_test=$((time_test_end - time_test_start))
|
|
||||||
if [[ $time_to_both_nodes_online != -1 ]];
|
|
||||||
then
|
|
||||||
time_to_both_nodes_online=$((time_to_both_nodes_online - time_test_start))
|
|
||||||
fi
|
|
||||||
#time_length_zt_join=$((time_zt_join_end-time_zt_join_start))
|
|
||||||
#time_length_zt_leave=$((time_zt_leave_end-time_zt_leave_start))
|
|
||||||
#time_length_zt_can_still_ping=$((time_zt_can_still_ping-time_zt_leave_start))
|
|
||||||
|
|
||||||
summary=$(
|
|
||||||
cat <<EOF
|
|
||||||
{
|
|
||||||
"version":"$ZTO_VER",
|
|
||||||
"commit":"$ZTO_COMMIT",
|
|
||||||
"arch_m":"$(uname -m)",
|
|
||||||
"arch_a":"$(uname -a)",
|
|
||||||
"binary_size":"$(stat -c %s zerotier-one)",
|
|
||||||
"time_length_test":$time_length_test,
|
|
||||||
"time_to_both_nodes_online":$time_to_both_nodes_online,
|
|
||||||
"num_possible_bytes_lost": $POSSIBLY_LOST,
|
|
||||||
"num_definite_bytes_lost": $DEFINITELY_LOST,
|
|
||||||
"num_bad_formattings": $POSSIBLY_LOST,
|
|
||||||
"coverage_lines_covered": $COVERAGE_LINE_COVERED,
|
|
||||||
"coverage_lines_total": $COVERAGE_LINE_TOTAL,
|
|
||||||
"coverage_lines_percent": $COVERAGE_LINE_PERCENT,
|
|
||||||
"ping_loss_percent_1_to_2": $ping_loss_percent_1_to_2,
|
|
||||||
"ping_loss_percent_2_to_1": $ping_loss_percent_2_to_1,
|
|
||||||
"test_exit_code": $1,
|
|
||||||
"test_exit_reason":"$2"
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
echo $summary >$FILENAME_SUMMARY
|
|
||||||
cat $FILENAME_SUMMARY
|
|
||||||
|
|
||||||
exit 0
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# CLI Check #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
spam_cli() {
|
|
||||||
echo "Spamming CLI..."
|
|
||||||
# Rapidly spam the CLI with joins/leaves
|
|
||||||
|
|
||||||
MAX_TRIES="${1:-10}"
|
|
||||||
|
|
||||||
for ((s = 0; s <= MAX_TRIES; s++)); do
|
|
||||||
$ZT1 status
|
|
||||||
$ZT2 status
|
|
||||||
sleep 0.1
|
|
||||||
done
|
|
||||||
|
|
||||||
SPAM_TRIES=128
|
|
||||||
|
|
||||||
for ((s = 0; s <= SPAM_TRIES; s++)); do
|
|
||||||
$ZT1 join $TEST_NETWORK
|
|
||||||
done
|
|
||||||
|
|
||||||
for ((s = 0; s <= SPAM_TRIES; s++)); do
|
|
||||||
$ZT1 leave $TEST_NETWORK
|
|
||||||
done
|
|
||||||
|
|
||||||
for ((s = 0; s <= SPAM_TRIES; s++)); do
|
|
||||||
$ZT1 leave $TEST_NETWORK
|
|
||||||
$ZT1 join $TEST_NETWORK
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Check for proper exit on load of invalid identity #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
check_exit_on_invalid_identity() {
|
|
||||||
echo "Checking ZeroTier exits on invalid identity..."
|
|
||||||
mkdir -p $(pwd)/exit_test
|
|
||||||
ZT1="sudo ./zerotier-one -p9999 $(pwd)/exit_test"
|
|
||||||
echo "asdfasdfasdfasdf" > $(pwd)/exit_test/identity.secret
|
|
||||||
echo "asdfasdfasdfasdf" > $(pwd)/exit_test/authtoken.secret
|
|
||||||
|
|
||||||
echo "Launch ZeroTier with an invalid identity"
|
|
||||||
$ZT1 &
|
|
||||||
my_pid=$!
|
|
||||||
|
|
||||||
echo "Waiting 5 seconds"
|
|
||||||
sleep 5
|
|
||||||
|
|
||||||
# check if process is running
|
|
||||||
kill -0 $my_pid
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
exit_test_and_generate_report $TEST_FAIL "Exit test FAILED: Process still running after being fed an invalid identity"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Check that we're binding to the primary port for TCP/TCP6/UDP #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
check_bind_to_correct_ports() {
|
|
||||||
PORT_NUMBER=$1
|
|
||||||
echo "Checking bound ports:"
|
|
||||||
sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier"
|
|
||||||
if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "tcp") ]];
|
|
||||||
then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to tcp/$1"
|
|
||||||
fi
|
|
||||||
if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "tcp6") ]];
|
|
||||||
then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to tcp6/$1"
|
|
||||||
fi
|
|
||||||
if [[ $(sudo netstat -anp | grep "$PORT_NUMBER" | grep "zerotier" | grep "udp") ]];
|
|
||||||
then
|
|
||||||
:
|
|
||||||
else
|
|
||||||
exit_test_and_generate_report $TEST_FAIL "ZeroTier did not bind to udp/$1"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
test "$@"
|
|
24
.github/workflows/validate-report.sh
vendored
24
.github/workflows/validate-report.sh
vendored
|
@ -1,24 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Set exit code depending on tool reports #
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
DEFINITELY_LOST=$(cat *test-results/*summary.json | jq .num_definite_bytes_lost)
|
|
||||||
EXIT_CODE=$(cat *test-results/*summary.json | jq .exit_code)
|
|
||||||
EXIT_REASON=$(cat *test-results/*summary.json | jq .exit_reason)
|
|
||||||
|
|
||||||
cat *test-results/*summary.json
|
|
||||||
|
|
||||||
echo -e "\nBytes of memory definitely lost: $DEFINITELY_LOST"
|
|
||||||
|
|
||||||
if [[ "$DEFINITELY_LOST" -gt 0 ]]; then
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Catch-all for other non-zero exit codes
|
|
||||||
|
|
||||||
if [[ "$EXIT_CODE" -gt 0 ]]; then
|
|
||||||
echo "Test failed: $EXIT_REASON"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
57
.github/workflows/validate.yml
vendored
57
.github/workflows/validate.yml
vendored
|
@ -1,57 +0,0 @@
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
push:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build_ubuntu:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: gitconfig
|
|
||||||
run: |
|
|
||||||
git config --global core.autocrlf input
|
|
||||||
|
|
||||||
- name: checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install Rust
|
|
||||||
uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
target: x86_64-unknown-linux-gnu
|
|
||||||
override: true
|
|
||||||
components: rustfmt, clippy
|
|
||||||
|
|
||||||
- name: Set up cargo cache
|
|
||||||
uses: Swatinem/rust-cache@v2
|
|
||||||
continue-on-error: false
|
|
||||||
with:
|
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('zeroidc//Cargo.lock') }}
|
|
||||||
shared-key: ${{ runner.os }}-cargo-
|
|
||||||
workspaces: |
|
|
||||||
zeroidc/
|
|
||||||
|
|
||||||
- name: validate-1m-linux
|
|
||||||
env:
|
|
||||||
CC: 'gcc'
|
|
||||||
CXX: 'g++'
|
|
||||||
BRANCH: ${{ github.ref_name }}
|
|
||||||
run: |
|
|
||||||
sudo apt install -y valgrind xmlstarlet gcovr iperf3 tree
|
|
||||||
make one ZT_COVERAGE=1 ZT_TRACE=1
|
|
||||||
sudo chmod +x ./.github/workflows/validate-linux.sh
|
|
||||||
sudo ./.github/workflows/validate-linux.sh
|
|
||||||
|
|
||||||
- name: Archive test results
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: ${{github.sha}}-test-results
|
|
||||||
path: "*test-results*"
|
|
||||||
|
|
||||||
- name: final-report
|
|
||||||
run: |
|
|
||||||
sudo chmod +x ./.github/workflows/validate-report.sh
|
|
||||||
sudo ./.github/workflows/validate-report.sh
|
|
||||||
|
|
139
.gitignore
vendored
Executable file → Normal file
139
.gitignore
vendored
Executable file → Normal file
|
@ -1,75 +1,31 @@
|
||||||
# Main binaries created in *nix builds
|
/build
|
||||||
/zerotier-one
|
/cmake-build-debug
|
||||||
/zerotier-idtool
|
/cmake-build-release
|
||||||
/zerotier-cli
|
/core/version.h
|
||||||
/zerotier-selftest
|
|
||||||
/zerotier
|
|
||||||
/nltest
|
|
||||||
|
|
||||||
# IDE stuff
|
|
||||||
/.idea
|
/.idea
|
||||||
/.nova
|
/.ide-*
|
||||||
/compile_commands.json
|
|
||||||
|
|
||||||
# OS-created garbage files from various platforms
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.Trashes
|
||||||
|
*.swp
|
||||||
|
._*
|
||||||
|
*~
|
||||||
|
*~.nib
|
||||||
|
*.secret
|
||||||
.Apple*
|
.Apple*
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
@eaDir
|
@eaDir
|
||||||
._*
|
.vscode
|
||||||
|
__pycache__
|
||||||
# Windows build droppings
|
|
||||||
/windows/ZeroTierOne.sdf
|
|
||||||
/windows/ZeroTierOne.v11.suo
|
|
||||||
/windows/x64
|
|
||||||
/windows/Win32
|
|
||||||
/windows/*/x64
|
|
||||||
/windows/*/Win32
|
|
||||||
/windows/ZeroTierOne/Release
|
|
||||||
/windows/ZeroTierOneService/obj
|
|
||||||
/windows/ZeroTierOneService/bin
|
|
||||||
/windows/Build
|
|
||||||
/windows/Debug
|
|
||||||
/windows/Release
|
|
||||||
/windows/WebUIWrapper/bin
|
|
||||||
/windows/WebUIWrapper/obj
|
|
||||||
/windows/lib
|
|
||||||
/ext/installfiles/windows/ZeroTier One-SetupFiles
|
|
||||||
/ext/installfiles/windows/*-cache
|
|
||||||
/ZeroTier One.msi
|
|
||||||
*.vcxproj.backup
|
|
||||||
/windows/TapDriver6/Win7Debug
|
|
||||||
/windows/TapDriver6/win7Release
|
|
||||||
/windows/*.db
|
|
||||||
/windows/*.opendb
|
|
||||||
enc_temp_folder
|
|
||||||
/windows/copyutil/bin
|
|
||||||
/windows/copyutil/obj
|
|
||||||
.vs/
|
|
||||||
|
|
||||||
# *nix/Mac build droppings
|
|
||||||
/build-*
|
|
||||||
/ZeroTierOneInstaller-*
|
|
||||||
/examples/docker/zerotier-one
|
|
||||||
/examples/docker/test-*.env
|
|
||||||
/world/mkworld
|
|
||||||
/world/*.c25519
|
|
||||||
zt1-src.tar.gz
|
|
||||||
/MacEthernetTapAgent
|
|
||||||
|
|
||||||
# Miscellaneous temporaries, build files, etc.
|
|
||||||
*.log
|
*.log
|
||||||
|
*.bak
|
||||||
*.opensdf
|
*.opensdf
|
||||||
*.user
|
*.user
|
||||||
*.cache
|
*.cache
|
||||||
|
*.obj
|
||||||
*.tlog
|
*.tlog
|
||||||
*.pid
|
*.pid
|
||||||
*.pkg
|
*.pkg
|
||||||
*.o
|
*.o
|
||||||
/*.a
|
|
||||||
*.dylib
|
|
||||||
*.so
|
|
||||||
*.so.*
|
|
||||||
*.o-*
|
*.o-*
|
||||||
*.core
|
*.core
|
||||||
*.deb
|
*.deb
|
||||||
|
@ -78,65 +34,6 @@ zt1-src.tar.gz
|
||||||
*.tmp
|
*.tmp
|
||||||
.depend
|
.depend
|
||||||
node_modules
|
node_modules
|
||||||
zt1_update_*
|
*.vcxproj.backup
|
||||||
debian/files
|
/*.db
|
||||||
debian/zerotier-one
|
/*.opendb
|
||||||
debian/zerotier-one*.debhelper
|
|
||||||
debian/*.log
|
|
||||||
debian/zerotier-one.substvars
|
|
||||||
root-watcher/config.json
|
|
||||||
|
|
||||||
# Java/Android/JNI build droppings
|
|
||||||
java/obj/
|
|
||||||
java/libs/
|
|
||||||
java/bin/
|
|
||||||
java/classes/
|
|
||||||
java/doc/
|
|
||||||
java/build_win64/
|
|
||||||
java/build_win32/
|
|
||||||
/java/mac32_64/
|
|
||||||
windows/WinUI/obj/
|
|
||||||
windows/WinUI/bin/
|
|
||||||
windows/ZeroTierOne/Debug/
|
|
||||||
/ext/installfiles/windows/chocolatey/zerotier-one/*.nupkg
|
|
||||||
|
|
||||||
# Miscellaneous mac/Xcode droppings
|
|
||||||
.DS_Store
|
|
||||||
.Trashes
|
|
||||||
*.swp
|
|
||||||
*~.nib
|
|
||||||
DerivedData/
|
|
||||||
*.pbxuser
|
|
||||||
*.mode1v3
|
|
||||||
*.mode2v3
|
|
||||||
*.perspectivev3
|
|
||||||
!default.pbxuser
|
|
||||||
!default.mode1v3
|
|
||||||
!default.mode2v3
|
|
||||||
!default.perspectivev3
|
|
||||||
*.xccheckout
|
|
||||||
xcuserdata/
|
|
||||||
.vscode
|
|
||||||
__pycache__
|
|
||||||
*~
|
|
||||||
attic/world/*.c25519
|
|
||||||
attic/world/mkworld
|
|
||||||
workspace/
|
|
||||||
workspace2/
|
|
||||||
zeroidc/target/
|
|
||||||
tcp-proxy/target
|
|
||||||
|
|
||||||
#snapcraft specifics
|
|
||||||
/parts/
|
|
||||||
/stage/
|
|
||||||
/prime/
|
|
||||||
|
|
||||||
*.snap
|
|
||||||
|
|
||||||
.snapcraft
|
|
||||||
__pycache__
|
|
||||||
*.pyc
|
|
||||||
*_source.tar.bz2
|
|
||||||
snap/.snapcraft
|
|
||||||
tcp-proxy/tcp-proxy
|
|
||||||
rustybits/target
|
|
||||||
|
|
14
.kick
14
.kick
|
@ -1,14 +0,0 @@
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
||||||
kick
|
|
28
AUTHORS.md
28
AUTHORS.md
|
@ -9,7 +9,7 @@
|
||||||
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)<br>
|
* Java JNI Interface to enable Android application development, and Android app itself (code for that is elsewhere)<br>
|
||||||
Grant Limberg / glimberg@gmail.com
|
Grant Limberg / glimberg@gmail.com
|
||||||
|
|
||||||
* ZeroTier SDK (formerly known as Network Containers)<br>
|
* ZeroTier SDK / libzt<br>
|
||||||
Joseph Henry / joseph.henry@zerotier.com
|
Joseph Henry / joseph.henry@zerotier.com
|
||||||
|
|
||||||
## Third Party Contributors
|
## Third Party Contributors
|
||||||
|
@ -32,44 +32,30 @@ ZeroTier includes the following third party code, either in ext/ or incorporated
|
||||||
|
|
||||||
* LZ4 compression algorithm by Yann Collet
|
* LZ4 compression algorithm by Yann Collet
|
||||||
|
|
||||||
* Files: node/Packet.cpp (bundled within anonymous namespace)
|
* Files: node/LZ4.cpp
|
||||||
* Home page: http://code.google.com/p/lz4/
|
* Home page: http://code.google.com/p/lz4/
|
||||||
* License grant: BSD 2-clause
|
* License: BSD 2-clause
|
||||||
|
|
||||||
* http-parser by Joyent, Inc. (many authors)
|
|
||||||
|
|
||||||
* Files: ext/http-parser/*
|
|
||||||
* Home page: https://github.com/joyent/http-parser/
|
|
||||||
* License grant: MIT/Expat
|
|
||||||
|
|
||||||
* C++11 json (nlohmann/json) by Niels Lohmann
|
* C++11 json (nlohmann/json) by Niels Lohmann
|
||||||
|
|
||||||
* Files: ext/json/*
|
* Files: ext/json/*
|
||||||
* Home page: https://github.com/nlohmann/json
|
* Home page: https://github.com/nlohmann/json
|
||||||
* License grant: MIT
|
* License: MIT
|
||||||
|
|
||||||
* tap-windows6 by the OpenVPN project
|
* tap-windows6 by the OpenVPN project
|
||||||
|
|
||||||
* Files: windows/TapDriver6/*
|
* Files: windows/TapDriver6/*
|
||||||
* Home page: https://github.com/OpenVPN/tap-windows6/
|
* Home page: https://github.com/OpenVPN/tap-windows6/
|
||||||
* License grant: GNU GPL v2
|
* License: GNU GPL v2
|
||||||
* ZeroTier Modifications: change name of driver to ZeroTier, add ioctl() to get L2 multicast memberships (source is in ext/ and modifications inherit GPL)
|
|
||||||
|
|
||||||
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519 digital signature algorithm, and Poly1305 MAC algorithm, all by Daniel J. Bernstein
|
* Salsa20 stream cipher, Curve25519 elliptic curve cipher, Ed25519 digital signature algorithm, and Poly1305 MAC algorithm, all by Daniel J. Bernstein
|
||||||
|
|
||||||
* Files: node/Salsa20.* node/C25519.* node/Poly1305.*
|
* Files: node/Salsa20.* node/C25519.* node/Poly1305.*
|
||||||
* Home page: http://cr.yp.to/
|
* Home page: http://cr.yp.to/
|
||||||
* License grant: public domain
|
* License: public domain
|
||||||
* ZeroTier Modifications: slight cryptographically-irrelevant modifications for inclusion into ZeroTier core
|
|
||||||
|
|
||||||
* MiniUPNPC and libnatpmp by Thomas Bernard
|
|
||||||
|
|
||||||
* Files: ext/libnatpmp/* ext/miniupnpc/*
|
|
||||||
* Home page: http://miniupnp.free.fr/
|
|
||||||
* License grant: BSD attribution no-endorsement
|
|
||||||
|
|
||||||
* cpp-httplib by yhirose
|
* cpp-httplib by yhirose
|
||||||
|
|
||||||
* Files: ext/cpp-httplib/*
|
* Files: ext/cpp-httplib/*
|
||||||
* Home page: https://github.com/yhirose/cpp-httplib
|
* Home page: https://github.com/yhirose/cpp-httplib
|
||||||
* License grant: MIT
|
* License: MIT
|
||||||
|
|
350
CMakeLists.txt
350
CMakeLists.txt
|
@ -1,12 +1,346 @@
|
||||||
# CMake build script for libzerotiercore.a
|
cmake_minimum_required (VERSION 3.8)
|
||||||
|
|
||||||
cmake_minimum_required (VERSION 2.8)
|
cmake_policy(SET CMP0048 NEW)
|
||||||
project (zerotiercore)
|
|
||||||
|
|
||||||
set (PROJ_DIR ${PROJECT_SOURCE_DIR})
|
if(${CMAKE_VERSION} VERSION_LESS 3.15)
|
||||||
set (ZT_DEFS -std=c++11)
|
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||||
|
else()
|
||||||
|
cmake_policy(VERSION 3.15)
|
||||||
|
endif()
|
||||||
|
|
||||||
file(GLOB core_src_glob ${PROJ_DIR}/node/*.cpp)
|
set(ZEROTIER_VERSION_MAJOR 1 CACHE INTERNAL "")
|
||||||
add_library(zerotiercore STATIC ${core_src_glob})
|
set(ZEROTIER_VERSION_MINOR 9 CACHE INTERNAL "")
|
||||||
|
set(ZEROTIER_VERSION_REVISION 0 CACHE INTERNAL "")
|
||||||
|
set(ZEROTIER_VERSION_BUILD 0 CACHE INTERNAL "")
|
||||||
|
|
||||||
target_compile_options(zerotiercore PRIVATE ${ZT_DEFS})
|
project(zerotier
|
||||||
|
VERSION ${ZEROTIER_VERSION_MAJOR}.${ZEROTIER_VERSION_MINOR}.${ZEROTIER_VERSION_REVISION}.${ZEROTIER_VERSION_BUILD}
|
||||||
|
DESCRIPTION "ZeroTier Network Hypervisor"
|
||||||
|
LANGUAGES CXX C)
|
||||||
|
|
||||||
|
if(NOT PACKAGE_STATIC)
|
||||||
|
|
||||||
|
find_program(
|
||||||
|
GO go
|
||||||
|
HINTS "/usr/local/go/bin" "/usr/bin" "/usr/local/bin" "C:/go/bin"
|
||||||
|
)
|
||||||
|
if(NOT GO)
|
||||||
|
message(FATAL_ERROR "Golang not found")
|
||||||
|
else(NOT GO)
|
||||||
|
message(STATUS "Found Golang at ${GO}")
|
||||||
|
endif(NOT GO)
|
||||||
|
|
||||||
|
set(default_build_type "Release")
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_SYSTEM_VERSION "7" CACHE STRING INTERNAL FORCE)
|
||||||
|
else(WIN32)
|
||||||
|
if(APPLE)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
else(APPLE)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
endif(APPLE)
|
||||||
|
endif(WIN32)
|
||||||
|
|
||||||
|
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||||
|
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
|
||||||
|
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
option(BUILD_CENTRAL_CONTROLLER "Build ZeroTier Central Controller" OFF)
|
||||||
|
if(BUILD_CENTRAL_CONTROLLER)
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
if(APPLE)
|
||||||
|
set(CMAKE_PREFIX_PATH
|
||||||
|
${CMAKE_PREFIX_PATH}
|
||||||
|
/usr/local/opt/libpq
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
endif(APPLE)
|
||||||
|
find_package(PostgreSQL REQUIRED)
|
||||||
|
|
||||||
|
pkg_check_modules(hiredis REQUIRED IMPORTED_TARGET hiredis)
|
||||||
|
|
||||||
|
add_subdirectory(controller/thirdparty/redis-plus-plus-1.1.1)
|
||||||
|
set(redispp_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/controller/thirdparty/redis-plus-plus-1.1.1/src/sw)
|
||||||
|
set(redispp_STATIC_LIB redispp_static)
|
||||||
|
endif(BUILD_CENTRAL_CONTROLLER)
|
||||||
|
|
||||||
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
add_definitions(-DZT_DEBUG)
|
||||||
|
endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
|
||||||
|
message("++ Setting Windows Compiler Flags ${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
|
add_definitions(-DNOMINMAX)
|
||||||
|
add_compile_options(
|
||||||
|
-Wall
|
||||||
|
-Wno-deprecated
|
||||||
|
-Wno-unused-function
|
||||||
|
-Wno-format
|
||||||
|
$<$<CONFIG:DEBUG>:-g>
|
||||||
|
$<$<CONFIG:DEBUG>:-O0>
|
||||||
|
$<$<CONFIG:RELEASE>:-O3>
|
||||||
|
$<$<CONFIG:RELEASE>:-ffast-math>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-O3>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||||
|
)
|
||||||
|
|
||||||
|
set(GOFLAGS
|
||||||
|
-a
|
||||||
|
-trimpath
|
||||||
|
)
|
||||||
|
|
||||||
|
if(BUILD_32BIT)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
|
||||||
|
set(GOARCH "GOARCH=386" CACHE STRING "go architecture")
|
||||||
|
add_compile_options(
|
||||||
|
-m32
|
||||||
|
)
|
||||||
|
add_link_options(
|
||||||
|
-m32
|
||||||
|
)
|
||||||
|
endif(BUILD_32BIT)
|
||||||
|
|
||||||
|
else(WIN32)
|
||||||
|
|
||||||
|
set(GOFLAGS
|
||||||
|
-trimpath
|
||||||
|
-buildmode=pie
|
||||||
|
)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
|
||||||
|
message("++ Setting MacOS Compiler Flags ${CMAKE_BUILD_TYPE}")
|
||||||
|
|
||||||
|
set(MACOS_VERSION_MIN "10.12")
|
||||||
|
|
||||||
|
add_compile_options(
|
||||||
|
-Wall
|
||||||
|
-Wno-deprecated
|
||||||
|
-Wno-unused-function
|
||||||
|
-mmacosx-version-min=${MACOS_VERSION_MIN}
|
||||||
|
$<$<CONFIG:DEBUG>:-g>
|
||||||
|
$<$<CONFIG:DEBUG>:-O0>
|
||||||
|
$<$<CONFIG:RELEASE>:-Ofast>
|
||||||
|
$<$<CONFIG:RELEASE>:-ffast-math>
|
||||||
|
$<$<CONFIG:RELEASE>:-fPIE>
|
||||||
|
$<$<CONFIG:RELEASE>:-flto>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-O1>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-fPIE>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||||
|
)
|
||||||
|
|
||||||
|
add_link_options(
|
||||||
|
-mmacosx-version-min=${MACOS_VERSION_MIN}
|
||||||
|
$<$<CONFIG:RELEASE>:-flto>
|
||||||
|
)
|
||||||
|
|
||||||
|
set(GOFLAGS
|
||||||
|
${GOFLAGS}
|
||||||
|
-a
|
||||||
|
-ldflags '-w -extldflags \"-Wl,-undefined -Wl,dynamic_lookup\"'
|
||||||
|
)
|
||||||
|
|
||||||
|
else(APPLE)
|
||||||
|
|
||||||
|
message("++ Setting Linux/BSD/Posix Compiler Flags (${CMAKE_BUILD_TYPE})")
|
||||||
|
|
||||||
|
add_compile_options(
|
||||||
|
-Wall
|
||||||
|
-Wno-deprecated
|
||||||
|
-Wno-unused-function
|
||||||
|
-Wno-format
|
||||||
|
$<$<CONFIG:DEBUG>:-g>
|
||||||
|
$<$<CONFIG:DEBUG>:-O0>
|
||||||
|
$<$<CONFIG:RELEASE>:-O3>
|
||||||
|
$<$<CONFIG:RELEASE>:-ffast-math>
|
||||||
|
$<$<CONFIG:RELEASE>:-fPIE>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-O3>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-fPIE>
|
||||||
|
$<$<CONFIG:RELWITHDEBINFO>:-g>
|
||||||
|
)
|
||||||
|
|
||||||
|
option(BUILD_32BIT "Force building as 32-bit binary" OFF)
|
||||||
|
option(BUILD_STATIC "Build statically linked executable" OFF)
|
||||||
|
option(BUILD_ARM_V5 "Build ARMv5" OFF)
|
||||||
|
option(BUILD_ARM_V6 "Build ARMv6" OFF)
|
||||||
|
|
||||||
|
if(BUILD_ARM_V5 AND BUILD_ARM_V6)
|
||||||
|
message(FATAL_ERROR "BUILD_ARM_V5 and BUILD_ARM_V6 are mutually exclusive!")
|
||||||
|
endif(BUILD_ARM_V5 AND BUILD_ARM_V6)
|
||||||
|
|
||||||
|
if(BUILD_32BIT)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
|
||||||
|
set(GOARCH "GOARCH=386" CACHE STRING "go architecture")
|
||||||
|
add_compile_options(
|
||||||
|
-m32
|
||||||
|
)
|
||||||
|
endif(BUILD_32BIT)
|
||||||
|
|
||||||
|
if(BUILD_STATIC)
|
||||||
|
add_link_options(
|
||||||
|
-static
|
||||||
|
)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "-static ${CMAKE_EXE_LINKER_FLAGS}")
|
||||||
|
set(GOFLAGS
|
||||||
|
${GOFLAGS}
|
||||||
|
-a
|
||||||
|
-tags osusergo,netgo
|
||||||
|
-ldflags '-w -extldflags \"-static -Wl,-unresolved-symbols=ignore-all\"'
|
||||||
|
)
|
||||||
|
else(BUILD_STATIC)
|
||||||
|
set(GOFLAGS
|
||||||
|
${GOFLAGS}
|
||||||
|
-a
|
||||||
|
-ldflags '-w -extldflags \"-Wl,-unresolved-symbols=ignore-all\"'
|
||||||
|
)
|
||||||
|
endif(BUILD_STATIC)
|
||||||
|
|
||||||
|
if(BUILD_ARM_V5)
|
||||||
|
set(GOARM "GOARM=5")
|
||||||
|
endif(BUILD_ARM_V5)
|
||||||
|
|
||||||
|
if(BUILD_ARM_V6)
|
||||||
|
set(GOARM "GOARM=6")
|
||||||
|
endif(BUILD_ARM_V6)
|
||||||
|
|
||||||
|
endif(APPLE)
|
||||||
|
endif(WIN32)
|
||||||
|
|
||||||
|
if (
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "AMD64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "X86_64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "x64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "X64"
|
||||||
|
)
|
||||||
|
message("++ Adding flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
add_compile_options(-maes -mrdrnd -mpclmul -msse -msse2)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "arm64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64" OR
|
||||||
|
CMAKE_SYSTEM_PROCESSOR MATCHES "AARCH64"
|
||||||
|
)
|
||||||
|
message("++ Adding flags for processor ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
|
add_compile_options(-march=armv8-a+aes+crypto -mtune=generic -mstrict-align)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(GO_BUILD_TAGS)
|
||||||
|
|
||||||
|
if(BUILD_CENTRAL_CONTROLLER)
|
||||||
|
add_definitions(-DZT_CONTROLLER_USE_LIBPQ=1)
|
||||||
|
set(GO_BUILD_TAGS -tags central)
|
||||||
|
endif(BUILD_CENTRAL_CONTROLLER)
|
||||||
|
|
||||||
|
add_subdirectory(core)
|
||||||
|
add_subdirectory(controller)
|
||||||
|
add_subdirectory(osdep)
|
||||||
|
add_subdirectory(serviceiocore)
|
||||||
|
|
||||||
|
file(GLOB go_src
|
||||||
|
${CMAKE_SOURCE_DIR}/cmd/*.go
|
||||||
|
${CMAKE_SOURCE_DIR}/cmd/cmd/*.go
|
||||||
|
${CMAKE_SOURCE_DIR}/pkg/zerotier/*.go
|
||||||
|
)
|
||||||
|
file(GLOB go_zt_service_tests_cmd_src
|
||||||
|
${CMAKE_SOURCE_DIR}/cmd/zt_service_tests/*.go
|
||||||
|
)
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(GO_EXE_NAME "zerotier.exe")
|
||||||
|
set(GO_SERVICE_TESTS_EXE_NAME "zt_service_tests.exe")
|
||||||
|
set(GO_EXTRA_LIBRARIES "-lstdc++ -lwsock32 -lws2_32 -liphlpapi -lole32 -loleaut32 -lrpcrt4 -luuid")
|
||||||
|
else(WIN32)
|
||||||
|
set(GO_EXE_NAME "zerotier")
|
||||||
|
set(GO_SERVICE_TESTS_EXE_NAME "zt_service_tests")
|
||||||
|
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
set(GO_EXTRA_LIBRARIES "-lstdc++")
|
||||||
|
if(BUILD_ARM_V5)
|
||||||
|
set(GO_EXTRA_LIBRARIES
|
||||||
|
${GO_EXTRA_LIBRARIES}
|
||||||
|
"-latomic"
|
||||||
|
)
|
||||||
|
endif(BUILD_ARM_V5)
|
||||||
|
else()
|
||||||
|
set(GO_EXTRA_LIBRARIES "-lc++" "-lm")
|
||||||
|
endif()
|
||||||
|
endif(WIN32)
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
zt_service_tests ALL
|
||||||
|
BYPRODUCTS ${CMAKE_BINARY_DIR}/zt_service_tests
|
||||||
|
SOURCES ${go_src} ${go_zt_service_tests_cmd_src}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$<TARGET_FILE:zt_core> $<TARGET_FILE:zt_controller> $<TARGET_FILE:zt_service_io_core> $<TARGET_FILE:zt_osdep> ${GO_EXTRA_LIBRARIES}\" ${GO} build -mod=vendor ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_SERVICE_TESTS_EXE_NAME} ${go_zt_service_tests_cmd_src}
|
||||||
|
COMMENT "Compiling zt_service_tests (Go/cgo self-tests)..."
|
||||||
|
)
|
||||||
|
add_dependencies(zt_service_tests zt_osdep zt_core zt_controller zt_service_io_core)
|
||||||
|
|
||||||
|
add_custom_target(
|
||||||
|
zerotier ALL
|
||||||
|
BYPRODUCTS ${CMAKE_BINARY_DIR}/zerotier
|
||||||
|
SOURCES ${go_src}
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E env ${GOARCH} ${GOARM} CGO_ENABLED=1 CGO_CFLAGS=\"-O3\" CGO_LDFLAGS=\"$<TARGET_FILE:zt_core> $<TARGET_FILE:zt_controller> $<TARGET_FILE:zt_service_io_core> $<TARGET_FILE:zt_osdep> ${GO_EXTRA_LIBRARIES}\" ${GO} build -mod=vendor ${GOFLAGS} -o ${CMAKE_BINARY_DIR}/${GO_EXE_NAME} ${CMAKE_SOURCE_DIR}/cmd/zerotier/zerotier.go
|
||||||
|
COMMENT "Compiling Go Code..."
|
||||||
|
)
|
||||||
|
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core)
|
||||||
|
|
||||||
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zerotier DESTINATION bin)
|
||||||
|
|
||||||
|
else(NOT PACKAGE_STATIC)
|
||||||
|
|
||||||
|
if(BUILD_32BIT)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR "x86" CACHE STRING "system processor")
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags")
|
||||||
|
add_compile_options(
|
||||||
|
-m32
|
||||||
|
)
|
||||||
|
endif(BUILD_32BIT)
|
||||||
|
|
||||||
|
set(STATIC_BINARY ${CMAKE_BINARY_DIR}/zerotier)
|
||||||
|
set(IMPORTED_LOCATION ${CMAKE_BINARY_DIR})
|
||||||
|
add_executable(zerotier IMPORTED GLOBAL)
|
||||||
|
install(PROGRAMS ${STATIC_BINARY} DESTINATION bin)
|
||||||
|
|
||||||
|
endif(NOT PACKAGE_STATIC)
|
||||||
|
|
||||||
|
# Linux packaging
|
||||||
|
|
||||||
|
if("${CMAKE_SYSTEM_NAME}" EQUAL "Linux")
|
||||||
|
if(IS_DIRECTORY /lib/systemd/system)
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.service
|
||||||
|
DESTINATION /lib/systemd/system
|
||||||
|
)
|
||||||
|
elseif(IS_DIRECTORY /usr/lib/systemd/system)
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.service
|
||||||
|
DESTINATION /usr/lib/systemd/system
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_SOURCE_DIR}/packaging/debian/zerotier.init
|
||||||
|
DESTINATION /etc/init.d
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if("${ZT_PACKAGE_FORMAT}" MATCHES "DEB")
|
||||||
|
include(packaging/debian.cmake)
|
||||||
|
elseif("${ZT_PACKAGE_FORMAT}" MATCHES "RPM")
|
||||||
|
include(packaging/rpm.cmake)
|
||||||
|
else()
|
||||||
|
endif()
|
||||||
|
|
2
COPYING
2
COPYING
|
@ -1,5 +1,5 @@
|
||||||
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
|
ZeroTier One, an endpoint server for the ZeroTier virtual network layer.
|
||||||
Copyright © 2011–2019 ZeroTier, Inc.
|
Copyright © 2013–2020 ZeroTier, Inc.
|
||||||
|
|
||||||
ZeroTier is released under the terms of the BSL version 1.1. See the
|
ZeroTier is released under the terms of the BSL version 1.1. See the
|
||||||
file LICENSE.txt for details.
|
file LICENSE.txt for details.
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
# vim: ft=dockerfile
|
|
||||||
|
|
||||||
FROM ubuntu:21.04 as stage
|
|
||||||
|
|
||||||
RUN apt-get update -qq && apt-get -qq install make clang
|
|
||||||
COPY . .
|
|
||||||
RUN /usr/bin/make
|
|
||||||
RUN echo $PWD
|
|
||||||
RUN cp zerotier-one /usr/sbin
|
|
||||||
|
|
||||||
FROM ubuntu:21.04
|
|
||||||
|
|
||||||
COPY --from=stage /zerotier-one /usr/sbin
|
|
||||||
RUN ln -sf /usr/sbin/zerotier-one /usr/sbin/zerotier-idtool
|
|
||||||
RUN ln -sf /usr/sbin/zerotier-one /usr/sbin/zerotier-cli
|
|
||||||
|
|
||||||
RUN echo "${VERSION}" > /etc/zerotier-version
|
|
||||||
RUN rm -rf /var/lib/zerotier-one
|
|
||||||
|
|
||||||
|
|
||||||
RUN apt-get -qq update
|
|
||||||
RUN apt-get -qq install iproute2 net-tools fping 2ping iputils-ping iputils-arping
|
|
||||||
|
|
||||||
COPY entrypoint.sh.release /entrypoint.sh
|
|
||||||
RUN chmod 755 /entrypoint.sh
|
|
||||||
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
|
@ -1,23 +0,0 @@
|
||||||
# vim: ft=dockerfile
|
|
||||||
|
|
||||||
FROM debian:bookworm
|
|
||||||
|
|
||||||
ARG VERSION
|
|
||||||
|
|
||||||
RUN apt-get update -qq && apt-get install curl gpg -y
|
|
||||||
RUN mkdir -p /usr/share/zerotier && \
|
|
||||||
curl -o /usr/share/zerotier/tmp.asc "https://download.zerotier.com/contact%40zerotier.com.gpg" && \
|
|
||||||
gpg --no-default-keyring --keyring /usr/share/zerotier/zerotier.gpg --import /usr/share/zerotier/tmp.asc && \
|
|
||||||
rm -f /usr/share/zerotier/tmp.asc && \
|
|
||||||
echo "deb [signed-by=/usr/share/zerotier/zerotier.gpg] http://download.zerotier.com/debian/bookworm bookworm main" > /etc/apt/sources.list.d/zerotier.list
|
|
||||||
|
|
||||||
RUN apt-get update -qq && apt-get install zerotier-one=${VERSION} curl iproute2 net-tools iputils-ping openssl libssl3 -y
|
|
||||||
RUN rm -rf /var/lib/zerotier-one
|
|
||||||
|
|
||||||
COPY entrypoint.sh.release /entrypoint.sh
|
|
||||||
RUN chmod 755 /entrypoint.sh
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=1s CMD bash /healthcheck.sh
|
|
||||||
|
|
||||||
CMD []
|
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
|
502
Jenkinsfile
vendored
Normal file
502
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,502 @@
|
||||||
|
pipeline {
|
||||||
|
options {
|
||||||
|
disableConcurrentBuilds()
|
||||||
|
preserveStashes(buildCount: 10)
|
||||||
|
timestamps()
|
||||||
|
}
|
||||||
|
parameters {
|
||||||
|
booleanParam(name: "BUILD_ALL", defaultValue: false, description: "Build all supported platform/architecture combos. Defaults to x86/x64 only")
|
||||||
|
}
|
||||||
|
environment {
|
||||||
|
PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
}
|
||||||
|
|
||||||
|
agent none
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage ("Build") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
def tasks = [:]
|
||||||
|
tasks << buildStaticBinaries()
|
||||||
|
tasks << buildDebianNative()
|
||||||
|
tasks << buildCentosNative()
|
||||||
|
tasks << buildMacOS()
|
||||||
|
tasks << buildWindows()
|
||||||
|
tasks << buildFreeBSD()
|
||||||
|
|
||||||
|
parallel tasks
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage ("Package Static") {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
parallel packageStatic()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def buildMacOS() {
|
||||||
|
def tasks = [:]
|
||||||
|
tasks << getTasks(['mac'],['amd64'], {unused1, unused2 ->
|
||||||
|
def myNode = {
|
||||||
|
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
node ('mac') {
|
||||||
|
dir("build") {
|
||||||
|
checkout scm
|
||||||
|
sh 'make'
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
return tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
def buildWindows() {
|
||||||
|
def tasks = [:]
|
||||||
|
tasks << getTasks(['windows'], ['amd64', 'i386'], { unused1, platform ->
|
||||||
|
def myNode = {
|
||||||
|
node ('windows') {
|
||||||
|
env.SHELL = 'C:/Windows/System32/cmd.exe'
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
|
||||||
|
dir ("build") {
|
||||||
|
withEnv(["PATH=C:\\TDM-GCC-64\\bin;C:\\WINDOWS;C:\\Windows\\system32;C:\\CMake\\bin;C:\\Go\\bin"]) {
|
||||||
|
def cmakeFlags = ""
|
||||||
|
if (platform == "i386") {
|
||||||
|
cmakeFlags = '-DBUILD_32BIT=1'
|
||||||
|
}
|
||||||
|
bat """
|
||||||
|
cmake -G"MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ${cmakeFlags} ..
|
||||||
|
mingw32-make -j8
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
|
||||||
|
return tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
def buildFreeBSD() {
|
||||||
|
def tasks = [:]
|
||||||
|
tasks << getTasks(['freebsd12'], ['amd64'], { unused1, unused2 ->
|
||||||
|
def myNode = {
|
||||||
|
node ('freebsd12') {
|
||||||
|
dir('build') {
|
||||||
|
checkout scm
|
||||||
|
sh 'make setup'
|
||||||
|
dir('build') {
|
||||||
|
sh 'make -j4'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
return tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
def buildStaticBinaries() {
|
||||||
|
def tasks = [:]
|
||||||
|
def dist = ["alpine"]
|
||||||
|
def archs = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
archs = ["arm64", "amd64", "i386", "armhf", "ppc64le", "s390x"]
|
||||||
|
} else {
|
||||||
|
archs = ["amd64", "i386"]
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks << getTasks(dist, archs, { distro, platform ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${platform}:latest")
|
||||||
|
runtime.inside {
|
||||||
|
dir("build") {
|
||||||
|
|
||||||
|
def cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"'
|
||||||
|
if (platform == "i386") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1"'
|
||||||
|
} else if (platform == "armhf") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DBUILD_ARM_V6=1"'
|
||||||
|
}
|
||||||
|
|
||||||
|
sh "${cmakeFlags} make"
|
||||||
|
dir("build") {
|
||||||
|
sh "mv zerotier zerotier-static-${platform}"
|
||||||
|
stash includes: 'zerotier-static-*', name: "static-${platform}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
|
||||||
|
return tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
def getTasks(axisDistro, axisPlatform, task) {
|
||||||
|
def tasks = [:]
|
||||||
|
for(int i=0; i< axisDistro.size(); i++) {
|
||||||
|
def axisDistroValue = axisDistro[i]
|
||||||
|
for(int j=0; j< axisPlatform.size(); j++) {
|
||||||
|
def axisPlatformValue = axisPlatform[j]
|
||||||
|
tasks["${axisDistroValue}/${axisPlatformValue}"] = task(axisDistroValue, axisPlatformValue)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
def packageStatic() {
|
||||||
|
def tasks = [:]
|
||||||
|
|
||||||
|
def centos7 = ["centos7"]
|
||||||
|
def centos7Arch = ["i386"]
|
||||||
|
tasks << getTasks(centos7, centos7Arch, { distro, arch ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||||
|
runtime.inside {
|
||||||
|
dir("build") {
|
||||||
|
unstash "static-${arch}"
|
||||||
|
sh "mkdir -p build"
|
||||||
|
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||||
|
sh 'CMAKE_ARGS="-DBUILD_32BIT=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=RPM" make setup'
|
||||||
|
dir("build") {
|
||||||
|
sh 'make package -j4 VERBOSE=1'
|
||||||
|
}
|
||||||
|
sh "mkdir -p ${distro}"
|
||||||
|
sh "cp -av build/*.rpm ${distro}/"
|
||||||
|
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
def s390xStatics = ["clefos", "debian-buster", "debian-sid", "debian-bullseye", "debian-stretch", "ubuntu-bionic", "ubuntu-eoan", "ubuntu-focal"]
|
||||||
|
def s390x = ["s390x"]
|
||||||
|
tasks << getTasks(s390xStatics, s390x , { distro, arch ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||||
|
def pkgFormat = "DEB"
|
||||||
|
if (distro == "clefos") {
|
||||||
|
pkgFormat = "RPM"
|
||||||
|
}
|
||||||
|
runtime.inside {
|
||||||
|
dir("build/") {
|
||||||
|
unstash "static-${arch}"
|
||||||
|
sh "mkdir -p build"
|
||||||
|
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||||
|
sh "CMAKE_ARGS=\"-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=${pkgFormat}\" make setup"
|
||||||
|
dir("build") {
|
||||||
|
sh 'make package -j4 VERBOSE=1'
|
||||||
|
}
|
||||||
|
sh "mkdir -p ${distro}"
|
||||||
|
sh "cp -av build/*.rpm ${distro}/"
|
||||||
|
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
def debianJessie = ["debian-jessie"]
|
||||||
|
def debianJessieArchs = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
debianJessieArch = ["armhf", "amd64", "i386"]
|
||||||
|
} else {
|
||||||
|
debianJessieArch = ["amd64", "i386"]
|
||||||
|
}
|
||||||
|
tasks << getTasks(debianJessie, debianJessieArch, { distro, arch ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||||
|
runtime.inside {
|
||||||
|
dir('build/') {
|
||||||
|
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
if (arch == "i386") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
} else if (arch == "armel") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||||
|
} else if (arch == "armhf") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||||
|
}
|
||||||
|
|
||||||
|
unstash "static-${arch}"
|
||||||
|
sh "mkdir -p build"
|
||||||
|
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||||
|
sh "${cmakeFlags} make setup"
|
||||||
|
dir("build") {
|
||||||
|
sh 'make package -j4 VERBOSE=1'
|
||||||
|
}
|
||||||
|
sh "mkdir -p ${distro}"
|
||||||
|
sh "cp -av build/*.deb ${distro}/"
|
||||||
|
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
|
||||||
|
def ubuntuTrusty = ["ubuntu-trusty"]
|
||||||
|
def ubuntuTrustyArch = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
ubuntuTrustyArch = ["i386", "amd64", "arm64", "ppc64le"]
|
||||||
|
} else {
|
||||||
|
ubuntuTrustyArch = ["i386", "amd64"]
|
||||||
|
}
|
||||||
|
tasks << getTasks(ubuntuTrusty, ubuntuTrustyArch, { distro, arch ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||||
|
runtime.inside {
|
||||||
|
dir('build/') {
|
||||||
|
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
if (arch == "i386") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
} else if (arch == "armel") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||||
|
} else if (arch == "armhf") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||||
|
}
|
||||||
|
|
||||||
|
unstash "static-${arch}"
|
||||||
|
sh "mkdir -p build"
|
||||||
|
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||||
|
sh "${cmakeFlags} make setup"
|
||||||
|
dir("build") {
|
||||||
|
sh 'make package -j4 VERBOSE=1'
|
||||||
|
}
|
||||||
|
sh "mkdir -p ${distro}"
|
||||||
|
sh "cp -av build/*.deb ${distro}/"
|
||||||
|
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
|
||||||
|
def debianWheezy = ["debian-wheezy"]
|
||||||
|
def debianWheezyArchs = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
debianWheezyArchs = ["armhf", "amd64", "i386"]
|
||||||
|
} else {
|
||||||
|
debianWheezyArchs = ["amd64", "i386"]
|
||||||
|
}
|
||||||
|
tasks << getTasks(debianJessie, debianJessieArch, { distro, arch ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||||
|
runtime.inside {
|
||||||
|
dir('build/') {
|
||||||
|
def cmakeFlags = 'CMAKE_ARGS="-DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
if (arch == "i386") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
} else if (arch == "armel") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||||
|
} else if (arch == "armhf") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_STATIC=1 -DPACKAGE_STATIC=1 -DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||||
|
}
|
||||||
|
unstash "static-${arch}"
|
||||||
|
sh "mkdir -p build"
|
||||||
|
sh "mv zerotier-static-${arch} build/zerotier && chmod +x build/zerotier"
|
||||||
|
sh "${cmakeFlags} make setup"
|
||||||
|
dir("build") {
|
||||||
|
sh 'make package -j4 VERBOSE=1'
|
||||||
|
}
|
||||||
|
sh "mkdir -p ${distro}"
|
||||||
|
sh "cp -av build/*.deb ${distro}/"
|
||||||
|
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
})
|
||||||
|
|
||||||
|
return tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
def buildDebianNative() {
|
||||||
|
def tasks = [:]
|
||||||
|
def debian = ["debian-buster" , "debian-stretch", "debian-sid", "debian-bullseye"]
|
||||||
|
def debianArchs = []
|
||||||
|
if (params.BUILD_ALL) {
|
||||||
|
debianArchs = ["ppc64le", "i386", "armhf", "armel", "arm64", "amd64"]
|
||||||
|
} else {
|
||||||
|
debianArchs = ["amd64", "i386"]
|
||||||
|
}
|
||||||
|
|
||||||
|
def build = { distro, arch ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||||
|
runtime.inside {
|
||||||
|
def cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
if (arch == "i386") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DBUILD_32BIT=1 -DZT_PACKAGE_FORMAT=DEB"'
|
||||||
|
} else if (arch == "armel") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V5=1"'
|
||||||
|
} else if (arch == "armhf") {
|
||||||
|
cmakeFlags = 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=DEB -DBUILD_ARM_V6=1"'
|
||||||
|
}
|
||||||
|
|
||||||
|
dir("build") {
|
||||||
|
sh "${cmakeFlags} make setup"
|
||||||
|
dir("build") {
|
||||||
|
sh "make package -j4 VERBOSE=1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sh "mkdir -p ${distro}"
|
||||||
|
sh "mv build/build/*.deb ${distro}"
|
||||||
|
archiveArtifacts artifacts: "${distro}/*.deb", onlyIfSuccessful: true
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks << getTasks(debian, debianArchs, build)
|
||||||
|
|
||||||
|
// bash is broken when running under QEMU-s390x on Xenial
|
||||||
|
def xenial = ["ubuntu-xenial"]
|
||||||
|
def xenialArchs = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
xenialArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le"]
|
||||||
|
} else {
|
||||||
|
xenialArchs = ["i386", "amd64"]
|
||||||
|
}
|
||||||
|
tasks << getTasks(xenial, xenialArchs, build)
|
||||||
|
|
||||||
|
def ubuntu = ["ubuntu-bionic", "ubuntu-eoan"]
|
||||||
|
def ubuntuArchs = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
ubuntuArchs = ["i386", "amd64", "armhf", "arm64", "ppc64le"]
|
||||||
|
} else {
|
||||||
|
ubuntuArchs = ["i386", "amd64"]
|
||||||
|
}
|
||||||
|
tasks << getTasks(ubuntu, ubuntuArchs, build)
|
||||||
|
|
||||||
|
def ubuntuFocal = ["ubuntu-focal"]
|
||||||
|
def ubuntuFocalArchs = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
ubuntuFocalArchs = ["amd64", "arm64", "ppc64le"]
|
||||||
|
} else {
|
||||||
|
ubuntuFocalArchs = ["amd64"]
|
||||||
|
}
|
||||||
|
tasks << getTasks(ubuntuFocal, ubuntuFocalArchs, build)
|
||||||
|
|
||||||
|
def kali = ["kali-rolling"]
|
||||||
|
def kaliArchs = ["amd64"]
|
||||||
|
tasks << getTasks(kali, kaliArchs, build)
|
||||||
|
|
||||||
|
return tasks
|
||||||
|
}
|
||||||
|
|
||||||
|
def buildCentosNative() {
|
||||||
|
def tasks = [:]
|
||||||
|
|
||||||
|
def build = { distro, arch ->
|
||||||
|
def myNode = {
|
||||||
|
node ('linux-build') {
|
||||||
|
env.PATH = env.PATH + ":/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/home/jenkins-build/go/bin"
|
||||||
|
dir ("build") {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
def runtime = docker.image("ztbuild/${distro}-${arch}:latest")
|
||||||
|
runtime.inside {
|
||||||
|
dir("build") {
|
||||||
|
if (distro == 'centos7' && arch == 'amd64') {
|
||||||
|
sh 'source scl_source enable devtoolset-8 llvm-toolset-7 && CMAKE_ARGS="-DZT_PACKAGE_FORMAT=RPM" make setup'
|
||||||
|
} else {
|
||||||
|
sh 'CMAKE_ARGS="-DZT_PACKAGE_FORMAT=RPM" make setup'
|
||||||
|
}
|
||||||
|
dir ("build") {
|
||||||
|
if (distro == 'centos7' && arch == 'amd64') {
|
||||||
|
sh 'source scl_source enable devtoolset-8 llvm-toolset-7 && make package -j4 VERBOSE=1'
|
||||||
|
} else {
|
||||||
|
sh 'make package -j4 VERBOSE=1'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sh "mkdir -p ${distro}"
|
||||||
|
sh "cp -av build/build/*.rpm ${distro}/"
|
||||||
|
archiveArtifacts artifacts: "${distro}/*.rpm", onlyIfSuccessful: true
|
||||||
|
|
||||||
|
cleanWs deleteDirs: true, disableDeferredWipeout: true, notFailBuild: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return myNode
|
||||||
|
}
|
||||||
|
|
||||||
|
def centos8 = ["centos8"]
|
||||||
|
def centos8Archs = []
|
||||||
|
if (params.BUILD_ALL == true) {
|
||||||
|
centos8Archs = ["amd64", "arm64", "ppc64le"]
|
||||||
|
} else {
|
||||||
|
centos8Archs = ["amd64"]
|
||||||
|
}
|
||||||
|
tasks << getTasks(centos8, centos8Archs, build)
|
||||||
|
|
||||||
|
def centos7 = ["centos7"]
|
||||||
|
def centos7Archs = ["amd64"]
|
||||||
|
tasks << getTasks(centos7, centos7Archs, build)
|
||||||
|
|
||||||
|
return tasks
|
||||||
|
}
|
|
@ -10,8 +10,8 @@ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
|
||||||
Parameters
|
Parameters
|
||||||
|
|
||||||
Licensor: ZeroTier, Inc.
|
Licensor: ZeroTier, Inc.
|
||||||
Licensed Work: ZeroTier Network Virtualization Engine 1.4.4
|
Licensed Work: ZeroTier Network Virtualization Engine
|
||||||
The Licensed Work is (c)2019 ZeroTier, Inc.
|
The Licensed Work is (c)2013-2020 ZeroTier, Inc.
|
||||||
Additional Use Grant: You may make use of the Licensed Work, provided you
|
Additional Use Grant: You may make use of the Licensed Work, provided you
|
||||||
do not use it in any of the following ways:
|
do not use it in any of the following ways:
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided you
|
||||||
services, social welfare, senior care, child care, and
|
services, social welfare, senior care, child care, and
|
||||||
the care of persons with disabilities.
|
the care of persons with disabilities.
|
||||||
|
|
||||||
Change Date: 2026-01-01
|
Change Date: 2025-01-01
|
||||||
|
|
||||||
Change License: Apache License version 2.0 as published by the Apache
|
Change License: Apache License version 2.0 as published by the Apache
|
||||||
Software Foundation
|
Software Foundation
|
||||||
|
|
52
Makefile
52
Makefile
|
@ -1,33 +1,31 @@
|
||||||
# Common makefile -- loads make rules for each platform
|
BUILDDIR := build
|
||||||
|
TIMESTAMP=$(shell date +"%Y%m%d%H%M")
|
||||||
|
|
||||||
OSTYPE=$(shell uname -s)
|
.PHONY: all
|
||||||
|
|
||||||
ifeq ($(OSTYPE),Darwin)
|
all: setup
|
||||||
include make-mac.mk
|
cd ${BUILDDIR} && $(MAKE) -j4 VERBOSE=1
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OSTYPE),Linux)
|
setup:
|
||||||
include make-linux.mk
|
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release ${CMAKE_ARGS}
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OSTYPE),FreeBSD)
|
setup-debug:
|
||||||
CC=clang
|
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS}
|
||||||
CXX=clang++
|
|
||||||
ZT_BUILD_PLATFORM=7
|
|
||||||
include make-bsd.mk
|
|
||||||
endif
|
|
||||||
ifeq ($(OSTYPE),OpenBSD)
|
|
||||||
CC=clang
|
|
||||||
CXX=clang++
|
|
||||||
ZT_BUILD_PLATFORM=9
|
|
||||||
include make-bsd.mk
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(OSTYPE),NetBSD)
|
debug:
|
||||||
include make-netbsd.mk
|
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug ${CMAKE_ARGS} && $(MAKE)
|
||||||
endif
|
|
||||||
|
|
||||||
drone:
|
central-controller:
|
||||||
@echo "rendering .drone.yaml from .drone.jsonnet"
|
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Release -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
|
||||||
drone jsonnet --format --stream
|
|
||||||
drone sign zerotier/ZeroTierOne --save
|
central-controller-debug:
|
||||||
|
mkdir -p ${BUILDDIR} && cd ${BUILDDIR} && cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_CENTRAL_CONTROLLER=1 ${CMAKE_ARGS} && $(MAKE) -j4
|
||||||
|
|
||||||
|
central-controller-docker:
|
||||||
|
docker build -t registry.zerotier.com/zerotier-central/ztcentral-controller:${TIMESTAMP} -f controller/central-docker/Dockerfile .
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf ${BUILDDIR}
|
||||||
|
|
||||||
|
distclean:
|
||||||
|
rm -rf ${BUILDDIR}
|
||||||
|
|
|
@ -1,73 +0,0 @@
|
||||||
# ZeroTier One in a container!
|
|
||||||
|
|
||||||
**NOTE:** _Most of this information pertains to the docker image only. For more information about ZeroTier, check out the repository_: [here](https://github.com/zerotier/ZeroTierOne) or the [commercial website](https://www.zerotier.com).
|
|
||||||
|
|
||||||
[ZeroTier](https://www.zerotier.com) is a smart programmable Ethernet switch for planet Earth. It allows all networked devices, VMs, containers, and applications to communicate as if they all reside in the same physical data center or cloud region.
|
|
||||||
|
|
||||||
This is accomplished by combining a cryptographically addressed and secure peer to peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.
|
|
||||||
|
|
||||||
All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer to peer, though we offer free (but slow) relaying for users who cannot establish peer to peer connections.
|
|
||||||
|
|
||||||
The goals and design principles of ZeroTier are inspired by among other things the original [Google BeyondCorp](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43231.pdf) paper and the [Jericho Forum](https://en.wikipedia.org/wiki/Jericho_Forum) with its notion of "deperimeterization."
|
|
||||||
|
|
||||||
Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre-built binary packages](https://www.zerotier.com/download/). Apps for Android and iOS are available for free in the Google Play and Apple app stores.
|
|
||||||
|
|
||||||
ZeroTier is licensed under the [BSL version 1.1](https://mariadb.com/bsl11/). See [LICENSE.txt](https://github.com/zerotier/ZeroTierOne/blob/master/LICENSE.txt) and the [ZeroTier pricing page](https://www.zerotier.com/pricing) for details. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license.
|
|
||||||
|
|
||||||
A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See [AUTHORS.md](https://github.com/zerotier/ZeroTierOne/blob/master/AUTHORS.md) for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.).
|
|
||||||
|
|
||||||
## Building the docker image
|
|
||||||
|
|
||||||
Due to the network being a substrate for most applications and not an application unto itself, it makes sense that many people would want to build their own image based on our formula.
|
|
||||||
|
|
||||||
The image is based on `debian:buster`.
|
|
||||||
|
|
||||||
The `Dockerfile.release` file contains build instructions for building the described image in the rest of the README. The build is multi-arch and multi-release capable.
|
|
||||||
|
|
||||||
These build arguments power the build:
|
|
||||||
|
|
||||||
- `PACKAGE_BASEURL`: The base URL of the package repository to fetch from. (default: `https://download.zerotier.com/debian/buster/pool/main/z/zerotier-one/`)
|
|
||||||
- `ARCH`: The architecture of the package, in debian format. Must match your image arch. (default: `amd64`)
|
|
||||||
- `VERSION`: **REQUIRED** the version of ZeroTier to fetch.
|
|
||||||
|
|
||||||
You can build this image like so:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker build -f Dockerfile.release -t mybuild --build-arg VERSION=1.6.5 .
|
|
||||||
```
|
|
||||||
|
|
||||||
## Using the docker image
|
|
||||||
|
|
||||||
The `entrypoint.sh` in the docker image is a little different; zerotier will be spawned in the background and the "main process" is actually just a sleeping shell script. This allows `zerotier-one` to gracefully terminate in some situations largely unique to docker.
|
|
||||||
|
|
||||||
The `zerotier/zerotier` image requires the `CAP_NET_ADMIN` capability and the `/dev/net/tun` device must be forwarded to it.
|
|
||||||
|
|
||||||
To join a network, simply supply it on the command-line; you can supply multiple networks.
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run --name myzerotier --rm --cap-add NET_ADMIN --device /dev/net/tun zerotier/zerotier:latest abcdefdeadbeef00
|
|
||||||
```
|
|
||||||
|
|
||||||
Once joining all the networks you have provided, it will sleep until terminated. Note that in ZeroTier, joining a network does not necessarily mean you have an IP or can do anything, really. You will want to probe the control socket:
|
|
||||||
|
|
||||||
```
|
|
||||||
docker exec myzerotier zerotier-cli listnetworks
|
|
||||||
```
|
|
||||||
|
|
||||||
To ensure you have a network available before trying to listen on it. Without pre-configuring the identity, this usually means going to the central admin panel and clicking the checkmark against your zerotier identity.
|
|
||||||
|
|
||||||
### Environment Variables
|
|
||||||
|
|
||||||
You can control a few settings including the identity used and the authtoken used to interact with the control socket (which you can forward and access through `localhost:9993`).
|
|
||||||
|
|
||||||
- `ZEROTIER_JOIN_NETWORKS`: additional way to set networks to join.
|
|
||||||
- `ZEROTIER_API_SECRET`: replaces the `authtoken.secret` before booting and allows you to manage the control socket's authentication key.
|
|
||||||
- `ZEROTIER_IDENTITY_PUBLIC`: the `identity.public` file for zerotier-one. Use `zerotier-idtool` to generate one of these for you.
|
|
||||||
- `ZEROTIER_IDENTITY_SECRET`: the `identity.secret` file for zerotier-one. Use `zerotier-idtool` to generate one of these for you.
|
|
||||||
- `ZEROTIER_LOCAL_CONF`: Sets the the `local.conf` file content for zerotier-one
|
|
||||||
|
|
||||||
### Tips
|
|
||||||
|
|
||||||
- Forwarding port `<dockerip>:9993` to somewhere outside is probably a good idea for highly trafficked services.
|
|
||||||
- Forwarding `localhost:9993` to a control network where you can drive it remotely might be a good idea, just be sure to set your authtoken properly through environment variables.
|
|
||||||
- Pre-generating your identities could be much simpler to do via our [terraform plugin](https://github.com/zerotier/terraform-provider-zerotier)
|
|
135
README.md
135
README.md
|
@ -1,13 +1,11 @@
|
||||||
ZeroTier - Global Area Networking
|
ZeroTier - Global Area Networking
|
||||||
======
|
======
|
||||||
|
|
||||||
*This document is written for a software developer audience. For information on using ZeroTier, see the: [Website](https://www.zerotier.com), [Documentation Site](https://docs.zerotier.com), and [Discussion Forum](https://discuss.zerotier.com).*
|
|
||||||
|
|
||||||
ZeroTier is a smart programmable Ethernet switch for planet Earth. It allows all networked devices, VMs, containers, and applications to communicate as if they all reside in the same physical data center or cloud region.
|
ZeroTier is a smart programmable Ethernet switch for planet Earth. It allows all networked devices, VMs, containers, and applications to communicate as if they all reside in the same physical data center or cloud region.
|
||||||
|
|
||||||
This is accomplished by combining a cryptographically addressed and secure peer to peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.
|
This is accomplished by combining a cryptographically addressed and secure peer to peer network (termed VL1) with an Ethernet emulation layer somewhat similar to VXLAN (termed VL2). Our VL2 Ethernet virtualization layer includes advanced enterprise SDN features like fine grained access control rules for network micro-segmentation and security monitoring.
|
||||||
|
|
||||||
All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer to peer, though we offer free (but slow) relaying for users who cannot establish peer to peer connections.
|
All ZeroTier traffic is encrypted end-to-end using secret keys that only you control. Most traffic flows peer to peer, though we offer free (but slow) relaying for users who cannot establish peer to peer connetions.
|
||||||
|
|
||||||
The goals and design principles of ZeroTier are inspired by among other things the original [Google BeyondCorp](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43231.pdf) paper and the [Jericho Forum](https://en.wikipedia.org/wiki/Jericho_Forum) with its notion of "deperimeterization."
|
The goals and design principles of ZeroTier are inspired by among other things the original [Google BeyondCorp](https://static.googleusercontent.com/media/research.google.com/en//pubs/archive/43231.pdf) paper and the [Jericho Forum](https://en.wikipedia.org/wiki/Jericho_Forum) with its notion of "deperimeterization."
|
||||||
|
|
||||||
|
@ -15,7 +13,7 @@ Visit [ZeroTier's site](https://www.zerotier.com/) for more information and [pre
|
||||||
|
|
||||||
ZeroTier is licensed under the [BSL version 1.1](https://mariadb.com/bsl11/). See [LICENSE.txt](LICENSE.txt) and the [ZeroTier pricing page](https://www.zerotier.com/pricing) for details. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license.
|
ZeroTier is licensed under the [BSL version 1.1](https://mariadb.com/bsl11/). See [LICENSE.txt](LICENSE.txt) and the [ZeroTier pricing page](https://www.zerotier.com/pricing) for details. ZeroTier is free to use internally in businesses and academic institutions and for non-commercial purposes. Certain types of commercial use such as building closed-source apps and devices based on ZeroTier or offering ZeroTier network controllers and network management as a SaaS service require a commercial license.
|
||||||
|
|
||||||
A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See [AUTHORS.md](AUTHORS.md) for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.).
|
A small amount of third party code is also included in ZeroTier and is not subject to our BSL license. See [AUTHORS.md] for a list of third party code, where it is included, and the licenses that apply to it. All of the third party code in ZeroTier is liberally licensed (MIT, BSD, Apache, public domain, etc.).
|
||||||
|
|
||||||
### Getting Started
|
### Getting Started
|
||||||
|
|
||||||
|
@ -37,161 +35,74 @@ The base path contains the ZeroTier One service main entry point (`one.cpp`), se
|
||||||
- `ext/`: third party libraries, binaries that we ship for convenience on some platforms (Mac and Windows), and installation support files.
|
- `ext/`: third party libraries, binaries that we ship for convenience on some platforms (Mac and Windows), and installation support files.
|
||||||
- `include/`: include files for the ZeroTier core.
|
- `include/`: include files for the ZeroTier core.
|
||||||
- `java/`: a JNI wrapper used with our Android mobile app. (The whole Android app is not open source but may be made so in the future.)
|
- `java/`: a JNI wrapper used with our Android mobile app. (The whole Android app is not open source but may be made so in the future.)
|
||||||
|
- `macui/`: a Macintosh menu-bar app for controlling ZeroTier One, written in Objective C.
|
||||||
- `node/`: the ZeroTier virtual Ethernet switch core, which is designed to be entirely separate from the rest of the code and able to be built as a stand-alone OS-independent library. Note to developers: do not use C++11 features in here, since we want this to build on old embedded platforms that lack C++11 support. C++11 can be used elsewhere.
|
- `node/`: the ZeroTier virtual Ethernet switch core, which is designed to be entirely separate from the rest of the code and able to be built as a stand-alone OS-independent library. Note to developers: do not use C++11 features in here, since we want this to build on old embedded platforms that lack C++11 support. C++11 can be used elsewhere.
|
||||||
- `osdep/`: code to support and integrate with OSes, including platform-specific stuff only built for certain targets.
|
- `osdep/`: code to support and integrate with OSes, including platform-specific stuff only built for certain targets.
|
||||||
- `rule-compiler/`: JavaScript rules language compiler for defining network-level rules.
|
- `rule-compiler/`: JavaScript rules language compiler for defining network-level rules.
|
||||||
- `service/`: the ZeroTier One service, which wraps the ZeroTier core and provides VPN-like connectivity to virtual networks for desktops, laptops, servers, VMs, and containers.
|
- `service/`: the ZeroTier One service, which wraps the ZeroTier core and provides VPN-like connectivity to virtual networks for desktops, laptops, servers, VMs, and containers.
|
||||||
- `windows/`: Visual Studio solution files, Windows service code, and the Windows task bar app UI.
|
- `windows/`: Visual Studio solution files, Windows service code, and the Windows task bar app UI.
|
||||||
- `zeroidc/`: OIDC implementation used by ZeroTier service to log into SSO-enabled networks. (This part is written in Rust, and more Rust will be appearing in this repository in the future.)
|
|
||||||
|
|
||||||
### Contributing
|
|
||||||
|
|
||||||
Please do pull requests off of the `dev` branch.
|
|
||||||
|
|
||||||
Releases are done by merging `dev` into `main` and then tagging and doing builds.
|
|
||||||
|
|
||||||
### Build and Platform Notes
|
### Build and Platform Notes
|
||||||
|
|
||||||
To build on Mac and Linux just type `make`. On FreeBSD and OpenBSD `gmake` (GNU make) is required and can be installed from packages or ports. For Windows there is a Visual Studio solution in `windows/`.
|
To build on Mac and Linux just type `make`. On FreeBSD and OpenBSD `gmake` (GNU make) is required and can be installed from packages or ports. For Windows there is a Visual Studio solution in `windows/'.
|
||||||
|
|
||||||
- **Mac**
|
- **Mac**
|
||||||
- Xcode command line tools for macOS 10.13 or newer are required.
|
- Xcode command line tools for OSX 10.8 or newer are required.
|
||||||
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
|
|
||||||
- **Linux**
|
- **Linux**
|
||||||
- The minimum compiler versions required are GCC/G++ 8.x or CLANG/CLANG++ 5.x.
|
- The minimum compiler versions required are GCC/G++ 4.9.3 or CLANG/CLANG++ 3.4.2. (Install `clang` on CentOS 7 as G++ is too old.)
|
||||||
- Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
|
- Linux makefiles automatically detect and prefer clang/clang++ if present as it produces smaller and slightly faster binaries in most cases. You can override by supplying CC and CXX variables on the make command line.
|
||||||
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
|
|
||||||
- **Windows**
|
- **Windows**
|
||||||
- Visual Studio 2022 on Windows 10 or newer.
|
- Windows 7 or newer is supported. This *may* work on Vista but isn't officially supported there. It will not work on Windows XP.
|
||||||
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
|
- We build with Visual Studio 2017. Older versions may not work. Clang or MinGW will also probably work but may require some makefile hacking.
|
||||||
- **FreeBSD**
|
- **FreeBSD**
|
||||||
- GNU make is required. Type `gmake` to build.
|
- GNU make is required. Type `gmake` to build.
|
||||||
- `binutils` is required. Type `pkg install binutils` to install.
|
|
||||||
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
|
|
||||||
- **OpenBSD**
|
- **OpenBSD**
|
||||||
- There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`).
|
- There is a limit of four network memberships on OpenBSD as there are only four tap devices (`/dev/tap0` through `/dev/tap3`).
|
||||||
- GNU make is required. Type `gmake` to build.
|
- GNU make is required. Type `gmake` to build.
|
||||||
- Rust for x86_64 and ARM64 targets *if SSO is enabled in the build*.
|
|
||||||
|
|
||||||
Typing `make selftest` will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
|
Typing `make selftest` will build a *zerotier-selftest* binary which unit tests various internals and reports on a few aspects of the build environment. It's a good idea to try this on novel platforms or architectures.
|
||||||
|
|
||||||
### Running
|
### Running
|
||||||
|
|
||||||
Running *zerotier-one* with `-h` option will show help.
|
Running *zerotier-one* with -h will show help.
|
||||||
|
|
||||||
On Linux and BSD, if you built from source, you can start the service with:
|
On Linux and BSD you can start the service with:
|
||||||
|
|
||||||
sudo ./zerotier-one -d
|
sudo ./zerotier-one -d
|
||||||
|
|
||||||
On most distributions, macOS, and Windows, the installer will start the service and set it up to start on boot.
|
|
||||||
|
|
||||||
A home folder for your system will automatically be created.
|
A home folder for your system will automatically be created.
|
||||||
|
|
||||||
The service is controlled via the JSON API, which by default is available at `127.0.0.1:9993`. It also listens on `0.0.0.0:9993` which is only usable if `allowManagementFrom` is properly configured in `local.conf`. We include a *zerotier-cli* command line utility to make API calls for standard things like joining and leaving networks. The *authtoken.secret* file in the home folder contains the secret token for accessing this API. See [service/README.md](service/README.md) for API documentation.
|
The service is controlled via the JSON API, which by default is available at 127.0.0.1 port 9993. We include a *zerotier-cli* command line utility to make API calls for standard things like joining and leaving networks. The *authtoken.secret* file in the home folder contains the secret token for accessing this API. See README.md in [service/](service/) for API documentation.
|
||||||
|
|
||||||
Here's where home folders live (by default) on each OS:
|
Here's where home folders live (by default) on each OS:
|
||||||
|
|
||||||
* **Linux**: `/var/lib/zerotier-one`
|
* **Linux**: `/var/lib/zerotier-one`
|
||||||
* **FreeBSD** / **OpenBSD**: `/var/db/zerotier-one`
|
* **FreeBSD** / **OpenBSD**: `/var/db/zerotier-one`
|
||||||
* **Mac**: `/Library/Application Support/ZeroTier/One`
|
* **Mac**: `/Library/Application Support/ZeroTier/One`
|
||||||
* **Windows**: `\ProgramData\ZeroTier\One` (That's the default. The base 'shared app data' folder might be different if Windows is installed with a non-standard drive letter assignment or layout.)
|
* **Windows**: `\ProgramData\ZeroTier\One` (That's for Windows 7. The base 'shared app data' folder might be different on different Windows versions.)
|
||||||
|
|
||||||
|
Running ZeroTier One on a Mac is the same, but OSX requires a kernel extension. We ship a signed binary build of the ZeroTier tap device driver, which can be installed on Mac with:
|
||||||
|
|
||||||
|
sudo make install-mac-tap
|
||||||
|
|
||||||
|
This will create the home folder for Mac, place *tap.kext* there, and set its modes correctly to enable ZeroTier One to manage it with *kextload* and *kextunload*.
|
||||||
|
|
||||||
### Basic Troubleshooting
|
### Basic Troubleshooting
|
||||||
|
|
||||||
For most users, it just works.
|
For most users, it just works.
|
||||||
|
|
||||||
If you are running a local system firewall, we recommend adding a rules permitting zerotier. If you installed binaries for Windows this should be done automatically. Other platforms might require manual editing of local firewall rules depending on your configuration.
|
If you are running a local system firewall, we recommend adding a rule permitting UDP port 9993 inbound and outbound. If you installed binaries for Windows this should be done automatically. Other platforms might require manual editing of local firewall rules depending on your configuration.
|
||||||
|
|
||||||
See the [documentation site](https://docs.zerotier.com/zerotier/troubleshooting) for more information.
|
The Mac firewall can be found under "Security" in System Preferences. Linux has a variety of firewall configuration systems and tools. If you're using Ubuntu's *ufw*, you can do this:
|
||||||
|
|
||||||
The Mac firewall can be found under "Security" in System Preferences. Linux has a variety of firewall configuration systems and tools.
|
sudo ufw allow 9993/udp
|
||||||
|
|
||||||
On CentOS check `/etc/sysconfig/iptables` for IPTables rules. For other distributions consult your distribution's documentation. You'll also have to check the UIs or documentation for commercial third party firewall applications like Little Snitch (Mac), McAfee Firewall Enterprise (Windows), etc. if you are running any of those. Some corporate environments might have centrally managed firewall software, so you might also have to contact IT.
|
On CentOS check `/etc/sysconfig/iptables` for IPTables rules. For other distributions consult your distribution's documentation. You'll also have to check the UIs or documentation for commercial third party firewall applications like Little Snitch (Mac), McAfee Firewall Enterprise (Windows), etc. if you are running any of those. Some corporate environments might have centrally managed firewall software, so you might also have to contact IT.
|
||||||
|
|
||||||
ZeroTier One peers will automatically locate each other and communicate directly over a local wired LAN *if UDP port 9993 inbound is open*. If that port is filtered, they won't be able to see each others' LAN announcement packets. If you're experiencing poor performance between devices on the same physical network, check their firewall settings. Without LAN auto-location peers must attempt "loopback" NAT traversal, which sometimes fails and in any case requires that every packet traverse your external router twice.
|
ZeroTier One peers will automatically locate each other and communicate directly over a local wired LAN *if UDP port 9993 inbound is open*. If that port is filtered, they won't be able to see each others' LAN announcement packets. If you're experiencing poor performance between devices on the same physical network, check their firewall settings. Without LAN auto-location peers must attempt "loopback" NAT traversal, which sometimes fails and in any case requires that every packet traverse your external router twice.
|
||||||
|
|
||||||
Users behind certain types of firewalls and "symmetric" NAT devices may not be able to connect to external peers directly at all. ZeroTier has limited support for port prediction and will *attempt* to traverse symmetric NATs, but this doesn't always work. If P2P connectivity fails you'll be bouncing UDP packets off our relay servers resulting in slower performance. Some NAT router(s) have a configurable NAT mode, and setting this to "full cone" will eliminate this problem. If you do this you may also see a magical improvement for things like VoIP phones, Skype, BitTorrent, WebRTC, certain games, etc., since all of these use NAT traversal techniques similar to ours.
|
Users behind certain types of firewalls and "symmetric" NAT devices may not able able to connect to external peers directly at all. ZeroTier has limited support for port prediction and will *attempt* to traverse symmetric NATs, but this doesn't always work. If P2P connectivity fails you'll be bouncing UDP packets off our relay servers resulting in slower performance. Some NAT router(s) have a configurable NAT mode, and setting this to "full cone" will eliminate this problem. If you do this you may also see a magical improvement for things like VoIP phones, Skype, BitTorrent, WebRTC, certain games, etc., since all of these use NAT traversal techniques similar to ours.
|
||||||
|
|
||||||
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
|
If a firewall between you and the Internet blocks ZeroTier's UDP traffic, you will fall back to last-resort TCP tunneling to rootservers over port 443 (https impersonation). This will work almost anywhere but is *very slow* compared to UDP or direct peer to peer connectivity.
|
||||||
|
|
||||||
Additional help can be found in our [knowledge base](https://zerotier.atlassian.net/wiki/spaces/SD/overview).
|
Additional help [can be found in our knowledge base](https://zerotier.atlassian.net/wiki/spaces/SD/overview).
|
||||||
|
|
||||||
### Prometheus Metrics
|
|
||||||
|
|
||||||
Prometheus Metrics are available at the `/metrics` API endpoint. This endpoint is protected by an API key stored in `metricstoken.secret` to prevent unwanted information leakage. Information that could be gleaned from the metrics include joined networks and peers your instance is talking to.
|
|
||||||
|
|
||||||
Access control is via the ZeroTier control interface itself and `metricstoken.secret`. This can be sent as a bearer auth token, via the `X-ZT1-Auth` HTTP header field, or appended to the URL as `?auth=<token>`. You can see the current metrics via `cURL` with the following command:
|
|
||||||
|
|
||||||
// Linux
|
|
||||||
curl -H "X-ZT1-Auth: $(sudo cat /var/lib/zerotier-one/metricstoken.secret)" http://localhost:9993/metrics
|
|
||||||
|
|
||||||
// macOS
|
|
||||||
curl -H "X-ZT1-Auth: $(sudo cat /Library/Application\ Support/ZeroTier/One/metricstoken.secret)" http://localhost:9993/metrics
|
|
||||||
|
|
||||||
// Windows PowerShell (Admin)
|
|
||||||
Invoke-RestMethod -Headers @{'X-ZT1-Auth' = "$(Get-Content C:\ProgramData\ZeroTier\One\metricstoken.secret)"; } -Uri http://localhost:9993/metrics
|
|
||||||
|
|
||||||
To configure a scrape job in Prometheus on the machine ZeroTier is running on, add this to your Prometheus `scrape_config`:
|
|
||||||
|
|
||||||
- job_name: zerotier-one
|
|
||||||
honor_labels: true
|
|
||||||
scrape_interval: 15s
|
|
||||||
metrics_path: /metrics
|
|
||||||
static_configs:
|
|
||||||
- targets:
|
|
||||||
- 127.0.0.1:9993
|
|
||||||
labels:
|
|
||||||
group: zerotier-one
|
|
||||||
node_id: $YOUR_10_CHARACTER_NODE_ID
|
|
||||||
authorization:
|
|
||||||
credentials: $YOUR_METRICS_TOKEN_SECRET
|
|
||||||
|
|
||||||
If neither of these methods are desirable, it is probably possible to distribute metrics via [Prometheus Proxy](https://github.com/pambrose/prometheus-proxy) or some other tool. Note: We have not tested this internally, but will probably work with the correct configuration.
|
|
||||||
|
|
||||||
Metrics are also available on disk in ZeroTier's working directory:
|
|
||||||
|
|
||||||
// Linux
|
|
||||||
/var/lib/zerotier-one/metrics.prom
|
|
||||||
|
|
||||||
// macOS
|
|
||||||
/Library/Application\ Support/ZeroTier/One/metrics.prom
|
|
||||||
|
|
||||||
//Windows
|
|
||||||
C:\ProgramData\ZeroTier\One\metrics.prom
|
|
||||||
|
|
||||||
#### Available Metrics
|
|
||||||
|
|
||||||
| Metric Name | Labels | Metric Type | Description |
|
|
||||||
| --- | --- | --- | --- |
|
|
||||||
| zt_packet | packet_type, direction | Counter | ZeroTier packet type counts |
|
|
||||||
| zt_packet_error | error_type, direction | Counter | ZeroTier packet errors|
|
|
||||||
| zt_data | protocol, direction | Counter | number of bytes ZeroTier has transmitted or received |
|
|
||||||
| zt_num_networks | | Gauge | number of networks this instance is joined to |
|
|
||||||
| zt_network_multicast_groups_subscribed | network_id | Gauge | number of multicast groups networks are subscribed to |
|
|
||||||
| zt_network_packets | network_id, direction | Counter | number of incoming/outgoing packets per network |
|
|
||||||
| zt_peer_latency | node_id | Histogram | peer latency (ms) |
|
|
||||||
| zt_peer_path_count | node_id, status | Gauge | number of paths to peer |
|
|
||||||
| zt_peer_packets | node_id, direction | Counter | number of packets to/from a peer |
|
|
||||||
| zt_peer_packet_errors | node_id | Counter | number of incoming packet errors from a peer |
|
|
||||||
|
|
||||||
If there are other metrics you'd like to see tracked, ask us in an Issue or send us a Pull Request!
|
|
||||||
|
|
||||||
### HTTP / App server
|
|
||||||
|
|
||||||
There is a static http file server suitable for hosting Single Page Apps at http://localhost:9993/app/<app-path>
|
|
||||||
|
|
||||||
Use `zerotier-cli info -j` to find your zerotier-one service's homeDir
|
|
||||||
|
|
||||||
``` sh
|
|
||||||
cd $ZT_HOME
|
|
||||||
sudo mkdir -p app/app1
|
|
||||||
sudo mkdir -p app/appB
|
|
||||||
echo '<html><meta charset=utf-8><title>appA</title><body><h1>hello world A' | sudo tee app/appA/index.html
|
|
||||||
echo '<html><meta charset=utf-8><title>app2</title><body><h1>hello world 2' | sudo tee app/app2/index.html
|
|
||||||
curl -sL http://localhost:9993/app/appA http://localhost:9993/app/app2
|
|
||||||
```
|
|
||||||
|
|
||||||
Then visit [http://localhost:9993/app/app1/](http://localhost:9993/app/app1/) and [http://localhost:9993/app/appB/](http://localhost:9993/app/appB/)
|
|
||||||
|
|
||||||
Requests to paths don't exist return the app root index.html, as is customary for SPAs.
|
|
||||||
If you want, you can write some javascript that talks to the service or controller [api](https://docs.zerotier.com/service/v1).
|
|
||||||
|
|
286
RELEASE-NOTES.md
286
RELEASE-NOTES.md
|
@ -1,278 +1,42 @@
|
||||||
ZeroTier Release Notes
|
ZeroTier Release Notes
|
||||||
======
|
======
|
||||||
|
|
||||||
# 2024-10-23 -- Version 1.14.2
|
# Version 1.9.0 (2.0 beta)
|
||||||
|
|
||||||
* Fix for missing entitlement on macOS Sequoia.
|
Version 2.0 is a very significant release with many changes. It remains backward compatibility to version 1.4.0 (and possibly earlier versions but this is not guaranteed) but makes numerous local and behavioral changes that should be reviewed before upgrading production systems.
|
||||||
* Fix for a problem correctly parsing local.conf to enable low bandwidth mode.
|
|
||||||
* Increment versions of some dependent libraries.
|
|
||||||
* Other fixes.
|
|
||||||
|
|
||||||
# 2024-09-12 -- Version 1.14.1
|
After this release we're going to be working to get to a more frequent, less extreme, more "agile" release cadence.
|
||||||
|
|
||||||
* Multithreaded packet I/O support! Currently this is just for Linux and must
|
Protocol changes:
|
||||||
be enabled in local.conf. It will likely make the largest difference on small
|
|
||||||
multi-core devices where CPU is a bottleneck and high throughput is desired.
|
|
||||||
It may be enabled by default in the future but we want it to be thoroughly
|
|
||||||
tested. It's a little harder than it seems at first glance due to the need
|
|
||||||
to keep packets in sequence and balance load.
|
|
||||||
* Several multipath bug fixes.
|
|
||||||
* Updated the versions on a number of libraries related to OIDC support and HTTP.
|
|
||||||
* MacOS .app now shows the correct version in its Info.plist manifest.
|
|
||||||
* Sanitize MAC addresses in JSON format rules parser.
|
|
||||||
* Some basic information about the platform (OS, CPU architecture) is now reported
|
|
||||||
to network controllers when networks are joined so it can be displayed to
|
|
||||||
network admins and in the future used in policy checking and inventory operations.
|
|
||||||
|
|
||||||
# 2024-05-02 -- Version 1.14.0
|
* Trusted paths have been completely removed. The new AES mode is so fast on CPUs with AES acceleration that much of the rationale for this is gone, and this feature was never used much to begin with due to inconvenience and obvious security concerns. Environments using trusted paths will need to upgrade all nodes at once.
|
||||||
|
* The symmetric encryption algorithm and mode is now AES-GMAC-SIV, a variation of AES-GCM using the same primitives but offering superior security bounds and behavior under non-ideal conditions. It's also a lot faster than Salsa20/12 and Poly1305 on CPUs with AES acceleration (almost all desktops, laptops, and newer routers and phones). Salsa20/12 with Poly1305 is still supported for communication with older versions and small devices that lack AES acceleration.
|
||||||
|
* A new identity type (1) has been introduced that contains both Curve25519 and NIST P-384 public key types, but classic type 0 remains the default for new identities for now. ECDH key agreement between V1 identities uses both keys and hashes the resulting secrets to yield security equal to the best of the two, but V1 identities can also agree with V0 identities using only their Curve25519 component.
|
||||||
|
* Roots can now be joined and left like networks in a much more convenient way, and the old "moon" and "planet" terminology is deprecated.
|
||||||
|
* A new peer to peer multicast algorithm has been introduced that offers much better scalability and better performance, especially when the physical network itself is hub-and-spoke with many low latency peers connected by higher latency WAN links.
|
||||||
|
* Forward secrecy is finally supported via periodic re-keying using ephemeral asymmetric keys. Both Curve25519 and NIST P-384 keys are used with secrets being hashed to provide security equal to the stronger of the two curves.
|
||||||
|
* As part of forward secrecy implementation peers now always exchange HELLO messages even if they don't have a direct path.
|
||||||
|
* Compression is only enabled for control packets as almost all data packets are largely un-compressable.
|
||||||
|
* New NAT traversal tricks have been added, such as (ab)use of port 500.
|
||||||
|
|
||||||
* Linux I/O performance improvements under heavy load
|
Code changes:
|
||||||
* Improvements to multipath
|
|
||||||
* Fix for port rebinding "coma" bug after periods offline (some laptop users)
|
|
||||||
* Fixed a rules engine quirk/ambiguity (GitHub Issue #2200)
|
|
||||||
* Controller API enhancements: node names and other node meta-data
|
|
||||||
* Other bug fixes
|
|
||||||
|
|
||||||
# 2023-09-12 -- Version 1.12.2
|
* Migrated from GNU make to cmake for easier cross platform builds and simplified build files.
|
||||||
|
* The core network hypervisor has been significantly refactored, almost amounting to a partial rewrite.
|
||||||
|
* Critical packet handling paths have been streamlined with unnecessary memcpy() steps removed.
|
||||||
|
* Host service code has been completely rewritten in Go. Packet handling code remains in C++, but Go offers superior developer productivity when it comes to implementing more complex local service and local API features. Go imposes a little bit more memory overhead but not much and has been tuned to minimize memory use.
|
||||||
|
|
||||||
* More improvements to macOS full tunnel mode.
|
User interface:
|
||||||
* Faster recovery after changes to physical network settings.
|
|
||||||
|
|
||||||
# 2023-08-25 -- Version 1.12.1
|
* Command line interface has been redesigned and rewritten. Old commands names are supported but their output will be different.
|
||||||
|
|
||||||
* Minor release to fix a port binding issue in Linux.
|
Other things:
|
||||||
* Update Debian dependencies.
|
|
||||||
* No changes for other platforms.
|
|
||||||
|
|
||||||
# 2023-08-23 -- Version 1.12.0
|
* The V2 design, protocol, and cryptographic primitives (AES-GMAC-SIV) have been security audited by [Trail of Bits](https://www.trailofbits.com), and the code is being audited as well prior to full 2.0 release.
|
||||||
|
|
||||||
* Experimental Windows ARM64 support
|
---
|
||||||
* Fix numerous sleep/wake issues on macOS and other platforms
|
|
||||||
* Faster recovery after changes to physical network settings
|
|
||||||
* Prometheus compatible metrics support!
|
|
||||||
* Fix full tunnel mode on recent macOS versions
|
|
||||||
* Numerous macOS DNS fixes
|
|
||||||
* 10-30% speed improvement on Linux
|
|
||||||
|
|
||||||
# 2023-03-23 -- Version 1.10.6
|
# Older version release notes
|
||||||
|
|
||||||
* Prevent binding temporary ipv6 addresses on macos (#1910)
|
|
||||||
* Prevent path-learning loops (#1914)
|
|
||||||
* Prevent infinite loop of UAC prompts in tray app
|
|
||||||
|
|
||||||
# 2023-03-10 -- Version 1.10.5
|
|
||||||
|
|
||||||
* Fix for high CPU usage bug on Windows
|
|
||||||
|
|
||||||
# 2023-03-07 -- Version 1.10.4
|
|
||||||
|
|
||||||
* SECURITY FIX (Windows): this version fixes a file permission problem on
|
|
||||||
Windows that could allow non-privileged users on a Windows system to read
|
|
||||||
privileged files in the ZeroTier service's working directory. This could
|
|
||||||
allow an unprivileged local Windows user to administrate the local ZeroTier
|
|
||||||
instance without appropriate local permissions. This issue is not remotely
|
|
||||||
exploitable unless a remote user can read arbitrary local files, and does
|
|
||||||
not impact other operating systems.
|
|
||||||
|
|
||||||
* Fix a bug in the handling of multiple IP address assignments to virtual
|
|
||||||
interfaces on macOS.
|
|
||||||
|
|
||||||
# 2023-02-15 -- Version 1.10.3
|
|
||||||
|
|
||||||
* Fix for duplicate paths in client. Could cause connectivity issues. Affects all platforms.
|
|
||||||
* Fix for Ethernet Tap MTU setting, would not properly apply on Linux.
|
|
||||||
* Fix default route bugs (macOS.)
|
|
||||||
* Enable Ping automatically for ZeroTier Adapters (Windows.)
|
|
||||||
* SSO updates and minor bugfixes.
|
|
||||||
* Add low-bandwidth mode.
|
|
||||||
* Add forceTcpRelay mode (optionally enabled.)
|
|
||||||
* Fix bug that prevented setting of custom TCP relay address.
|
|
||||||
* Build script improvements and bug fixes.
|
|
||||||
|
|
||||||
# 2022-11-01 -- Version 1.10.2
|
|
||||||
|
|
||||||
* Fix another SSO "stuck client" issue in zeroidc.
|
|
||||||
* Expose root-reported external IP/port information via the local JSON API for better diagnostics.
|
|
||||||
* Multipath: CLI output improvement for inspecting bonds
|
|
||||||
* Multipath: balance-aware mode
|
|
||||||
* Multipath: Custom policies
|
|
||||||
* Multipath: Link quality measurement improvements
|
|
||||||
|
|
||||||
Note that releases are coming few and far between because most of our dev effort is going into version 2.
|
|
||||||
|
|
||||||
# 2022-06-27 -- Version 1.10.1
|
|
||||||
|
|
||||||
* Fix an issue that could cause SSO clients to get "stuck" on stale auth URLs.
|
|
||||||
* A few other SSO related bug fixes.
|
|
||||||
|
|
||||||
# 2022-06-07 -- Version 1.10.0
|
|
||||||
|
|
||||||
* Fix formatting problem in `zerotier-cli` when using SSO networks.
|
|
||||||
* Fix a few other minor bugs in SSO signin to prepare for general availability.
|
|
||||||
* Remove requirement for webview in desktop UI and instead just make everything available via the tray pulldown/menu. Use [libui-ng](https://github.com/libui-ng/libui-ng) for minor prompt dialogs. Saves space and eliminates installation headaches on Windows.
|
|
||||||
* Fix SSO "spam" bug in desktop UI.
|
|
||||||
* Use system default browser for SSO login so all your plugins, MFA devices, password managers, etc. will work as you have them configured.
|
|
||||||
* Minor fix for bonding/multipath.
|
|
||||||
|
|
||||||
# 2022-05-10 -- Version 1.8.10
|
|
||||||
|
|
||||||
* Fixed a bug preventing SSO sign-on on Windows.
|
|
||||||
|
|
||||||
# 2022-04-25 -- Version 1.8.9
|
|
||||||
|
|
||||||
* Fixed a long-standing and strange bug that was causing sporadic "phantom" packet authentication failures. Not a security problem but could be behind sporadic reports of link failures under some conditions.
|
|
||||||
* Fixed a memory leak in SSO/OIDC support.
|
|
||||||
* Fixed SSO/OIDC display error on CLI.
|
|
||||||
* Fixed a bug causing nodes to sometimes fail to push certs to each other (primarily affects SSO/OIDC use cases).
|
|
||||||
* Fixed a deadlock bug on leaving SSO/OIDC managed networks.
|
|
||||||
* Added some new Linux distributions to the build subsystem.
|
|
||||||
|
|
||||||
# 2022-04-11 -- Version 1.8.8
|
|
||||||
|
|
||||||
* Fix a local privilege escalation bug in the Windows installer.
|
|
||||||
* Dependency fix for some Ubuntu versions.
|
|
||||||
* No changes for other platforms. Windows upgrade recommended, everyone else optional.
|
|
||||||
|
|
||||||
# 2022-03-30 -- Version 1.8.7
|
|
||||||
|
|
||||||
* Fix for dependency installations in Windows MSI package.
|
|
||||||
* Fix for desktop UI setup when run by a non-super-user.
|
|
||||||
* Bug fix in local OIDC / SSO support for auth0 and other providers.
|
|
||||||
* Other minor fixes for e.g. old Linux distributions.
|
|
||||||
|
|
||||||
# 2022-03-04 -- Version 1.8.6
|
|
||||||
|
|
||||||
* Fixed an issue that could cause the UI to be non-responsive if not joined to any networks.
|
|
||||||
* Fix dependency issues in Debian and RedHat packages for some distributions (Fedora, Mint).
|
|
||||||
* Bumped the peer cache serialization version to prevent "coma" issues on upgrade due to changes in path logic behaving badly with old values.
|
|
||||||
|
|
||||||
# 2022-02-22 -- Version 1.8.5
|
|
||||||
|
|
||||||
* Plumbing under the hood for endpoint device SSO support.
|
|
||||||
* Fix in LinuxEthernetTap to tap device support on very old (2.6) Linux kernels.
|
|
||||||
* Fix an issue that could cause self-hosted roots ("moons") to fail to assist peers in making direct links. (GitHub issue #1512)
|
|
||||||
* Merge a series of changes by Joseph Henry (of ZeroTier) that should fix some edge cases where ZeroTier would "forget" valid paths.
|
|
||||||
* Minor multipath improvements for automatic path negotiation.
|
|
||||||
|
|
||||||
# 2021-11-30 -- Version 1.8.4
|
|
||||||
|
|
||||||
* Fixed an ugly font problem on some older macOS versions.
|
|
||||||
* Fixed a bug that could cause the desktop tray app control panel to stop opening after a while on Windows.
|
|
||||||
* Fixed a possible double "release" in macOS tray app code that crashed on older macOS versions.
|
|
||||||
* Fixed installation on 32-bit Windows 10.
|
|
||||||
* Fixed a build flags issue that could cause ZeroTier to crash on older ARM32 CPUs.
|
|
||||||
|
|
||||||
# 2021-11-15 -- Version 1.8.3
|
|
||||||
|
|
||||||
* Remove problematic spinlock, which was only used on x86_64 anyway. Just use pthread always.
|
|
||||||
* Fix fd leak on MacOS that caused non-responsiveness after some time.
|
|
||||||
* Fix Debian install scripts to set /usr/sbin/nologin as shell on service user.
|
|
||||||
* Fix regression that could prevent managed routes from being deleted.
|
|
||||||
* DesktopUI: Remove NSDate:now() call, now works on MacOS 10.13 or newer!
|
|
||||||
|
|
||||||
# 2021-11-08 -- Version 1.8.2
|
|
||||||
|
|
||||||
* Fix multicast on linux.
|
|
||||||
* Fix a bug that could cause the tap adapter to have the wrong MAC on Linux.
|
|
||||||
* Update build flags to possibly support MacOS older than 10.14, but more work needs to be done. It may not work yet.
|
|
||||||
* Fix path variable setting on Windows.
|
|
||||||
|
|
||||||
# 2021-10-28 -- Version 1.8.1
|
|
||||||
|
|
||||||
* Fix numerous UI issues from 1.8.0 (never fully released).
|
|
||||||
* Remove support for REALLY ancient 1.1.6 or earlier network controllers.
|
|
||||||
* MacOS IPv6 no longer binds to temporary addresses as these can cause interruptions if they expire.
|
|
||||||
* Added additional hardening against address impersonation on networks (also in 1.6.6).
|
|
||||||
* Fix an issue that could cause clobbering of MacOS IP route settings on restart.
|
|
||||||
|
|
||||||
* NOTE: Windows 7 is no longer supported! Windows 7 users will have to use version 1.6.5 or earlier.
|
|
||||||
|
|
||||||
# 2021-09-15 -- Version 1.8.0 (preview release only)
|
|
||||||
|
|
||||||
* A *completely* rewritten desktop UI for Mac and Windows!
|
|
||||||
* Implement a workaround for one potential source of a "coma" bug, which can occur if buggy NATs/routers stop allowing the service to communicate on a given port. ZeroTier now reassigns a new secondary port if it's offline for a while unless a secondary port is manually specified in local.conf. Working around crummy buggy routers is an ongoing effort.
|
|
||||||
* Fix for MacOS MTU capping issue on feth devices
|
|
||||||
* Fix for mistakenly using v6 source addresses for v4 routes on some platforms
|
|
||||||
* Stop binding to temporary IPv6 addresses
|
|
||||||
* Set MAC address before bringing up Linux TAP link
|
|
||||||
* Check if DNS servers need to be applied on macOS
|
|
||||||
* Upgrade json.hpp dependency to version 3.10.2
|
|
||||||
|
|
||||||
# 2021-09-21 -- Version 1.6.6
|
|
||||||
|
|
||||||
* Backport COM hash check mitigation against network member impersonation.
|
|
||||||
|
|
||||||
# 2021-04-13 -- Version 1.6.5
|
|
||||||
|
|
||||||
* Fix a bug in potential network path filtering that could in some circumstances lead to "software laser" effects.
|
|
||||||
* Fix a printf overflow in zerotier-cli (not exploitable or a security risk)
|
|
||||||
* Windows now looks up the name of ZeroTier devices instead of relying on them having "ZeroTier" in them.
|
|
||||||
|
|
||||||
# 2021-02-15 -- Version 1.6.4
|
|
||||||
|
|
||||||
* The groundhog saw his shadow, which meant that the "connection coma" bug still wasn't gone. We think we found it this time.
|
|
||||||
|
|
||||||
# 2021-02-02 -- Version 1.6.3
|
|
||||||
|
|
||||||
* Likely fix for GitHub issue #1334, an issue that could cause ZeroTier to
|
|
||||||
go into a "coma" on some networks.
|
|
||||||
* Also groundhog day
|
|
||||||
|
|
||||||
# 2020-11-30 -- Version 1.6.2
|
|
||||||
|
|
||||||
* Fix an ARM hardware AES crypto issue (not an exploitable vulnerability).
|
|
||||||
* Fix a Linux network leave hang due to a mutex deadlock.
|
|
||||||
|
|
||||||
# 2020-11-24 -- Version 1.6.1
|
|
||||||
|
|
||||||
This release fixes some minor bugs and other issues in 1.6.0.
|
|
||||||
|
|
||||||
* Fixed a bug that caused IP addresses in the 203.0.0.0/8 block to be miscategorized as not being in global scope.
|
|
||||||
* Changed Linux builds to (hopefully) fix LXC and SELinux issues.
|
|
||||||
* Fixed unaligned memory access that caused crash on FreeBSD systems on the ARM architecture.
|
|
||||||
* Merged CLI options for controlling bonded devices into the beta multipath code.
|
|
||||||
* Updated Windows driver with Microsoft cross-signing to fix issues on some Windows systems.
|
|
||||||
|
|
||||||
# 2020-11-19 -- Version 1.6.0
|
|
||||||
|
|
||||||
Version 1.6.0 is a major release that incorporates back-ported features from the 2.0 branch, which is still under development. It also fixes a number of issues.
|
|
||||||
|
|
||||||
New features and improvements (including those listed under 1.5.0):
|
|
||||||
|
|
||||||
* **Apple Silicon** (MacOS ARM64) native support via universal binary. ZeroTier now requires the very latest Xcode to build.
|
|
||||||
* **Linux performance improvements** for up to 25% faster tun/tap I/O performance on multi-core systems.
|
|
||||||
* **Multipath support** with modes modeled after the Linux kernel's bonding driver. This includes active-passive and active-active modes with fast failover and load balancing. See section 2.1.5 of the manual.
|
|
||||||
* **DNS configuration** push from network controllers to end nodes, with locally configurable permissions for whether or not push is allowed.
|
|
||||||
* **AES-GMAC-SIV** encryption mode, which is both somewhat more secure and significantly faster than the old Salsa20/12-Poly1305 mode on hardware that supports AES acceleration. This includes virtually all X86-64 chips and most ARM64. This mode is based on AES-SIV and has been audited by Trail of Bits to ensure that it is equivalent security-wise.
|
|
||||||
|
|
||||||
Bug fixes:
|
|
||||||
|
|
||||||
* **Managed route assignment fixes** to eliminate missing routes on Linux and what we believe to be the source of sporadic high CPU usage on MacOS.
|
|
||||||
* **Hang on shutdown** issues should be fixed.
|
|
||||||
* **Sporadic multicast outages** should be fixed.
|
|
||||||
|
|
||||||
Known remaining issues:
|
|
||||||
|
|
||||||
* AES hardware acceleration is not yet supported on 32-bit ARM, PowerPC (32 or 64), or MIPS (32 or 64) systems. Currently supported are X86-64 and ARM64/AARCH64 with crypto extensions.
|
|
||||||
|
|
||||||
# 2020-10-05 -- Version 1.5.0 (actually 1.6.0-beta1)
|
|
||||||
|
|
||||||
Version 1.6.0 (1.5.0 is a beta!) is a significant release that incorporates a number of back-ported fixes and features from the ZeroTier 2.0 tree.
|
|
||||||
|
|
||||||
Major new features are:
|
|
||||||
|
|
||||||
* **Multipath support** with modes modeled after the Linux kernel's bonding driver. This includes active-passive and active-active modes with fast failover and load balancing. See section 2.1.5 of the manual.
|
|
||||||
* **DNS configuration** push from network controllers to end nodes, with locally configurable permissions for whether or not push is allowed.
|
|
||||||
* **AES-GMAC-SIV** encryption mode, which is both somewhat more secure and significantly faster than the old Salsa20/12-Poly1305 mode on hardware that supports AES acceleration. This includes virtually all X86-64 chips and most ARM64. This mode is based on AES-SIV and has been audited by Trail of Bits to ensure that it is equivalent security-wise.
|
|
||||||
|
|
||||||
Known issues that are not yet fixed in this beta:
|
|
||||||
|
|
||||||
* Some Mac users have reported periods of 100% CPU in kernel_task and connection instability after leaving networks that have been joined for a period of time, or needing to kill ZeroTier and restart it to finish leaving a network. This doesn't appear to affect all users and we haven't diagnosed the root cause yet.
|
|
||||||
* The service sometimes hangs on shutdown requiring a kill -9. This also does not affect all systems or users.
|
|
||||||
* AES hardware acceleration is not yet supported on 32-bit ARM, PowerPC (32 or 64), or MIPS (32 or 64) systems. Currently supported are X86-64 and ARM64/AARCH64 with crypto extensions.
|
|
||||||
* Some users have reported multicast/broadcast outages on networks lasting up to 30 seconds. Still investigating.
|
|
||||||
|
|
||||||
We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
|
|
||||||
|
|
||||||
# 2019-08-30 -- Version 1.4.6
|
# 2019-08-30 -- Version 1.4.6
|
||||||
|
|
||||||
|
@ -372,7 +136,7 @@ We're trying to fix all these issues before the 1.6.0 release. Stay tuned.
|
||||||
# 2017-04-20 -- Version 1.2.4
|
# 2017-04-20 -- Version 1.2.4
|
||||||
|
|
||||||
* Managed routes are now only bifurcated for the default route. This is a change in behavior, though few people will probably notice. Bifurcating all managed routes was causing more trouble than it was worth for most users.
|
* Managed routes are now only bifurcated for the default route. This is a change in behavior, though few people will probably notice. Bifurcating all managed routes was causing more trouble than it was worth for most users.
|
||||||
* Up to 2X crypto speedup on x86-64 (except Windows, which will take some porting) and 32-bit ARM platforms due to integration of fast assembly language implementations of Salsa20/12 from the [supercop](http://bench.cr.yp.to/supercop.html) code base. These were written by Daniel J. Bernstein and are in the public domain. My MacBook Pro (Core i5 2.8ghz) now does almost 1.5GiB/sec Salsa20/12 per core and a Raspberry Pi got a 2X boost. 64-bit ARM support and Windows support will take some work but should not be too hard.
|
* Up to 2X crypto speedup on x86-64 (except Windows, which will take some porting) and 32-bit ARM platforms due to integration of fast assembly language implementations of Salsa20/12 from the [supercop](http://bench.cr.yp.to/supercop.html) code base. These were written by Daniel J. Bernstein and are in the public domain. My Macbook Pro (Core i5 2.8ghz) now does almost 1.5GiB/sec Salsa20/12 per core and a Raspberry Pi got a 2X boost. 64-bit ARM support and Windows support will take some work but should not be too hard.
|
||||||
* Refactored code that manages credentials to greatly reduce memory use in most cases. This may also result in a small performance improvement.
|
* Refactored code that manages credentials to greatly reduce memory use in most cases. This may also result in a small performance improvement.
|
||||||
* Reworked and simplified path selection and priority logic to fix path instability and dead path persistence edge cases. There have been some sporadic reports of persistent path instabilities and dead paths hanging around that take minutes to resolve. These have proven difficult to reproduce in house, but hopefully this will fix them. In any case it seems to speed up path establishment in our tests and it makes the code simpler and more readable.
|
* Reworked and simplified path selection and priority logic to fix path instability and dead path persistence edge cases. There have been some sporadic reports of persistent path instabilities and dead paths hanging around that take minutes to resolve. These have proven difficult to reproduce in house, but hopefully this will fix them. In any case it seems to speed up path establishment in our tests and it makes the code simpler and more readable.
|
||||||
* Eliminated some unused cruft from the code around path management and in the peer class.
|
* Eliminated some unused cruft from the code around path management and in the peer class.
|
||||||
|
|
93
SECURITY.md
93
SECURITY.md
|
@ -1,93 +0,0 @@
|
||||||
# Security
|
|
||||||
|
|
||||||
ZeroTier takes the security of our software products and services seriously, which
|
|
||||||
includes all source code repositories managed through our GitHub organization.
|
|
||||||
|
|
||||||
## Supported Versions
|
|
||||||
|
|
||||||
The following versions of ZeroTier One receive security updates
|
|
||||||
|
|
||||||
| Version | Supported |
|
|
||||||
| -------- | ------------------ |
|
|
||||||
| 1.14.x | :white_check_mark: |
|
|
||||||
| 1.12.x | :white_check_mark: |
|
|
||||||
| < 1.12.0 | :x: |
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
|
||||||
|
|
||||||
**Please do not report security issues through public GitHub issues**
|
|
||||||
|
|
||||||
Instead, please report vulnerabilities via email to security@zerotier.com. If possible,
|
|
||||||
please encrypt with our PGP key (see below).
|
|
||||||
|
|
||||||
Please include the following information, or as much as you can provide to help us
|
|
||||||
understand the nature and scope of the issue:
|
|
||||||
|
|
||||||
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
|
||||||
* Full paths of source file(s) related to the manifestation of the issue
|
|
||||||
* The location of the affected source code (tag/branch/commit or direct URL)
|
|
||||||
* Any special configuration required to reproduce the issue
|
|
||||||
* Step-by-step instructions to reproduce the issue
|
|
||||||
* Proof-of-concept or exploit code (if possible)
|
|
||||||
* Impact of the issue, including how an attacker might exploit the issue
|
|
||||||
|
|
||||||
## Preferred Languages
|
|
||||||
|
|
||||||
We prefer all communications to be in English.
|
|
||||||
|
|
||||||
## security@zerotier.com PGP key
|
|
||||||
|
|
||||||
```
|
|
||||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
|
||||||
|
|
||||||
mQINBGQGOVIBEACalXTnNqaiSOVLFEiqHpDMg8N/OI5D5850Xy1ZEvx3B3rz7cbn
|
|
||||||
k30ozHtJKbh+vqpyItE7DjyQAuF19gP5Q64Yh0Y+MmLHq60q/GwOwAYz7cI+UzA3
|
|
||||||
5x8YqcmTp32LAM1xJn+iMlMLBuAmJl4kULKmOXPlpqPiyTFs5saizvm7fgRmfgJJ
|
|
||||||
HpsnIrTkaDFJhAR+jvMJohVYwmhuydeI0DsHu7KGpG1ddcHDrUjOPNqXnnAPSPwx
|
|
||||||
llw4yfKlQb8GYErsv/G5QVyzd5+SxEuiI4MARRnrk8LlMQ33CR6pzIQ/Bk5AAmye
|
|
||||||
mHqfEAknkiOf++urYhRs9BL3Kz3MdV0cg92zr9EFOg0u56jxf5OnAiTOhGUUA0hn
|
|
||||||
dS7peVGl46R9Oy2JYIazNDGi+4NIsYDFXsnsss9xOQVygPyeQd71zFHfix0jct9w
|
|
||||||
j3o/kj7Egsnm9nc13354bYT6bbalqXiRWwGH1eAFpjueNWiVFwZS6NZUP3WeNDiY
|
|
||||||
BlPo1LodvolbXiJcTILTCyEkERJPCK2zoE2nTdVfvTLWsuehw1M6Yd2/q74TVYy/
|
|
||||||
RY+KjHkrChEBQ9PqXsXRHj6opKbT8JLfZkvU5k+3IiqqxOpB+QXFI/whj493CxWW
|
|
||||||
so7QAmzOCyJq8GDVPxzkwUac22YIkXdiOmb8i/HWq+kLY/HjQE259Gx6KwARAQAB
|
|
||||||
tClaZXJvVGllciBTZWN1cml0eSA8c2VjdXJpdHlAemVyb3RpZXIuY29tPokCTAQT
|
|
||||||
AQoANhYhBH1HQGb+4jzl6mnFqf09m6uqADkABQJkBjlSAhsDBAsJCAcEFQoJCAUW
|
|
||||||
AgMBAAIeAQIXgAAKCRD9PZurqgA5ACqPD/sFt6SG6Tu0HwTY2ofJtYsa2GBLL0pf
|
|
||||||
dYlX4cWSs1PVB5+m5Oj18y+GB2umA9GnsVtmvaSfp3XEngt2zNWX27uUsVfL35b2
|
|
||||||
/5TVVe8RjzOedqMN+lQWMvO+f/C1zmWYXjjpC+iGjgMMaRRrofkkn+7uL4N9y6gY
|
|
||||||
rcXtpACT1rYFC+i1AKnZfUO8Vr5ji7odq0f7bDkN/N38rB0kRRwEmO8wqdpQK6gK
|
|
||||||
nxf9vgJl5ggimDk5Xtz1sfd3y28bf5N4hdOCkXUbd10nUFY3wDNTM4VxozxTGJeG
|
|
||||||
imdcc19Wuw/1fGUZ5SIjgPanCdPLGYwSTr+M6Fuern9uTtlC1GOby3BUtmVGP6EU
|
|
||||||
1pSAJSRpmoBPHKKOYtSMwV8PCboXru9P1ab8y8STKM3SKyghUJrl17gdc0LaksZa
|
|
||||||
E54pJudGPIQMFRqZjMdV6jgMuaLTozjZ4mW8EThf4mkX4xDkO8l7cOn0225ZYJZC
|
|
||||||
lZKpdnwzk9owkJA80u4KBNJxTtB4ZAPzjBsD5hFzCZQTLNQp/psU3EjZsau28eXT
|
|
||||||
E/C1QjEQHgy4ohkgQlCm1H1+clKssCWcdmsVGXuS1u8gh4K6X9b0Z6LeCGRaQvH2
|
|
||||||
+DB8oTAdqp9nUZv9rP4pbo+sR4fF67CFLriVuxjedAiFkbM4uHMFcL4tc/X9+DRo
|
|
||||||
YN5X7oEkZvO507kCDQRkBjlSARAAz58UMF7K1qKyQjzKTcutaYZ5SaIGky9lCLZn
|
|
||||||
/2vjpFCoBogkxS/6IKQcwZk8b4S9QstaaQZDFEkxqNeKC0GiFTAMAb6SmYcK495h
|
|
||||||
EZnHl0NA5Nc2dBlZk5E/ENzTCz2bXaxCcVESc2z+xCzu07brbhGrqvliKiwOUzt9
|
|
||||||
JzqEsar6I95OutBcZvkFCs44/Uf9bS1qf1w4klE8w3vdMtGH23umrET4tFZ+sh6o
|
|
||||||
ZFtQx0u2eKjsRdn/RMtsxLNaJlcE1DdIAqBpQrcmuwMC8v5wUGfCGZjhClzmyQlq
|
|
||||||
akUkayir7UtbHbFT/mgO+YI77YGXWk5QrwPscqqT2l8KB/YMujNDmaWa/0KV1lIY
|
|
||||||
zr5s4dzVeiwqFLR9ANFIhzFwzf3JLi6XSx123Qix0TxZoYPZCHl7yoi9qi6qybz5
|
|
||||||
0Od2LSz3jbApeKYymZ+zjE+YV5y9DI6Wzy1j2M1FogNvTO9fMk+6dLt4HhTdSNvH
|
|
||||||
cKya462YCcy+tnZTkhmh+FTebbJlV6D4wG7skE5KCdBhjm53xLwp6XW9L6n2CrkL
|
|
||||||
W1IDBcCz0oPd1sMkXbO3wnxdXprV2XurCfsg/R2nszSNzvdJ8/xj3cr9hpoJ714R
|
|
||||||
qqyoEDRZ1Ss9kGL166o5MpN5qb/EewdkqGgWP7YFXbhsdHQiW7Z7dAqzjoaybD4O
|
|
||||||
nakkwyUAEQEAAYkCNgQYAQoAIBYhBH1HQGb+4jzl6mnFqf09m6uqADkABQJkBjlS
|
|
||||||
AhsMAAoJEP09m6uqADkAax0P/Rh8EZYRqW6dPYTl1YQusAK10rAcRNq3ekjofXGk
|
|
||||||
oXK1S7HWGoFgl5++5nfSfNgFJ5VLcgIM56wtIf49zFjWe5oC6fw8k+ghh4d2chMP
|
|
||||||
hdDILx6e0c30Iq1+EvovGR9hWa0wJ4cKTdzlwhY9ZC09q0ia+bl2mwpie1JQDR0c
|
|
||||||
zXCjt+PldLeeK9z1/XT0Q7KowYC+U18oR+KFm+EaRV4QT85JVequnIeGkmaHJrHB
|
|
||||||
lH4T5A5ib7y8edon1c0Zx3GsaxJUojkEJ0SX7ffVDu6ztUZfkHfCVpMW4VzUeGA/
|
|
||||||
m+CtFO9ciLRGZEkRa+zhIGoBvwEXU0GiwiF4nZ0F2C8UioeW0YIEV9zl3nXJctYE
|
|
||||||
ZKc2whSENQRTGgaYHVoVZhznt71LKWgFLshwBo81UCXVkzwAjMW1ActDnmPw5M7q
|
|
||||||
xR5Qp5G49Z1GmfSozazha0HVFPKNV5i3RlTzs4yLUnZyH0yC9IvtOefMHcLjG96L
|
|
||||||
N5miEV97gvJJjrn8rhRvpUwAWgmT/9IuYjBNQTtNN40arto5HxezR76WCjdKYxdL
|
|
||||||
p3dM1iiBDShHNm7LdyZlLFhTOMU0tNBxJJ7B09ar5gakeZjD+2aB1ODX9VuFtozL
|
|
||||||
onBjI2gIkry0UIkuznHfFw05lZAZAiqHEVgVi/WTk4C/bklDZNgE0lx+IWzEz2iS
|
|
||||||
L455
|
|
||||||
=lheL
|
|
||||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
||||||
```
|
|
|
@ -14,7 +14,7 @@ The version must be incremented in all of the following files:
|
||||||
/debian/changelog
|
/debian/changelog
|
||||||
/ext/installfiles/mac/ZeroTier One.pkgproj
|
/ext/installfiles/mac/ZeroTier One.pkgproj
|
||||||
/ext/installfiles/windows/ZeroTier One.aip
|
/ext/installfiles/windows/ZeroTier One.aip
|
||||||
../DesktopUI/mac-app-template/ZeroTier.app/Contents/Info.plist
|
/windows/WinUI/AboutView.xaml
|
||||||
|
|
||||||
The final .AIP file can only be edited on Windows with [Advanced Installer Enterprise](http://www.advancedinstaller.com/). In addition to incrementing the version be sure that a new product code is generated. (The "upgrade code" GUID on the other hand must never change.)
|
The final .AIP file can only be edited on Windows with [Advanced Installer Enterprise](http://www.advancedinstaller.com/). In addition to incrementing the version be sure that a new product code is generated. (The "upgrade code" GUID on the other hand must never change.)
|
||||||
|
|
119
attic/PeerList.hpp
Normal file
119
attic/PeerList.hpp
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c)2013-2020 ZeroTier, Inc.
|
||||||
|
*
|
||||||
|
* Use of this software is governed by the Business Source License included
|
||||||
|
* in the LICENSE.TXT file in the project's root directory.
|
||||||
|
*
|
||||||
|
* Change Date: 2025-01-01
|
||||||
|
*
|
||||||
|
* On the date above, in accordance with the Business Source License, use
|
||||||
|
* of this software will be governed by version 2.0 of the Apache License.
|
||||||
|
*/
|
||||||
|
/****/
|
||||||
|
|
||||||
|
#ifndef ZT_PEERLIST_HPP
|
||||||
|
#define ZT_PEERLIST_HPP
|
||||||
|
|
||||||
|
#include "Constants.hpp"
|
||||||
|
#include "SharedPtr.hpp"
|
||||||
|
#include "Peer.hpp"
|
||||||
|
|
||||||
|
namespace ZeroTier {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A list of peers
|
||||||
|
*
|
||||||
|
* This is a simple vector optimized for the case where there will almost always
|
||||||
|
* be zero or one element. In that case it doesn't allocate. If there's more than
|
||||||
|
* one element, it will grow to include all elements.
|
||||||
|
*
|
||||||
|
* It's used to return lookups in Topology where there will almost always be zero
|
||||||
|
* or one peers returned but where there technically (but very rarely) can be more.
|
||||||
|
*/
|
||||||
|
class PeerList
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ZT_INLINE PeerList() noexcept:
|
||||||
|
m_onePeer(),
|
||||||
|
m_peers(&m_onePeer),
|
||||||
|
m_peerCount(0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
ZT_INLINE PeerList(const PeerList &pl)
|
||||||
|
{
|
||||||
|
const unsigned int pc = pl.m_peerCount;
|
||||||
|
if (likely(pc <= 1)) {
|
||||||
|
m_onePeer = pl.m_onePeer;
|
||||||
|
m_peers = &m_onePeer;
|
||||||
|
} else {
|
||||||
|
m_peers = new SharedPtr<Peer>[pc];
|
||||||
|
for (unsigned int i = 0;i < pc;++i)
|
||||||
|
m_peers[i] = pl.m_peers[i];
|
||||||
|
}
|
||||||
|
m_peerCount = pc;
|
||||||
|
}
|
||||||
|
|
||||||
|
ZT_INLINE ~PeerList()
|
||||||
|
{
|
||||||
|
if (unlikely(m_peers != &m_onePeer))
|
||||||
|
delete[] m_peers;
|
||||||
|
}
|
||||||
|
|
||||||
|
ZT_INLINE PeerList &operator=(const PeerList &pl)
|
||||||
|
{
|
||||||
|
if (&pl != this) {
|
||||||
|
if (unlikely(m_peers != &m_onePeer))
|
||||||
|
delete[] m_peers;
|
||||||
|
if (likely(pl.m_peerCount <= 1)) {
|
||||||
|
m_onePeer = pl.m_onePeer;
|
||||||
|
m_peers = &m_onePeer;
|
||||||
|
} else {
|
||||||
|
m_onePeer.zero();
|
||||||
|
m_peers = new SharedPtr<Peer>[pl.m_peerCount];
|
||||||
|
for (unsigned int i = 0;i < pl.m_peerCount;++i)
|
||||||
|
m_peers[i] = pl.m_peers[i];
|
||||||
|
}
|
||||||
|
m_peerCount = pl.m_peerCount;
|
||||||
|
}
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resize the peer list to store a given number of members
|
||||||
|
*
|
||||||
|
* To populate the list, this must be called first followed by each member
|
||||||
|
* being set with the [] operator. List content after this call is undefined
|
||||||
|
* and may contain old data if the object is being re-used.
|
||||||
|
*
|
||||||
|
* @param s New size of list
|
||||||
|
*/
|
||||||
|
ZT_INLINE void resize(const unsigned int s)
|
||||||
|
{
|
||||||
|
if (unlikely(m_peers != &m_onePeer))
|
||||||
|
delete[] m_peers;
|
||||||
|
m_peerCount = s;
|
||||||
|
if (likely(s <= 1)) {
|
||||||
|
m_peers = &m_onePeer;
|
||||||
|
} else {
|
||||||
|
m_peers = new SharedPtr<Peer>[s];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ZT_INLINE SharedPtr <Peer> &operator[](const unsigned int i) noexcept
|
||||||
|
{ return m_peers[i]; }
|
||||||
|
|
||||||
|
ZT_INLINE const SharedPtr <Peer> &operator[](const unsigned int i) const noexcept
|
||||||
|
{ return m_peers[i]; }
|
||||||
|
|
||||||
|
ZT_INLINE unsigned int size() const noexcept
|
||||||
|
{ return m_peerCount; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
SharedPtr <Peer> m_onePeer;
|
||||||
|
SharedPtr <Peer> *m_peers;
|
||||||
|
unsigned int m_peerCount;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace ZeroTier
|
||||||
|
|
||||||
|
#endif
|
|
@ -1,459 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Net;
|
|
||||||
using System.IO;
|
|
||||||
using System.Windows;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public class APIHandler
|
|
||||||
{
|
|
||||||
private string authtoken;
|
|
||||||
|
|
||||||
private string url = null;
|
|
||||||
|
|
||||||
private static volatile APIHandler instance;
|
|
||||||
private static object syncRoot = new Object();
|
|
||||||
|
|
||||||
public delegate void NetworkListCallback(List<ZeroTierNetwork> networks);
|
|
||||||
public delegate void StatusCallback(ZeroTierStatus status);
|
|
||||||
|
|
||||||
private string ZeroTierAddress = "";
|
|
||||||
|
|
||||||
public static APIHandler Instance
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
lock (syncRoot)
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
if (!initHandler())
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool initHandler(bool resetToken = false)
|
|
||||||
{
|
|
||||||
String localZtDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\ZeroTier\\One";
|
|
||||||
String globalZtDir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ZeroTier\\One";
|
|
||||||
|
|
||||||
String authToken = "";
|
|
||||||
Int32 port = 9993;
|
|
||||||
|
|
||||||
if (resetToken)
|
|
||||||
{
|
|
||||||
instance = null;
|
|
||||||
if (File.Exists(localZtDir + "\\authtoken.secret"))
|
|
||||||
{
|
|
||||||
File.Delete(localZtDir + "\\authtoken.secret");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (File.Exists(localZtDir + "\\zerotier-one.port"))
|
|
||||||
{
|
|
||||||
File.Delete(localZtDir + "\\zerotier-one.port");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!File.Exists(localZtDir + "\\authtoken.secret") || !File.Exists(localZtDir + "\\zerotier-one.port"))
|
|
||||||
{
|
|
||||||
// launch external process to copy file into place
|
|
||||||
String curPath = System.Reflection.Assembly.GetEntryAssembly().Location;
|
|
||||||
int index = curPath.LastIndexOf("\\");
|
|
||||||
curPath = curPath.Substring(0, index);
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo(curPath + "\\copyutil.exe", "\"" + globalZtDir + "\"" + " " + "\"" + localZtDir + "\"");
|
|
||||||
startInfo.Verb = "runas";
|
|
||||||
|
|
||||||
|
|
||||||
var process = Process.Start(startInfo);
|
|
||||||
process.WaitForExit();
|
|
||||||
}
|
|
||||||
|
|
||||||
authToken = readAuthToken(localZtDir + "\\authtoken.secret");
|
|
||||||
|
|
||||||
if ((authToken == null) || (authToken.Length <= 0))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Unable to read ZeroTier One authtoken", "ZeroTier One");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
port = readPort(localZtDir + "\\zerotier-one.port");
|
|
||||||
instance = new APIHandler(port, authToken);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String readAuthToken(String path)
|
|
||||||
{
|
|
||||||
String authToken = "";
|
|
||||||
|
|
||||||
if (File.Exists(path))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
byte[] tmp = File.ReadAllBytes(path);
|
|
||||||
authToken = System.Text.Encoding.UTF8.GetString(tmp).Trim();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
MessageBox.Show("Unable to read ZeroTier One Auth Token from:\r\n" + path, "ZeroTier One");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return authToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Int32 readPort(String path)
|
|
||||||
{
|
|
||||||
Int32 port = 9993;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
byte[] tmp = File.ReadAllBytes(path);
|
|
||||||
port = Int32.Parse(System.Text.Encoding.ASCII.GetString(tmp).Trim());
|
|
||||||
if ((port <= 0) || (port > 65535))
|
|
||||||
port = 9993;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
|
|
||||||
private APIHandler()
|
|
||||||
{
|
|
||||||
url = "http://127.0.0.1:9993";
|
|
||||||
}
|
|
||||||
|
|
||||||
public APIHandler(int port, string authtoken)
|
|
||||||
{
|
|
||||||
url = "http://127.0.0.1:" + port;
|
|
||||||
this.authtoken = authtoken;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void GetStatus(StatusCallback cb)
|
|
||||||
{
|
|
||||||
var request = WebRequest.Create(url + "/status" + "?auth=" + authtoken) as HttpWebRequest;
|
|
||||||
if (request != null)
|
|
||||||
{
|
|
||||||
request.Method = "GET";
|
|
||||||
request.ContentType = "application/json";
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var httpResponse = (HttpWebResponse)request.GetResponse();
|
|
||||||
if (httpResponse.StatusCode == HttpStatusCode.OK)
|
|
||||||
{
|
|
||||||
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
|
|
||||||
{
|
|
||||||
var responseText = streamReader.ReadToEnd();
|
|
||||||
|
|
||||||
ZeroTierStatus status = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
status = JsonConvert.DeserializeObject<ZeroTierStatus>(responseText);
|
|
||||||
|
|
||||||
if (ZeroTierAddress != status.Address)
|
|
||||||
{
|
|
||||||
ZeroTierAddress = status.Address;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (JsonReaderException e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e.ToString());
|
|
||||||
}
|
|
||||||
cb(status);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (httpResponse.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Net.Sockets.SocketException)
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
catch (System.Net.WebException e)
|
|
||||||
{
|
|
||||||
HttpWebResponse res = (HttpWebResponse)e.Response;
|
|
||||||
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void GetNetworks(NetworkListCallback cb)
|
|
||||||
{
|
|
||||||
var request = WebRequest.Create(url + "/network" + "?auth=" + authtoken) as HttpWebRequest;
|
|
||||||
if (request == null)
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
request.Method = "GET";
|
|
||||||
request.ContentType = "application/json";
|
|
||||||
request.Timeout = 10000;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var httpResponse = (HttpWebResponse)request.GetResponse();
|
|
||||||
|
|
||||||
if (httpResponse.StatusCode == HttpStatusCode.OK)
|
|
||||||
{
|
|
||||||
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
|
|
||||||
{
|
|
||||||
var responseText = streamReader.ReadToEnd();
|
|
||||||
|
|
||||||
List<ZeroTierNetwork> networkList = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
networkList = JsonConvert.DeserializeObject<List<ZeroTierNetwork>>(responseText);
|
|
||||||
foreach (ZeroTierNetwork n in networkList)
|
|
||||||
{
|
|
||||||
// all networks received via JSON are connected by definition
|
|
||||||
n.IsConnected = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (JsonReaderException e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e.ToString());
|
|
||||||
}
|
|
||||||
cb(networkList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (httpResponse.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Net.Sockets.SocketException)
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
catch (System.Net.WebException e)
|
|
||||||
{
|
|
||||||
HttpWebResponse res = (HttpWebResponse)e.Response;
|
|
||||||
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void JoinNetwork(Dispatcher d, string nwid, bool allowManaged = true, bool allowGlobal = false, bool allowDefault = false, bool allowDNS = false)
|
|
||||||
{
|
|
||||||
Task.Factory.StartNew(() =>
|
|
||||||
{
|
|
||||||
var request = WebRequest.Create(url + "/network/" + nwid + "?auth=" + authtoken) as HttpWebRequest;
|
|
||||||
if (request == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
request.Method = "POST";
|
|
||||||
request.ContentType = "applicaiton/json";
|
|
||||||
request.Timeout = 30000;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
using (var streamWriter = new StreamWriter(((HttpWebRequest)request).GetRequestStream()))
|
|
||||||
{
|
|
||||||
string json = "{\"allowManaged\":" + (allowManaged ? "true" : "false") + "," +
|
|
||||||
"\"allowGlobal\":" + (allowGlobal ? "true" : "false") + "," +
|
|
||||||
"\"allowDefault\":" + (allowDefault ? "true" : "false") + "," +
|
|
||||||
"\"allowDNS\":" + (allowDNS ? "true" : "false") + "}";
|
|
||||||
streamWriter.Write(json);
|
|
||||||
streamWriter.Flush();
|
|
||||||
streamWriter.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Net.WebException)
|
|
||||||
{
|
|
||||||
d.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("Error Joining Network: Cannot connect to ZeroTier service.");
|
|
||||||
}));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var httpResponse = (HttpWebResponse)request.GetResponse();
|
|
||||||
|
|
||||||
if (httpResponse.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
else if (httpResponse.StatusCode != HttpStatusCode.OK)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Error sending join network message");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Net.Sockets.SocketException)
|
|
||||||
{
|
|
||||||
d.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("Error Joining Network: Cannot connect to ZeroTier service.");
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
catch (System.Net.WebException e)
|
|
||||||
{
|
|
||||||
HttpWebResponse res = (HttpWebResponse)e.Response;
|
|
||||||
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
d.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("Error Joining Network: Cannot connect to ZeroTier service.");
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public void LeaveNetwork(Dispatcher d, string nwid)
|
|
||||||
{
|
|
||||||
Task.Factory.StartNew(() =>
|
|
||||||
{
|
|
||||||
var request = WebRequest.Create(url + "/network/" + nwid + "?auth=" + authtoken) as HttpWebRequest;
|
|
||||||
if (request == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
request.Method = "DELETE";
|
|
||||||
request.Timeout = 30000;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var httpResponse = (HttpWebResponse)request.GetResponse();
|
|
||||||
|
|
||||||
if (httpResponse.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
else if (httpResponse.StatusCode != HttpStatusCode.OK)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Error sending leave network message");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Net.Sockets.SocketException)
|
|
||||||
{
|
|
||||||
d.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("Error Leaving Network: Cannot connect to ZeroTier service.");
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
catch (System.Net.WebException e)
|
|
||||||
{
|
|
||||||
HttpWebResponse res = (HttpWebResponse)e.Response;
|
|
||||||
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
d.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
MessageBox.Show("Error Leaving Network: Cannot connect to ZeroTier service.");
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
Console.WriteLine("Error leaving network: Unknown error");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public delegate void PeersCallback(List<ZeroTierPeer> peers);
|
|
||||||
|
|
||||||
public void GetPeers(PeersCallback cb)
|
|
||||||
{
|
|
||||||
var request = WebRequest.Create(url + "/peer" + "?auth=" + authtoken) as HttpWebRequest;
|
|
||||||
if (request == null)
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
request.Method = "GET";
|
|
||||||
request.ContentType = "application/json";
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
var httpResponse = (HttpWebResponse)request.GetResponse();
|
|
||||||
if (httpResponse.StatusCode == HttpStatusCode.OK)
|
|
||||||
{
|
|
||||||
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
|
|
||||||
{
|
|
||||||
var responseText = streamReader.ReadToEnd();
|
|
||||||
//Console.WriteLine(responseText);
|
|
||||||
List<ZeroTierPeer> peerList = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
peerList = JsonConvert.DeserializeObject<List<ZeroTierPeer>>(responseText);
|
|
||||||
}
|
|
||||||
catch (JsonReaderException e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e.ToString());
|
|
||||||
}
|
|
||||||
cb(peerList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (httpResponse.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (System.Net.Sockets.SocketException)
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
catch (System.Net.WebException e)
|
|
||||||
{
|
|
||||||
HttpWebResponse res = (HttpWebResponse)e.Response;
|
|
||||||
if (res != null && res.StatusCode == HttpStatusCode.Unauthorized)
|
|
||||||
{
|
|
||||||
APIHandler.initHandler(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
cb(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public string NodeAddress()
|
|
||||||
{
|
|
||||||
return ZeroTierAddress;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
<Window x:Class="WinUI.AboutView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:WinUI"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="AboutView" Height="368.267" Width="300" Icon="ZeroTierIcon.ico">
|
|
||||||
<Grid>
|
|
||||||
<Image x:Name="image" HorizontalAlignment="Center" Height="100" Margin="0,10,0,0" VerticalAlignment="Top" Width="100" Source="ZeroTierIcon.ico"/>
|
|
||||||
<RichTextBox x:Name="richTextBox" HorizontalAlignment="Left" Height="209" Margin="10,123,0,0" VerticalAlignment="Top" Width="275" IsReadOnly="True" IsDocumentEnabled="True" BorderThickness="0" FontSize="18" RenderTransformOrigin="0.506,0.63">
|
|
||||||
<RichTextBox.Resources>
|
|
||||||
<Style TargetType="Hyperlink">
|
|
||||||
<Setter Property="Cursor" Value="Hand" />
|
|
||||||
</Style>
|
|
||||||
</RichTextBox.Resources>
|
|
||||||
<FlowDocument>
|
|
||||||
<Paragraph TextAlignment="Center">
|
|
||||||
<Run Text="ZeroTier One"/>
|
|
||||||
</Paragraph>
|
|
||||||
<Paragraph TextAlignment="Center">
|
|
||||||
<Run FontSize="14" Text="Version 1.6.6"/>
|
|
||||||
<LineBreak/>
|
|
||||||
<Run FontSize="14" Text="(c) 2011-2021 ZeroTier, Inc."/>
|
|
||||||
<LineBreak/>
|
|
||||||
<Run FontSize="14" Text="www.zerotier.com"/>
|
|
||||||
</Paragraph>
|
|
||||||
<Paragraph TextAlignment="Center">
|
|
||||||
<Run FontSize="14" Text="ZeroTier One allows your computer to join virtual networks. Just select "join" and enter a network's 16-digit ID. Each network appears on your computer as a new network port."/>
|
|
||||||
</Paragraph>
|
|
||||||
</FlowDocument>
|
|
||||||
</RichTextBox>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
|
@ -1,35 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for AboutView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class AboutView : Window
|
|
||||||
{
|
|
||||||
public AboutView()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Hyperlink_MouseLeftButtonDown(object sender, RequestNavigateEventArgs e)
|
|
||||||
{
|
|
||||||
var hyperlink = (Hyperlink)sender;
|
|
||||||
Process.Start(hyperlink.NavigateUri.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<configuration>
|
|
||||||
<startup>
|
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
|
||||||
</startup>
|
|
||||||
</configuration>
|
|
|
@ -1,14 +0,0 @@
|
||||||
<Application x:Class="WinUI.App"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
StartupUri="ToolbarItem.xaml">
|
|
||||||
<Application.Resources>
|
|
||||||
|
|
||||||
<ResourceDictionary>
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
|
||||||
<ResourceDictionary Source="Simple Styles.xaml"/>
|
|
||||||
</ResourceDictionary.MergedDictionaries>
|
|
||||||
</ResourceDictionary>
|
|
||||||
|
|
||||||
</Application.Resources>
|
|
||||||
</Application>
|
|
|
@ -1,25 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using Hardcodet.Wpf.TaskbarNotification;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for App.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class App : Application
|
|
||||||
{
|
|
||||||
private TaskbarIcon tb;
|
|
||||||
|
|
||||||
private void InitApplication()
|
|
||||||
{
|
|
||||||
tb = (TaskbarIcon)FindResource("NotifyIcon");
|
|
||||||
tb.Visibility = Visibility.Visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,256 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class CentralAPI
|
|
||||||
{
|
|
||||||
private static volatile CentralAPI instance;
|
|
||||||
private static object syncRoot = new Object();
|
|
||||||
|
|
||||||
private CookieContainer cookieContainer;
|
|
||||||
private HttpClientHandler clientHandler;
|
|
||||||
private HttpClient client;
|
|
||||||
|
|
||||||
private CentralServer server;
|
|
||||||
public CentralServer Central
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return this.server;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
this.server = value;
|
|
||||||
WriteCentralConfig();
|
|
||||||
UpdateRequestHeaders();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CentralAPI Instance
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
lock (syncRoot)
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
instance = new CentralAPI();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private CentralAPI()
|
|
||||||
{
|
|
||||||
#if DEBUG
|
|
||||||
ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
|
|
||||||
#endif
|
|
||||||
cookieContainer = new CookieContainer();
|
|
||||||
clientHandler = new HttpClientHandler
|
|
||||||
{
|
|
||||||
AllowAutoRedirect = true,
|
|
||||||
UseCookies = true,
|
|
||||||
CookieContainer = cookieContainer
|
|
||||||
};
|
|
||||||
|
|
||||||
client = new HttpClient(clientHandler);
|
|
||||||
|
|
||||||
string centralConfigPath = CentralConfigFile();
|
|
||||||
if (File.Exists(centralConfigPath))
|
|
||||||
{
|
|
||||||
byte[] tmp = File.ReadAllBytes(centralConfigPath);
|
|
||||||
string json = Encoding.UTF8.GetString(tmp).Trim();
|
|
||||||
CentralServer ctmp = JsonConvert.DeserializeObject<CentralServer>(json);
|
|
||||||
if (ctmp != null)
|
|
||||||
{
|
|
||||||
Central = ctmp;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Central = new CentralServer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Central = new CentralServer();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasAccessToken()
|
|
||||||
{
|
|
||||||
if (Central == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return !string.IsNullOrEmpty(Central.APIKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
private string ZeroTierDir()
|
|
||||||
{
|
|
||||||
return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\ZeroTier\\One";
|
|
||||||
}
|
|
||||||
|
|
||||||
private string CentralConfigFile()
|
|
||||||
{
|
|
||||||
return ZeroTierDir() + "\\central.conf";
|
|
||||||
}
|
|
||||||
|
|
||||||
public void WriteCentralConfig()
|
|
||||||
{
|
|
||||||
string json = JsonConvert.SerializeObject(Central);
|
|
||||||
byte[] tmp = Encoding.UTF8.GetBytes(json);
|
|
||||||
if (tmp != null)
|
|
||||||
{
|
|
||||||
File.WriteAllBytes(CentralConfigFile(), tmp);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateRequestHeaders()
|
|
||||||
{
|
|
||||||
if (client.DefaultRequestHeaders.Contains("Authorization"))
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Remove("Authorization");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(Central.APIKey))
|
|
||||||
{
|
|
||||||
client.DefaultRequestHeaders.Add("Authorization", "bearer " + Central.APIKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<bool> Login(string email, string password, bool isNewUser)
|
|
||||||
{
|
|
||||||
string postURL = Central.ServerURL + "/api/_auth/local";
|
|
||||||
CentralLogin login = new CentralLogin(email, password, isNewUser);
|
|
||||||
var content = new StringContent(JsonConvert.SerializeObject(login), Encoding.UTF8, "application/json");
|
|
||||||
HttpResponseMessage response = await client.PostAsync(postURL, content);
|
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
string resContent = await response.Content.ReadAsStringAsync();
|
|
||||||
|
|
||||||
CentralUser user = JsonConvert.DeserializeObject<CentralUser>(resContent);
|
|
||||||
|
|
||||||
if (user.Tokens.Count == 0)
|
|
||||||
{
|
|
||||||
// create token
|
|
||||||
user = await CreateAuthToken(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
Central.APIKey = user.Tokens[0];
|
|
||||||
|
|
||||||
UpdateRequestHeaders();
|
|
||||||
WriteCentralConfig();
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<CentralUser> CreateAuthToken(CentralUser user)
|
|
||||||
{
|
|
||||||
string randomTokenURL = Central.ServerURL + "/api/randomToken";
|
|
||||||
HttpResponseMessage response = await client.GetAsync(randomTokenURL);
|
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
// TODO: throw an error
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
string resContent = await response.Content.ReadAsStringAsync();
|
|
||||||
|
|
||||||
CentralToken t = JsonConvert.DeserializeObject<CentralToken>(resContent);
|
|
||||||
|
|
||||||
user.Tokens.Add(t.Token);
|
|
||||||
|
|
||||||
string tokenObj = "{ \"tokens\": " + JsonConvert.SerializeObject(user.Tokens) + " } ";
|
|
||||||
|
|
||||||
string postURL = Central.ServerURL + "/api/user/" + user.Id;
|
|
||||||
var postContent = new StringContent(tokenObj, Encoding.UTF8, "application/json");
|
|
||||||
response = await client.PostAsync(postURL, postContent);
|
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
// TODO: thrown an error
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
resContent = await response.Content.ReadAsStringAsync();
|
|
||||||
user = JsonConvert.DeserializeObject<CentralUser>(resContent);
|
|
||||||
|
|
||||||
return user;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<List<CentralNetwork>> GetNetworkList()
|
|
||||||
{
|
|
||||||
string networkURL = Central.ServerURL + "/api/network";
|
|
||||||
|
|
||||||
HttpResponseMessage response = await client.GetAsync(networkURL);
|
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
// TODO: Throw Error
|
|
||||||
return new List<CentralNetwork>();
|
|
||||||
}
|
|
||||||
|
|
||||||
string resContent = await response.Content.ReadAsStringAsync();
|
|
||||||
|
|
||||||
List<CentralNetwork> networkList = JsonConvert.DeserializeObject<List<CentralNetwork>>(resContent);
|
|
||||||
|
|
||||||
return networkList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<CentralNetwork> CreateNewNetwork()
|
|
||||||
{
|
|
||||||
string networkURL = Central.ServerURL + "/api/network?easy=1";
|
|
||||||
CentralNetwork network = new CentralNetwork();
|
|
||||||
network.Config = new CentralNetwork.CentralNetworkConfig();
|
|
||||||
network.Config.Name = NetworkNameGenerator.GenerateName();
|
|
||||||
string jsonNetwork = JsonConvert.SerializeObject(network);
|
|
||||||
var postContent = new StringContent(jsonNetwork, Encoding.UTF8, "application/json");
|
|
||||||
HttpResponseMessage response = await client.PostAsync(networkURL, postContent);
|
|
||||||
|
|
||||||
if (!response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
string resContent = await response.Content.ReadAsStringAsync();
|
|
||||||
|
|
||||||
CentralNetwork newNetwork = JsonConvert.DeserializeObject<CentralNetwork>(resContent);
|
|
||||||
|
|
||||||
return newNetwork;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async Task<bool> AuthorizeNode(string nodeAddress, string networkId)
|
|
||||||
{
|
|
||||||
string json = "{ \"config\": { \"authorized\": true } }";
|
|
||||||
string postURL = Central.ServerURL + "/api/network/" + networkId + "/member/" + nodeAddress;
|
|
||||||
var postContent = new StringContent(json, Encoding.UTF8, "application/json");
|
|
||||||
HttpResponseMessage response = await client.PostAsync(postURL, postContent);
|
|
||||||
|
|
||||||
if (response.IsSuccessStatusCode)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class CentralLogin
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
public CentralLogin(string email, string password, bool isNew)
|
|
||||||
{
|
|
||||||
Login = email;
|
|
||||||
Password = password;
|
|
||||||
IsNew = isNew;
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("login")]
|
|
||||||
public string Login { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("password")]
|
|
||||||
public string Password { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("register")]
|
|
||||||
public bool IsNew { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,48 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class CentralNetwork
|
|
||||||
{
|
|
||||||
[JsonProperty("id")]
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("type")]
|
|
||||||
public string Type { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("clock")]
|
|
||||||
public UInt64 Clock { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("rulesSource")]
|
|
||||||
public string RulesSource { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("description")]
|
|
||||||
public string Description { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("ownerId")]
|
|
||||||
public string OwnerID { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("onlineMemberCount")]
|
|
||||||
public int OnlineMemberCount { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("config")]
|
|
||||||
public CentralNetworkConfig Config { get; set; }
|
|
||||||
|
|
||||||
public class CentralNetworkConfig
|
|
||||||
{
|
|
||||||
[JsonProperty("id")]
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("nwid")]
|
|
||||||
public string NetworkID { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("name")]
|
|
||||||
public string Name { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class CentralServer
|
|
||||||
{
|
|
||||||
public CentralServer()
|
|
||||||
{
|
|
||||||
ServerURL = "https://my.zerotier.com";
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("server_url")]
|
|
||||||
public string ServerURL { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("api_key")]
|
|
||||||
public string APIKey { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,21 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class CentralToken
|
|
||||||
{
|
|
||||||
[JsonProperty("token")]
|
|
||||||
public string Token { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("clock")]
|
|
||||||
public UInt64 Clock { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("raw")]
|
|
||||||
public string Raw { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,51 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class CentralUser
|
|
||||||
{
|
|
||||||
public class CentralGlobalPermissions
|
|
||||||
{
|
|
||||||
[JsonProperty("a")]
|
|
||||||
public bool Administrator { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("d")]
|
|
||||||
public bool Delete { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("m")]
|
|
||||||
public bool Modify { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("r")]
|
|
||||||
public bool Read { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("id")]
|
|
||||||
public string Id { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("type")]
|
|
||||||
public string Type { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("clock")]
|
|
||||||
public UInt64 Clock { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("globalPermissions")]
|
|
||||||
public CentralGlobalPermissions GlobalPermissions { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("displayName")]
|
|
||||||
public string DisplayName { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("email")]
|
|
||||||
public string Email { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("smsNumber")]
|
|
||||||
public string SmsNumber { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("tokens")]
|
|
||||||
public List<string> Tokens { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1,13 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
interface ISwitchable
|
|
||||||
{
|
|
||||||
void UtilizeState(object state);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
<Window x:Class="WinUI.JoinNetworkView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:WinUI"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="Join a Network" SizeToContent="WidthAndHeight" Height="Auto" Width="Auto" Icon="ZeroTierIcon.ico">
|
|
||||||
<Grid HorizontalAlignment="Left" Margin="0,0,0,0" Width="315">
|
|
||||||
<TextBox x:Name="joinNetworkBox" HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="291" PreviewTextInput="joinNetworkBox_OnTextEntered" PreviewKeyDown="joinNetworkBox_OnKeyDown"/>
|
|
||||||
<CheckBox x:Name="allowManagedCheckbox" Content="Allow Managed" HorizontalAlignment="Left" Margin="10,38,0,0" VerticalAlignment="Top" IsChecked="True"/>
|
|
||||||
<CheckBox x:Name="allowGlobalCheckbox" Content="Allow Global" HorizontalAlignment="Left" Margin="118,38,0,0" VerticalAlignment="Top"/>
|
|
||||||
<CheckBox x:Name="allowDefaultCheckbox" Content="Allow Default" HorizontalAlignment="Left" Margin="10,58,0,0" VerticalAlignment="Top"/>
|
|
||||||
<CheckBox x:Name="allowDNSCheckbox" Content="Allow DNS" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="118,58,0,0"/>
|
|
||||||
<Button x:Name="joinButton" Content="Join" HorizontalAlignment="Left" Margin="226,58,0,10" Background="#FFFFB354" VerticalAlignment="Top" Width="75" Click="joinButton_Click" IsEnabled="False"/>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
|
@ -1,127 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for JoinNetworkView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class JoinNetworkView : Window
|
|
||||||
{
|
|
||||||
Regex charRegex = new Regex("[0-9a-fxA-FX]");
|
|
||||||
Regex wholeStringRegex = new Regex("^[0-9a-fxA-FX]+$");
|
|
||||||
|
|
||||||
public JoinNetworkView()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
DataObject.AddPastingHandler(joinNetworkBox, onPaste);
|
|
||||||
DataObject.AddCopyingHandler(joinNetworkBox, onCopyCut);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void joinNetworkBox_OnTextEntered(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
e.Handled = !charRegex.IsMatch(e.Text);
|
|
||||||
|
|
||||||
if ( (joinNetworkBox.Text.Length + e.Text.Length) == 16)
|
|
||||||
{
|
|
||||||
joinButton.IsEnabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
joinButton.IsEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void joinNetworkBox_OnKeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
|
|
||||||
{
|
|
||||||
if (e.Key == Key.X && joinNetworkBox.IsSelectionActive)
|
|
||||||
{
|
|
||||||
// handle ctrl-x removing characters
|
|
||||||
joinButton.IsEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (e.Key == Key.Delete || e.Key == Key.Back)
|
|
||||||
{
|
|
||||||
if ((joinNetworkBox.Text.Length - 1) == 16)
|
|
||||||
{
|
|
||||||
joinButton.IsEnabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
joinButton.IsEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if ((joinNetworkBox.Text.Length + 1) > 16)
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onPaste(object sender, DataObjectPastingEventArgs e)
|
|
||||||
{
|
|
||||||
var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
|
|
||||||
if (!isText)
|
|
||||||
{
|
|
||||||
joinButton.IsEnabled = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var text = e.SourceDataObject.GetData(DataFormats.UnicodeText) as string;
|
|
||||||
|
|
||||||
if (!wholeStringRegex.IsMatch(text))
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
e.CancelCommand();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (text.Length == 16 || (joinNetworkBox.Text.Length + text.Length) == 16)
|
|
||||||
{
|
|
||||||
joinButton.IsEnabled = true;
|
|
||||||
}
|
|
||||||
else if (text.Length > 16 || (joinNetworkBox.Text.Length + text.Length) > 16)
|
|
||||||
{
|
|
||||||
e.Handled = true;
|
|
||||||
e.CancelCommand();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
joinButton.IsEnabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onCopyCut(object sender, DataObjectCopyingEventArgs e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private void joinButton_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
bool allowDefault = allowDefaultCheckbox.IsChecked.Value;
|
|
||||||
bool allowGlobal = allowGlobalCheckbox.IsChecked.Value;
|
|
||||||
bool allowManaged = allowManagedCheckbox.IsChecked.Value;
|
|
||||||
bool allowDNS = allowDNSCheckbox.IsChecked.Value;
|
|
||||||
|
|
||||||
APIHandler.Instance.JoinNetwork(this.Dispatcher, joinNetworkBox.Text, allowManaged, allowGlobal, allowDefault, allowDNS);
|
|
||||||
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,233 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for MainWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class MainWindow : Window
|
|
||||||
{
|
|
||||||
APIHandler handler;
|
|
||||||
Regex charRegex = new Regex("[0-9a-fxA-FX]");
|
|
||||||
Regex wholeStringRegex = new Regex("^[0-9a-fxA-FX]+$");
|
|
||||||
|
|
||||||
Timer timer = new Timer();
|
|
||||||
|
|
||||||
bool connected = false;
|
|
||||||
|
|
||||||
public MainWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
if (InitAPIHandler())
|
|
||||||
{
|
|
||||||
networksPage.SetAPIHandler(handler);
|
|
||||||
|
|
||||||
updateStatus();
|
|
||||||
if (!connected)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Unable to connect to ZeroTier Service.");
|
|
||||||
}
|
|
||||||
|
|
||||||
updateNetworks();
|
|
||||||
//updatePeers();
|
|
||||||
|
|
||||||
DataObject.AddPastingHandler(joinNetworkID, OnPaste);
|
|
||||||
|
|
||||||
timer.Elapsed += new ElapsedEventHandler(OnUpdateTimer);
|
|
||||||
timer.Interval = 2000;
|
|
||||||
timer.Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private String readAuthToken(String path)
|
|
||||||
{
|
|
||||||
String authToken = "";
|
|
||||||
|
|
||||||
if (File.Exists(path))
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
byte[] tmp = File.ReadAllBytes(path);
|
|
||||||
authToken = System.Text.Encoding.UTF8.GetString(tmp).Trim();
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
MessageBox.Show("Unable to read ZeroTier One Auth Token from:\r\n" + path, "ZeroTier One");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return authToken;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Int32 readPort(String path)
|
|
||||||
{
|
|
||||||
Int32 port = 9993;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
byte[] tmp = File.ReadAllBytes(path);
|
|
||||||
port = Int32.Parse(System.Text.Encoding.ASCII.GetString(tmp).Trim());
|
|
||||||
if ((port <= 0) || (port > 65535))
|
|
||||||
port = 9993;
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
return port;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool InitAPIHandler()
|
|
||||||
{
|
|
||||||
String localZtDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\ZeroTier\\One";
|
|
||||||
String globalZtDir = Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\ZeroTier\\One";
|
|
||||||
|
|
||||||
String authToken = "";
|
|
||||||
Int32 port = 9993;
|
|
||||||
|
|
||||||
if (!File.Exists(localZtDir + "\\authtoken.secret") || !File.Exists(localZtDir + "\\zerotier-one.port"))
|
|
||||||
{
|
|
||||||
// launch external process to copy file into place
|
|
||||||
String curPath = System.Reflection.Assembly.GetEntryAssembly().Location;
|
|
||||||
int index = curPath.LastIndexOf("\\");
|
|
||||||
curPath = curPath.Substring(0, index);
|
|
||||||
ProcessStartInfo startInfo = new ProcessStartInfo(curPath + "\\copyutil.exe", globalZtDir + " " + localZtDir);
|
|
||||||
startInfo.Verb = "runas";
|
|
||||||
|
|
||||||
|
|
||||||
var process = Process.Start(startInfo);
|
|
||||||
process.WaitForExit();
|
|
||||||
}
|
|
||||||
|
|
||||||
authToken = readAuthToken(localZtDir + "\\authtoken.secret");
|
|
||||||
|
|
||||||
if ((authToken == null) || (authToken.Length <= 0))
|
|
||||||
{
|
|
||||||
MessageBox.Show("Unable to read ZeroTier One authtoken", "ZeroTier One");
|
|
||||||
this.Close();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
port = readPort(localZtDir + "\\zerotier-one.port");
|
|
||||||
handler = new APIHandler(port, authToken);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateStatus()
|
|
||||||
{
|
|
||||||
var status = handler.GetStatus();
|
|
||||||
|
|
||||||
if (status != null)
|
|
||||||
{
|
|
||||||
connected = true;
|
|
||||||
|
|
||||||
networkId.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
this.networkId.Text = status.Address;
|
|
||||||
}));
|
|
||||||
versionString.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
this.versionString.Content = status.Version;
|
|
||||||
}));
|
|
||||||
onlineStatus.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
this.onlineStatus.Content = (status.Online ? "ONLINE" : "OFFLINE");
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
connected = false;
|
|
||||||
|
|
||||||
networkId.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
this.networkId.Text = "";
|
|
||||||
}));
|
|
||||||
versionString.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
this.versionString.Content = "0";
|
|
||||||
}));
|
|
||||||
onlineStatus.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
this.onlineStatus.Content = "OFFLINE";
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateNetworks()
|
|
||||||
{
|
|
||||||
var networks = handler.GetNetworks();
|
|
||||||
|
|
||||||
networksPage.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
networksPage.setNetworks(networks);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updatePeers()
|
|
||||||
{
|
|
||||||
//var peers = handler.GetPeers();
|
|
||||||
|
|
||||||
//peersPage.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
//{
|
|
||||||
// peersPage.SetPeers(peers);
|
|
||||||
//}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnUpdateTimer(object source, ElapsedEventArgs e)
|
|
||||||
{
|
|
||||||
updateStatus();
|
|
||||||
updateNetworks();
|
|
||||||
//updatePeers();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void joinButton_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (joinNetworkID.Text.Length < 16)
|
|
||||||
{
|
|
||||||
MessageBox.Show("Invalid Network ID");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
handler.JoinNetwork(joinNetworkID.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnNetworkEntered(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
e.Handled = !charRegex.IsMatch(e.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPaste(object sender, DataObjectPastingEventArgs e)
|
|
||||||
{
|
|
||||||
var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
|
|
||||||
if (!isText) return;
|
|
||||||
|
|
||||||
var text = e.SourceDataObject.GetData(DataFormats.UnicodeText) as string;
|
|
||||||
|
|
||||||
if (!wholeStringRegex.IsMatch(text))
|
|
||||||
{
|
|
||||||
e.CancelCommand();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,88 +0,0 @@
|
||||||
<UserControl Background="LightGray" x:Class="WinUI.NetworkInfoView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
>
|
|
||||||
|
|
||||||
<Border Background="GhostWhite" BorderBrush="Gainsboro" BorderThickness="1" CornerRadius="8,8,8,8">
|
|
||||||
<Grid Background="GhostWhite" Margin="10,10,10,10">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition Width="10"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
<RowDefinition Height="auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<Grid Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBox x:Name="networkId" Text="8056c2e21c000001" HorizontalAlignment="Left" Grid.Column="0" Foreground="#FF91A2A3" FontFamily="Lucida Console" BorderThickness="0" IsReadOnly="true" Background="Transparent"/>
|
|
||||||
<TextBox x:Name="networkName" Text="earth.zerotier.net" HorizontalAlignment="Right" Grid.Column="1" Foreground="#FF000000" BorderThickness="0" IsReadOnly="true" Background="Transparent"/>
|
|
||||||
</Grid>
|
|
||||||
|
|
||||||
<Separator Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3"/>
|
|
||||||
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Status" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="2" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Type" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="3" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="MAC" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="4" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="MTU" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="5" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Broadcast" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="6" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Bridging" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="7" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Device" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="8" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Managed IPs" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="9" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Allow Global IP" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="10" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Allow Managed IP" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="11" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Allow Default Route" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="12" Foreground="#FF000000"/>
|
|
||||||
<TextBlock TextWrapping="Wrap" Text="Allow DNS" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="13" Foreground="#FF000000"/>
|
|
||||||
|
|
||||||
<Rectangle Grid.Column="2" Grid.Row="2" Grid.RowSpan="12" Fill="#FFEEEEEE"/>
|
|
||||||
|
|
||||||
<TextBlock x:Name="networkStatus" FontFamily="Lucida Console" TextWrapping="Wrap" HorizontalAlignment="Right" Text="OK" TextAlignment="Right" Grid.Column="2" Grid.Row="2" Foreground="#FF000000"/>
|
|
||||||
<TextBlock x:Name="networkType" FontFamily="Lucida Console" TextWrapping="Wrap" Text="PUBLIC" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="3" Foreground="#FF000000"/>
|
|
||||||
<TextBlock x:Name="macAddress" FontFamily="Lucida Console" TextWrapping="Wrap" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="4" Foreground="#FF000000"><Span><Run Text="02:83:4a:1e:4b:3a"/></Span></TextBlock>
|
|
||||||
<TextBlock x:Name="mtu" FontFamily="Lucida Console" TextWrapping="Wrap" Text="2800" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="5" Foreground="#FF000000"/>
|
|
||||||
<TextBlock x:Name="broadcastEnabled" FontFamily="Lucida Console" TextWrapping="Wrap" Text="ENABLED" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="6" Foreground="#FF000000"/>
|
|
||||||
<TextBlock x:Name="bridgingEnabled" FontFamily="Lucida Console" TextWrapping="Wrap" Text="DISABLED" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="7" Background="#FFEEEEEE" Foreground="#FF000000"/>
|
|
||||||
<TextBlock x:Name="deviceName" FontFamily="Lucida Console" TextWrapping="Wrap" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="8" Foreground="#FF000000"><Span><Run Text="ethernet_32771"/></Span></TextBlock>
|
|
||||||
<TextBox x:Name="managedIps" TextWrapping="Wrap" FontFamily="Lucida Console" HorizontalAlignment="Right" TextAlignment="Right" Grid.Column="2" Grid.Row="9" Foreground="#FF000000" IsReadOnly="True" BorderThickness="0" Background="#FFEEEEEE" Text="28.2.169.248/7
fd80:56c2:e21c:0000:0199:9383:4a02:a9f8/88"/>
|
|
||||||
<CheckBox x:Name="allowGlobal" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="10" />
|
|
||||||
<CheckBox x:Name="allowManaged" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="11" />
|
|
||||||
<CheckBox x:Name="allowDefault" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="12" />
|
|
||||||
<CheckBox x:Name="allowDNS" HorizontalAlignment="Right" Grid.Column="2" Grid.Row="13"/>
|
|
||||||
|
|
||||||
<Separator Grid.Column="0" Grid.Row="14" Grid.ColumnSpan="3"/>
|
|
||||||
|
|
||||||
<Grid Grid.Column="0" Grid.Row="15" Grid.ColumnSpan="3" Background="GhostWhite">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Button x:Name="deleteButton" Grid.Column="0" Content="Delete" HorizontalAlignment="Left" VerticalAlignment="Center" Width="75" Background="#FFFFB354" Click="deleteButton_Click"/>
|
|
||||||
<CheckBox x:Name="connectedCheckBox" Grid.Column="2" Content="Connected" HorizontalAlignment="Right" VerticalAlignment="Center" Checked="connectedCheckBox_Checked" Unchecked="connectedCheckbox_Unchecked"/>
|
|
||||||
</Grid>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
|
||||||
</UserControl>
|
|
|
@ -1,183 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for NetworkInfoView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class NetworkInfoView : UserControl
|
|
||||||
{
|
|
||||||
public ZeroTierNetwork network;
|
|
||||||
|
|
||||||
public NetworkInfoView(ZeroTierNetwork network)
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
this.network = network;
|
|
||||||
|
|
||||||
UpdateNetworkData();
|
|
||||||
|
|
||||||
allowDefault.Checked += AllowDefault_CheckStateChanged;
|
|
||||||
allowDefault.Unchecked += AllowDefault_CheckStateChanged;
|
|
||||||
allowGlobal.Checked += AllowGlobal_CheckStateChanged;
|
|
||||||
allowGlobal.Unchecked += AllowGlobal_CheckStateChanged;
|
|
||||||
allowManaged.Checked += AllowManaged_CheckStateChanged;
|
|
||||||
allowManaged.Unchecked += AllowManaged_CheckStateChanged;
|
|
||||||
allowDNS.Checked += AllowDNS_CheckStateChanged;
|
|
||||||
allowDNS.Unchecked += AllowDNS_CheckStateChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateNetworkData()
|
|
||||||
{
|
|
||||||
|
|
||||||
if (this.networkId.Text != network.NetworkId)
|
|
||||||
this.networkId.Text = network.NetworkId;
|
|
||||||
|
|
||||||
if (this.networkName.Text != network.NetworkName)
|
|
||||||
this.networkName.Text = network.NetworkName;
|
|
||||||
|
|
||||||
if (this.networkStatus.Text != network.NetworkStatus)
|
|
||||||
this.networkStatus.Text = network.NetworkStatus;
|
|
||||||
|
|
||||||
if (this.networkType.Text != network.NetworkType)
|
|
||||||
this.networkType.Text = network.NetworkType;
|
|
||||||
|
|
||||||
if (this.macAddress.Text != network.MacAddress)
|
|
||||||
this.macAddress.Text = network.MacAddress;
|
|
||||||
|
|
||||||
if (this.mtu.Text != network.MTU.ToString())
|
|
||||||
this.mtu.Text = network.MTU.ToString();
|
|
||||||
|
|
||||||
this.broadcastEnabled.Text = (network.BroadcastEnabled ? "ENABLED" : "DISABLED");
|
|
||||||
this.bridgingEnabled.Text = (network.Bridge ? "ENABLED" : "DISABLED");
|
|
||||||
|
|
||||||
if (this.deviceName.Text != network.DeviceName)
|
|
||||||
this.deviceName.Text = network.DeviceName;
|
|
||||||
|
|
||||||
string iplist = "";
|
|
||||||
for (int i = 0; i < network.AssignedAddresses.Length; ++i)
|
|
||||||
{
|
|
||||||
iplist += network.AssignedAddresses[i];
|
|
||||||
if (i < (network.AssignedAddresses.Length - 1))
|
|
||||||
iplist += "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.managedIps.Text != iplist)
|
|
||||||
this.managedIps.Text = iplist;
|
|
||||||
|
|
||||||
this.allowDefault.IsChecked = network.AllowDefault;
|
|
||||||
this.allowGlobal.IsChecked = network.AllowGlobal;
|
|
||||||
this.allowManaged.IsChecked = network.AllowManaged;
|
|
||||||
this.allowDNS.IsChecked = network.AllowDNS;
|
|
||||||
|
|
||||||
this.connectedCheckBox.Checked -= connectedCheckBox_Checked;
|
|
||||||
this.connectedCheckBox.Unchecked -= connectedCheckbox_Unchecked;
|
|
||||||
|
|
||||||
this.connectedCheckBox.IsChecked = network.IsConnected;
|
|
||||||
|
|
||||||
this.connectedCheckBox.Checked += connectedCheckBox_Checked;
|
|
||||||
this.connectedCheckBox.Unchecked += connectedCheckbox_Unchecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool HasNetwork(ZeroTierNetwork network)
|
|
||||||
{
|
|
||||||
if (this.network.NetworkId.Equals(network.NetworkId))
|
|
||||||
return true;
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetNetworkInfo(ZeroTierNetwork network)
|
|
||||||
{
|
|
||||||
this.network = network;
|
|
||||||
|
|
||||||
UpdateNetworkData();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void deleteButton_Click(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
APIHandler.Instance.LeaveNetwork(this.Dispatcher, network.NetworkId);
|
|
||||||
NetworkMonitor.Instance.RemoveNetwork(network.NetworkId);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AllowManaged_CheckStateChanged(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CheckBox cb = sender as CheckBox;
|
|
||||||
APIHandler.Instance.JoinNetwork(this.Dispatcher, network.NetworkId,
|
|
||||||
allowManaged.IsChecked ?? false,
|
|
||||||
allowGlobal.IsChecked ?? false,
|
|
||||||
allowDefault.IsChecked ?? false,
|
|
||||||
allowDNS.IsChecked ?? false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AllowGlobal_CheckStateChanged(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CheckBox cb = sender as CheckBox;
|
|
||||||
APIHandler.Instance.JoinNetwork(this.Dispatcher, network.NetworkId,
|
|
||||||
allowManaged.IsChecked ?? false,
|
|
||||||
allowGlobal.IsChecked ?? false,
|
|
||||||
allowDefault.IsChecked ?? false,
|
|
||||||
allowDNS.IsChecked ?? false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AllowDefault_CheckStateChanged(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CheckBox cb = sender as CheckBox;
|
|
||||||
APIHandler.Instance.JoinNetwork(this.Dispatcher, network.NetworkId,
|
|
||||||
allowManaged.IsChecked ?? false,
|
|
||||||
allowGlobal.IsChecked ?? false,
|
|
||||||
allowDefault.IsChecked ?? false,
|
|
||||||
allowDNS.IsChecked ?? false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AllowDNS_CheckStateChanged(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CheckBox cb = sender as CheckBox;
|
|
||||||
APIHandler.Instance.JoinNetwork(this.Dispatcher, network.NetworkId,
|
|
||||||
allowManaged.IsChecked ?? false,
|
|
||||||
allowGlobal.IsChecked ?? false,
|
|
||||||
allowDefault.IsChecked ?? false,
|
|
||||||
allowDNS.IsChecked ?? false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void connectedCheckBox_Checked(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
onConnectedCheckboxUpdated(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void connectedCheckbox_Unchecked(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
onConnectedCheckboxUpdated(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onConnectedCheckboxUpdated(bool isChecked)
|
|
||||||
{
|
|
||||||
if (isChecked)
|
|
||||||
{
|
|
||||||
bool global = allowGlobal.IsChecked.Value;
|
|
||||||
bool managed = allowManaged.IsChecked.Value;
|
|
||||||
bool defRoute = allowDefault.IsChecked.Value;
|
|
||||||
bool dns = allowDNS.IsChecked.Value;
|
|
||||||
|
|
||||||
APIHandler.Instance.JoinNetwork(this.Dispatcher, networkId.Text, managed, global, defRoute, dns);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
APIHandler.Instance.LeaveNetwork(this.Dispatcher, networkId.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,88 +0,0 @@
|
||||||
<Window
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:WinUI"
|
|
||||||
mc:Ignorable="d" x:Class="WinUI.NetworkListView"
|
|
||||||
Title="ZeroTier One" SizeToContent="Width" Height="500" Width="Auto" Icon="ZeroTierIcon.ico">
|
|
||||||
|
|
||||||
<Window.Resources>
|
|
||||||
<SolidColorBrush x:Key="GreenBrush" Color="#ff91a2a3"/>
|
|
||||||
|
|
||||||
<SolidColorBrush x:Key="SolidBorderBrush" Color="#888" />
|
|
||||||
|
|
||||||
<SolidColorBrush x:Key="GreenDisabledBrush" Color="#FF234447" />
|
|
||||||
|
|
||||||
<SolidColorBrush x:Key="DisabledBackgroundBrush" Color="#EEE" />
|
|
||||||
|
|
||||||
<SolidColorBrush x:Key="DisabledBorderBrush" Color="#AAA" />
|
|
||||||
|
|
||||||
<SolidColorBrush x:Key="DisabledForegroundBrush" Color="#888" />
|
|
||||||
|
|
||||||
<Style TargetType="{x:Type DataGrid}">
|
|
||||||
<Setter Property="Background" Value="#FFF" />
|
|
||||||
<Setter Property="AlternationCount" Value="2" />
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style TargetType="{x:Type DataGridRow}">
|
|
||||||
<Style.Triggers>
|
|
||||||
<Trigger Property="ItemsControl.AlternationIndex" Value="0">
|
|
||||||
<Setter Property="Background" Value="#EEE"></Setter>
|
|
||||||
</Trigger>
|
|
||||||
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
|
|
||||||
<Setter Property="Background" Value="#FFF"></Setter>
|
|
||||||
</Trigger>
|
|
||||||
</Style.Triggers>
|
|
||||||
</Style>
|
|
||||||
|
|
||||||
<Style TargetType="{x:Type TabItem}">
|
|
||||||
<Setter Property="Template">
|
|
||||||
<Setter.Value>
|
|
||||||
<ControlTemplate TargetType="{x:Type TabItem}">
|
|
||||||
<Grid>
|
|
||||||
<Border
|
|
||||||
Name="Border"
|
|
||||||
Margin="0,0,-4,0"
|
|
||||||
Background="{StaticResource GreenBrush}"
|
|
||||||
BorderBrush="{StaticResource SolidBorderBrush}"
|
|
||||||
BorderThickness="1,1,1,1"
|
|
||||||
CornerRadius="2,12,0,0" >
|
|
||||||
<ContentPresenter x:Name="ContentSite"
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
ContentSource="Header"
|
|
||||||
Margin="12,2,12,2"
|
|
||||||
RecognizesAccessKey="True"/>
|
|
||||||
</Border>
|
|
||||||
</Grid>
|
|
||||||
<ControlTemplate.Triggers>
|
|
||||||
<Trigger Property="IsSelected" Value="True">
|
|
||||||
<Setter Property="Panel.ZIndex" Value="100" />
|
|
||||||
<Setter TargetName="Border" Property="Background" Value="{StaticResource GreenDisabledBrush}" />
|
|
||||||
<Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
|
|
||||||
</Trigger>
|
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
|
||||||
<Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}" />
|
|
||||||
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBorderBrush}" />
|
|
||||||
<Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}" />
|
|
||||||
</Trigger>
|
|
||||||
</ControlTemplate.Triggers>
|
|
||||||
</ControlTemplate>
|
|
||||||
</Setter.Value>
|
|
||||||
</Setter>
|
|
||||||
</Style>
|
|
||||||
</Window.Resources>
|
|
||||||
|
|
||||||
<DockPanel>
|
|
||||||
<Grid Background="LightGray" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<local:NetworksPage x:Name="networksPage" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Column="0" Grid.Row="0" Margin="0,0,0,0"/>
|
|
||||||
</Grid>
|
|
||||||
</DockPanel>
|
|
||||||
</Window>
|
|
|
@ -1,85 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
using System.ComponentModel;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for MainWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class NetworkListView : Window
|
|
||||||
{
|
|
||||||
Regex charRegex = new Regex("[0-9a-fxA-FX]");
|
|
||||||
Regex wholeStringRegex = new Regex("^[0-9a-fxA-FX]+$");
|
|
||||||
|
|
||||||
public NetworkListView()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
Closed += onClosed;
|
|
||||||
|
|
||||||
NetworkMonitor.Instance.SubscribeNetworkUpdates(updateNetworks);
|
|
||||||
}
|
|
||||||
|
|
||||||
~NetworkListView()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnClosing(CancelEventArgs e)
|
|
||||||
{
|
|
||||||
e.Cancel = true;
|
|
||||||
Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void onClosed(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
NetworkMonitor.Instance.UnsubscribeNetworkUpdates(updateNetworks);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateNetworks(List<ZeroTierNetwork> networks)
|
|
||||||
{
|
|
||||||
if (networks != null)
|
|
||||||
{
|
|
||||||
networksPage.Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
networksPage.setNetworks(networks);
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnNetworkEntered(object sender, TextCompositionEventArgs e)
|
|
||||||
{
|
|
||||||
e.Handled = !charRegex.IsMatch(e.Text);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnPaste(object sender, DataObjectPastingEventArgs e)
|
|
||||||
{
|
|
||||||
var isText = e.SourceDataObject.GetDataPresent(DataFormats.UnicodeText, true);
|
|
||||||
if (!isText) return;
|
|
||||||
|
|
||||||
var text = e.SourceDataObject.GetData(DataFormats.UnicodeText) as string;
|
|
||||||
|
|
||||||
if (!wholeStringRegex.IsMatch(text))
|
|
||||||
{
|
|
||||||
e.CancelCommand();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,203 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class NetworkMonitor
|
|
||||||
{
|
|
||||||
public delegate void NetworkListCallback(List<ZeroTierNetwork> networks);
|
|
||||||
public delegate void StatusCallback(ZeroTierStatus status);
|
|
||||||
|
|
||||||
private Thread runThread;
|
|
||||||
private NetworkListCallback _nwCb;
|
|
||||||
private StatusCallback _stCb;
|
|
||||||
|
|
||||||
|
|
||||||
private List<ZeroTierNetwork> _knownNetworks = new List<ZeroTierNetwork>();
|
|
||||||
|
|
||||||
private static NetworkMonitor instance;
|
|
||||||
private static object syncRoot = new object();
|
|
||||||
|
|
||||||
public static NetworkMonitor Instance
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
lock (syncRoot)
|
|
||||||
{
|
|
||||||
if (instance == null)
|
|
||||||
{
|
|
||||||
instance = new NetworkMonitor();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private NetworkMonitor()
|
|
||||||
{
|
|
||||||
runThread = new Thread(new ThreadStart(run));
|
|
||||||
loadNetworks();
|
|
||||||
|
|
||||||
runThread.Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
~NetworkMonitor()
|
|
||||||
{
|
|
||||||
runThread.Interrupt();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadNetworks()
|
|
||||||
{
|
|
||||||
String dataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\ZeroTier\\One";
|
|
||||||
String dataFile = Path.Combine(dataPath, "networks.dat");
|
|
||||||
|
|
||||||
if (File.Exists(dataFile))
|
|
||||||
{
|
|
||||||
List<ZeroTierNetwork> netList;
|
|
||||||
|
|
||||||
using (Stream stream = File.Open(dataFile, FileMode.Open))
|
|
||||||
{
|
|
||||||
var bformatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
|
|
||||||
netList = (List<ZeroTierNetwork>)bformatter.Deserialize(stream);
|
|
||||||
stream.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (_knownNetworks)
|
|
||||||
{
|
|
||||||
_knownNetworks = netList;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void writeNetworks()
|
|
||||||
{
|
|
||||||
String dataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\ZeroTier\\One";
|
|
||||||
String dataFile = Path.Combine(dataPath, "networks.dat");
|
|
||||||
|
|
||||||
if (!Directory.Exists(dataPath))
|
|
||||||
{
|
|
||||||
Directory.CreateDirectory(dataPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
using (Stream stream = File.Open(dataFile, FileMode.OpenOrCreate))
|
|
||||||
{
|
|
||||||
lock (_knownNetworks)
|
|
||||||
{
|
|
||||||
var bformatter = new System.Runtime.Serialization.Formatters.Binary.BinaryFormatter();
|
|
||||||
bformatter.Serialize(stream, _knownNetworks);
|
|
||||||
stream.Flush();
|
|
||||||
stream.Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void apiNetworkCallback(List<ZeroTierNetwork> networks)
|
|
||||||
{
|
|
||||||
if (networks == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
lock (_knownNetworks)
|
|
||||||
{
|
|
||||||
_knownNetworks = _knownNetworks.Union(networks, new NetworkEqualityComparer()).ToList();
|
|
||||||
|
|
||||||
foreach (ZeroTierNetwork n in _knownNetworks)
|
|
||||||
{
|
|
||||||
if (networks.Contains(n))
|
|
||||||
{
|
|
||||||
n.IsConnected = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
n.IsConnected = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_knownNetworks.Sort();
|
|
||||||
_nwCb(_knownNetworks);
|
|
||||||
}
|
|
||||||
|
|
||||||
writeNetworks();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void apiStatusCallback(ZeroTierStatus status)
|
|
||||||
{
|
|
||||||
_stCb(status);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void run()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
while (runThread.IsAlive)
|
|
||||||
{
|
|
||||||
APIHandler handler = APIHandler.Instance;
|
|
||||||
|
|
||||||
if (handler != null)
|
|
||||||
{
|
|
||||||
handler.GetNetworks(apiNetworkCallback);
|
|
||||||
handler.GetStatus(apiStatusCallback);
|
|
||||||
}
|
|
||||||
|
|
||||||
Thread.Sleep(2000);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Console.WriteLine("Monitor Thread Exception: " + "\n" + e.StackTrace);
|
|
||||||
}
|
|
||||||
Console.WriteLine("Monitor Thread Ended");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SubscribeStatusUpdates(StatusCallback cb)
|
|
||||||
{
|
|
||||||
_stCb += cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UnsubscribeStatusUpdates(StatusCallback cb)
|
|
||||||
{
|
|
||||||
_stCb -= cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SubscribeNetworkUpdates(NetworkListCallback cb)
|
|
||||||
{
|
|
||||||
_nwCb += cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UnsubscribeNetworkUpdates(NetworkListCallback cb)
|
|
||||||
{
|
|
||||||
_nwCb -= cb;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveNetwork(String networkID)
|
|
||||||
{
|
|
||||||
lock(_knownNetworks)
|
|
||||||
{
|
|
||||||
foreach (ZeroTierNetwork n in _knownNetworks)
|
|
||||||
{
|
|
||||||
if (n.NetworkId.Equals(networkID))
|
|
||||||
{
|
|
||||||
_knownNetworks.Remove(n);
|
|
||||||
writeNetworks();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StopMonitor()
|
|
||||||
{
|
|
||||||
runThread.Abort();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,201 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
class NetworkNameGenerator
|
|
||||||
{
|
|
||||||
public static string GenerateName()
|
|
||||||
{
|
|
||||||
Random r = new Random(DateTime.Now.Millisecond);
|
|
||||||
int firstIndex = r.Next(0, FIRST.Length);
|
|
||||||
int secondIndex = r.Next(0, SECOND.Length);
|
|
||||||
return FIRST[firstIndex] + "_" + SECOND[secondIndex];
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string[] FIRST =
|
|
||||||
{
|
|
||||||
"admiring",
|
|
||||||
"adoring",
|
|
||||||
"agitated",
|
|
||||||
"amazing",
|
|
||||||
"angry",
|
|
||||||
"awesome",
|
|
||||||
"berserk",
|
|
||||||
"big",
|
|
||||||
"clever",
|
|
||||||
"compassionate",
|
|
||||||
"cranky",
|
|
||||||
"crazy",
|
|
||||||
"desperate",
|
|
||||||
"determined",
|
|
||||||
"distracted",
|
|
||||||
"dreamy",
|
|
||||||
"ecstatic",
|
|
||||||
"elated",
|
|
||||||
"elegant",
|
|
||||||
"fervent",
|
|
||||||
"focused",
|
|
||||||
"furious",
|
|
||||||
"gigantic",
|
|
||||||
"gloomy",
|
|
||||||
"goofy",
|
|
||||||
"grave",
|
|
||||||
"happy",
|
|
||||||
"high",
|
|
||||||
"hopeful",
|
|
||||||
"hungry",
|
|
||||||
"insane",
|
|
||||||
"jolly",
|
|
||||||
"jovial",
|
|
||||||
"lonely",
|
|
||||||
"loving",
|
|
||||||
"modest",
|
|
||||||
"nostalgic",
|
|
||||||
"pedantic",
|
|
||||||
"pensive",
|
|
||||||
"prickly",
|
|
||||||
"reverent",
|
|
||||||
"romantic",
|
|
||||||
"sad",
|
|
||||||
"serene",
|
|
||||||
"sharp",
|
|
||||||
"silly",
|
|
||||||
"sleepy",
|
|
||||||
"stoic",
|
|
||||||
"stupefied",
|
|
||||||
"suspicious",
|
|
||||||
"tender",
|
|
||||||
"thirsty",
|
|
||||||
"tiny",
|
|
||||||
"trusting"
|
|
||||||
};
|
|
||||||
|
|
||||||
private static string[] SECOND =
|
|
||||||
{
|
|
||||||
// constructed telephone-like devices in 1854
|
|
||||||
"meucci",
|
|
||||||
|
|
||||||
// prototype make-or-break telephones in 1860
|
|
||||||
"reis",
|
|
||||||
|
|
||||||
// Alexander Graham Bell
|
|
||||||
"bell",
|
|
||||||
|
|
||||||
// designed telephone using water microphone in 1876
|
|
||||||
"gray",
|
|
||||||
|
|
||||||
// Tivadar Puskás invented the telephone switchboard exchange in 1876.
|
|
||||||
"puskas",
|
|
||||||
|
|
||||||
// Thomas Edison, invented the carbon microphone which produced a strong telephone signal.
|
|
||||||
"edison",
|
|
||||||
|
|
||||||
// 1950s, Paul Baran developed the concept Distributed Adaptive Message Block Switching
|
|
||||||
"baran",
|
|
||||||
|
|
||||||
// Donald Davies coined the phrase 'packet switching network'
|
|
||||||
"davies",
|
|
||||||
|
|
||||||
// Robert Licklider helped get ARPANET funded
|
|
||||||
"licklider",
|
|
||||||
|
|
||||||
// Robert Taylor, ARPANET pioneer
|
|
||||||
"taylor",
|
|
||||||
|
|
||||||
// Lawrence Roberts, ARPANET
|
|
||||||
"roberts",
|
|
||||||
|
|
||||||
// Vint Cerf, TCP
|
|
||||||
"cerf",
|
|
||||||
|
|
||||||
// Bob Kahn, TCP
|
|
||||||
"kahn",
|
|
||||||
|
|
||||||
// David P Reed, UDP
|
|
||||||
"reed",
|
|
||||||
|
|
||||||
// Community Memory was created by Efrem Lipkin, Mark Szpakowski, and Lee Felsenstein, acting as The Community Memory Project within the Resource One computer center at Project One in San Francisco.
|
|
||||||
"lipkin",
|
|
||||||
"szpakowski",
|
|
||||||
"felsenstein",
|
|
||||||
|
|
||||||
// The first public dial-up BBS was developed by Ward Christensen and Randy Suess.
|
|
||||||
"christensen",
|
|
||||||
"suess",
|
|
||||||
|
|
||||||
// Joybubbles (May 25, 1949 – August 8, 2007), born Josef Carl Engressia, Jr. in Richmond, Virginia, USA, was an early phone phreak.
|
|
||||||
"engressia",
|
|
||||||
"joybubbles",
|
|
||||||
|
|
||||||
// John Thomas Draper (born 1943), also known as Captain Crunch, Crunch or Crunchman (after Cap'n Crunch breakfast cereal mascot), is an American computer programmer and former phone phreak
|
|
||||||
"draper",
|
|
||||||
|
|
||||||
// Dennis C. Hayes, founder of Hayes Microcomputer Products
|
|
||||||
// "The Modem of Dennis Hayes and Dale Heatherington."
|
|
||||||
"hayes",
|
|
||||||
"heatherington",
|
|
||||||
|
|
||||||
// "Ethernet was developed at Xerox PARC between 1973 and 1974.[7][8] It was inspired by ALOHAnet, which Robert Metcalfe had studied as part of his PhD dissertation."
|
|
||||||
"metcalfe",
|
|
||||||
|
|
||||||
// William Bradford Shockley Jr. (February 13, 1910 – August 12, 1989) was an American physicist and inventor. Shockley was the manager of a research group that included John Bardeen and Walter Brattain. The three scientists invented the point contact transistor in 1947
|
|
||||||
"shockley",
|
|
||||||
"bardeen",
|
|
||||||
"brattain",
|
|
||||||
|
|
||||||
// "Randall Erck invented the modern modem as we know it today. There were devices similar to modems used by the military, but they were designed more for the purpose of sending encripted nuclear launch codes to various bases around the world."
|
|
||||||
"erck",
|
|
||||||
|
|
||||||
// Leonard Kleinrock, packet switching network pioneer
|
|
||||||
"kleinrock",
|
|
||||||
|
|
||||||
// Tim Berners-Lee, WWW
|
|
||||||
"berners_lee",
|
|
||||||
|
|
||||||
// Steve Wozniak, early phone phreak
|
|
||||||
"wozniak",
|
|
||||||
|
|
||||||
// James Fields Smathers of Kansas City invented what is considered the first practical power-operated typewriter in 1914.
|
|
||||||
"smathers",
|
|
||||||
|
|
||||||
// The teleprinter evolved through a series of inventions by a number of engineers, including Royal Earl House, David Edward Hughes, Emile Baudot, Donald Murray, Charles L. Krum, Edward Kleinschmidt and Frederick G. Creed.
|
|
||||||
"house",
|
|
||||||
"hughes",
|
|
||||||
"baudot",
|
|
||||||
"murray",
|
|
||||||
"krum",
|
|
||||||
"kleinschmidt",
|
|
||||||
"creed",
|
|
||||||
|
|
||||||
// Ron Rosenbaum, author of "Secrets of the Little Blue Box" which mainstreamed phone phreaking
|
|
||||||
"rosenbaum",
|
|
||||||
|
|
||||||
// Bram Cohen. Bram Cohen (born October 12, 1975) is an American computer programmer, best known as the author of the peer-to-peer (P2P) BitTorrent protocol,
|
|
||||||
"cohen",
|
|
||||||
|
|
||||||
// Jarkko Oikarinen (born 16 August 1967, in Kuusamo, Finland) is the inventor of the first Internet chat network, called Internet Relay Chat (IRC), where he is known as WiZ.
|
|
||||||
"oikarinen",
|
|
||||||
|
|
||||||
// "What you probably didn't know is that the author of Trumpet Winsock — Peter Tattam from Tasmania, Australia — didn't see much money for his efforts."
|
|
||||||
"tattam",
|
|
||||||
|
|
||||||
// Satoshi Nakamoto
|
|
||||||
"nakamoto",
|
|
||||||
|
|
||||||
// Philo Farnsworth, inventor of the first practical TV tube
|
|
||||||
"farnsworth",
|
|
||||||
|
|
||||||
// Scottish inventor John Logie Baird employed the Nipkow disk in his prototype video systems. On 25 March 1925, Baird gave the first public demonstration of televised silhouette images in motion, at Selfridge's Department Store in London.
|
|
||||||
"baird",
|
|
||||||
|
|
||||||
// Beginning in 1836, the American artist Samuel F. B. Morse, the American physicist Joseph Henry, and Alfred Vail developed an electrical telegraph system.
|
|
||||||
"morse",
|
|
||||||
"henry",
|
|
||||||
"vail"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.Serialization;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
[Serializable]
|
|
||||||
public class NetworkRoute : ISerializable
|
|
||||||
{
|
|
||||||
protected NetworkRoute(SerializationInfo info, StreamingContext ctx)
|
|
||||||
{
|
|
||||||
Target = info.GetString("target");
|
|
||||||
Via = info.GetString("via");
|
|
||||||
Flags = info.GetInt32("flags");
|
|
||||||
Metric = info.GetInt32("metric");
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx)
|
|
||||||
{
|
|
||||||
info.AddValue("target", Target);
|
|
||||||
info.AddValue("via", Via);
|
|
||||||
info.AddValue("flags", Flags);
|
|
||||||
info.AddValue("metric", Metric);
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("target")]
|
|
||||||
public string Target { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("via")]
|
|
||||||
public string Via { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("flags")]
|
|
||||||
public int Flags { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("metric")]
|
|
||||||
public int Metric { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,13 +0,0 @@
|
||||||
<UserControl x:Class="WinUI.NetworksPage"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="300" d:DesignWidth="300">
|
|
||||||
<ScrollViewer x:Name="MyScrollViewer" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
|
||||||
<UniformGrid x:Name="wrapPanel" Background="#FFDDDDDD" HorizontalAlignment="Stretch" VerticalAlignment="Top" Columns="1">
|
|
||||||
|
|
||||||
</UniformGrid>
|
|
||||||
</ScrollViewer>
|
|
||||||
</UserControl>
|
|
|
@ -1,99 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for NetworksPage.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class NetworksPage : UserControl
|
|
||||||
{
|
|
||||||
public NetworksPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNetworks(List<ZeroTierNetwork> networks)
|
|
||||||
{
|
|
||||||
if (networks == null)
|
|
||||||
{
|
|
||||||
this.wrapPanel.Children.Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (ZeroTierNetwork network in networks)
|
|
||||||
{
|
|
||||||
NetworkInfoView view = ChildWithNetwork(network);
|
|
||||||
if (view != null)
|
|
||||||
{
|
|
||||||
view.SetNetworkInfo(network);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wrapPanel.Children.Add(
|
|
||||||
new NetworkInfoView(
|
|
||||||
network));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove networks we're no longer joined to.
|
|
||||||
List<ZeroTierNetwork> tmpList = GetNetworksFromChildren();
|
|
||||||
foreach (ZeroTierNetwork n in networks)
|
|
||||||
{
|
|
||||||
if (tmpList.Contains(n))
|
|
||||||
{
|
|
||||||
tmpList.Remove(n);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (ZeroTierNetwork n in tmpList)
|
|
||||||
{
|
|
||||||
NetworkInfoView view = ChildWithNetwork(n);
|
|
||||||
if (view != null)
|
|
||||||
{
|
|
||||||
wrapPanel.Children.Remove(view);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private NetworkInfoView ChildWithNetwork(ZeroTierNetwork network)
|
|
||||||
{
|
|
||||||
List<NetworkInfoView> list = wrapPanel.Children.OfType<NetworkInfoView>().ToList();
|
|
||||||
|
|
||||||
foreach (NetworkInfoView view in list)
|
|
||||||
{
|
|
||||||
if (view.HasNetwork(network))
|
|
||||||
{
|
|
||||||
return view;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private List<ZeroTierNetwork> GetNetworksFromChildren()
|
|
||||||
{
|
|
||||||
List<ZeroTierNetwork> networks = new List<ZeroTierNetwork>(wrapPanel.Children.Count);
|
|
||||||
|
|
||||||
List<NetworkInfoView> list = wrapPanel.Children.OfType<NetworkInfoView>().ToList();
|
|
||||||
foreach (NetworkInfoView n in list)
|
|
||||||
{
|
|
||||||
networks.Add(n.network);
|
|
||||||
}
|
|
||||||
|
|
||||||
return networks;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
<UserControl x:Class="WinUI.PeersPage"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
d:DesignHeight="300" d:DesignWidth="300" Background="White" Foreground="Black">
|
|
||||||
|
|
||||||
<DataGrid x:Name="dataGrid" GridLinesVisibility="None" AutoGenerateColumns="False" CanUserResizeColumns="True" Margin="0,0,0,0" CanUserReorderColumns="False" HorizontalAlignment="Stretch" VerticalScrollBarVisibility="Auto" CanUserSortColumns="False">
|
|
||||||
<DataGrid.CellStyle>
|
|
||||||
<Style TargetType="DataGridCell">
|
|
||||||
<Setter Property="BorderThickness" Value="0"/>
|
|
||||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
|
||||||
</Style>
|
|
||||||
</DataGrid.CellStyle>
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn Header="Address" Binding="{Binding Address}"/>
|
|
||||||
<DataGridTextColumn Header="Version" Binding="{Binding VersionString}"/>
|
|
||||||
<DataGridTextColumn Header="Latency" Binding="{Binding Latency}"/>
|
|
||||||
<DataGridTextColumn Header="Data Paths" Binding="{Binding DataPaths}"/>
|
|
||||||
<DataGridTextColumn Header="Last Unicast" Binding="{Binding LastUnicastFrame}"/>
|
|
||||||
<DataGridTextColumn Header="Last Multicast" Binding="{Binding LastMulticastFrame}"/>
|
|
||||||
<DataGridTextColumn Width="*" Header="Role" Binding="{Binding Role}"/>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</UserControl>
|
|
|
@ -1,54 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for PeersPage.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class PeersPage : UserControl
|
|
||||||
{
|
|
||||||
private List<ZeroTierPeer> peersList = new List<ZeroTierPeer>();
|
|
||||||
|
|
||||||
public PeersPage()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
dataGrid.ItemsSource = peersList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SetPeers(List<ZeroTierPeer> list)
|
|
||||||
{
|
|
||||||
if (list == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
|
|
||||||
foreach(ZeroTierPeer p in list)
|
|
||||||
{
|
|
||||||
ZeroTierPeer curPeer = peersList.Find(peer => peer.Equals(p));
|
|
||||||
if (curPeer == null)
|
|
||||||
{
|
|
||||||
peersList.Add(p);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
curPeer.Update(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dataGrid.Items.Refresh();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,30 +0,0 @@
|
||||||
<Window x:Class="WinUI.PreferencesView"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:WinUI"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="PreferencesView" SizeToContent="WidthAndHeight" Height="Auto" Width="Auto" Icon="ZeroTierIcon.ico">
|
|
||||||
<Grid>
|
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
<ColumnDefinition Width="Auto"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<CheckBox x:Name="startupCheckbox" Content="Launch ZeroTier On Startup" HorizontalAlignment="Left" Margin="10" VerticalAlignment="Top" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0"/>
|
|
||||||
|
|
||||||
<TextBlock Text="Central Instance:" Grid.Row="1" Grid.Column="0" Margin="10"/>
|
|
||||||
<TextBox x:Name="CentralInstanceTextBox" Grid.Row="1" Grid.Column="1" MinWidth="200" Margin="10"/>
|
|
||||||
|
|
||||||
<TextBlock Text="API Key:" Grid.Row="2" Grid.Column="0" Margin="10"/>
|
|
||||||
<TextBox x:Name="APIKeyTextBox" Grid.Row="2" Grid.Column="1" MinWidth="200" Margin="10"/>
|
|
||||||
|
|
||||||
<Button x:Name="OKButton" Grid.Row="3" Grid.Column="1" Background="#FFFFB354" Content="OK" Margin="10" Width="90" HorizontalAlignment="Right" Click="OKButton_Clicked"/>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
|
@ -1,74 +0,0 @@
|
||||||
using Microsoft.Win32;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for PreferencesView.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class PreferencesView : Window
|
|
||||||
{
|
|
||||||
public static string AppName = "ZeroTier One";
|
|
||||||
private RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
|
|
||||||
private string AppLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
|
|
||||||
public PreferencesView()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
|
|
||||||
string keyValue = rk.GetValue(AppName) as string;
|
|
||||||
|
|
||||||
if (keyValue != null && keyValue.Equals(AppLocation))
|
|
||||||
{
|
|
||||||
startupCheckbox.IsChecked = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
CentralAPI api = CentralAPI.Instance;
|
|
||||||
CentralInstanceTextBox.Text = api.Central.ServerURL;
|
|
||||||
APIKeyTextBox.Text = api.Central.APIKey;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OKButton_Clicked(object sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
CentralAPI api = CentralAPI.Instance;
|
|
||||||
|
|
||||||
if (api.Central.ServerURL != CentralInstanceTextBox.Text ||
|
|
||||||
api.Central.APIKey != APIKeyTextBox.Text)
|
|
||||||
{
|
|
||||||
CentralServer newServer = new CentralServer();
|
|
||||||
newServer.ServerURL = CentralInstanceTextBox.Text;
|
|
||||||
newServer.APIKey = APIKeyTextBox.Text;
|
|
||||||
|
|
||||||
api.Central = newServer;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (startupCheckbox.IsChecked.HasValue && (bool)startupCheckbox.IsChecked)
|
|
||||||
{
|
|
||||||
rk.SetValue(AppName, AppLocation);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
string keyValue = rk.GetValue(AppName) as string;
|
|
||||||
|
|
||||||
if (keyValue != null && keyValue.Equals(AppLocation))
|
|
||||||
{
|
|
||||||
rk.DeleteValue(AppName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,56 +0,0 @@
|
||||||
using System.Reflection;
|
|
||||||
using System.Resources;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyTitle("ZeroTier One")]
|
|
||||||
[assembly: AssemblyDescription("")]
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
|
||||||
[assembly: AssemblyCompany("ZeroTier, Inc")]
|
|
||||||
[assembly: AssemblyProduct("ZeroTier One")]
|
|
||||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
|
||||||
[assembly: AssemblyTrademark("")]
|
|
||||||
[assembly: AssemblyCulture("")]
|
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
|
||||||
|
|
||||||
//In order to begin building localizable applications, set
|
|
||||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
|
||||||
//inside a <PropertyGroup>. For example, if you are using US english
|
|
||||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
|
||||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
|
||||||
//the line below to match the UICulture setting in the project file.
|
|
||||||
|
|
||||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
|
||||||
|
|
||||||
|
|
||||||
[assembly: ThemeInfo(
|
|
||||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// or application resource dictionaries)
|
|
||||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
|
||||||
//(used if a resource is not found in the page,
|
|
||||||
// app, or any theme specific resource dictionaries)
|
|
||||||
)]
|
|
||||||
|
|
||||||
|
|
||||||
// Version information for an assembly consists of the following four values:
|
|
||||||
//
|
|
||||||
// Major Version
|
|
||||||
// Minor Version
|
|
||||||
// Build Number
|
|
||||||
// Revision
|
|
||||||
//
|
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
|
||||||
// by using the '*' as shown below:
|
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
||||||
[assembly: NeutralResourcesLanguageAttribute("en-US")]
|
|
73
attic/WinUI/Properties/Resources.Designer.cs
generated
73
attic/WinUI/Properties/Resources.Designer.cs
generated
|
@ -1,73 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace WinUI.Properties {
|
|
||||||
using System;
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
|
||||||
/// </summary>
|
|
||||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
|
||||||
// class via a tool like ResGen or Visual Studio.
|
|
||||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
|
||||||
// with the /str option, or rebuild your VS project.
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
internal class Resources {
|
|
||||||
|
|
||||||
private static global::System.Resources.ResourceManager resourceMan;
|
|
||||||
|
|
||||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
|
||||||
|
|
||||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
|
||||||
internal Resources() {
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the cached ResourceManager instance used by this class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
|
||||||
get {
|
|
||||||
if (object.ReferenceEquals(resourceMan, null)) {
|
|
||||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WinUI.Properties.Resources", typeof(Resources).Assembly);
|
|
||||||
resourceMan = temp;
|
|
||||||
}
|
|
||||||
return resourceMan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Overrides the current thread's CurrentUICulture property for all
|
|
||||||
/// resource lookups using this strongly typed resource class.
|
|
||||||
/// </summary>
|
|
||||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
|
||||||
internal static global::System.Globalization.CultureInfo Culture {
|
|
||||||
get {
|
|
||||||
return resourceCulture;
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
resourceCulture = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
|
|
||||||
/// </summary>
|
|
||||||
internal static System.Drawing.Icon ZeroTierIcon {
|
|
||||||
get {
|
|
||||||
object obj = ResourceManager.GetObject("ZeroTierIcon", resourceCulture);
|
|
||||||
return ((System.Drawing.Icon)(obj));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,124 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<root>
|
|
||||||
<!--
|
|
||||||
Microsoft ResX Schema
|
|
||||||
|
|
||||||
Version 2.0
|
|
||||||
|
|
||||||
The primary goals of this format is to allow a simple XML format
|
|
||||||
that is mostly human readable. The generation and parsing of the
|
|
||||||
various data types are done through the TypeConverter classes
|
|
||||||
associated with the data types.
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
... ado.net/XML headers & schema ...
|
|
||||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
|
||||||
<resheader name="version">2.0</resheader>
|
|
||||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
|
||||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
|
||||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
|
||||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
|
||||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
|
||||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
|
||||||
</data>
|
|
||||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
|
||||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
|
||||||
<comment>This is a comment</comment>
|
|
||||||
</data>
|
|
||||||
|
|
||||||
There are any number of "resheader" rows that contain simple
|
|
||||||
name/value pairs.
|
|
||||||
|
|
||||||
Each data row contains a name, and value. The row also contains a
|
|
||||||
type or mimetype. Type corresponds to a .NET class that support
|
|
||||||
text/value conversion through the TypeConverter architecture.
|
|
||||||
Classes that don't support this are serialized and stored with the
|
|
||||||
mimetype set.
|
|
||||||
|
|
||||||
The mimetype is used for serialized objects, and tells the
|
|
||||||
ResXResourceReader how to depersist the object. This is currently not
|
|
||||||
extensible. For a given mimetype the value must be set accordingly:
|
|
||||||
|
|
||||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
|
||||||
that the ResXResourceWriter will generate, however the reader can
|
|
||||||
read any of the formats listed below.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.binary.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.soap.base64
|
|
||||||
value : The object must be serialized with
|
|
||||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
|
|
||||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
|
||||||
value : The object must be serialized into a byte array
|
|
||||||
: using a System.ComponentModel.TypeConverter
|
|
||||||
: and then encoded with base64 encoding.
|
|
||||||
-->
|
|
||||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
|
||||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
|
||||||
<xsd:element name="root" msdata:IsDataSet="true">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:choice maxOccurs="unbounded">
|
|
||||||
<xsd:element name="metadata">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="assembly">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:attribute name="alias" type="xsd:string" />
|
|
||||||
<xsd:attribute name="name" type="xsd:string" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="data">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
|
||||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
|
||||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
|
||||||
<xsd:attribute ref="xml:space" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
<xsd:element name="resheader">
|
|
||||||
<xsd:complexType>
|
|
||||||
<xsd:sequence>
|
|
||||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
|
||||||
</xsd:sequence>
|
|
||||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:choice>
|
|
||||||
</xsd:complexType>
|
|
||||||
</xsd:element>
|
|
||||||
</xsd:schema>
|
|
||||||
<resheader name="resmimetype">
|
|
||||||
<value>text/microsoft-resx</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="version">
|
|
||||||
<value>2.0</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="reader">
|
|
||||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<resheader name="writer">
|
|
||||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
|
||||||
</resheader>
|
|
||||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
|
||||||
<data name="ZeroTierIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
|
||||||
<value>..\ZeroTierIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
|
30
attic/WinUI/Properties/Settings.Designer.cs
generated
30
attic/WinUI/Properties/Settings.Designer.cs
generated
|
@ -1,30 +0,0 @@
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
|
||||||
// This code was generated by a tool.
|
|
||||||
// Runtime Version:4.0.30319.42000
|
|
||||||
//
|
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
|
||||||
// the code is regenerated.
|
|
||||||
// </auto-generated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
namespace WinUI.Properties
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
|
||||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
|
||||||
{
|
|
||||||
|
|
||||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
|
||||||
|
|
||||||
public static Settings Default
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,7 +0,0 @@
|
||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
|
||||||
<Profiles>
|
|
||||||
<Profile Name="(Default)" />
|
|
||||||
</Profiles>
|
|
||||||
<Settings />
|
|
||||||
</SettingsFile>
|
|
Binary file not shown.
Before Width: | Height: | Size: 44 KiB |
File diff suppressed because it is too large
Load diff
|
@ -1,6 +0,0 @@
|
||||||
<ResourceDictionary
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:local="clr-namespace:WinUI">
|
|
||||||
|
|
||||||
</ResourceDictionary>
|
|
|
@ -1,65 +0,0 @@
|
||||||
<Window x:Class="WinUI.ToolbarItem"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:WinUI"
|
|
||||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
|
||||||
xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Height="300" Width="300" Visibility="Hidden" Name="Toolbar">
|
|
||||||
|
|
||||||
<Window.Resources>
|
|
||||||
<CollectionViewSource Source="{Binding ElementName=Toolbar, Path=NetworkCollection}" x:Key="KnownNetworks">
|
|
||||||
<CollectionViewSource.SortDescriptions>
|
|
||||||
<scm:SortDescription PropertyName="Header" Direction="Ascending"/>
|
|
||||||
</CollectionViewSource.SortDescriptions>
|
|
||||||
</CollectionViewSource>
|
|
||||||
</Window.Resources>
|
|
||||||
|
|
||||||
<Grid>
|
|
||||||
<tb:TaskbarIcon x:Name="MyNotifyIcon"
|
|
||||||
IconSource="ZeroTierIcon.ico"
|
|
||||||
ToolTipText="ZeroTier One"
|
|
||||||
MenuActivation="LeftOrRightClick">
|
|
||||||
<tb:TaskbarIcon.ContextMenu>
|
|
||||||
<ContextMenu>
|
|
||||||
<ContextMenu.ItemsSource>
|
|
||||||
<CompositeCollection>
|
|
||||||
<MenuItem Header="Node ID: unknown"
|
|
||||||
Click="ToolbarItem_NodeIDClicked"
|
|
||||||
x:Name="nodeIdMenuItem"/>
|
|
||||||
<Separator/>
|
|
||||||
<MenuItem Header="Join Network..."
|
|
||||||
Click="ToolbarItem_JoinNetworkClicked"/>
|
|
||||||
<MenuItem Header="Show Networks..."
|
|
||||||
Click="ToolbarItem_ShowNetworksClicked"/>
|
|
||||||
<Separator/>
|
|
||||||
|
|
||||||
<CollectionContainer Collection="{Binding Source={StaticResource KnownNetworks}}">
|
|
||||||
|
|
||||||
</CollectionContainer>
|
|
||||||
|
|
||||||
<Separator/>
|
|
||||||
<MenuItem Header="ZeroTier Central"
|
|
||||||
Click="ToolbarItem_CentralClicked"/>
|
|
||||||
<MenuItem Header="Create and Join Network"
|
|
||||||
Click="ToolbarItem_NewNetwork"
|
|
||||||
x:Name="newNetworkItem"/>
|
|
||||||
<Separator/>
|
|
||||||
<MenuItem Header="About..."
|
|
||||||
Click="ToolbarItem_AboutClicked"/>
|
|
||||||
<MenuItem Header="Preferences..."
|
|
||||||
Click="ToolbarItem_PreferencesClicked"/>
|
|
||||||
<Separator/>
|
|
||||||
<MenuItem Header="Quit"
|
|
||||||
Click="ToolbarItem_QuitClicked"/>
|
|
||||||
|
|
||||||
</CompositeCollection>
|
|
||||||
</ContextMenu.ItemsSource>
|
|
||||||
</ContextMenu>
|
|
||||||
</tb:TaskbarIcon.ContextMenu>
|
|
||||||
|
|
||||||
</tb:TaskbarIcon>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
|
@ -1,353 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Collections.ObjectModel;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Net.Http;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Timers;
|
|
||||||
using System.Windows.Threading;
|
|
||||||
using System.IO;
|
|
||||||
using System.Diagnostics;
|
|
||||||
using Microsoft.Win32;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for ToolbarItem.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class ToolbarItem : Window, INotifyPropertyChanged
|
|
||||||
{
|
|
||||||
private APIHandler handler = APIHandler.Instance;
|
|
||||||
|
|
||||||
private Point netListLocation = new Point(0, 0);
|
|
||||||
private Point joinNetLocation = new Point(0, 0);
|
|
||||||
private Point aboutViewLocation = new Point(0, 0);
|
|
||||||
private Point prefsViewLocation = new Point(0, 0);
|
|
||||||
|
|
||||||
private NetworkListView netListView = new NetworkListView();
|
|
||||||
private JoinNetworkView joinNetView = null;
|
|
||||||
private AboutView aboutView = null;
|
|
||||||
private PreferencesView prefsView = null;
|
|
||||||
|
|
||||||
private NetworkMonitor mon = NetworkMonitor.Instance;
|
|
||||||
|
|
||||||
private ObservableCollection<MenuItem> _networkCollection = new ObservableCollection<MenuItem>();
|
|
||||||
|
|
||||||
|
|
||||||
public ObservableCollection<MenuItem> NetworkCollection
|
|
||||||
{
|
|
||||||
get { return _networkCollection; }
|
|
||||||
set { _networkCollection = value; }
|
|
||||||
}
|
|
||||||
|
|
||||||
private string nodeId;
|
|
||||||
|
|
||||||
public ToolbarItem()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
|
|
||||||
mon.SubscribeNetworkUpdates(updateNetworks);
|
|
||||||
mon.SubscribeStatusUpdates(updateStatus);
|
|
||||||
|
|
||||||
SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged);
|
|
||||||
}
|
|
||||||
|
|
||||||
~ToolbarItem()
|
|
||||||
{
|
|
||||||
mon.UnsubscribeNetworkUpdates(updateNetworks);
|
|
||||||
mon.UnsubscribeStatusUpdates(updateStatus);
|
|
||||||
}
|
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
|
|
||||||
protected void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
|
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateNetworks(List<ZeroTierNetwork> networks)
|
|
||||||
{
|
|
||||||
if (networks != null)
|
|
||||||
{
|
|
||||||
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
NetworkCollection.Clear();
|
|
||||||
foreach (ZeroTierNetwork n in networks)
|
|
||||||
{
|
|
||||||
MenuItem item = new MenuItem();
|
|
||||||
item.Header = n.Title.Replace("_", "__");
|
|
||||||
item.DataContext = n;
|
|
||||||
item.IsChecked = n.IsConnected;
|
|
||||||
item.Click += ToolbarItem_NetworkClicked;
|
|
||||||
|
|
||||||
NetworkCollection.Add(item);
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void updateStatus(ZeroTierStatus status)
|
|
||||||
{
|
|
||||||
if (status != null)
|
|
||||||
{
|
|
||||||
Dispatcher.BeginInvoke(DispatcherPriority.Normal, new Action(() =>
|
|
||||||
{
|
|
||||||
nodeIdMenuItem.Header = "Node ID: " + status.Address;
|
|
||||||
nodeIdMenuItem.IsEnabled = true;
|
|
||||||
nodeId = status.Address;
|
|
||||||
|
|
||||||
if (CentralAPI.Instance.HasAccessToken())
|
|
||||||
{
|
|
||||||
newNetworkItem.IsEnabled = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
newNetworkItem.IsEnabled = false;
|
|
||||||
}
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_NodeIDClicked(object sender, System.Windows.RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
Clipboard.SetDataObject(nodeId);
|
|
||||||
}
|
|
||||||
catch (ArgumentNullException)
|
|
||||||
{
|
|
||||||
// tried to copy a null nodeId
|
|
||||||
Console.WriteLine("ArgumentNullException");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
Console.WriteLine(ex.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_ShowNetworksClicked(object sender, System.Windows.RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (netListView == null)
|
|
||||||
{
|
|
||||||
netListView = new WinUI.NetworkListView();
|
|
||||||
netListView.Closed += ShowNetworksClosed;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool netListNeedsMoving = true;
|
|
||||||
if (netListLocation.X > 0 && netListLocation.Y > 0)
|
|
||||||
{
|
|
||||||
netListView.Left = netListLocation.X;
|
|
||||||
netListView.Top = netListLocation.Y;
|
|
||||||
netListNeedsMoving = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
netListView.Show();
|
|
||||||
|
|
||||||
if (netListNeedsMoving)
|
|
||||||
{
|
|
||||||
setWindowPosition(netListView);
|
|
||||||
netListLocation.X = netListView.Left;
|
|
||||||
netListLocation.Y = netListView.Top;
|
|
||||||
}
|
|
||||||
|
|
||||||
netListView.Activate();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowNetworksClosed(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
netListView = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_JoinNetworkClicked(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
if (joinNetView == null)
|
|
||||||
{
|
|
||||||
joinNetView = new JoinNetworkView();
|
|
||||||
joinNetView.Closed += JoinNetworkClosed;
|
|
||||||
|
|
||||||
bool needsMove = true;
|
|
||||||
if (joinNetLocation.X > 0 && joinNetLocation.Y > 0)
|
|
||||||
{
|
|
||||||
joinNetView.Left = joinNetLocation.X;
|
|
||||||
joinNetView.Top = joinNetLocation.Y;
|
|
||||||
needsMove = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
joinNetView.Show();
|
|
||||||
|
|
||||||
if (needsMove)
|
|
||||||
{
|
|
||||||
setWindowPosition(joinNetView);
|
|
||||||
joinNetLocation.X = joinNetView.Left;
|
|
||||||
joinNetLocation.Y = joinNetView.Top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
joinNetView.Activate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void JoinNetworkClosed(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
joinNetView = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_CentralClicked(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
Process.Start("https://my.zerotier.com");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_AboutClicked(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
if (aboutView == null)
|
|
||||||
{
|
|
||||||
aboutView = new AboutView();
|
|
||||||
aboutView.Closed += AboutClosed;
|
|
||||||
|
|
||||||
bool needsMove = true;
|
|
||||||
if (aboutViewLocation.X > 0 && aboutViewLocation.Y > 0)
|
|
||||||
{
|
|
||||||
aboutView.Left = aboutViewLocation.X;
|
|
||||||
aboutView.Top = aboutViewLocation.Y;
|
|
||||||
needsMove = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
aboutView.Show();
|
|
||||||
|
|
||||||
if (needsMove)
|
|
||||||
{
|
|
||||||
setWindowPosition(aboutView);
|
|
||||||
aboutViewLocation.X = aboutView.Left;
|
|
||||||
aboutViewLocation.Y = aboutView.Top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
aboutView.Activate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void AboutClosed(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
aboutView = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_PreferencesClicked(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
if (prefsView == null)
|
|
||||||
{
|
|
||||||
prefsView = new PreferencesView();
|
|
||||||
prefsView.Closed += PreferencesClosed;
|
|
||||||
|
|
||||||
bool needsMove = true;
|
|
||||||
if (prefsViewLocation.X > 0 && prefsViewLocation.Y > 0)
|
|
||||||
{
|
|
||||||
prefsView.Left = prefsViewLocation.X;
|
|
||||||
prefsView.Top = prefsViewLocation.Y;
|
|
||||||
needsMove = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
prefsView.Show();
|
|
||||||
|
|
||||||
if (needsMove)
|
|
||||||
{
|
|
||||||
setWindowPosition(prefsView);
|
|
||||||
prefsViewLocation.X = prefsView.Left;
|
|
||||||
prefsViewLocation.Y = prefsView.Top;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
prefsView.Activate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PreferencesClosed(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
prefsView = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_QuitClicked(object sender, System.EventArgs e)
|
|
||||||
{
|
|
||||||
NetworkMonitor.Instance.StopMonitor();
|
|
||||||
Close();
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ToolbarItem_NetworkClicked(object sender, System.Windows.RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if(sender.GetType() == typeof(MenuItem))
|
|
||||||
{
|
|
||||||
MenuItem item = e.Source as MenuItem;
|
|
||||||
if (item.DataContext != null)
|
|
||||||
{
|
|
||||||
ZeroTierNetwork network = item.DataContext as ZeroTierNetwork;
|
|
||||||
if (item.IsChecked)
|
|
||||||
{
|
|
||||||
APIHandler.Instance.LeaveNetwork(Dispatcher, network.NetworkId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
APIHandler.Instance.JoinNetwork(Dispatcher, network.NetworkId, network.AllowManaged, network.AllowGlobal, network.AllowDefault);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async void ToolbarItem_NewNetwork(object sender, System.Windows.RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (CentralAPI.Instance.HasAccessToken())
|
|
||||||
{
|
|
||||||
CentralAPI api = CentralAPI.Instance;
|
|
||||||
CentralNetwork newNetwork = await api.CreateNewNetwork();
|
|
||||||
|
|
||||||
APIHandler handler = APIHandler.Instance;
|
|
||||||
handler.JoinNetwork(this.Dispatcher, newNetwork.Id);
|
|
||||||
|
|
||||||
string nodeId = APIHandler.Instance.NodeAddress();
|
|
||||||
bool authorized = await CentralAPI.Instance.AuthorizeNode(nodeId, newNetwork.Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setWindowPosition(Window w)
|
|
||||||
{
|
|
||||||
double width = w.ActualWidth;
|
|
||||||
double height = w.ActualHeight;
|
|
||||||
|
|
||||||
double screenHeight = SystemParameters.PrimaryScreenHeight;
|
|
||||||
double screenWidth = SystemParameters.PrimaryScreenWidth;
|
|
||||||
|
|
||||||
double top = screenHeight - height - 40;
|
|
||||||
double left = screenWidth - width - 20;
|
|
||||||
|
|
||||||
w.Top = top;
|
|
||||||
w.Left = left;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
// reset cached locations to (0, 0) when display size changes
|
|
||||||
netListLocation.X = 0;
|
|
||||||
netListLocation.Y = 0;
|
|
||||||
joinNetLocation.X = 0;
|
|
||||||
joinNetLocation.Y = 0;
|
|
||||||
aboutViewLocation.X = 0;
|
|
||||||
aboutViewLocation.Y = 0;
|
|
||||||
prefsViewLocation.X = 0;
|
|
||||||
prefsViewLocation.Y = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,273 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
|
||||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
|
||||||
<ProjectGuid>{4CCA6B98-5E64-45BF-AC34-19B3E2570DB1}</ProjectGuid>
|
|
||||||
<OutputType>WinExe</OutputType>
|
|
||||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
|
||||||
<RootNamespace>WinUI</RootNamespace>
|
|
||||||
<AssemblyName>ZeroTier One</AssemblyName>
|
|
||||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
|
||||||
<FileAlignment>512</FileAlignment>
|
|
||||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<ExpressionBlendVersion>5.0.40218.0</ExpressionBlendVersion>
|
|
||||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
|
||||||
<PublishUrl>publish\</PublishUrl>
|
|
||||||
<Install>true</Install>
|
|
||||||
<InstallFrom>Disk</InstallFrom>
|
|
||||||
<UpdateEnabled>false</UpdateEnabled>
|
|
||||||
<UpdateMode>Foreground</UpdateMode>
|
|
||||||
<UpdateInterval>7</UpdateInterval>
|
|
||||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
|
||||||
<UpdatePeriodically>false</UpdatePeriodically>
|
|
||||||
<UpdateRequired>false</UpdateRequired>
|
|
||||||
<MapFileExtensions>true</MapFileExtensions>
|
|
||||||
<AutorunEnabled>true</AutorunEnabled>
|
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
|
||||||
<ApplicationVersion>1.0.0.0</ApplicationVersion>
|
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
|
||||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugSymbols>true</DebugSymbols>
|
|
||||||
<DebugType>full</DebugType>
|
|
||||||
<Optimize>false</Optimize>
|
|
||||||
<OutputPath>bin\Debug\</OutputPath>
|
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
<Prefer32Bit>true</Prefer32Bit>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
|
||||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
|
||||||
<DebugType>pdbonly</DebugType>
|
|
||||||
<Optimize>true</Optimize>
|
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
|
||||||
<ErrorReport>prompt</ErrorReport>
|
|
||||||
<WarningLevel>4</WarningLevel>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<StartupObject>WinUI.App</StartupObject>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<ApplicationIcon>ZeroTierIcon.ico</ApplicationIcon>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignAssembly>false</SignAssembly>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup>
|
|
||||||
<SignManifests>false</SignManifests>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup />
|
|
||||||
<ItemGroup>
|
|
||||||
<Reference Include="Accessibility" />
|
|
||||||
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net45\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="PresentationUI, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
|
||||||
<Reference Include="ReachFramework" />
|
|
||||||
<Reference Include="System" />
|
|
||||||
<Reference Include="System.Data" />
|
|
||||||
<Reference Include="System.Deployment" />
|
|
||||||
<Reference Include="System.Drawing" />
|
|
||||||
<Reference Include="System.Net.Http" />
|
|
||||||
<Reference Include="System.Printing" />
|
|
||||||
<Reference Include="System.Windows.Forms" />
|
|
||||||
<Reference Include="System.Xml" />
|
|
||||||
<Reference Include="Microsoft.CSharp" />
|
|
||||||
<Reference Include="System.Core" />
|
|
||||||
<Reference Include="System.Xml.Linq" />
|
|
||||||
<Reference Include="System.Data.DataSetExtensions" />
|
|
||||||
<Reference Include="System.Xaml">
|
|
||||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="UIAutomationProvider" />
|
|
||||||
<Reference Include="UIAutomationTypes" />
|
|
||||||
<Reference Include="WindowsBase" />
|
|
||||||
<Reference Include="PresentationCore" />
|
|
||||||
<Reference Include="PresentationFramework" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ApplicationDefinition Include="App.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</ApplicationDefinition>
|
|
||||||
<Compile Include="AboutView.xaml.cs">
|
|
||||||
<DependentUpon>AboutView.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="CentralAPI.cs" />
|
|
||||||
<Compile Include="CentralLogin.cs" />
|
|
||||||
<Compile Include="CentralNetwork.cs" />
|
|
||||||
<Compile Include="CentralServer.cs" />
|
|
||||||
<Compile Include="CentralToken.cs" />
|
|
||||||
<Compile Include="CentralUser.cs" />
|
|
||||||
<Compile Include="ISwitchable.cs" />
|
|
||||||
<Compile Include="JoinNetworkView.xaml.cs">
|
|
||||||
<DependentUpon>JoinNetworkView.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="NetworkMonitor.cs" />
|
|
||||||
<Compile Include="NetworkNameGenerator.cs" />
|
|
||||||
<Compile Include="NetworkRoute.cs" />
|
|
||||||
<Compile Include="NetworksPage.xaml.cs">
|
|
||||||
<DependentUpon>NetworksPage.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="PeersPage.xaml.cs">
|
|
||||||
<DependentUpon>PeersPage.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="PreferencesView.xaml.cs">
|
|
||||||
<DependentUpon>PreferencesView.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="ToolbarItem.xaml.cs">
|
|
||||||
<DependentUpon>ToolbarItem.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="ZeroTierPeerPhysicalPath.cs" />
|
|
||||||
<Compile Include="ZeroTierPeer.cs" />
|
|
||||||
<Compile Include="ZeroTierNetwork.cs" />
|
|
||||||
<Compile Include="ZeroTierStatus.cs" />
|
|
||||||
<Page Include="AboutView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="JoinNetworkView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="NetworkListView.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Compile Include="APIHandler.cs" />
|
|
||||||
<Compile Include="App.xaml.cs">
|
|
||||||
<DependentUpon>App.xaml</DependentUpon>
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="NetworkListView.xaml.cs">
|
|
||||||
<DependentUpon>NetworkListView.xaml</DependentUpon>
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Page Include="NetworkInfoView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="NetworksPage.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="PeersPage.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="PreferencesView.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Simple Styles.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="Themes\Generic.xaml">
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
</Page>
|
|
||||||
<Page Include="ToolbarItem.xaml">
|
|
||||||
<SubType>Designer</SubType>
|
|
||||||
<Generator>MSBuild:Compile</Generator>
|
|
||||||
</Page>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<Compile Include="NetworkInfoView.xaml.cs">
|
|
||||||
<DependentUpon>NetworkInfoView.xaml</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\AssemblyInfo.cs">
|
|
||||||
<SubType>Code</SubType>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\Resources.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTime>True</DesignTime>
|
|
||||||
<DependentUpon>Resources.resx</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Properties\Settings.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DependentUpon>Settings.settings</DependentUpon>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
<EmbeddedResource Include="Properties\Resources.resx">
|
|
||||||
<Generator>ResXFileCodeGenerator</Generator>
|
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
|
||||||
</EmbeddedResource>
|
|
||||||
<None Include="app.manifest" />
|
|
||||||
<None Include="packages.config" />
|
|
||||||
<None Include="Properties\Settings.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<AppDesigner Include="Properties\" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="App.config" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<BootstrapperPackage Include=".NETFramework,Version=v4.5">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>Microsoft .NET Framework 4.5 %28x86 and x64%29</ProductName>
|
|
||||||
<Install>true</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
|
||||||
<Visible>False</Visible>
|
|
||||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
|
||||||
<Install>false</Install>
|
|
||||||
</BootstrapperPackage>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<BlendEmbeddedFont Include="Fonts\segoeui.ttf">
|
|
||||||
<IsSystemFont>True</IsSystemFont>
|
|
||||||
<All>True</All>
|
|
||||||
<AutoFill>True</AutoFill>
|
|
||||||
</BlendEmbeddedFont>
|
|
||||||
<BlendEmbeddedFont Include="Fonts\segoeuib.ttf">
|
|
||||||
<IsSystemFont>True</IsSystemFont>
|
|
||||||
<All>True</All>
|
|
||||||
<AutoFill>True</AutoFill>
|
|
||||||
</BlendEmbeddedFont>
|
|
||||||
<BlendEmbeddedFont Include="Fonts\segoeuii.ttf">
|
|
||||||
<IsSystemFont>True</IsSystemFont>
|
|
||||||
<All>True</All>
|
|
||||||
<AutoFill>True</AutoFill>
|
|
||||||
</BlendEmbeddedFont>
|
|
||||||
<BlendEmbeddedFont Include="Fonts\segoeuiz.ttf">
|
|
||||||
<IsSystemFont>True</IsSystemFont>
|
|
||||||
<All>True</All>
|
|
||||||
<AutoFill>True</AutoFill>
|
|
||||||
</BlendEmbeddedFont>
|
|
||||||
<Resource Include="ZeroTierIcon.ico" />
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<None Include="Resources\ZeroTierIcon.ico" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
|
||||||
<PropertyGroup>
|
|
||||||
<PostBuildEvent>copy "$(SolutionDir)\copyutil\bin\$(ConfigurationName)\copyutil.exe" "$(ProjectDir)\$(OutDir)\copyutil.exe"</PostBuildEvent>
|
|
||||||
</PropertyGroup>
|
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
|
||||||
Other similar extension points exist, see Microsoft.Common.targets.
|
|
||||||
<Target Name="BeforeBuild">
|
|
||||||
</Target>
|
|
||||||
<Target Name="AfterBuild">
|
|
||||||
</Target>
|
|
||||||
-->
|
|
||||||
</Project>
|
|
Binary file not shown.
Before Width: | Height: | Size: 361 KiB |
|
@ -1,516 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.Serialization;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
[Serializable]
|
|
||||||
public class ZeroTierNetwork : ISerializable, IEquatable<ZeroTierNetwork>, IComparable<ZeroTierNetwork>, INotifyPropertyChanged
|
|
||||||
{
|
|
||||||
private string networkId;
|
|
||||||
private string macAddress;
|
|
||||||
private string networkName;
|
|
||||||
private string networkStatus;
|
|
||||||
private string networkType;
|
|
||||||
private Int32 mtu;
|
|
||||||
private bool dhcp;
|
|
||||||
private bool bridge;
|
|
||||||
private bool broadcastEnabled;
|
|
||||||
private Int32 portError;
|
|
||||||
private Int32 netconfRevision;
|
|
||||||
private string[] assignedAddresses;
|
|
||||||
private NetworkRoute[] routes;
|
|
||||||
private string deviceName;
|
|
||||||
private bool allowManaged;
|
|
||||||
private bool allowGlobal;
|
|
||||||
private bool allowDefault;
|
|
||||||
private bool allowDNS;
|
|
||||||
private bool isConnected;
|
|
||||||
|
|
||||||
protected ZeroTierNetwork(SerializationInfo info, StreamingContext ctx)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
NetworkId = info.GetString("nwid");
|
|
||||||
MacAddress = info.GetString("mac");
|
|
||||||
NetworkName = info.GetString("name");
|
|
||||||
NetworkStatus = info.GetString("status");
|
|
||||||
NetworkType = info.GetString("type");
|
|
||||||
MTU = info.GetInt32("mtu");
|
|
||||||
DHCP = info.GetBoolean("dhcp");
|
|
||||||
Bridge = info.GetBoolean("bridge");
|
|
||||||
BroadcastEnabled = info.GetBoolean("broadcastEnabled");
|
|
||||||
PortError = info.GetInt32("portError");
|
|
||||||
NetconfRevision = info.GetInt32("netconfRevision");
|
|
||||||
AssignedAddresses = (string[])info.GetValue("assignedAddresses", typeof(string[]));
|
|
||||||
Routes = (NetworkRoute[])info.GetValue("routes", typeof(NetworkRoute[]));
|
|
||||||
DeviceName = info.GetString("portDeviceName");
|
|
||||||
AllowManaged = info.GetBoolean("allowManaged");
|
|
||||||
AllowGlobal = info.GetBoolean("allowGlobal");
|
|
||||||
AllowDefault = info.GetBoolean("allowDefault");
|
|
||||||
AllowDNS = info.GetBoolean("allowDNS");
|
|
||||||
}
|
|
||||||
catch { }
|
|
||||||
IsConnected = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
|
||||||
|
|
||||||
public virtual void GetObjectData(SerializationInfo info, StreamingContext ctx)
|
|
||||||
{
|
|
||||||
info.AddValue("nwid", NetworkId);
|
|
||||||
info.AddValue("mac", MacAddress);
|
|
||||||
info.AddValue("name", NetworkName);
|
|
||||||
info.AddValue("status", NetworkStatus);
|
|
||||||
info.AddValue("type", NetworkType);
|
|
||||||
info.AddValue("mtu", MTU);
|
|
||||||
info.AddValue("dhcp", DHCP);
|
|
||||||
info.AddValue("bridge", Bridge);
|
|
||||||
info.AddValue("broadcastEnabled", BroadcastEnabled);
|
|
||||||
info.AddValue("portError", PortError);
|
|
||||||
info.AddValue("netconfRevision", NetconfRevision);
|
|
||||||
info.AddValue("assignedAddresses", AssignedAddresses);
|
|
||||||
info.AddValue("routes", Routes);
|
|
||||||
info.AddValue("portDeviceName", DeviceName);
|
|
||||||
info.AddValue("allowManaged", AllowManaged);
|
|
||||||
info.AddValue("allowGlobal", AllowGlobal);
|
|
||||||
info.AddValue("allowDefault", AllowDefault);
|
|
||||||
info.AddValue("allowDNS", AllowDNS);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdateNetwork(ZeroTierNetwork network)
|
|
||||||
{
|
|
||||||
if (network == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (!NetworkId.Equals(network.NetworkId))
|
|
||||||
{
|
|
||||||
NetworkId = network.NetworkId;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!MacAddress.Equals(network.MacAddress))
|
|
||||||
{
|
|
||||||
MacAddress = network.MacAddress;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!NetworkName.Equals(network.NetworkName))
|
|
||||||
{
|
|
||||||
NetworkName = network.NetworkName;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!NetworkStatus.Equals(network.NetworkStatus))
|
|
||||||
{
|
|
||||||
NetworkStatus = network.NetworkStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!NetworkType.Equals(network.NetworkType))
|
|
||||||
{
|
|
||||||
NetworkType = network.NetworkType;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MTU != network.MTU)
|
|
||||||
{
|
|
||||||
MTU = network.MTU;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DHCP != network.DHCP)
|
|
||||||
{
|
|
||||||
DHCP = network.DHCP;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Bridge != network.Bridge)
|
|
||||||
{
|
|
||||||
Bridge = network.Bridge;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (BroadcastEnabled != network.BroadcastEnabled)
|
|
||||||
{
|
|
||||||
BroadcastEnabled = network.BroadcastEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PortError != network.PortError)
|
|
||||||
{
|
|
||||||
PortError = network.PortError;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (NetconfRevision != network.NetconfRevision)
|
|
||||||
{
|
|
||||||
NetconfRevision = network.NetconfRevision;
|
|
||||||
}
|
|
||||||
|
|
||||||
AssignedAddresses = network.AssignedAddresses;
|
|
||||||
|
|
||||||
Routes = network.Routes;
|
|
||||||
|
|
||||||
if (!DeviceName.Equals(network.DeviceName))
|
|
||||||
{
|
|
||||||
DeviceName = network.DeviceName;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AllowManaged != network.AllowManaged)
|
|
||||||
{
|
|
||||||
AllowManaged = network.AllowManaged;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AllowGlobal != network.AllowGlobal)
|
|
||||||
{
|
|
||||||
AllowGlobal = network.AllowGlobal;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AllowDefault != network.AllowDefault)
|
|
||||||
{
|
|
||||||
AllowDefault = network.AllowDefault;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (AllowDNS != network.AllowDNS)
|
|
||||||
{
|
|
||||||
AllowDNS = network.AllowDNS;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IsConnected != network.IsConnected)
|
|
||||||
{
|
|
||||||
IsConnected = network.IsConnected;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void NotifyPropertyChanged([CallerMemberName] string propertyName = null)
|
|
||||||
{
|
|
||||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("nwid")]
|
|
||||||
public string NetworkId {
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return networkId;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
networkId = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("mac")]
|
|
||||||
public string MacAddress
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return macAddress;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
macAddress = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("name")]
|
|
||||||
public string NetworkName
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return networkName;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
networkName = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("status")]
|
|
||||||
public string NetworkStatus
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return networkStatus;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
networkStatus = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("type")]
|
|
||||||
public string NetworkType
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return networkType;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
networkType = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("mtu")]
|
|
||||||
public int MTU
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return mtu;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
mtu = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("dhcp")]
|
|
||||||
public bool DHCP
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return dhcp;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
dhcp = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("bridge")]
|
|
||||||
public bool Bridge
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return bridge;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
bridge = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("broadcastEnabled")]
|
|
||||||
public bool BroadcastEnabled
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return broadcastEnabled;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
broadcastEnabled = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("portError")]
|
|
||||||
public int PortError
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return portError;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
portError = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("netconfRevision")]
|
|
||||||
public int NetconfRevision
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return netconfRevision;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
netconfRevision = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("assignedAddresses")]
|
|
||||||
public string[] AssignedAddresses
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return assignedAddresses;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
assignedAddresses = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("routes")]
|
|
||||||
public NetworkRoute[] Routes
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return routes;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
routes = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("portDeviceName")]
|
|
||||||
public string DeviceName
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return deviceName;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
deviceName = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("allowManaged")]
|
|
||||||
public bool AllowManaged
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return allowManaged;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
allowManaged = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("allowGlobal")]
|
|
||||||
public bool AllowGlobal
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return allowGlobal;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
allowGlobal = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("allowDefault")]
|
|
||||||
public bool AllowDefault
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return allowDefault;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
allowDefault = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("allowDNS")]
|
|
||||||
public bool AllowDNS
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return allowDNS;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
allowDNS = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsConnected
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return isConnected;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
isConnected = value;
|
|
||||||
NotifyPropertyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String Title
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
|
|
||||||
if (NetworkName != null && NetworkName.Length > 0)
|
|
||||||
{
|
|
||||||
return NetworkId + " (" + NetworkName + ")";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return NetworkId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Equals(ZeroTierNetwork network)
|
|
||||||
{
|
|
||||||
if (NetworkId == null || network == null)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return NetworkId.Equals(network.NetworkId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int CompareTo(ZeroTierNetwork network)
|
|
||||||
{
|
|
||||||
if (NetworkId == null || network == null)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
UInt64 thisNwid = UInt64.Parse(NetworkId, System.Globalization.NumberStyles.HexNumber);
|
|
||||||
UInt64 otherNwid = UInt64.Parse(network.NetworkId, System.Globalization.NumberStyles.HexNumber);
|
|
||||||
|
|
||||||
if (thisNwid > otherNwid)
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
else if (thisNwid < otherNwid)
|
|
||||||
{
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class NetworkEqualityComparer : IEqualityComparer<ZeroTierNetwork>
|
|
||||||
{
|
|
||||||
public bool Equals(ZeroTierNetwork lhs, ZeroTierNetwork rhs)
|
|
||||||
{
|
|
||||||
if (lhs.NetworkId.Equals(rhs.NetworkId))
|
|
||||||
{
|
|
||||||
lhs.UpdateNetwork(rhs);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int GetHashCode(ZeroTierNetwork obj)
|
|
||||||
{
|
|
||||||
return obj.NetworkId.GetHashCode();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,116 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
public class ZeroTierPeer : IEquatable<ZeroTierPeer>
|
|
||||||
{
|
|
||||||
[JsonProperty("address")]
|
|
||||||
public string Address { get; set; }
|
|
||||||
|
|
||||||
private Int64 _lastUnicast;
|
|
||||||
[JsonProperty("lastUnicastFrame")]
|
|
||||||
public Int64 LastUnicastFrame
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_lastUnicast == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1);
|
|
||||||
Int64 millisecondsSinceEpoch = (Int64)t.TotalMilliseconds;
|
|
||||||
return (millisecondsSinceEpoch - _lastUnicast) / 1000;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_lastUnicast = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private Int64 _lastMulticast;
|
|
||||||
[JsonProperty("lastMulticastFrame")]
|
|
||||||
public Int64 LastMulticastFrame
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_lastMulticast == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1);
|
|
||||||
Int64 millisecondsSinceEpoch = (Int64)t.TotalMilliseconds;
|
|
||||||
return (millisecondsSinceEpoch - _lastMulticast) / 1000;
|
|
||||||
}
|
|
||||||
set
|
|
||||||
{
|
|
||||||
_lastMulticast = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("versionMajor")]
|
|
||||||
public int VersionMajor { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("versionMinor")]
|
|
||||||
public int VersionMinor { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("versionRev")]
|
|
||||||
public int VersionRev { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("version")]
|
|
||||||
public string Version { get; set; }
|
|
||||||
|
|
||||||
public string VersionString
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (Version == "-1.-1.-1")
|
|
||||||
return "-";
|
|
||||||
else
|
|
||||||
return Version;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonProperty("latency")]
|
|
||||||
public string Latency { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("role")]
|
|
||||||
public string Role { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("paths")]
|
|
||||||
public List<ZeroTierPeerPhysicalPath> Paths { get; set; }
|
|
||||||
|
|
||||||
public string DataPaths
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
string pathStr = "";
|
|
||||||
foreach(ZeroTierPeerPhysicalPath path in Paths)
|
|
||||||
{
|
|
||||||
pathStr += path.Address + "\n";
|
|
||||||
}
|
|
||||||
return pathStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Equals(ZeroTierPeer other)
|
|
||||||
{
|
|
||||||
return this.Address.Equals(other.Address, StringComparison.InvariantCultureIgnoreCase);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update(ZeroTierPeer other)
|
|
||||||
{
|
|
||||||
_lastUnicast = other._lastUnicast;
|
|
||||||
_lastMulticast = other._lastMulticast;
|
|
||||||
VersionMajor = other.VersionMajor;
|
|
||||||
VersionMinor = other.VersionMinor;
|
|
||||||
VersionRev = other.VersionRev;
|
|
||||||
Version = other.Version;
|
|
||||||
Latency = other.Latency;
|
|
||||||
Role = other.Role;
|
|
||||||
Paths = other.Paths;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,27 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
public class ZeroTierPeerPhysicalPath
|
|
||||||
{
|
|
||||||
[JsonProperty("address")]
|
|
||||||
public string Address { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("lastSend")]
|
|
||||||
public UInt64 LastSend { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("lastReceive")]
|
|
||||||
public UInt64 LastReceive { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("fixed")]
|
|
||||||
public bool Fixed { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("preferred")]
|
|
||||||
public bool Preferred { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace WinUI
|
|
||||||
{
|
|
||||||
public class ZeroTierStatus
|
|
||||||
{
|
|
||||||
[JsonProperty("address")]
|
|
||||||
public string Address { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("publicIdentity")]
|
|
||||||
public string PublicIdentity { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("online")]
|
|
||||||
public bool Online { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("tcpFallbackActive")]
|
|
||||||
public bool TcpFallbackActive { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("versionMajor")]
|
|
||||||
public int VersionMajor { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("versionMinor")]
|
|
||||||
public int VersionMinor { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("versionRev")]
|
|
||||||
public int VersionRev { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("version")]
|
|
||||||
public string Version { get; set; }
|
|
||||||
|
|
||||||
[JsonProperty("clock")]
|
|
||||||
public UInt64 Clock { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
|
|
||||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
|
||||||
<security>
|
|
||||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
|
||||||
<!-- UAC Manifest Options
|
|
||||||
If you want to change the Windows User Account Control level replace the
|
|
||||||
requestedExecutionLevel node with one of the following.
|
|
||||||
|
|
||||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
|
||||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
|
||||||
|
|
||||||
Specifying requestedExecutionLevel node will disable file and registry virtualization.
|
|
||||||
If you want to utilize File and Registry Virtualization for backward
|
|
||||||
compatibility then delete the requestedExecutionLevel node.
|
|
||||||
-->
|
|
||||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
|
||||||
</requestedPrivileges>
|
|
||||||
</security>
|
|
||||||
</trustInfo>
|
|
||||||
|
|
||||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
|
||||||
<application>
|
|
||||||
<!-- A list of all Windows versions that this application is designed to work with.
|
|
||||||
Windows will automatically select the most compatible environment.-->
|
|
||||||
|
|
||||||
<!-- If your application is designed to work with Windows Vista, uncomment the following supportedOS node-->
|
|
||||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>-->
|
|
||||||
|
|
||||||
<!-- If your application is designed to work with Windows 7, uncomment the following supportedOS node-->
|
|
||||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>-->
|
|
||||||
|
|
||||||
<!-- If your application is designed to work with Windows 8, uncomment the following supportedOS node-->
|
|
||||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"></supportedOS>-->
|
|
||||||
|
|
||||||
</application>
|
|
||||||
</compatibility>
|
|
||||||
|
|
||||||
<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
|
|
||||||
<!-- <dependency>
|
|
||||||
<dependentAssembly>
|
|
||||||
<assemblyIdentity
|
|
||||||
type="win32"
|
|
||||||
name="Microsoft.Windows.Common-Controls"
|
|
||||||
version="6.0.0.0"
|
|
||||||
processorArchitecture="*"
|
|
||||||
publicKeyToken="6595b64144ccf1df"
|
|
||||||
language="*"
|
|
||||||
/>
|
|
||||||
</dependentAssembly>
|
|
||||||
</dependency>-->
|
|
||||||
|
|
||||||
</asmv1:assembly>
|
|
|
@ -1,5 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<packages>
|
|
||||||
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net45" />
|
|
||||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
|
|
||||||
</packages>
|
|
26
attic/central-controller-docker/Dockerfile
Normal file
26
attic/central-controller-docker/Dockerfile
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
# Dockerfile for ZeroTier Central Controllers
|
||||||
|
FROM centos:7 as builder
|
||||||
|
MAINTAINER Adam Ierymekno <adam.ierymenko@zerotier.com>, Grant Limberg <grant.limberg@zerotier.com>
|
||||||
|
|
||||||
|
ARG git_branch=master
|
||||||
|
|
||||||
|
RUN yum update -y
|
||||||
|
RUN yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-2.noarch.rpm
|
||||||
|
RUN yum -y install epel-release && yum -y update && yum clean all
|
||||||
|
RUN yum groupinstall -y "Development Tools"
|
||||||
|
RUN yum install -y bash postgresql10 postgresql10-devel libpqxx-devel glibc-static libstdc++-static clang jemalloc jemalloc-devel
|
||||||
|
|
||||||
|
RUN git clone http://git.int.zerotier.com/zerotier/ZeroTierOne.git
|
||||||
|
RUN if [ "$git_branch" != "master" ]; then cd ZeroTierOne && git checkout -b $git_branch origin/$git_branch; fi
|
||||||
|
RUN ldconfig
|
||||||
|
RUN cd ZeroTierOne && make central-controller
|
||||||
|
|
||||||
|
FROM centos:7
|
||||||
|
|
||||||
|
COPY --from=builder /ZeroTierOne/zerotier-one /usr/local/bin/zerotier-one
|
||||||
|
RUN chmod a+x /usr/local/bin/zerotier-one
|
||||||
|
|
||||||
|
ADD ext/central-controller-docker/main.sh /
|
||||||
|
RUN chmod a+x /main.sh
|
||||||
|
|
||||||
|
ENTRYPOINT /main.sh
|
80
attic/central-controller-docker/main.sh
Executable file
80
attic/central-controller-docker/main.sh
Executable file
|
@ -0,0 +1,80 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ -z "$ZT_IDENTITY_PATH" ]; then
|
||||||
|
echo '*** FAILED: ZT_IDENTITY_PATH environment variable is not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$ZT_DB_HOST" ]; then
|
||||||
|
echo '*** FAILED: ZT_DB_HOST environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$ZT_DB_PORT" ]; then
|
||||||
|
echo '*** FAILED: ZT_DB_PORT environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$ZT_DB_NAME" ]; then
|
||||||
|
echo '*** FAILED: ZT_DB_NAME environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$ZT_DB_USER" ]; then
|
||||||
|
echo '*** FAILED: ZT_DB_USER environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$ZT_DB_PASSWORD" ]; then
|
||||||
|
echo '*** FAILED: ZT_DB_PASSWORD environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
RMQ=""
|
||||||
|
if [ "$ZT_USE_RABBITMQ" == "true" ]; then
|
||||||
|
if [ -z "$RABBITMQ_HOST" ]; then
|
||||||
|
echo '*** FAILED: RABBITMQ_HOST environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$RABBITMQ_PORT" ]; then
|
||||||
|
echo '*** FAILED: RABBITMQ_PORT environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$RABBITMQ_USERNAME" ]; then
|
||||||
|
echo '*** FAILED: RABBITMQ_USERNAME environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ -z "$RABBITMQ_PASSWORD" ]; then
|
||||||
|
echo '*** FAILED: RABBITMQ_PASSWORD environment variable not defined'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
RMQ=", \"rabbitmq\": {
|
||||||
|
\"host\": \"${RABBITMQ_HOST}\",
|
||||||
|
\"port\": ${RABBITMQ_PORT},
|
||||||
|
\"username\": \"${RABBITMQ_USERNAME}\",
|
||||||
|
\"password\": \"${RABBITMQ_PASSWORD}\"
|
||||||
|
}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir -p /var/lib/zerotier-one
|
||||||
|
|
||||||
|
pushd /var/lib/zerotier-one
|
||||||
|
ln -s $ZT_IDENTITY_PATH/identity.public identity.public
|
||||||
|
ln -s $ZT_IDENTITY_PATH/identity.secret identity.secret
|
||||||
|
popd
|
||||||
|
|
||||||
|
DEFAULT_PORT=9993
|
||||||
|
|
||||||
|
echo "{
|
||||||
|
\"settings\": {
|
||||||
|
\"portMappingEnabled\": true,
|
||||||
|
\"softwareUpdate\": \"disable\",
|
||||||
|
\"interfacePrefixBlacklist\": [
|
||||||
|
\"inot\",
|
||||||
|
\"nat64\"
|
||||||
|
],
|
||||||
|
\"controllerDbPath\": \"postgres:host=${ZT_DB_HOST} port=${ZT_DB_PORT} dbname=${ZT_DB_NAME} user=${ZT_DB_USER} password=${ZT_DB_PASSWORD} sslmode=prefer sslcert=${DB_CLIENT_CERT} sslkey=${DB_CLIENT_KEY} sslrootcert=${DB_SERVER_CA}\"
|
||||||
|
${RMQ}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
" > /var/lib/zerotier-one/local.conf
|
||||||
|
|
||||||
|
export GLIBCXX_FORCE_NEW=1
|
||||||
|
export GLIBCPP_FORCE_NEW=1
|
||||||
|
export LD_PRELOAD="/usr/lib64/libjemalloc.so"
|
||||||
|
exec /usr/local/bin/zerotier-one -p${ZT_CONTROLLER_PORT:-$DEFAULT_PORT} /var/lib/zerotier-one
|
116
attic/debian/changelog
Normal file
116
attic/debian/changelog
Normal file
|
@ -0,0 +1,116 @@
|
||||||
|
zerotier-one (1.4.6) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Update default root server list
|
||||||
|
* Fix build flags on "armhf" (32-bit ARM) platforms for better
|
||||||
|
compatibility with Pi Zero and other devices.
|
||||||
|
* Fix license text in one.cpp.
|
||||||
|
* Add a clarification to LICENSE.txt.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 30 Aug 2019 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.4.4) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
* License changed to BSL 1.1
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 23 Aug 2019 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.4.2-2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
* This is a new build that fixes a binary build issue with containers and SELinux
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 04 Aug 2019 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.4.2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 04 Aug 2019 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.4.0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Thu, 29 Jul 2019 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.2.12) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 25 Jul 2018 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.2.10) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 08 May 2018 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.2.8) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 27 Apr 2018 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.2.6) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 17 Apr 2018 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.2.4) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Mon, 24 Mar 2017 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.2.2) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 17 Mar 2017 01:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.2.0) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 14 Mar 2017 09:08:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.1.14) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 21 Jul 2016 07:14:12 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.1.12) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 12 Jul 2016 03:02:22 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.1.10) unstable; urgency=medium
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
* ZeroTier Debian packages no longer depend on http-parser since its ABI is too unstable.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Tue, 12 Jul 2016 12:29:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.1.8) unstable; urgency=low
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 08 Jul 2016 01:56:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.1.6) unstable; urgency=medium
|
||||||
|
|
||||||
|
* First Debian release on ZeroTier, Inc. private apt repository.
|
||||||
|
|
||||||
|
* See https://github.com/zerotier/ZeroTierOne for release notes.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Fri, 24 Jun 2016 10:00:00 -0700
|
||||||
|
|
||||||
|
zerotier-one (1.1.5) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
|
* Development package -- first clean Debian packaging test.
|
||||||
|
|
||||||
|
-- Adam Ierymenko <adam.ierymenko@zerotier.com> Wed, 08 Jun 2016 10:05:01 -0700
|
1
attic/debian/compat
Normal file
1
attic/debian/compat
Normal file
|
@ -0,0 +1 @@
|
||||||
|
8
|
|
@ -3,14 +3,14 @@ Maintainer: Adam Ierymenko <adam.ierymenko@zerotier.com>
|
||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Standards-Version: 3.9.6
|
Standards-Version: 3.9.6
|
||||||
Build-Depends: debhelper
|
Build-Depends: debhelper (>= 9)
|
||||||
Vcs-Git: git://github.com/zerotier/ZeroTierOne
|
Vcs-Git: git://github.com/zerotier/ZeroTierOne
|
||||||
Vcs-Browser: https://github.com/zerotier/ZeroTierOne
|
Vcs-Browser: https://github.com/zerotier/ZeroTierOne
|
||||||
Homepage: https://www.zerotier.com/
|
Homepage: https://www.zerotier.com/
|
||||||
|
|
||||||
Package: zerotier-one
|
Package: zerotier-one
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: adduser, libstdc++6 (>= 5), openssl
|
Depends: ${shlibs:Depends}, ${misc:Depends}, iproute2, adduser, libstdc++6
|
||||||
Homepage: https://www.zerotier.com/
|
Homepage: https://www.zerotier.com/
|
||||||
Description: ZeroTier network virtualization service
|
Description: ZeroTier network virtualization service
|
||||||
ZeroTier One lets you join ZeroTier virtual networks and
|
ZeroTier One lets you join ZeroTier virtual networks and
|
|
@ -10,7 +10,7 @@ Homepage: https://www.zerotier.com/
|
||||||
|
|
||||||
Package: zerotier-one
|
Package: zerotier-one
|
||||||
Architecture: any
|
Architecture: any
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, libstdc++6
|
Depends: ${shlibs:Depends}, ${misc:Depends}, iproute, libstdc++6
|
||||||
Homepage: https://www.zerotier.com/
|
Homepage: https://www.zerotier.com/
|
||||||
Description: ZeroTier network virtualization service
|
Description: ZeroTier network virtualization service
|
||||||
ZeroTier One lets you join ZeroTier virtual networks and
|
ZeroTier One lets you join ZeroTier virtual networks and
|
|
@ -12,7 +12,7 @@ License: ZeroTier BSL 1.1
|
||||||
Use of this software is governed by the Business Source License included
|
Use of this software is governed by the Business Source License included
|
||||||
in the LICENSE.TXT file in the project's root directory.
|
in the LICENSE.TXT file in the project's root directory.
|
||||||
|
|
||||||
Change Date: 2026-01-01
|
Change Date: 2023-01-01
|
||||||
|
|
||||||
On the date above, in accordance with the Business Source License, use
|
On the date above, in accordance with the Business Source License, use
|
||||||
of this software will be governed by version 2.0 of the Apache License.
|
of this software will be governed by version 2.0 of the Apache License.
|
|
@ -3,7 +3,7 @@
|
||||||
case "$1" in
|
case "$1" in
|
||||||
configure)
|
configure)
|
||||||
if ! id zerotier-one >>/dev/null 2>&1; then
|
if ! id zerotier-one >>/dev/null 2>&1; then
|
||||||
useradd --system --user-group --home-dir /var/lib/zerotier-one --shell /usr/sbin/nologin --no-create-home zerotier-one
|
useradd --system --user-group --home-dir /var/lib/zerotier-one --no-create-home zerotier-one
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
2
debian/rules → attic/debian/rules
Normal file → Executable file
2
debian/rules → attic/debian/rules
Normal file → Executable file
|
@ -7,7 +7,7 @@ CXXFLAGS=-O3 -fstack-protector-strong
|
||||||
dh $@ --with systemd
|
dh $@ --with systemd
|
||||||
|
|
||||||
override_dh_auto_build:
|
override_dh_auto_build:
|
||||||
make
|
make -j 4
|
||||||
|
|
||||||
override_dh_systemd_start:
|
override_dh_systemd_start:
|
||||||
dh_systemd_start --restart-after-upgrade
|
dh_systemd_start --restart-after-upgrade
|
0
debian/rules.wheezy → attic/debian/rules.wheezy
Normal file → Executable file
0
debian/rules.wheezy → attic/debian/rules.wheezy
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=ZeroTier One
|
Description=ZeroTier One
|
||||||
After=network-online.target network.target
|
After=network-online.target
|
||||||
Wants=network-online.target
|
Wants=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue