Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 99ed112

Browse files
authored
Merge pull request #14 from Emyrk/stevenmasley/kasm
chore: kasmweb client to honor path based apps
2 parents b165b4a + 0916518 commit 99ed112

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

better-vnc/for-dogfood/build/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,15 @@ RUN echo "kasm-user ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers.d/nopasswd
1010
RUN DEBIAN_FRONTEND=noninteractive make-ssl-cert generate-default-snakeoil --force-overwrite
1111
RUN adduser kasm-user ssl-cert
1212

13+
# By default, the kasm web client html page connects to `/websockify` for the websocket connection.
14+
# This fails for path based apps, as we need to prepend the application path.
15+
# Replace the line that sets the websocket path to include the application path.
16+
# Kasm web should only be hosted on the path "/", but just incase it is moved, this regex match
17+
# will only replace the websocket path if the path is in the format of "/@<username>/<appname>/apps/<appname>/"
18+
#
19+
# note: this effect is compiled to some location, so a restart of the container is not enough. The container needs to be
20+
# rebuilt from scratch (empty volume) to apply.
21+
RUN sed "s#'websockify'#(window.location.pathname.match(/@[^\\\\/]+\\\\/[^\\\\/]+\\\\/apps\\\\/[^\\\\/]+\\\\//) ?? [''])[0]+'websockify'#g" < $KASM_VNC_PATH/www/dist/main.bundle.js > $KASM_VNC_PATH/www/dist/main.bundle.js.tmp
22+
RUN mv $KASM_VNC_PATH/www/dist/main.bundle.js.tmp $KASM_VNC_PATH/www/dist/main.bundle.js
23+
1324
USER 1000

0 commit comments

Comments
 (0)