Compare commits

...

12 Commits

Author SHA1 Message Date
Dmitry Maksyoma
0a81e4be72 vncserver: fix case of -websocketPort not specified 2021-10-30 00:53:46 +13:00
Dmitry Maksyoma
1bc53710c7 Deb/Rpm: set package versions to 0.9.3~beta 2021-10-29 19:33:06 +13:00
Dmitry Maksyoma
991e839408 Refactor vnc_startup.sh 2021-10-29 19:04:31 +13:00
Dmitry Maksyoma
b682457093 vnc_startup.sh: select XFCE by default 2021-10-29 18:59:12 +13:00
Dmitry Maksyoma
4d34a083be vnc_startup.sh: remove temporary hack 2021-10-29 18:57:27 +13:00
Dmitry Maksyoma
54cfcccd1b vncserver test image: Python specs require a newer Python
Newer Python is available in Ubuntu Focal.
2021-10-29 18:39:43 +13:00
Dmitry Maksyoma
923b05803e Don't check www.x.org certificate for now (wget) 2021-10-29 18:32:29 +13:00
Dmitry Maksyoma
0844c10674 vncserver: fix -websocketPort being ignored 2021-10-29 18:31:50 +13:00
Dmitry Maksyoma
991bf3c773 vncserver: CentOS support 2021-10-28 23:03:10 +13:00
Dmitry Maksyoma
9a82b7debe vncserver: fix -debug 2021-10-28 23:02:41 +13:00
Dmitry Maksyoma
c2d18f3829 vncserver: fix display :0 being ignored on CLI 2021-10-28 22:56:32 +13:00
Dmitry Maksyoma
3e843eea8d vncserver: fix heredoc to work on CentOS 2021-10-28 22:55:56 +13:00
6 changed files with 32 additions and 66 deletions

View File

@@ -17,7 +17,7 @@ cd /tmp
# default to the version of x in Ubuntu 18.04, otherwise caller will need to specify
XORG_VER=${XORG_VER:-"1.19.6"}
XORG_PATCH=$(echo "$XORG_VER" | grep -Po '^\d.\d+' | sed 's#\.##')
wget https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.bz2
wget --no-check-certificate https://www.x.org/archive/individual/xserver/xorg-server-${XORG_VER}.tar.bz2
#git clone https://kasmweb@bitbucket.org/kasmtech/kasmvnc.git
#cd kasmvnc

View File

