mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Merge branch 'edge' of http://10.6.6.2/zerotier/ZeroTierOne into edge
This commit is contained in:
commit
9827b8991d
3 changed files with 15 additions and 16 deletions
|
@ -5,7 +5,7 @@
|
||||||
"defaultOne": "@local",
|
"defaultOne": "@local",
|
||||||
"things": {
|
"things": {
|
||||||
"local": {
|
"local": {
|
||||||
"auth": "XXXXXXXXXXXXXXXXXXXXXXXX",
|
"auth": "local_service_auth_token_replaced_automatically",
|
||||||
"type": "one",
|
"type": "one",
|
||||||
"url": "http://127.0.0.1:9993/"
|
"url": "http://127.0.0.1:9993/"
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,7 +4,8 @@ EXPOSE 8080/tcp 9993/udp
|
||||||
# Install ZT network conf files
|
# Install ZT network conf files
|
||||||
RUN mkdir -p /var/lib/zerotier-one/networks.d
|
RUN mkdir -p /var/lib/zerotier-one/networks.d
|
||||||
ADD *.conf /var/lib/zerotier-one/networks.d/
|
ADD *.conf /var/lib/zerotier-one/networks.d/
|
||||||
ADD zerotier /
|
ADD *.conf /
|
||||||
|
ADD zerotier-one /
|
||||||
ADD zerotier-cli /
|
ADD zerotier-cli /
|
||||||
ADD .zerotierCliSettings /
|
ADD .zerotierCliSettings /
|
||||||
|
|
||||||
|
|
|
@ -1,23 +1,21 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
echo '*** ZeroTier-Kubernetes self-auth test script'
|
echo '*** ZeroTier-Kubernetes self-auth test script'
|
||||||
chown -R daemon /var/lib/zerotier-one
|
chown -R daemon /var/lib/zerotier-one
|
||||||
chgrp -R daemon /var/lib/zerotier-one
|
chgrp -R daemon /var/lib/zerotier-one
|
||||||
su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
|
su daemon -s /bin/bash -c '/zerotier-one -d -U -p9993 >>/tmp/zerotier-one.out 2>&1'
|
||||||
virtip4=""
|
dev=""
|
||||||
while [ -z "$virtip4" ]; do
|
|
||||||
sleep 0.2
|
|
||||||
virtip4=`/zerotier-cli listnetworks | grep -F $nwid | cut -d ' ' -f 9 | sed 's/,/\n/g' | grep -F '.' | cut -d / -f 1`
|
|
||||||
dev=`/zerotier-cli listnetworks | grep -F "" | cut -d ' ' -f 8 | cut -d "_" -f 2 | sed "s/^<dev>//" | tr '\n' '\0'`
|
|
||||||
done
|
|
||||||
echo '*** Up and running at' $virtip4 ' on network: ' $nwid
|
|
||||||
|
|
||||||
echo '*** Self-Authorizing to deployment network'
|
|
||||||
nwconf=$(ls *.conf)
|
nwconf=$(ls *.conf)
|
||||||
nwid="${nwconf%.*}"
|
nwid="${nwconf%.*}"
|
||||||
|
|
||||||
|
sleep 10
|
||||||
|
dev=$(cat /var/lib/zerotier-one/identity.public| cut -d ':' -f 1)
|
||||||
|
|
||||||
|
echo '*** Joining'
|
||||||
|
./zerotier-cli join "$nwid".conf
|
||||||
AUTHTOKEN=$(cat /var/lib/zerotier-one/authtoken.secret)
|
AUTHTOKEN=$(cat /var/lib/zerotier-one/authtoken.secret)
|
||||||
sed "s|\local_service_auth_token|${AUTHTOKEN}|" .zerotierCliSettings > /root/.zerotierCliSettings
|
sed "s|\local_service_auth_token_replaced_automatically|${AUTHTOKEN}|" .zerotierCliSettings > /root/.zerotierCliSettings
|
||||||
|
echo '*** Authorizing'
|
||||||
./zerotier-cli join $(nwid).conf
|
./zerotier-cli net-auth @my.zerotier.com "$nwid" "$dev"
|
||||||
./zerotier-cli net-auth $(nwid) $(dev)
|
node server.js
|
||||||
|
|
||||||
# node server.js
|
|
Loading…
Add table
Reference in a new issue