mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2025-06-28 21:52:08 +02:00
KASM-7202 run web code from source using node
This commit is contained in:
parent
a2496294e1
commit
cb00ca07c8
33
BUILDING.txt
33
BUILDING.txt
@ -105,6 +105,39 @@ Now run Xvnc and Xfce4 from inside the container
|
|||||||
|
|
||||||
Now open a browser and navigate to your dev VM on port 6901.
|
Now open a browser and navigate to your dev VM on port 6901.
|
||||||
|
|
||||||
|
Running noVNC from source
|
||||||
|
-------------------------
|
||||||
|
If you need to debug or make changes to the UI code, use the following procedures to use npm to serve the web code. The code will automatically rebuild when changes are made and the code will not be packaged.
|
||||||
|
These steps assume you have already built the docker image covered in the previous section named `kasmvnc:dev`.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# run an instance of the dev container, expose an additional port
|
||||||
|
sudo docker run -it -v ./:/src -p 6901:6901 -p 8443:8443 --name kasmvnc_dev kasmvnc:dev
|
||||||
|
```
|
||||||
|
|
||||||
|
Now from inside the container. **This assumes KasmVNC is already built, follow steps above if you need to build KasmVNC**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Run KasmVNC
|
||||||
|
/src/xorg.build/bin/Xvnc -interface 0.0.0.0 -PublicIP 127.0.0.1 -disableBasicAuth -RectThreads 0 -Log *:stdout:100 -httpd /src/kasmweb/dist -sslOnly 0 -SecurityTypes None -websocketPort 6901 :1 &
|
||||||
|
/usr/bin/xfce4-session --display :1 &
|
||||||
|
|
||||||
|
sudo nginx
|
||||||
|
cd kasmweb
|
||||||
|
npm install
|
||||||
|
npm run serve # <-- Needs to run in foreground
|
||||||
|
```
|
||||||
|
|
||||||
|
Now open a browser and navigate to your dev VM on port 8443 over https.
|
||||||
|
|
||||||
|
NGINX is proxying the websocket to KasmVNC and all other requests go to the node server. NGINX listens on 8443 with ssl.
|
||||||
|
|
||||||
|
Since `npm run serve` needs to run in the foreground, you may need to exec into the container from another terminal to run additional commands like stopping Xvnc, rebuilding KasmVNC, etc.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker exec -it kasmvnc_dev /bin/bash
|
||||||
|
```
|
||||||
|
|
||||||
Building the KasmVNC Server on Modern Unix/Linux Systems
|
Building the KasmVNC Server on Modern Unix/Linux Systems
|
||||||
---------------------------------------------------------
|
---------------------------------------------------------
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ if(ENABLE_NLS)
|
|||||||
add_subdirectory(po)
|
add_subdirectory(po)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
####add_subdirectory(tests)
|
#############add_subdirectory(tests)
|
||||||
|
|
||||||
|
|
||||||
include(cmake/BuildPackages.cmake)
|
include(cmake/BuildPackages.cmake)
|
||||||
|
@ -119,24 +119,25 @@ make -j5
|
|||||||
# modifications for the servertarball
|
# modifications for the servertarball
|
||||||
cd /src
|
cd /src
|
||||||
mkdir -p xorg.build/bin
|
mkdir -p xorg.build/bin
|
||||||
|
mkdir -p xorg.build/lib
|
||||||
cd xorg.build/bin/
|
cd xorg.build/bin/
|
||||||
ln -s /src/unix/xserver/hw/vnc/Xvnc Xvnc
|
ln -sf /src/unix/xserver/hw/vnc/Xvnc Xvnc
|
||||||
cd ..
|
cd ..
|
||||||
mkdir -p man/man1
|
mkdir -p man/man1
|
||||||
touch man/man1/Xserver.1
|
touch man/man1/Xserver.1
|
||||||
cp /src/unix/xserver/hw/vnc/Xvnc.man man/man1/Xvnc.1
|
cp /src/unix/xserver/hw/vnc/Xvnc.man man/man1/Xvnc.1
|
||||||
mkdir lib
|
|
||||||
cd lib
|
cd lib
|
||||||
if [ -d /usr/lib/x86_64-linux-gnu/dri ]; then
|
if [ -d /usr/lib/x86_64-linux-gnu/dri ]; then
|
||||||
ln -s /usr/lib/x86_64-linux-gnu/dri dri
|
ln -sfn /usr/lib/x86_64-linux-gnu/dri dri
|
||||||
elif [ -d /usr/lib/aarch64-linux-gnu/dri ]; then
|
elif [ -d /usr/lib/aarch64-linux-gnu/dri ]; then
|
||||||
ln -s /usr/lib/aarch64-linux-gnu/dri dri
|
ln -sfn /usr/lib/aarch64-linux-gnu/dri dri
|
||||||
elif [ -d /usr/lib/arm-linux-gnueabihf/dri ]; then
|
elif [ -d /usr/lib/arm-linux-gnueabihf/dri ]; then
|
||||||
ln -s /usr/lib/arm-linux-gnueabihf/dri dri
|
ln -sfn /usr/lib/arm-linux-gnueabihf/dri dri
|
||||||
elif [ -d /usr/lib/xorg/modules/dri ]; then
|
elif [ -d /usr/lib/xorg/modules/dri ]; then
|
||||||
ln -s /usr/lib/xorg/modules/dri dri
|
ln -sfn /usr/lib/xorg/modules/dri dri
|
||||||
else
|
else
|
||||||
ln -s /usr/lib64/dri dri
|
ln -sfn /usr/lib64/dri dri
|
||||||
fi
|
fi
|
||||||
cd /src
|
cd /src
|
||||||
|
|
||||||
|
42
builder/conf/nginx_kasm.conf
Normal file
42
builder/conf/nginx_kasm.conf
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
server {
|
||||||
|
listen 8443 ssl;
|
||||||
|
ssl_certificate /etc/ssl/certs/ssl-cert-snakeoil.pem;
|
||||||
|
ssl_certificate_key /etc/ssl/private/ssl-cert-snakeoil.key;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://127.0.0.1:5173;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /api/ {
|
||||||
|
proxy_pass https://127.0.0.1:6901;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /websockify {
|
||||||
|
# The following configurations must be configured when proxying to Kasm Workspaces
|
||||||
|
|
||||||
|
# WebSocket Support
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
|
||||||
|
# Host and X headers
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
|
||||||
|
# Connectivity Options
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_read_timeout 1800s;
|
||||||
|
proxy_send_timeout 1800s;
|
||||||
|
proxy_connect_timeout 1800s;
|
||||||
|
proxy_buffering off;
|
||||||
|
|
||||||
|
# Allow large requests to support file uploads to sessions
|
||||||
|
client_max_body_size 10M;
|
||||||
|
|
||||||
|
# # Proxy to KasmVNC using SSL
|
||||||
|
#proxy_pass https://127.0.0.1:6901;
|
||||||
|
# Proxy to KasmVNC without SSL
|
||||||
|
proxy_pass http://127.0.0.1:6901;
|
||||||
|
}
|
||||||
|
}
|
@ -10,13 +10,18 @@ EXPOSE 6901
|
|||||||
|
|
||||||
USER root
|
USER root
|
||||||
|
|
||||||
|
COPY builder/conf/nginx_kasm.conf /etc/nginx/conf.d/
|
||||||
|
|
||||||
RUN sed -i 's$# deb-src$deb-src$' /etc/apt/sources.list && \
|
RUN sed -i 's$# deb-src$deb-src$' /etc/apt/sources.list && \
|
||||||
apt update && \
|
apt update && \
|
||||||
apt install -y socat sudo libxfont-dev cmake git libgnutls28-dev vim wget tightvncserver curl libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev pkg-config libfreetype6-dev libxtst-dev autoconf automake libtool xutils-dev libpixman-1-dev libxshmfence-dev libxcvt-dev libxkbfile-dev x11proto-dev libgbm-dev inotify-tools && \
|
apt install -y socat vim wget tightvncserver curl inotify-tools sudo \
|
||||||
|
libxfont-dev libgnutls28-dev libpng-dev libtiff-dev libgif-dev libavcodec-dev libssl-dev libxrandr-dev libxcursor-dev pkg-config libfreetype6-dev \
|
||||||
|
libxtst-dev xutils-dev libpixman-1-dev libxshmfence-dev libxcvt-dev libxkbfile-dev x11proto-dev libgbm-dev \
|
||||||
|
cmake git autoconf automake libtool && \
|
||||||
echo "kasm-user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
echo "kasm-user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||||
|
|
||||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
|
||||||
RUN apt install -y nodejs
|
RUN apt install -y nodejs nginx
|
||||||
|
|
||||||
USER 1000
|
USER 1000
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user