diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 058ab09..144062e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -60,8 +60,8 @@ jobs: uses: docker/build-push-action@v5 with: push: true - #cache-from: type=gha,mode=max - #cache-to: type=gha,mode=max + cache-from: type=gha,scope=anylink + cache-to: type=gha,mode=max,scope=anylink context: . file: ./docker/Dockerfile #platforms: linux/amd64,linux/arm64 @@ -77,6 +77,11 @@ jobs: run: bash release.sh - name: Release + # https://github.com/ncipollo/release-action + # artifacts: bin/release/* + # generateReleaseNotes: true + # draft: true + # https://github.com/softprops/action-gh-release uses: softprops/action-gh-release@v1 #if: startsWith(github.ref, 'refs/tags/') with: diff --git a/.gitignore b/.gitignore index 698379b..6be8658 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,8 @@ .idea/ anylink-deploy anylink-deploy.tar.gz +anylink +anylink.db dist artifact-dist \ No newline at end of file diff --git a/.goreleaser.yaml b/.goreleaser.yaml index eeb9cc6..31e67f8 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -47,7 +47,7 @@ builds: {{- if eq .Os "linux" }} {{- if eq .Arch "amd64" }}CC=x86_64-linux-musl-gcc{{- end }} - {{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++{{- end }} + {{- if eq .Arch "arm64" }}CC=aarch64-linux-gnu-gcc{{- end }} {{- end }} {{- if eq .Os "darwin" }} {{- if eq .Arch "amd64"}}CC=o64-clang{{- end }} diff --git a/README.md b/README.md index 665bbc1..5cd5aa8 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ AnyLink 服务端仅在 CentOS 7、CentOS 8、Ubuntu 18.04、Ubuntu 20.04 测试 > 没有编程基础的同学建议直接下载 release 包,从下面的地址下载 anylink-deploy.tar.gz > > https://github.com/bjdgyc/anylink/releases +> +> 如果不会安装,可以提供有偿远程协助服务。添加QQ联系我 68492170 ### 使用问题 @@ -66,7 +68,7 @@ AnyLink 服务端仅在 CentOS 7、CentOS 8、Ubuntu 18.04、Ubuntu 20.04 测试 ### 自行编译安装 -> 需要提前安装好 golang >= 1.20 和 nodejs >= 16.x 和 yarn >= v1.22.x +> 需要提前安装好 golang >= 1.20 和 nodejs = 16.x 和 yarn >= v1.22.x ```shell git clone https://github.com/bjdgyc/anylink.git @@ -123,14 +125,22 @@ sudo ./anylink > 示例配置文件内有详细的注释,根据注释填写配置即可。 ```shell +# 查看帮助信息 +./anylink -h + # 生成后台密码 ./anylink tool -p 123456 # 生成jwt密钥 ./anylink tool -s + +# 查看所有配置项 +./anylink tool -d ``` > 数据库配置示例 +> +> 数据库表结构自动生成,无需手动导入(请赋予 DDL 权限) | db_type | db_source | |----------|--------------------------------------------------------| @@ -142,6 +152,14 @@ sudo ./anylink > > [conf/server-sample.toml](server/conf/server-sample.toml) +## Upgrade + +> 升级前请备份配置文件`conf`目录 和 数据库,并停止服务 +> +> 使用新版的 `anylink` 二进制文件替换旧版 +> +> 重启服务后,即可完成升级 + ## Setting > 以下参数必须设置其中之一 @@ -214,12 +232,17 @@ https://cloud.tencent.com/document/product/216/62007 > 以下参数可以通过执行 `ip a` 查看 ``` + +# 命令行执行 master网卡需要打开混杂模式 +ip link set dev eth0 promisc on + +#=====================# + +# 配置文件修改 # 首先关闭nat转发功能 iptables_nat = false -# master网卡需要打开混杂模式 -ip link set dev eth0 promisc on - +link_mode = "macvtap" #内网主网卡名称 ipv4_master = "eth0" #以下网段需要跟ipv4_master网卡设置成一样 @@ -229,28 +252,36 @@ ipv4_start = "10.1.2.100" ipv4_end = "10.1.2.200" ``` -## Systemd +## Deploy + +> 部署配置文件放在 `deploy` 目录下,请根据实际情况修改配置文件 + +### Systemd 1. 添加 anylink 程序 - - - anylink 程序目录放入 `/usr/local/anylink-deploy` + - 首先把 `anylink-deploy` 文件夹放入 `/usr/local/anylink-deploy` - 添加执行权限 `chmod +x /usr/local/anylink-deploy/anylink` - -2. systemd/anylink.service 脚本放入: - +2. 把 `anylink.service` 脚本放入: - centos: `/usr/lib/systemd/system/` - ubuntu: `/lib/systemd/system/` - 3. 操作命令: - - 启动: `systemctl start anylink` - 停止: `systemctl stop anylink` - 开机自启: `systemctl enable anylink` +### Docker Compose + +1. 进入 `deploy` 目录 +2. 执行脚本 `docker-compose up` + +### k8s + +1. 进入 `deploy` 目录 +2. 执行脚本 `kubectl apply -f deployment.yaml` + ## Docker 1. 获取镜像 - ```bash # 具体tag可以从docker hub获取 # https://hub.docker.com/r/bjdgyc/anylink/tags @@ -258,50 +289,67 @@ ipv4_end = "10.1.2.200" ``` 2. 查看命令信息 - ```bash docker run -it --rm bjdgyc/anylink -h ``` 3. 生成密码 - ```bash docker run -it --rm bjdgyc/anylink tool -p 123456 #Passwd:$2a$10$lCWTCcGmQdE/4Kb1wabbLelu4vY/cUwBwN64xIzvXcihFgRzUvH2a ``` 4. 生成 jwt secret - ```bash docker run -it --rm bjdgyc/anylink tool -s #Secret:9qXoIhY01jqhWIeIluGliOS4O_rhcXGGGu422uRZ1JjZxIZmh17WwzW36woEbA ``` -5. 启动容器 - +5. 查看所有配置项 ```bash + docker run -it --rm bjdgyc/anylink tool -d + ``` + +6. 启动容器 + ```bash + # 默认启动 docker run -itd --name anylink --privileged \ - -p 443:443 -p 8800:8800 \ + -p 443:443 -p 8800:8800 -p 443:443/udp \ --restart=always \ bjdgyc/anylink + + # 自定义配置目录 + # 首次启动会自动创建配置文件 + # 配置文件初始化完成后,容器会强制退出,请重新启动容器 + docker run -itd --name anylink --privileged \ + -p 443:443 -p 8800:8800 -p 443:443/udp \ + -v /home/myconf:/app/conf \ + --restart=always \ + bjdgyc/anylink + + docker restart anylink ``` 6. 使用自定义参数启动容器 ```bash - # 参数可以参考 -h 命令 + # 参数可以参考 ./anylink tool -d + # 可以使用命令行参数 或者 环境变量 配置 docker run -itd --name anylink --privileged \ - -p 443:443 -p 8800:8800 \ + -e LINK_LOG_LEVEL=info \ + -p 443:443 -p 8800:8800 -p 443:443/udp \ + -v /home/myconf:/app/conf \ --restart=always \ bjdgyc/anylink \ - -c=/etc/server.toml --ip_lease=1209600 # IP地址租约时长 + --ip_lease=1209600 # IP地址租约时长 ``` 7. 构建镜像 (非必需) - ```bash #获取仓库源码 git clone https://github.com/bjdgyc/anylink.git # 构建镜像 + sh build_docker.sh + 或 docker build -t anylink -f docker/Dockerfile . ``` @@ -329,7 +377,6 @@ ipv4_end = "10.1.2.200" - [OpenConnect](https://gitlab.com/openconnect/openconnect) (Windows/macOS/Linux) - [AnyLink Secure Client](https://github.com/tlslink/anylink-client) (Windows/macOS/Linux) - ## Contribution 欢迎提交 PR、Issues,感谢为 AnyLink 做出贡献。 diff --git a/build.sh b/build.sh index 8fa34e5..bfd0f68 100644 --- a/build.sh +++ b/build.sh @@ -31,7 +31,7 @@ cp -rf $cpath/web/ui . # -tags osusergo,netgo,sqlite_omit_load_extension flags="-v -trimpath" -ldflags="-s -w -extldflags '-static' -X main.appVer=$ver -X main.commitId=$(git rev-parse HEAD) -X main.date=$(date --iso-8601=seconds)" +ldflags="-s -w -extldflags '-static' -X main.appVer=$ver -X main.commitId=$(git rev-parse HEAD) -X main.date=$(date -Iseconds)" #国内可替换源加快速度 export GOPROXY=https://goproxy.io diff --git a/build_docker.sh b/build_docker.sh index c51b28f..a784de5 100644 --- a/build_docker.sh +++ b/build_docker.sh @@ -5,9 +5,11 @@ echo $ver # docker login -u bjdgyc -# docker build -t bjdgyc/anylink -f docker/Dockerfile . +# 生成时间 2024-01-30T21:41:27+08:00 +# date -Iseconds -docker buildx build -t bjdgyc/anylink --progress=plain --build-arg CN="yes" --build-arg appVer=$ver \ +docker buildx build -t bjdgyc/anylink:latest --progress=plain --build-arg CN="yes" --build-arg appVer=$ver \ --build-arg commitId=$(git rev-parse HEAD) -f docker/Dockerfile . +echo "docker tag latest $ver" docker tag bjdgyc/anylink:latest bjdgyc/anylink:$ver diff --git a/systemd/anylink.service b/deploy/anylink.service similarity index 80% rename from systemd/anylink.service rename to deploy/anylink.service index c2023a2..7ae8d95 100644 --- a/systemd/anylink.service +++ b/deploy/anylink.service @@ -17,8 +17,8 @@ ExecStart=/usr/local/anylink-deploy/anylink --conf=/usr/local/anylink-deploy/con # ExecStart=/bin/bash -c 'exec /usr/local/anylink-deploy/anylink --conf=/usr/local/anylink-deploy/conf/server.toml >> /usr/local/anylink-deploy/log/anylink.log 2>&1' # systemd new than v236 -# StandardOutput=file:/usr/local/anylink-deploy/log/anylink.log -# StandardError=file:/usr/local/anylink-deploy/log/anylink.log +# StandardOutput=file:/usr/local/anylink-deploy/log/anylink-systemd.log +# StandardError=file:/usr/local/anylink-deploy/log/anylink-systemd.log [Install] WantedBy=multi-user.target diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml new file mode 100644 index 0000000..70b86bc --- /dev/null +++ b/deploy/deployment.yaml @@ -0,0 +1,101 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: anylink + namespace: default + labels: + link-app: anylink +spec: + replicas: 1 + selector: + matchLabels: + link-app: anylink + template: + metadata: + labels: + link-app: anylink + spec: + #hostNetwork: true + dnsPolicy: ClusterFirst + containers: + - name: anylink + env: + - name: NODE_NAME + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: spec.nodeName + - name: GOMAXPROCS + valueFrom: + resourceFieldRef: + resource: limits.cpu + - name: POD_CPU_LIMIT + valueFrom: + resourceFieldRef: + resource: limits.cpu + - name: POD_MEMORY_LIMIT + valueFrom: + resourceFieldRef: + resource: limits.memory + - name: TZ + value: "Asia/Shanghai" + image: bjdgyc/anylink:latest + imagePullPolicy: Always + args: + - --conf=/app/conf/server.toml + ports: + - name: https + containerPort: 443 + protocol: TCP + - name: https-admin + containerPort: 8800 + protocol: TCP + - name: dtls + containerPort: 443 + protocol: UDP + # 设置资源 + resources: + limits: + cpu: "2" + memory: 4Gi + ephemeral-storage: "2Gi" + securityContext: + privileged: true + # 禁用自动注入 service 信息到环境变量 + enableServiceLinks: false + restartPolicy: Always + terminationGracePeriodSeconds: 30 + nodeSelector: + kubernetes.io/os: linux + securityContext: { } + tolerations: + - operator: Exists + #设置优先级 + priorityClassName: system-cluster-critical + +--- +apiVersion: v1 +kind: Service +metadata: + name: anylink + namespace: default + labels: + link-app: anylink +spec: + ports: + - name: https + port: 443 + targetPort: 443 + protocol: TCP + - name: https-admin + port: 8800 + targetPort: 8800 + protocol: TCP + - name: dtls + port: 443 + targetPort: 443 + protocol: UDP + selector: + link-app: anylink + sessionAffinity: ClientIP + type: ClusterIP diff --git a/deploy/docker-compose.yaml b/deploy/docker-compose.yaml new file mode 100644 index 0000000..be08dcc --- /dev/null +++ b/deploy/docker-compose.yaml @@ -0,0 +1,19 @@ +services: + anylink: + image: bjdgyc/anylink:latest + container_name: anylink + restart: always + privileged: true + #cpus: 2 + #mem_limit: 4g + ports: + - 443:443 + - 8800:8800 + - 443:443/udp + environment: + LINK_LOG_LEVEL: info + command: + - --conf=/app/conf/server.toml + #volumes: + # - /home/myconf:/app/conf + dns_search: . diff --git a/docker/Dockerfile b/docker/Dockerfile index 497a362..2306a6b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,39 +16,37 @@ ARG commitId="commitId" ENV TZ=Asia/Shanghai WORKDIR /server -COPY docker/init.sh /tmp/init.sh +COPY docker/init_build.sh /tmp/ COPY server/ /server/ COPY web/ui /server/ui #RUN apk add gcc musl-dev bash -RUN sh /tmp/init.sh +RUN sh /tmp/init_build.sh # anylink FROM alpine:3.19 LABEL maintainer="github.com/bjdgyc" +ARG CN="no" + ENV TZ=Asia/Shanghai ENV ANYLINK_IN_CONTAINER=true WORKDIR /app +COPY docker/init_release.sh /tmp/ + COPY --from=builder_golang /server/anylink /app/ -COPY docker/docker_entrypoint.sh /app/ -COPY ./server/bridge-init.sh /app/ -COPY ./server/conf /app/conf -COPY ./systemd /app/systemd -COPY ./README.md /app/README.md -COPY ./LICENSE /app/LICENSE +COPY docker/docker_entrypoint.sh server/bridge-init.sh ./README.md ./LICENSE /app/ +COPY ./deploy /app/deploy COPY ./home /app/home +COPY ./server/conf /app/conf #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 iproute2 tzdata \ - && chmod +x /app/docker_entrypoint.sh \ - && mkdir /app/log \ - && ls /app +RUN sh /tmp/init_release.sh -EXPOSE 443 8800 + +EXPOSE 443 8800 443/udp #CMD ["/app/anylink"] ENTRYPOINT ["/app/docker_entrypoint.sh"] diff --git a/docker/docker_entrypoint.sh b/docker/docker_entrypoint.sh index 40b8852..e2e00a1 100644 --- a/docker/docker_entrypoint.sh +++ b/docker/docker_entrypoint.sh @@ -18,6 +18,14 @@ case $var1 in #iptables -t nat -A POSTROUTING -s "${IPV4_CIDR}" -o eth0+ -j MASQUERADE #iptables -nL -t nat + # 启动服务 先判断配置文件是否存在 + if [ ! -f /app/conf/profile.xml ]; then + /bin/cp -r /home/conf-bak/* /app/conf/ + echo "After the configuration file is initialized, the container will be forcibly exited. Restart the container." + echo "配置文件初始化完成后,容器会强制退出,请重新启动容器。" + exit 1 + fi + exec /app/anylink "$@" ;; esac diff --git a/docker/init.sh b/docker/init_build.sh similarity index 97% rename from docker/init.sh rename to docker/init_build.sh index 45b09b5..e512964 100644 --- a/docker/init.sh +++ b/docker/init_build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh set -x diff --git a/docker/init_release.sh b/docker/init_release.sh new file mode 100644 index 0000000..411a2a0 --- /dev/null +++ b/docker/init_release.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +set -x + +#TODO 本地打包时使用镜像 +if [[ $CN == "yes" ]]; then + sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories + export GOPROXY=https://goproxy.cn +fi + +apk add --no-cache bash iptables iproute2 tzdata +chmod +x /app/docker_entrypoint.sh +mkdir /app/log + +#备份配置文件 +cp -r /app/conf /home/conf-bak + +tree /app + +uname -a +date -Iseconds diff --git a/release.sh b/release.sh index 6d6791b..02c2cc3 100644 --- a/release.sh +++ b/release.sh @@ -17,8 +17,8 @@ cpath=$(pwd) ver=$(cat version) echo "当前版本 $ver" +rm -rf artifact-dist mkdir artifact-dist -rm -rf artifact-dist/* app function archive() { os=$1 @@ -26,11 +26,11 @@ function archive() { #echo "整理部署文件 $os $arch" deploy="anylink-$ver-$os-$arch" + docker container rm $deploy docker container create --platform $os/$arch --name $deploy bjdgyc/anylink:$ver - docker cp -a $deploy:/app ./ - rm -rf anylink-deploy - mv app anylink-deploy + docker cp -a $deploy:/app ./anylink-deploy + ls -lh anylink-deploy tar zcf ${deploy}.tar.gz anylink-deploy diff --git a/server/base/cfg.go b/server/base/cfg.go index 81b5701..b0b52a2 100644 --- a/server/base/cfg.go +++ b/server/base/cfg.go @@ -155,6 +155,7 @@ type SCfg struct { Env string `json:"env"` Info string `json:"info"` Data interface{} `json:"data"` + Val interface{} `json:"default"` } func ServerCfg2Slice() []SCfg { @@ -169,18 +170,27 @@ func ServerCfg2Slice() []SCfg { field := typ.Field(i) value := s.Field(i) tag := field.Tag.Get("json") - usage, env := getUsageEnv(tag) + usage, env, val := getUsageEnv(tag) - datas = append(datas, SCfg{Name: tag, Env: env, Info: usage, Data: value.Interface()}) + datas = append(datas, SCfg{Name: tag, Env: env, Info: usage, Data: value.Interface(), Val: val}) } return datas } -func getUsageEnv(name string) (usage, env string) { +func getUsageEnv(name string) (usage, env string, val interface{}) { for _, v := range configs { if v.Name == name { usage = v.Usage + if v.Typ == cfgStr { + val = v.ValStr + } + if v.Typ == cfgInt { + val = v.ValInt + } + if v.Typ == cfgBool { + val = v.ValBool + } } } diff --git a/server/base/cmd.go b/server/base/cmd.go index 3b7db05..12a4fbb 100644 --- a/server/base/cmd.go +++ b/server/base/cmd.go @@ -57,6 +57,21 @@ func execute() { envs[rr.Key().String()] = rr.Value().Index(0).String() } + if !runSrv { + if debug { + scfgData := ServerCfg2Slice() + fmtStr := "%-18v %-23v %-20v %v\n" + fmt.Printf(fmtStr, "Name", "Env", "Value", "Info") + for _, v := range scfgData { + if v.Name == "admin_pass" || v.Name == "jwt_secret" { + v.Val = "******" + } + fmt.Printf(fmtStr, v.Name, v.Env, v.Val, v.Info) + } + } + os.Exit(0) + } + // 移动配置解析代码 conf := linkViper.GetString("conf") linkViper.SetConfigFile(conf) @@ -65,10 +80,6 @@ func execute() { // 没有配置文件,直接报错 panic("config file err:" + err.Error()) } - - if !runSrv { - os.Exit(0) - } } func initCmd() { @@ -112,28 +123,6 @@ func initCmd() { cobra.OnInitialize(func() { linkViper.AutomaticEnv() - - // ver := linkViper.GetBool("version") - // if ver { - // printVersion() - // os.Exit(0) - // } - // - // return - // - // conf := linkViper.GetString("conf") - // _, err := os.Stat(conf) - // if errors.Is(err, os.ErrNotExist) { - // // 没有配置文件,不做处理 - // panic("conf stat err:" + err.Error()) - // } - // - // - // linkViper.SetConfigFile(conf) - // err = linkViper.ReadInConfig() - // if err != nil { - // panic("config file err:" + err.Error()) - // } }) } @@ -151,6 +140,8 @@ func initToolCmd() *cobra.Command { toolCmd.Flags().BoolVarP(&debug, "debug", "d", false, "list the config viper.Debug() info") toolCmd.Run = func(cmd *cobra.Command, args []string) { + runSrv = false + switch { case rev: printVersion() @@ -169,7 +160,7 @@ func initToolCmd() *cobra.Command { pass, _ := utils.PasswordHash(passwd) fmt.Printf("Passwd:%s\n", pass) case debug: - linkViper.Debug() + // linkViper.Debug() default: fmt.Println("Using [anylink tool -h] for help") } @@ -179,6 +170,6 @@ func initToolCmd() *cobra.Command { } func printVersion() { - fmt.Printf("%s v%s build on %s [%s, %s] BuildDate:%s commit_id(%s)\n", + fmt.Printf("%s v%s build on %s [%s, %s] date:%s commit_id(%s)\n", APP_NAME, APP_VER, runtime.Version(), runtime.GOOS, runtime.GOARCH, BuildDate, CommitId) } diff --git a/server/base/config.go b/server/base/config.go index 61a5a55..11183fd 100644 --- a/server/base/config.go +++ b/server/base/config.go @@ -23,7 +23,7 @@ var configs = []config{ {Typ: cfgStr, Name: "conf", Usage: "config file", ValStr: "./conf/server.toml", Short: "c"}, {Typ: cfgStr, Name: "profile", Usage: "profile.xml file", ValStr: "./conf/profile.xml"}, {Typ: cfgStr, Name: "server_addr", Usage: "TCP服务监听地址(任意端口)", ValStr: ":443"}, - {Typ: cfgBool, Name: "server_dtls", Usage: "开启DTLS", ValBool: false}, + {Typ: cfgBool, Name: "server_dtls", Usage: "开启DTLS", ValBool: true}, {Typ: cfgStr, Name: "server_dtls_addr", Usage: "DTLS监听地址(任意端口)", ValStr: ":443"}, {Typ: cfgStr, Name: "admin_addr", Usage: "后台服务监听地址", ValStr: ":8800"}, {Typ: cfgBool, Name: "proxy_protocol", Usage: "TCP代理协议", ValBool: false}, diff --git a/server/conf/server-sample.toml b/server/conf/server-sample.toml index 76686f8..a4633ec 100644 --- a/server/conf/server-sample.toml +++ b/server/conf/server-sample.toml @@ -31,8 +31,8 @@ jwt_secret = "abcdef.0123456789.abcdef" #TCP服务监听地址(任意端口) server_addr = ":443" -#开启 DTLS, 默认关闭 -server_dtls = false +#开启 DTLS +server_dtls = true #UDP监听地址(任意端口) server_dtls_addr = ":443" #后台服务监听地址 @@ -40,6 +40,7 @@ admin_addr = ":8800" #开启tcp proxy protocol协议 proxy_protocol = false +#虚拟网络类型[tun macvtap tap] link_mode = "tun" #客户端分配的ip地址池 diff --git a/server/conf/server.toml b/server/conf/server.toml index b56410c..bdbc657 100644 --- a/server/conf/server.toml +++ b/server/conf/server.toml @@ -25,10 +25,15 @@ jwt_secret = "abcdef.0123456789.abcdef" #TCP服务监听地址(任意端口) server_addr = ":443" +#开启 DTLS +server_dtls = true +#UDP监听地址(任意端口) +server_dtls_addr = ":443" #后台服务监听地址 admin_addr = ":8800" - +#虚拟网络类型[tun macvtap] +link_mode = "tun" #客户端分配的ip地址池 ipv4_master = "eth0" ipv4_cidr = "192.168.90.0/24" diff --git a/server/handler/server.go b/server/handler/server.go index f1f7380..eca4dba 100644 --- a/server/handler/server.go +++ b/server/handler/server.go @@ -4,7 +4,6 @@ import ( "crypto/tls" "fmt" "io" - "log" "net" "net/http" "os" @@ -66,7 +65,7 @@ func startTls() { ln, err = net.Listen("tcp", addr) if err != nil { - log.Fatal(err) + base.Fatal(err) } defer ln.Close()