nili 2 лет назад
Родитель
Сommit
67c7da4ff4
9 измененных файлов с 93 добавлено и 76 удалено
  1. BIN
      .DS_Store
  2. BIN
      .github/.DS_Store
  3. 12 9
      .github/workflows/auto_build_docker_container.yml
  4. 4 4
      Dockerfile
  5. 27 0
      README-EN.md
  6. 50 46
      README.md
  7. 0 17
      README_EN.md
  8. 0 0
      runner.sh
  9. 0 0
      ztncui.sh

BIN
.github/.DS_Store


+ 12 - 9
.github/workflows/auto_build_docker_container.yml

@@ -2,9 +2,9 @@ name: 自动构建docker镜像
 
 on:
   schedule:
-    - cron: "21 19 * * 0"
-  watch:
-    types: started
+    - cron: "36 19 * * 0"
+  #watch:
+  #  types: started
   workflow_dispatch:
 
 #  push:
@@ -17,7 +17,7 @@ jobs:
     runs-on: ubuntu-latest
     steps:
 
-      - name: Check Out Repo 
+      - name: Check Out Repo
         uses: actions/checkout@v4
 
 #      - name: Login to GHCR
@@ -34,18 +34,21 @@ jobs:
           username: ${{ secrets.DOCKER_USERNAME }}
           password: ${{ secrets.DOCKER_PASSWORD }}
 
+      - name: Get Respository Name
+        run: echo "IMAGE_NAME=$(echo '${{ github.repository }}' | awk -F '/' '{print $2}')" >> "$GITHUB_ENV"
+
       - name: Docker meta
         id: meta
         uses: docker/metadata-action@v5
         with:
           # list of Docker images to use as base name for tags
           images: |
-            ${{ secrets.DOCKER_USERNAME }}/zerotier-aio-zh
+            ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}
           #  ghcr.io/username/app
           # generate Docker tags based on the following events/attributes
           tags: |
             type=raw,value=latest
-            {{date 'YYYY/MM/DD'}}
+            {{date 'YYYY/MM/DD/hh/mm/ss'}}
 #            type=schedule,pattern={{date 'YYYY/MM/DD'}}
 #            type=semver,pattern={{version}}
 #            type=semver,pattern=$()
@@ -67,10 +70,10 @@ jobs:
         id: docker_build_all
         uses: docker/build-push-action@v5
         with:
-          context: ./dockerfile/
-          file: ./dockerfile/Dockerfile
+          context: ./
+          file: ./Dockerfile
           push: true
-          platforms: linux/amd64,linux/arm64
+          platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7
           tags: ${{ steps.meta.outputs.tags }}
           labels: ${{ steps.meta.outputs.labels }}
       - name: all Image digest

+ 4 - 4
dockerfile/Dockerfile → Dockerfile

@@ -8,8 +8,8 @@ LABEL Description="ztncui (a ZeroTier network controller user interface) + ZeroT
 
 # BUILD ZTNCUI IN FIRST STAGE
 WORKDIR /build
-COPY ZTNCUI.sh .
-RUN chmod a+x ZTNCUI.sh && ./ZTNCUI.sh
+COPY ztncui.sh .
+RUN chmod a+x ztncui.sh && ./ztncui.sh
 
 # BUILD GO UTILS
 FROM golang:bullseye AS gobuilder
@@ -28,8 +28,8 @@ FROM debian:bullseye-slim AS runner
 ENV DEBIAN_FRONTEND=noninteractive
 ENV AUTOGEN_PLANET=0
 WORKDIR /tmp
-COPY RUNNER.sh .
-RUN chmod a+x RUNNER.sh && bash RUNNER.sh
+COPY runner.sh .
+RUN chmod a+x runner.sh && bash runner.sh
 
 WORKDIR /opt/key-networks/ztncui
 COPY --from=jsbuilder /build/artifact.zip .

+ 27 - 0
README-EN.md

