mirror of
https://github.com/rustdesk/doc.rustdesk.com.git
synced 2025-02-25 14:42:02 +01:00
commit
f6d11c4e40
@ -5,8 +5,7 @@ weight: 23
|
|||||||
|
|
||||||
## How to build on Linux
|
## How to build on Linux
|
||||||
|
|
||||||
|
Run below on Linux or Mac (works on Windows too, however you may need to slightly modify some commands, e.g. change `wget` to `curl.exe -O`):
|
||||||
Run below on Linux or Mac (works on Windows too, however you may need to slightly modify some commands, *e.g.* change `wget` to `curl.exe -O`):
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/JelleBuning/rustdesk.git
|
git clone https://github.com/JelleBuning/rustdesk.git
|
||||||
@ -14,12 +13,12 @@ cd rustdesk
|
|||||||
git switch fix_build
|
git switch fix_build
|
||||||
cd flutter/web/js
|
cd flutter/web/js
|
||||||
|
|
||||||
# install protoc first http://google.github.io/proto-lens/installing-protoc.html
|
# Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html
|
||||||
npm install ts-proto
|
npm install ts-proto
|
||||||
# only works with vite<=2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy
|
# 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
|
npm install vite@2.8
|
||||||
|
|
||||||
# required for yarn build
|
# Required for yarn build
|
||||||
npm install yarn -g
|
npm install yarn -g
|
||||||
npm install typescript -g
|
npm install typescript -g
|
||||||
npm install protoc -g
|
npm install protoc -g
|
||||||
@ -28,9 +27,9 @@ yarn build
|
|||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# about details of yuv converter, check this https://github.com/rustdesk/rustdesk/issues/364#issuecomment-1023562050
|
# 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
|
wget https://github.com/rustdesk/doc.rustdesk.com/releases/download/console/web_deps.tar.gz
|
||||||
# decompress to the current directory
|
# Decompress to the current directory
|
||||||
tar xzf web_deps.tar.gz
|
tar xzf web_deps.tar.gz
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
@ -43,31 +42,33 @@ flutter run -d chrome
|
|||||||
|
|
||||||
## How to build with Docker
|
## How to build with Docker
|
||||||
|
|
||||||
Run below on Linux or Mac
|
Run below on Linux or Mac:
|
||||||
- Begin by installing fultter for [Linux](https://docs.flutter.dev/get-started/install/linux#install-flutter-manually) or [MacOS](https://docs.flutter.dev/get-started/install/macos)
|
- Begin by installing flutter for [Linux](https://docs.flutter.dev/get-started/install/linux#install-flutter-manually) or [macOS](https://docs.flutter.dev/get-started/install/macos)
|
||||||
- Setup the flutter app locally
|
- Setup the flutter app locally:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/JelleBuning/rustdesk.git
|
git clone https://github.com/JelleBuning/rustdesk.git
|
||||||
cd rustdesk
|
cd rustdesk
|
||||||
git switch fix_build
|
git switch fix_build
|
||||||
cd flutter/web/js
|
cd flutter/web/js
|
||||||
|
|
||||||
# install protoc first http://google.github.io/proto-lens/installing-protoc.html
|
# Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html
|
||||||
npm install ts-proto
|
npm install ts-proto
|
||||||
# only works with vite<=2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy
|
# 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
|
npm install vite@2.8
|
||||||
|
|
||||||
# required for yarn build
|
# Required for yarn build
|
||||||
npm install yarn -g
|
npm install yarn -g
|
||||||
npm install typescript -g
|
npm install typescript -g
|
||||||
npm install protoc -g
|
npm install protoc -g
|
||||||
|
|
||||||
yarn build
|
yarn build
|
||||||
```
|
```
|
||||||
|
|
||||||
- Create a `Dockerfile` with the following content under `flutter` directory:
|
- Create a `Dockerfile` with the following content under `flutter` directory:
|
||||||
|
|
||||||
```Dockerfile
|
```Dockerfile
|
||||||
# Install Operating system and dependencies
|
# Install operating system and dependencies
|
||||||
FROM ubuntu:20.04
|
FROM ubuntu:20.04
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
@ -76,7 +77,7 @@ 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 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
|
RUN apt-get clean
|
||||||
|
|
||||||
# download Flutter SDK from Flutter Github repo
|
# Download Flutter SDK from Flutter Github repo
|
||||||
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter
|
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter
|
||||||
|
|
||||||
# Set flutter environment path
|
# Set flutter environment path
|
||||||
@ -93,7 +94,7 @@ RUN flutter config --enable-web
|
|||||||
# Copy files to container and build
|
# Copy files to container and build
|
||||||
RUN mkdir /app/
|
RUN mkdir /app/
|
||||||
# I was unable to build web app from dockerfile
|
# I was unable to build web app from dockerfile
|
||||||
# so instead I built it locally and commented the "flutter build web" in this file
|
# So instead I built it locally and commented the "flutter build web" in this file
|
||||||
COPY . /app/
|
COPY . /app/
|
||||||
WORKDIR /app/
|
WORKDIR /app/
|
||||||
# RUN flutter build web
|
# RUN flutter build web
|
||||||
@ -101,13 +102,15 @@ WORKDIR /app/
|
|||||||
# Record the exposed port
|
# Record the exposed port
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# make server startup script executable and start the web server
|
# Make server startup script executable and start the web server
|
||||||
RUN ["chmod", "+x", "/app/server/server.sh"]
|
RUN ["chmod", "+x", "/app/server/server.sh"]
|
||||||
|
|
||||||
ENTRYPOINT [ "/app/server/server.sh"]
|
ENTRYPOINT [ "/app/server/server.sh"]
|
||||||
```
|
```
|
||||||
|
|
||||||
- Create `server` directory under `flutter`
|
- Create `server` directory under `flutter`
|
||||||
- Create a `server.sh` file with the following content under `flutter/server` directory:
|
- Create a `server.sh` file with the following content under `flutter/server` directory:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
@ -118,31 +121,42 @@ PORT=5000
|
|||||||
echo 'preparing port' $PORT '...'
|
echo 'preparing port' $PORT '...'
|
||||||
fuser -k 5000/tcp
|
fuser -k 5000/tcp
|
||||||
|
|
||||||
# switch directories
|
# Switch directory
|
||||||
cd build/web/
|
cd build/web/
|
||||||
|
|
||||||
# Start the server
|
# Start the server
|
||||||
echo 'Server starting on port' $PORT '...'
|
echo 'Server starting on port' $PORT '...'
|
||||||
python3 -m http.server $PORT
|
python3 -m http.server $PORT
|
||||||
```
|
```
|
||||||
- Build the docker image
|
|
||||||
|
- Build the docker image:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker build -t rustdesk-web-client .
|
docker build -t rustdesk-web-client .
|
||||||
```
|
```
|
||||||
- Run the docker image
|
|
||||||
|
- Run the docker image:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -p 5000:5000 rustdesk-web-client
|
docker run -p 5000:5000 rustdesk-web-client
|
||||||
```
|
```
|
||||||
|
|
||||||
- Open your browser and go to `localhost:5000` to see the web app
|
- Open your browser and go to `localhost:5000` to see the web app
|
||||||
|
|
||||||
### Rustdesk Web Client using existing Docker image
|
### RustDesk Web Client using existing Docker image
|
||||||
|
|
||||||
If you do not want to build the docker image yourself, you can use the image I built and uploaded to [Docker Hub](https://hub.docker.com/r/keyurbhole/flutter_web_desk)
|
If you do not want to build the docker image yourself, you can use the image I built and uploaded to [Docker Hub](https://hub.docker.com/r/keyurbhole/flutter_web_desk)
|
||||||
- Pull the image
|
|
||||||
|
- Pull the image:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker pull keyurbhole/flutter_web_desk
|
docker pull keyurbhole/flutter_web_desk
|
||||||
```
|
```
|
||||||
- Run the image
|
|
||||||
|
- Run the image:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
docker run -p 5000:5000 keyurbhole/flutter_web_desk
|
docker run -p 5000:5000 keyurbhole/flutter_web_desk
|
||||||
```
|
```
|
||||||
|
|
||||||
- Open your browser and go to `localhost:5000` to see the web app
|
- Open your browser and go to `localhost:5000` to see the web app
|
Loading…
Reference in New Issue
Block a user