启用汉化

This commit is contained in:
chenxudong2020 2024-10-12 21:54:58 +08:00
parent 395bffc4e4
commit af25a7a818
3 changed files with 6 additions and 15 deletions

View File

@ -45,8 +45,8 @@ RUN set -x\
RUN set -x \
&& mkdir /app -p \
&& cd /app \
&& git clone --progress https://ghproxy.imoyuapp.win/https://github.com/key-networks/ztncui.git\
&& bash zh.sh \
&& git clone https://github.com/key-networks/ztncui.git\
&& sh zh.sh \
&& cd /app/ztncui/src \
&& npm config set registry https://registry.npmmirror.com\
&& npm install -g node-gyp\

View File

@ -5,14 +5,5 @@ REPO=ZeroTierOne
DOCKER_IMAGE="xubiaolin/zerotier-planet"
latest_tag=$(curl -s "https://api.github.com/repos/$USER/$REPO/tags" | jq -r '.[].name' | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" | sort -V | tail -n 1)
latest_docker_tag=$(curl -s "https://hub.docker.com/v2/repositories/${DOCKER_IMAGE}/tags/" | jq -r '.results[].name' | grep -E "^[0-9]+\.[0-9]+\.[0-9]+$" | sort -V | tail -n 1)
if [ "$latest_tag" == "$latest_docker_tag" ]; then
echo "No new version found"
exit 0
fi
echo "Latest tag for $USER/$REPO matching latest is: $latest_tag"
docker buildx build --platform linux/arm64,linux/amd64 -t "$DOCKER_IMAGE":latest --push .
docker buildx build --platform linux/arm64,linux/amd64 -t "${DOCKER_IMAGE}:${latest_tag}" --push .
docker buildx build --platform linux/arm64,linux/amd64 -t "$DOCKER_IMAGE":latest .

4
zh.sh
View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
sed -i "s|'Listening for HTTP requests on port '|'监听HTTP请求的端口 '|g" ztncui/src/bin/www
sed -i "s|' on all interfaces'|' 在所有接口上'|g" ztncui/src/bin/www
@ -118,7 +118,7 @@ sed -i "s|network controller UI|网络控制器用户界面|g" ztncui/src/views/
sed -i "s|Logout|注销|g" ztncui/src/views/head_layout.pug
sed -i "s|network controller UI by|网络控制器用户界面汉化作者|g" ztncui/src/views/index.pug
sed -i "s|a(href='https://key-networks.com' target='_blank') Key Networks|a(href='https://github.com/niliovo/zerotier-aio-zh' target='_blank') Nili|g" ztncui/src/views/index.pug
sed -i "s|a(href='https://key-networks.com' target='_blank') Key Networks|a(href='https://github.com/chenxudong2020/docker-zerotier-planet' target='_blank') |g" ztncui/src/views/index.pug
sed -i "s|This network controller has a ZeroTier address of|该控制器的ZeroTier地址为|g" ztncui/src/views/index.pug
sed -i "s|ZeroTier version|ZeroTier版本为|g" ztncui/src/views/index.pug
sed -i "s|List all networks on this network controller|列出该网络控制器上的所有网络|g" ztncui/src/views/index.pug