@@ -0,0 +1,27 @@
+# Zerotier-Aio-Zh
+
+**Note that this repository is for Chinese users only, English users should visit [the original repository.](https://github.com/kmahyyg/ztncui-aio)**
+
+- [中文](./README.md)
+- [ENGLISH](./README_EN.md)
+
+- [Github](https://github.com/niliovo/zerotier-aio-zh)
+- [Docker Hub](https://hub.docker.com/r/niliaerith/zerotier-aio-zh)
+
+# Thanks
+
+- [zerotier/ZeroTierOne](https://github.niliovo.top/zerotier/ZeroTierOne)
+- [kmahyyg/ztncui-aio](https://github.com/kmahyyg/ztncui-aio)
+- [key-networks/ztncui](https://github.com/key-networks/ztncui)
+- [GitHub](https://github.com/)
+- [Docker Hub](https://hub.docker.com/)
+
+## STAR History
+
+<a href="https://star-history.com/#niliovo/zerotier-aio-zh&Date">
+  <picture>
+    <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=niliovo/zerotier-aio-zh&type=Date&theme=dark" />
+    <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=niliovo/zerotier-aio-zh&type=Date" />
+    <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=niliovo/zerotier-aio-zh&type=Date" />
+  </picture>
+</a>

+ 50 - 46
README.md

@@ -1,6 +1,4 @@
-# zerotier-aio-zh
-
-**注意,本仓库为汉化仓库,提交ISSUE请前往[原仓库](https://github.com/kmahyyg/ztncui-aio)**
+# Zerotier-Aio-Zh
 
 - [中文](./README.md)
 - [ENGLISH](./README_EN.md)
@@ -8,46 +6,30 @@
 - [Github](https://github.com/niliovo/zerotier-aio-zh)
 - [Docker Hub](https://hub.docker.com/r/niliaerith/zerotier-aio-zh)
 
-# 本项目基于下列项目,汉化 ztncui-aio 并打包镜像
+## 项目说明
+
+> 本项目基于下列项目,汉化 ztncui-aio 并打包镜像
 
 - [zerotier/ZeroTierOne](https://github.niliovo.top/zerotier/ZeroTierOne)
 - [kmahyyg/ztncui-aio](https://github.com/kmahyyg/ztncui-aio)
 - [key-networks/ztncui](https://github.com/key-networks/ztncui)
 
-# 使用指南
-
-## Docker-Cli使用指南
-
-- armv7(armv7未测试,请自行构建,命令如下)
-
-```
-git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/dockerfile && docker build -t zerotier-aio-zh .
-```
-
-- amd64/arm64
-- host模式
-
-```sh
-docker run -itd --name zerotier-aio-zh --hostname zerotier-aio-zh --net host --restart always --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun -v /your_path/zerotier-aio-zh/opt/key-networks/ztncui/etc:/opt/key-networks/ztncui/etc -v /your_path/zerotier-aio-zh/var/lib/zerotier-one:/var/lib/zerotier-one -v /your_path/zerotier-aio-zh/etc/zt-mkworld:/etc/zt-mkworld -e PUID=0 -e PGID=0 -e TZ=Asia/Shanghai -e AUTOGEN_PLANET=0 -e NODE_ENV=production -e HTTPS_HOST=xxx.xxx.xxx.xxx -e HTTPS_PORT=3443 -e HTTP_PORT=3000 -e HTTP_ALL_INTERFACES=yes -e MYDOMAIN=ztncui.docker.test -e ZTNCUI_PASSWD=YourPassWD -e MYADDR=PublicIP --privileged=true niliaerith/zerotier-aio-zh:latest
-
-```
+**注意,本仓库为汉化仓库,提交ISSUE请前往[原仓库](https://github.com/kmahyyg/ztncui-aio)**
 
-- bridge模式
+### 支持平台
 
-```sh
-docker run -itd --name zerotier-aio-zh --hostname zerotier-aio-zh --net bridge -p3000:3000 -p3180:3180 -p3443:3443 -p9993:9993/udp --restart always --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun -v /your_path/zerotier-aio-zh/opt/key-networks/ztncui/etc:/opt/key-networks/ztncui/etc -v /your_path/zerotier-aio-zh/var/lib/zerotier-one:/var/lib/zerotier-one -v /your_path/zerotier-aio-zh/etc/zt-mkworld:/etc/zt-mkworld -e PUID=0 -e PGID=0 -e TZ=Asia/Shanghai -e AUTOGEN_PLANET=0 -e NODE_ENV=production -e HTTPS_HOST=xxx.xxx.xxx.xxx -e HTTPS_PORT=3443 -e HTTP_PORT=3000 -e HTTP_ALL_INTERFACES=yes -e MYDOMAIN=ztncui.docker.test -e ZTNCUI_PASSWD=YourPassWD -e MYADDR=PublicIP --privileged=true niliaerith/zerotier-aio-zh:latest
-```
+- x86_64
+- arm64
+- x86_32(未测试)
+- arm32(未测试)
 
-## Docker Compose使用指南
+> 提示:多平台镜像为QEMU模拟不同平台编译,可能存在问题,如果镜像不可用,请尝试自行编译
 
-- armv7(armv7构建耗时超过6h导致GitHub Action无法完成构建镜像,请自行构建,命令如下)
+## 使用说明
 
-```
-git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/dockerfile && docker build -t zerotier-aio-zh .
-```
+### Docker Compose
 
-- amd64/arm64
-- host模式
+#### host模式
 
 ```compose.yml
   zerotier-aio-zh:
@@ -65,8 +47,6 @@ git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/d
       - /your_path/zerotier-aio-zh/var/lib/zerotier-one:/var/lib/zerotier-one
       - /your_path/zerotier-aio-zh/etc/zt-mkworld:/etc/zt-mkworld
     environment:
-      - PUID=0
-      - PGID=0
       - TZ=Asia/Shanghai
       - AUTOGEN_PLANET=0
       - NODE_ENV=production
@@ -80,7 +60,7 @@ git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/d
     privileged: true
 ```
 
-- bridge模式
+#### bridge模式
 
 ```compose.yml
   zerotier-aio-zh:
@@ -103,8 +83,6 @@ git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/d
       - /your_path/zerotier-aio-zh/var/lib/zerotier-one:/var/lib/zerotier-one
       - /your_path/zerotier-aio-zh/etc/zt-mkworld:/etc/zt-mkworld
     environment:
-      - PUID=0
-      - PGID=0
       - TZ=Asia/Shanghai
       - AUTOGEN_PLANET=0
       - NODE_ENV=production
@@ -118,6 +96,30 @@ git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/d
     privileged: true
 ```
 
+### Docker Cli
+
+#### host模式
+
+```sh
+docker run -itd --name zerotier-aio-zh --hostname zerotier-aio-zh --net host --restart always --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun -v /your_path/zerotier-aio-zh/opt/key-networks/ztncui/etc:/opt/key-networks/ztncui/etc -v /your_path/zerotier-aio-zh/var/lib/zerotier-one:/var/lib/zerotier-one -v /your_path/zerotier-aio-zh/etc/zt-mkworld:/etc/zt-mkworld -e TZ=Asia/Shanghai -e AUTOGEN_PLANET=0 -e NODE_ENV=production -e HTTPS_HOST=xxx.xxx.xxx.xxx -e HTTPS_PORT=3443 -e HTTP_PORT=3000 -e HTTP_ALL_INTERFACES=yes -e MYDOMAIN=ztncui.docker.test -e ZTNCUI_PASSWD=YourPassWD -e MYADDR=PublicIP --privileged=true niliaerith/zerotier-aio-zh:latest
+
+```
+
+#### bridge模式
+
+```sh
+docker run -itd --name zerotier-aio-zh --hostname zerotier-aio-zh --net bridge -p3000:3000 -p3180:3180 -p3443:3443 -p9993:9993/udp --restart always --cap-add=NET_ADMIN --device /dev/net/tun:/dev/net/tun -v /your_path/zerotier-aio-zh/opt/key-networks/ztncui/etc:/opt/key-networks/ztncui/etc -v /your_path/zerotier-aio-zh/var/lib/zerotier-one:/var/lib/zerotier-one -v /your_path/zerotier-aio-zh/etc/zt-mkworld:/etc/zt-mkworld -e TZ=Asia/Shanghai -e AUTOGEN_PLANET=0 -e NODE_ENV=production -e HTTPS_HOST=xxx.xxx.xxx.xxx -e HTTPS_PORT=3443 -e HTTP_PORT=3000 -e HTTP_ALL_INTERFACES=yes -e MYDOMAIN=ztncui.docker.test -e ZTNCUI_PASSWD=YourPassWD -e MYADDR=PublicIP --privileged=true niliaerith/zerotier-aio-zh:latest
+```
+
+### 自行编译
+
+```
+git clone https://github.com/niliovo/zerotier-aio-zh.git
+cd zerotier-aio-zh
+docker build -t zerotier-aio-zh .
+# 将上述镜像 'niliaerith/zerotier-aio-zh' 替换为 'zerotier-aio-zh'
+```
+
 ## 变量
 
 - `AUTOGEN_PLANET=0`如果设置为 1,将使用此节点身份生成planet文件并放入httpfs文件夹以在外部提供服务。如果设置为 2,将使用`/etc/zt-mkworld/mkworld.config.json`. 如果设置为 0,则不执行任何操作(默认为0)。
@@ -155,15 +157,7 @@ git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/d
 - `ZTNCUI_PASSWD=YourPassWD` WebUI密码,默认用户名为admin
 - `MYADDR` 公网IP地址,如果未设置将自动检测
 
-- 更多用法详见[kmahyyg/ztncui-aio](https://github.com/kmahyyg/ztncui-aio)
-
-## 支持平台
-
-- amd64
-- arm64
-- armv7(未测试,需自行构建镜像)
-
-- ~~i386(node没有此版本,故不支持)~~
+> 更多用法详见[kmahyyg/ztncui-aio](https://github.com/kmahyyg/ztncui-aio)
 
 # 感谢
 
@@ -172,3 +166,13 @@ git clone https://github.com/niliovo/zerotier-aio-zh.git && cd zerotier-aio-zh/d
 - [key-networks/ztncui](https://github.com/key-networks/ztncui)
 - [GitHub](https://github.com/)
 - [Docker Hub](https://hub.docker.com/)
+
+## STAR 历史
+
+<a href="https://star-history.com/#niliovo/zerotier-aio-zh&Date">
+  <picture>
+    <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=niliovo/zerotier-aio-zh&type=Date&theme=dark" />
+    <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=niliovo/zerotier-aio-zh&type=Date" />
+    <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=niliovo/zerotier-aio-zh&type=Date" />
+  </picture>
+</a>

+ 0 - 17
README_EN.md

@@ -1,17 +0,0 @@
-# zerotier-aio-zh
-
-**Note that this repository is for Chinese users only, users should visit [the original repository.](https://github.com/kmahyyg/ztncui-aio)**
-
-- [中文](./README.md)
-- [ENGLISH](./README_EN.md)
-
-- [Github](https://github.com/niliovo/zerotier-aio-zh)
-- [Docker Hub](https://hub.docker.com/r/niliaerith/zerotier-aio-zh)
-
-# Thanks
-
-- [zerotier/ZeroTierOne](https://github.niliovo.top/zerotier/ZeroTierOne)
-- [kmahyyg/ztncui-aio](https://github.com/kmahyyg/ztncui-aio)
-- [key-networks/ztncui](https://github.com/key-networks/ztncui)
-- [GitHub](https://github.com/)
-- [Docker Hub](https://hub.docker.com/)

+ 0 - 0
dockerfile/RUNNER.sh → runner.sh


+ 0 - 0
dockerfile/ZTNCUI.sh → ztncui.sh


粤ICP备19079148号