From b376552085e22c40e7a820c1e1edf7c78e4f0b17 Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Sat, 10 Apr 2021 15:46:49 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker=E6=BA=90=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a9874d..399f58e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,13 +9,14 @@ RUN npx browserslist@latest --update-db \ # server FROM golang:alpine as builder_golang -ENV GOPROXY=https://goproxy.io \ - GOOS=linux +#TODO 本地打包时使用镜像 +#ENV GOPROXY=https://goproxy.io +ENV GOOS=linux WORKDIR /anylink COPY . /anylink COPY --from=builder_node /web/ui /anylink/server/ui -#本地打包时使用镜像 +#TODO 本地打包时使用镜像 #RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories RUN apk add --no-cache git RUN cd /anylink/server;go build -o anylink -ldflags "-X main.COMMIT_ID=$(git rev-parse HEAD)" \ @@ -34,7 +35,7 @@ COPY ./server/conf /app/conf COPY ./server/files /app/files COPY docker_entrypoint.sh /app/ -#本地打包时使用镜像 +#TODO 本地打包时使用镜像 #RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories RUN apk add --no-cache bash iptables && ls /app From d4b8cc3576e2022916fbfef136c9cbae275bf69d Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Sat, 10 Apr 2021 15:51:03 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker=E6=BA=90=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 399f58e..ef466cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,9 @@ COPY docker_entrypoint.sh /app/ #TODO 本地打包时使用镜像 #RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories -RUN apk add --no-cache bash iptables && ls /app +RUN apk add --no-cache bash iptables \ + && chmod +x /app/docker_entrypoint.sh \ + && ls /app EXPOSE 443 8800 From ed569dfba1709303ec87587f0f7446025187344a Mon Sep 17 00:00:00 2001 From: bjdgyc Date: Sat, 10 Apr 2021 16:45:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9docker=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++++------ server/dbdata/db.go | 2 +- server/files/.gitignore | 5 ----- server/files/info.txt | 2 ++ server/handler/link_home.go | 2 +- 5 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 server/files/.gitignore create mode 100644 server/files/info.txt diff --git a/README.md b/README.md index 1403330..ad6c56f 100644 --- a/README.md +++ b/README.md @@ -130,9 +130,8 @@ systemd 脚本放入: 4. 启动容器 ```bash - docker run -itd --privileged \ - -p 443:443 \ - -p 8800:8800 \ + docker run -itd --name anylink --privileged \ + -p 443:443 -p 8800:8800 \ --restart=always \ anylink ``` @@ -140,10 +139,9 @@ systemd 脚本放入: 5. 使用自定义参数启动容器 ```bash - docker run -itd --privileged \ + docker run -itd --name anylink --privileged \ -e IPV4_CIDR=192.168.10.0/24 \ - -p 443:443 \ - -p 8800:8800 \ + -p 443:443 -p 8800:8800 \ --restart=always \ anylink -c=/etc/server.toml --admin_addr=:8080 ``` diff --git a/server/dbdata/db.go b/server/dbdata/db.go index b74bc63..e9a772e 100644 --- a/server/dbdata/db.go +++ b/server/dbdata/db.go @@ -85,5 +85,5 @@ const accountMail = `

您好:

- 软件下载地址: https://gitee.com/bjdgyc/anylink-soft/blob/master/README.md + 软件下载地址: https://{{.LinkAddr}}/files/info.txt

` diff --git a/server/files/.gitignore b/server/files/.gitignore deleted file mode 100644 index f6f2015..0000000 --- a/server/files/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Binaries for programs and plugins - -* -!.gitignore -!index.html \ No newline at end of file diff --git a/server/files/info.txt b/server/files/info.txt new file mode 100644 index 0000000..2e7e2e0 --- /dev/null +++ b/server/files/info.txt @@ -0,0 +1,2 @@ +客户端软件需放置在files目录内, +如需要帮助请加QQ群:567510628 \ No newline at end of file diff --git a/server/handler/link_home.go b/server/handler/link_home.go index bb7c05f..bc4f8e3 100644 --- a/server/handler/link_home.go +++ b/server/handler/link_home.go @@ -22,7 +22,7 @@ func LinkHome(w http.ResponseWriter, r *http.Request) { } w.WriteHeader(http.StatusOK) - fmt.Fprintln(w, "hello world") + fmt.Fprintln(w, "AnyLink 是一个企业级远程办公 sslvpn 的软件,可以支持多人同时在线使用。") } func LinkOtpQr(w http.ResponseWriter, r *http.Request) {