为了在系统上安装RustDesk Web客户端,可以通过几个简单的步骤来完成。利用Docker技术,在任何支持Docker的环境中都能轻松部署和运行RustDesk。接下来将指导如何设置和启动RustDesk Web客户端。
一、在Linux上构建RustDesk
在Linux或Mac上运行:
git clone https://github.com/JelleBuning/rustdesk.git cd rustdesk git switch fix_build cd flutter/web/js # Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html npm install ts-proto # Only works with vite <= 2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy npm install vite@2.8 # Required for yarn build npm install yarn -g npm install typescript -g npm install protoc -g yarn build cd .. # About details of YUV converter, check this https://github.com/rustdesk/rustdesk/issues/364#issuecomment-1023562050 wget https://github.com/rustdesk/doc.rustdesk.com/releases/download/console/web_deps.tar.gz # Decompress to the current directory tar xzf web_deps.tar.gz cd .. # Good Luck! flutter run -d chrome
二、构建版本
继续执行以下命令:
flutter build web --release cd build/web # You could use any server, just an example python -m http.server 8000
三、使用Docker进行构建RustDesk
在Linux或Mac上运行以下内容:
1、首先安装 flutterLinux操作系统或macOS操作系统。
2、在本地设置 flutter 应用:
git clone https://github.com/JelleBuning/rustdesk.git cd rustdesk git switch fix_build cd flutter/web/js # Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html npm install ts-proto # Only works with vite <= 2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy npm install vite@2.8 # Required for yarn build npm install yarn -g npm install typescript -g npm install protoc -g yarn build
3、创建一下内容:
# Install operating system and dependencies FROM ubuntu:20.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update RUN apt-get install -y curl git wget unzip libgconf-2-4 gdb libstdc++6 libglu1-mesa fonts-droid-fallback lib32stdc++6 python3 clang cmake ninja-build pkg-config libgtk-3-dev RUN apt-get clean # Download Flutter SDK from Flutter GitHub repo RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter # Set flutter environment path ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:${PATH}" # Run flutter doctor RUN flutter doctor # Enable flutter web RUN flutter channel master RUN flutter upgrade RUN flutter config --enable-web # Copy files to container and build RUN mkdir /app/ # I was unable to build web app from dockerfile # So instead I built it locally and commented the "flutter build web" in this file COPY . /app/ WORKDIR /app/ # RUN flutter build web # Record the exposed port EXPOSE 5000 # Make server startup script executable and start the web server RUN ["chmod", "+x", "/app/server/server.sh"] ENTRYPOINT [ "/app/server/server.sh"]
4、在server下创建flutter目录:
5、在目录下创建包含以下内容的文件:server.shflutter/server
#!/bin/bash # Set the port PORT=5000 # Stop any program currently running on the set port echo 'Preparing port' $PORT '...' fuser -k 5000/tcp # Switch directory cd build/web/ # Start the server echo 'Server starting on port' $PORT '...' python3 -m http.server $PORT
6、构建Docker镜像:
docker build -t rustdesk-web-client .
7、运行Docker映像:
docker run -p 5000:5000 rustdesk-web-client
8、打开浏览器,然后转到localhost:5000查看Web应用。
四、在Docker中构建RustDesk Web客户端
如果不想自己构建Docker镜像,可以使用我构建并上传到的镜像Docker中心。
1、拉取图像
docker pull keyurbhole/flutter_web_desk
2、运行映像
docker run -p 5000:5000 keyurbhole/flutter_web_desk
打开浏览器,然后转到localhost:5000查看 Web 应用。