@@ -1,48 +0,0 @@
FROM ubuntu:bionic
ENV DEBIAN_FRONTEND=noninteractive
ENV VNC_PORT 8443
ENV VNC_PORT2 8444
ENV VNC_PORT3 8445
EXPOSE $VNC_PORT
EXPOSE $VNC_PORT2
EXPOSE $VNC_PORT3
RUN apt-get update && apt-get install -y supervisor xfce4 xfce4-terminal xterm libnss-wrapper gettext wget
RUN apt-get purge -y pm-utils xscreensaver*
RUN apt-get update && apt-get install -y vim less
RUN apt-get update && apt-get -y install lsb-release
RUN apt-get update && apt-get -y install net-tools
# RUN mkdir -p /usr/share/man/man1
# RUN apt-get update && apt-get install -y apt-utils openjdk-11-jre
RUN apt-get update && apt-get install -y ubuntu-mate-desktop
RUN apt-get update && apt-get install -y lxde
RUN apt-get update && apt-get install -y lxqt
RUN apt-get update && apt-get install -y kde-full
RUN apt-get update && apt-get install -y cinnamon
RUN apt-get update && apt-get install -y ubuntu-gnome-desktop
RUN apt-get update && apt-get install -y python3-pip
RUN useradd -m docker
ENV USER docker
ARG KASMVNC_PACKAGE_DIR
COPY $KASMVNC_PACKAGE_DIR/kasmvncserver_*.deb /tmp
RUN dpkg -i /tmp/*.deb; apt-get -yf install
ENV HOME /home/docker
RUN chown -R 1000:0 $HOME
USER 1000:ssl-cert
WORKDIR $HOME
RUN pip3 install --user pipenv
RUN echo 'PATH="/src/unix:~/.local/bin/:$PATH"' >> ~/.bashrc
RUN echo 'alias go="sh /src/s; vncserver -kill :1"' >> ~/.bashrc
RUN echo 'alias ns="netstat -nltp"' >> ~/.bashrc
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
ENTRYPOINT "cd /src && pipenv install; /bin/bash"

View File

@@ -61,11 +61,6 @@ kasmvncpasswd -d -u "$VNC_USER-to-delete" $HOME/.kasmpasswd
chmod 0600 $HOME/.kasmpasswd
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -keyout $HOME/.vnc/self.pem -out $HOME/.vnc/self.pem -subj "/C=US/ST=VA/L=None/O=None/OU=DoFu/CN=kasm/emailAddress=none@none.none"
exec /bin/bash
vncserver :1 -interface 0.0.0.0
vncserver -kill :1
if [[ -f $PASSWD_PATH ]]; then
rm -f $PASSWD_PATH
fi
@@ -88,10 +83,10 @@ vncserver -kill $DISPLAY &> $HOME/.vnc/vnc_startup.log \
detect_www_dir
detect_cert_location
[ -n "$KASMVNC_VERBOSE_LOGGING" ] && verbose_logging_option="-log *:stderr:100"
[ -n "$KASMVNC_VERBOSE_LOGGING" ] && verbose_logging_option="-debug"
echo -e "start vncserver with param: VNC_COL_DEPTH=$VNC_COL_DEPTH, VNC_RESOLUTION=$VNC_RESOLUTION\n..."
vncserver $DISPLAY -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -FrameRate=$MAX_FRAME_RATE -websocketPort $VNC_PORT $cert_option -sslOnly -interface 0.0.0.0 $VNCOPTIONS $package_www_dir_option $verbose_logging_option #&> $STARTUPDIR/no_vnc_startup.log
vncserver $DISPLAY -select-de xfce -depth $VNC_COL_DEPTH -geometry $VNC_RESOLUTION -FrameRate=$MAX_FRAME_RATE -websocketPort $VNC_PORT $cert_option -sslOnly -interface 0.0.0.0 $VNCOPTIONS $package_www_dir_option $verbose_logging_option #&> $STARTUPDIR/no_vnc_startup.log
PID_SUN=$!

View File

@@ -1,5 +1,5 @@
Name: kasmvncserver
Version: 0.9.1~beta
Version: 0.9.3~beta
Release: 1%{?dist}
Summary: VNC server accessible from a web browser
@@ -48,11 +48,12 @@ DESTDIR=$RPM_BUILD_ROOT
DST_MAN=$DESTDIR/usr/share/man/man1
mkdir -p $DESTDIR/usr/bin $DESTDIR/usr/share/man/man1 \
$DESTDIR/usr/share/doc/kasmvncserver
$DESTDIR/usr/share/doc/kasmvncserver $DESTDIR/usr/lib
cp $SRC_BIN/Xvnc $DESTDIR/usr/bin;
cp $SRC_BIN/vncserver $DESTDIR/usr/bin;
cp $SRC_BIN/vncconfig $DESTDIR/usr/bin;
cp $SRC_BIN/kasmvncpasswd $DESTDIR/usr/bin;
cp -r $SRC/lib/kasmvnc/ $DESTDIR/usr/lib/kasmvncserver
cd $DESTDIR/usr/bin && ln -s kasmvncpasswd vncpasswd;
cp -r $SRC/share/doc/kasmvnc*/* $DESTDIR/usr/share/doc/kasmvncserver/
rsync -r --exclude '.git*' --exclude po2js --exclude xgettext-html \
@@ -66,6 +67,7 @@ cd $DST_MAN && ln -s vncpasswd.1 kasmvncpasswd.1;
%files
/usr/bin/*
/usr/lib/kasmvncserver
/usr/share/man/man1/*
/usr/share/kasmvnc/www

6
debian/changelog vendored
View File

@@ -1,3 +1,9 @@
kasmvnc (0.9.3~beta-1) unstable; urgency=medium
* New upstream release.
-- Dmitry Maksyoma <ledestin@gmail.com> Fri, 29 Oct 2021 19:16:33 +1300
kasmvnc (0.9.1~beta-1) unstable; urgency=medium
* Initial release of the Debian package.

View File

@@ -562,10 +562,10 @@ sub CheckUserHasAccessToDefaultCertOnDebian {
my $certGroup = 'ssl-cert';
if (system("groups | grep -qw $certGroup") != 0) {
say <<~EOF;
Can't access TLS certificate.
Please add your user to $certGroup via 'addgroup <user> $certGroup'
EOF
say <<EOF;
Can't access TLS certificate.
Please add your user to $certGroup via 'addgroup <user> $certGroup'
EOF
exit(1);
}
}
@@ -979,6 +979,9 @@ sub SwallowedArgs {
if ($opt{"-interface"}) {
$cmd .= " " . "-interface " . quotedString($opt{"-interface"});
}
if ($opt{"-log"}) {
$cmd .= " " . "-log " . quotedString($opt{"-log"});
}
$cmd;
}
@@ -1107,12 +1110,15 @@ sub DefineFilePathsAndStuff {
}
sub ParseAndProcessCliOptions {
my @supportedOptions = ("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,"-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0,"-noxstartup",0,"-xstartup",1,"-select-de",OPTIONAL_ARG_VALUE, "-interface", REQUIRED_ARG_VALUE, '-debug', NO_ARG_VALUE);
my @supportedOptions = ("-geometry",1,"-depth",1,"-pixelformat",1,"-name",1,"-kill",1,"-help",0,"-h",0,"--help",0,"-fp",1,"-list",0,"-fg",0,"-autokill",0,"-noxstartup",0,"-xstartup",1,"-select-de",OPTIONAL_ARG_VALUE, "-interface", REQUIRED_ARG_VALUE, '-debug', NO_ARG_VALUE, '-websocketPort', REQUIRED_ARG_VALUE);
ParseOptionsAndRemoveMatchesFromARGV(@supportedOptions);
ProcessCliOptions();
CheckGeometryAndDepthAreSensible();
$displayNumber = DetectDisplayNumberFromCliArgs() ||
GetLowestAvailableDisplayNumber();
$displayNumber = DetectDisplayNumberFromCliArgs();
if (!defined($displayNumber)) {
$displayNumber = GetLowestAvailableDisplayNumber();
}
CheckCliOptionsForBeingValid();
}
@@ -1127,7 +1133,8 @@ sub PrepareDefaultsForPassingToXvnc {
%default_opts;
%config;
$websocketPort = $defaultWebsocketPort + $displayNumber;
$websocketPort = $opt{"-websocketPort"} ||
GenerateWebsocketPortFromDisplayNumber();
$desktopName = $opt{'-name'} || "$host:$displayNumber ($ENV{USER})";
SetReasonabeDefaults();
@@ -1135,6 +1142,10 @@ sub PrepareDefaultsForPassingToXvnc {
CheckBrowserHostDefined();
}
sub GenerateWebsocketPortFromDisplayNumber {
$defaultWebsocketPort + $displayNumber;
}
sub EnsureAtLeastOneKasmUserExists {
@kasmPasswdUsers = LoadKasmPasswdUsers();
if (!AtLeastOneUserConfigured()) {