diff --git a/deploy.sh b/deploy.sh index d20c030..d4d0c8b 100755 --- a/deploy.sh +++ b/deploy.sh @@ -93,7 +93,11 @@ function install() { -e API_PORT=${API_PORT} \ -e FILE_SERVER_PORT=${FILE_PORT} \ -v $(pwd)/data/zerotier/dist:/app/dist \ - -v $(pwd)/data/zerotier/ztncui:/app/ztncui -v $(pwd)/data/zerotier/one:/var/lib/zerotier-one -v $(pwd)/data/zerotier/config:/app/config xubiaolin/zerotier-planet:latest + -v $(pwd)/data/zerotier/ztncui:/app/ztncui \ + -v $(pwd)/data/zerotier/one:/var/lib/zerotier-one\ + -v $(pwd)/data/zerotier/config:/app/config\ + --restart unless-stopped\ + xubiaolin/zerotier-planet:latest if [ $? -ne 0 ]; then echo "安装失败" diff --git a/entrypoint.sh b/entrypoint.sh index e47585f..4185168 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -35,6 +35,7 @@ function check_zerotier() { echo "start mkmoonworld" openssl rand -hex 16 > authtoken.secret + ./zerotier-idtool generate identity.secret identity.public ./zerotier-idtool initmoon identity.public >moon.json if [ -z "$IP_ADDR4" ]; then IP_ADDR4=$(curl -s https://ipv4.icanhazip.com/); fi @@ -63,7 +64,6 @@ function check_zerotier() { jq --argjson newEndpoints "$stableEndpoints" '.roots[0].stableEndpoints = $newEndpoints' moon.json >temp.json && mv temp.json moon.json ./zerotier-idtool genmoon moon.json && mkdir -p moons.d && cp ./*.moon ./moons.d - # wget "${GH_MIRROR}https://github.com/kaaass/ZeroTierOne/releases/download/mkmoonworld-1.0/mkmoonworld-x86_64" cp /app/mkmoonworld-x86_64 ./mkmoonworld-x86_64 chmod +x ./mkmoonworld-x86_64 ./mkmoonworld-x86_64 moon.json