diff --git a/CHANGELOG.md b/CHANGELOG.md index 86cd56a1..c8bc90dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -118,4 +118,9 @@ # v0.8.6 -1. 升级rdesktop库,支持libx11库的静态连接 \ No newline at end of file +1. 升级rdesktop库,支持libx11库的静态连接 + +# v0.9.0 + +1. 远程桌面支持macos系统 +2. 修改部署文档 \ No newline at end of file diff --git a/README.md b/README.md index caf4bc11..9812f603 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,10 @@ deepin远程桌面 ![deepin-vnc](docs/imgs/vnc_deepin.png) +macos远程桌面 + +![macos-vnc](docs/imgs/vnc_macos.png) + windows读取剪贴板内容 ![vnc-clipboard](docs/imgs/vnc_clipboard.png) diff --git a/build b/build index 4295961a..5842647d 100755 --- a/build +++ b/build @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=0.8.6 +VERSION=0.9.0 DOCKER_BUILDKIT=1 docker build -t natpass -f contrib/build/Dockerfile . docker run --rm \ diff --git a/build_all b/build_all index 2eb727f0..d5b581da 100755 --- a/build_all +++ b/build_all @@ -1,6 +1,6 @@ #!/bin/sh -VERSION=0.8.6 +VERSION=0.9.0 DOCKER_BUILDKIT=1 docker build -t natpass -f contrib/build/Dockerfile . docker run --rm \ diff --git a/code/client/rule/vnc/process/process_darwin.go b/code/client/rule/vnc/process/process_darwin.go deleted file mode 100644 index c640fce2..00000000 --- a/code/client/rule/vnc/process/process_darwin.go +++ /dev/null @@ -1,6 +0,0 @@ -package process - -// CreateWorker create worker process -func CreateWorker(name, confDir string, showCursor bool) (*Process, error) { - return nil, ErrNotSupported -} diff --git a/code/client/rule/vnc/process/process_linux.go b/code/client/rule/vnc/process/process_xx.go similarity index 94% rename from code/client/rule/vnc/process/process_linux.go rename to code/client/rule/vnc/process/process_xx.go index ac6696dd..7f1ca361 100644 --- a/code/client/rule/vnc/process/process_linux.go +++ b/code/client/rule/vnc/process/process_xx.go @@ -1,3 +1,6 @@ +//go:build !windows +// +build !windows + package process import ( diff --git a/contrib/build/Dockerfile b/contrib/build/Dockerfile index f18b5b79..ba2eda2f 100644 --- a/contrib/build/Dockerfile +++ b/contrib/build/Dockerfile @@ -3,7 +3,7 @@ ARG LIBPNG_VERSION=1.6.37 ARG GO_VERSION=1.18.3 ARG GO_PROXY=https://goproxy.cn,direct -FROM debian:stable-slim +FROM lwch/darwin-crosscompiler:11.3 ARG APT_MIRROR ARG GO_VERSION diff --git a/contrib/build/build_all.go b/contrib/build/build_all.go index c55efc85..833e860c 100644 --- a/contrib/build/build_all.go +++ b/contrib/build/build_all.go @@ -37,13 +37,15 @@ type target struct { var targets = []target{ // darwin { - os: "darwin", - arch: "amd64", + os: "darwin", + arch: "amd64", + cc: "o64-clang", cxx: "o64-clang++", packExt: ".tar.gz", }, { - os: "darwin", - arch: "arm64", + os: "darwin", + arch: "arm64", + cc: "aarch64-apple-darwin20.4-clang", cxx: "aarch64-apple-darwin20.4-clang++", packExt: ".tar.gz", }, // linux @@ -195,6 +197,8 @@ func build(t target) { } else if t.os == "linux" && !strings.Contains(t.arch, "arm") { env = append(env, "CGO_ENABLED=1") ldflags += "-extldflags -static" + } else if t.os == "darwin" { + env = append(env, "CGO_ENABLED=1") } else { env = append(env, "CGO_ENABLED=0") } diff --git a/docs/imgs/vnc_macos.png b/docs/imgs/vnc_macos.png new file mode 100755 index 00000000..362da67b Binary files /dev/null and b/docs/imgs/vnc_macos.png differ diff --git a/docs/startup.md b/docs/startup.md index 48eadb1f..0bc86fca 100644 --- a/docs/startup.md +++ b/docs/startup.md @@ -1,43 +1,33 @@ # 开始使用 -以下示例均在*debian*系统下进行,其他系统请自行查找相关系统命令, - windows系统可通过services.msc命令进入系统服务管理面板进行服务管理。 +部署过程共分为三部分:服务器端、受控端和控制端,下面以*debian*系统进行举例。 ## 服务器端部署 1. 在服务器上[下载](https://github.com/lwch/natpass/releases)并解压到任意目录 -2. 使用以下命令将np-svr注册为系统服务,其中-conf参数后跟配置文件所在路径,-user参数后为程序启动身份(建议使用nobody身份启动) +2. 使用以下命令启动服务器端程序 - sudo ./np-svr -conf server.yaml -action install -user nobody -3. 启动服务 + sudo ./np-svr -conf server.yaml - sudo systemctl start np-svr - -4. (可选)开放外网防火墙,默认端口6154 +3. (可选)开放外网防火墙,默认端口6154 ## 受控端部署 1. 在受控端机器上[下载](https://github.com/lwch/natpass/releases)并解压到任意目录 2. (可选)修改remote.yaml配置文件,修改*server*地址 -3. 使用以下命令将np-cli注册为系统服务,其中-conf参数后跟配置文件所在路径,-user参数后为程序启动身份 - - sudo ./np-cli -conf remote.yaml -action install -user `whoami` -4. 启动服务 +3. 使用以下命令启动客户端程序 - sudo systemctl start np-cli + sudo ./np-cli -conf remote.yaml -user `whoami` ## 控制端部署 1. 在本地控制机上[下载](https://github.com/lwch/natpass/releases)并解压到任意目录 2. (可选)修改local.yaml配置文件,修改*server*地址 3. (可选)修改rule.d目录下的规则配置文件,[rule配置方法](rules.md) -4. 使用以下命令将np-cli注册为系统服务,其中-conf参数后跟配置文件所在路径,-user参数后为程序启动身份(建议使用nobody身份启动) - - sudo ./np-cli -conf local.yaml -action install -user nobody -5. 启动服务 +4. 使用以下命令启动客户端程序 - sudo systemctl start np-cli -6. 在以上操作成功后即可在浏览器中通过local.yaml中配置的端口号进行访问,默认地址: + sudo ./np-cli -conf local.yaml +5. 在以上操作成功后即可在浏览器中通过local.yaml中配置的端口号进行访问,默认地址: http://127.0.0.1:8080 diff --git a/go.mod b/go.mod index 547079c4..35eefa76 100644 --- a/go.mod +++ b/go.mod @@ -7,14 +7,14 @@ require ( github.com/dustin/go-humanize v1.0.0 github.com/go-bindata/go-bindata/v3 v3.1.3 github.com/gorilla/websocket v1.5.0 - github.com/kardianos/service v1.2.1 + github.com/kardianos/service v1.2.2-0.20220428125717-29f8c79c511b github.com/kisielk/errcheck v1.6.1 // indirect github.com/lwch/logging v0.0.0-20220322084100-ec48185d95ab - github.com/lwch/rdesktop v1.0.1-0.20220628065908-dcf9d8e979b4 + github.com/lwch/rdesktop v1.1.1 github.com/lwch/runtime v0.0.0-20190520054850-8c97e19e0c6d github.com/lwch/yaml v0.0.0-20211206085137-772f80e85a26 golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 + golang.org/x/sys v0.0.0-20220702020025-31831981b65f golang.org/x/text v0.3.7 golang.org/x/tools v0.1.11 // indirect golang.org/x/xerrors v0.0.0-20220609144429-65e65417b02f // indirect diff --git a/go.sum b/go.sum index d09a45d1..69a09905 100644 --- a/go.sum +++ b/go.sum @@ -9,20 +9,16 @@ github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/kardianos/service v1.2.1 h1:AYndMsehS+ywIS6RB9KOlcXzteWUzxgMgBymJD7+BYk= -github.com/kardianos/service v1.2.1/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= +github.com/kardianos/service v1.2.2-0.20220428125717-29f8c79c511b h1:b5xYQ10mzbfvw0tJnqclfR5sObkGBdghZ+6wYLe7LCQ= +github.com/kardianos/service v1.2.2-0.20220428125717-29f8c79c511b/go.mod h1:CIMRFEJVL+0DS1a3Nx06NaMn4Dz63Ng6O7dl0qH0zVM= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/errcheck v1.6.1 h1:cErYo+J4SmEjdXZrVXGwLJCE2sB06s23LpkcyWNrT+s= github.com/kisielk/errcheck v1.6.1/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= github.com/lwch/logging v0.0.0-20211115073745-0db19179db17/go.mod h1:aXQui5bsF/d4I+z6szuiBWY5m4y9t6pyZ2Q/sLgkBBg= github.com/lwch/logging v0.0.0-20220322084100-ec48185d95ab h1:zqeHtNXEg707Tq8gv5yE//rc6ue/SVSaUxlslbGBxrg= github.com/lwch/logging v0.0.0-20220322084100-ec48185d95ab/go.mod h1:aXQui5bsF/d4I+z6szuiBWY5m4y9t6pyZ2Q/sLgkBBg= -github.com/lwch/rdesktop v1.0.0 h1:i+i+U5fu+400UJISSiFT+JV55yogb231PDj6ao6AMCc= -github.com/lwch/rdesktop v1.0.0/go.mod h1:vZtkNUaG1bDuzJavu8OQQoBbHVS6cYJE7y4oxtmhYYM= -github.com/lwch/rdesktop v1.0.1-0.20220628063626-7a6b7d0f55ed h1:dqhAvlOZjOp/GB74KMJ6FzIz1q8wvjTWWTrzW29/uWI= -github.com/lwch/rdesktop v1.0.1-0.20220628063626-7a6b7d0f55ed/go.mod h1:vZtkNUaG1bDuzJavu8OQQoBbHVS6cYJE7y4oxtmhYYM= -github.com/lwch/rdesktop v1.0.1-0.20220628065908-dcf9d8e979b4 h1:rqE8tCaMTAXrnY+cZJMFmAo7th6O9o4yQNXZdqJx6P4= -github.com/lwch/rdesktop v1.0.1-0.20220628065908-dcf9d8e979b4/go.mod h1:vZtkNUaG1bDuzJavu8OQQoBbHVS6cYJE7y4oxtmhYYM= +github.com/lwch/rdesktop v1.1.1 h1:rcKfHDo9PbCFBwX+PEwXANufhnkfRa7E/hg0R/4VhnM= +github.com/lwch/rdesktop v1.1.1/go.mod h1:9AqIceehSOVcxwpXDPEdYchCyJXT99bd9PpsaTHALlg= github.com/lwch/runtime v0.0.0-20190520054850-8c97e19e0c6d h1:Xg+zzPtvX22DaoJD5Bp0tqPdB8gn5WypghIJ4fluqiQ= github.com/lwch/runtime v0.0.0-20190520054850-8c97e19e0c6d/go.mod h1:uEt0zu1MDC7WnVvodPBGSYAD/KMKk0v36xE8UE5veM8= github.com/lwch/yaml v0.0.0-20211206085137-772f80e85a26 h1:sR3nbPhdfstDxYLp7c1EnsKH3z8+u+wgnhC3AI9/qf0= @@ -31,6 +27,8 @@ github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/image v0.0.0-20220617043117-41969df76e82 h1:KpZB5pUSBvrHltNEdK/tw0xlPeD13M6M6aGP32gKqiw= +golang.org/x/image v0.0.0-20220617043117-41969df76e82/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= @@ -51,10 +49,8 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c h1:aFV+BgZ4svzjfabn8ERpuB4JI4N6/rdy1iusx77G3oU= -golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 h1:wEZYwx+kK+KlZ0hpvP2Ls1Xr4+RWnlzGFwPP0aiDjIU= -golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220702020025-31831981b65f h1:xdsejrW/0Wf2diT5CPp3XmKUNbr7Xvw8kYilQ+6qjRY= +golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=