vncserver: YAML config spike
This commit is contained in:
@@ -37,6 +37,7 @@ RUN yum install -y epel-release && yum groupinstall xfce -y
|
|||||||
RUN yum erase -y pm-utils xscreensaver*
|
RUN yum erase -y pm-utils xscreensaver*
|
||||||
RUN yum install -y redhat-lsb-core
|
RUN yum install -y redhat-lsb-core
|
||||||
RUN yum install -y vim less
|
RUN yum install -y vim less
|
||||||
|
RUN yum localinstall -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
|
||||||
|
|
||||||
RUN echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc
|
RUN echo 'source $STARTUPDIR/generate_container_user' >> $HOME/.bashrc
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ License: GPLv2+
|
|||||||
URL: https://github.com/kasmtech/KasmVNC
|
URL: https://github.com/kasmtech/KasmVNC
|
||||||
|
|
||||||
BuildRequires: rsync
|
BuildRequires: rsync
|
||||||
Requires: xorg-x11-xauth, xorg-x11-xkb-utils, xkeyboard-config, xorg-x11-server-utils, openssl, perl, perl-Switch
|
Requires: xorg-x11-xauth, xorg-x11-xkb-utils, xkeyboard-config, xorg-x11-server-utils, openssl, perl, perl-Switch, rpmfusion-free-release, perl-Hash-Merge-Simple
|
||||||
Conflicts: tigervnc-server, tigervnc-server-minimal
|
Conflicts: tigervnc-server, tigervnc-server-minimal
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -48,11 +48,12 @@ DESTDIR=$RPM_BUILD_ROOT
|
|||||||
DST_MAN=$DESTDIR/usr/share/man/man1
|
DST_MAN=$DESTDIR/usr/share/man/man1
|
||||||
|
|
||||||
mkdir -p $DESTDIR/usr/bin $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/Xvnc $DESTDIR/usr/bin;
|
||||||
cp $SRC_BIN/vncserver $DESTDIR/usr/bin;
|
cp $SRC_BIN/vncserver $DESTDIR/usr/bin;
|
||||||
cp $SRC_BIN/vncconfig $DESTDIR/usr/bin;
|
cp $SRC_BIN/vncconfig $DESTDIR/usr/bin;
|
||||||
cp $SRC_BIN/kasmvncpasswd $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;
|
cd $DESTDIR/usr/bin && ln -s kasmvncpasswd vncpasswd;
|
||||||
cp -r $SRC/share/doc/kasmvnc*/* $DESTDIR/usr/share/doc/kasmvncserver/
|
cp -r $SRC/share/doc/kasmvnc*/* $DESTDIR/usr/share/doc/kasmvncserver/
|
||||||
rsync -r --exclude '.git*' --exclude po2js --exclude xgettext-html \
|
rsync -r --exclude '.git*' --exclude po2js --exclude xgettext-html \
|
||||||
@@ -66,6 +67,7 @@ cd $DST_MAN && ln -s vncpasswd.1 kasmvncpasswd.1;
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
/usr/bin/*
|
/usr/bin/*
|
||||||
|
/usr/lib/kasmvncserver
|
||||||
/usr/share/man/man1/*
|
/usr/share/man/man1/*
|
||||||
/usr/share/kasmvnc/www
|
/usr/share/kasmvnc/www
|
||||||
|
|
||||||
|
|||||||
3
debian/control
vendored
3
debian/control
vendored
@@ -12,7 +12,8 @@ Homepage: https://github.com/kasmtech/KasmVNC
|
|||||||
Package: kasmvncserver
|
Package: kasmvncserver
|
||||||
Architecture: amd64
|
Architecture: amd64
|
||||||
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, ssl-cert, xauth,
|
Depends: ${shlibs:Depends}, ${misc:Depends}, ${perl:Depends}, ssl-cert, xauth,
|
||||||
x11-xkb-utils, xkb-data, procps, libswitch-perl
|
x11-xkb-utils, xkb-data, procps, libswitch-perl, libyaml-tiny-perl,
|
||||||
|
libhash-merge-simple-perl
|
||||||
Provides: vnc-server
|
Provides: vnc-server
|
||||||
Description: VNC server accessible from a web browser
|
Description: VNC server accessible from a web browser
|
||||||
VNC stands for Virtual Network Computing. It is, in essence, a remote
|
VNC stands for Virtual Network Computing. It is, in essence, a remote
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ use v5.10;
|
|||||||
use Time::HiRes qw (sleep);
|
use Time::HiRes qw (sleep);
|
||||||
use Switch;
|
use Switch;
|
||||||
use File::Basename;
|
use File::Basename;
|
||||||
|
use YAML::Tiny;
|
||||||
|
|
||||||
|
use Hash::Merge::Simple;
|
||||||
|
|
||||||
use constant {
|
use constant {
|
||||||
NO_ARG_VALUE => 0,
|
NO_ARG_VALUE => 0,
|
||||||
@@ -39,6 +42,8 @@ use constant {
|
|||||||
CheckWeCanRunInThisEnvironment();
|
CheckWeCanRunInThisEnvironment();
|
||||||
|
|
||||||
DefineFilePathsAndStuff();
|
DefineFilePathsAndStuff();
|
||||||
|
LoadYAMLConfig();
|
||||||
|
exit;
|
||||||
|
|
||||||
ParseAndProcessCliOptions();
|
ParseAndProcessCliOptions();
|
||||||
|
|
||||||
@@ -1081,6 +1086,8 @@ sub DefineFilePathsAndStuff {
|
|||||||
$de_was_selected_file="$ENV{HOME}/.vnc/.de-was-selected";
|
$de_was_selected_file="$ENV{HOME}/.vnc/.de-was-selected";
|
||||||
|
|
||||||
$vncSystemConfigDir = "/etc/kasmvnc";
|
$vncSystemConfigDir = "/etc/kasmvnc";
|
||||||
|
$vncDefaultsConfig = "/src/unix/vncserver_defaults.yaml";
|
||||||
|
$vncSystemConfig = "/src/unix/vncserver.yaml";
|
||||||
$vncSystemConfigDefaultsFile = "$vncSystemConfigDir/vncserver-config-defaults";
|
$vncSystemConfigDefaultsFile = "$vncSystemConfigDir/vncserver-config-defaults";
|
||||||
$vncSystemConfigMandatoryFile = "$vncSystemConfigDir/vncserver-config-mandatory";
|
$vncSystemConfigMandatoryFile = "$vncSystemConfigDir/vncserver-config-mandatory";
|
||||||
$defaultWebsocketPort = 8443;
|
$defaultWebsocketPort = 8443;
|
||||||
@@ -1245,3 +1252,12 @@ sub LocalSelectDePath {
|
|||||||
my $dirname = dirname($0);
|
my $dirname = dirname($0);
|
||||||
"$dirname/../builder/startup/deb/select-de.sh";
|
"$dirname/../builder/startup/deb/select-de.sh";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub LoadYAMLConfig {
|
||||||
|
my $defaultsConfig = YAML::Tiny->read($vncDefaultsConfig)->[0];
|
||||||
|
my $systemConfig = YAML::Tiny->read($vncSystemConfig)->[0];
|
||||||
|
my %mergedConfig = %{ Hash::Merge::Simple::merge($defaultsConfig, $systemConfig) };
|
||||||
|
|
||||||
|
say $mergedConfig{framerate};
|
||||||
|
say $mergedConfig{dlp}{region}{x1};
|
||||||
|
}
|
||||||
|
|||||||
25
unix/vncserver.yaml
Normal file
25
unix/vncserver.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
# geometry: 1024x768
|
||||||
|
# interface: 192.168.0.1
|
||||||
|
framerate: 40
|
||||||
|
# dynamic_quality:
|
||||||
|
# min: 7
|
||||||
|
# max: 8
|
||||||
|
# treat_lossless: 10
|
||||||
|
# prefer_bandwidth: true
|
||||||
|
# max_video_resolution:
|
||||||
|
# width: 640
|
||||||
|
# height: 480
|
||||||
|
dlp:
|
||||||
|
region:
|
||||||
|
x1: 11
|
||||||
|
y1: 11
|
||||||
|
allow_click: false
|
||||||
|
# clipboard:
|
||||||
|
# send_max: 10000
|
||||||
|
# accept_max: 10000
|
||||||
|
# delay: 1000
|
||||||
|
# keyboard:
|
||||||
|
# ratelimit: 30
|
||||||
|
# logging:
|
||||||
|
# level: verbose
|
||||||
25
unix/vncserver_defaults.yaml
Normal file
25
unix/vncserver_defaults.yaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
---
|
||||||
|
geometry: 1024x768
|
||||||
|
interface: 192.168.0.1
|
||||||
|
framerate: 30
|
||||||
|
dynamic_quality:
|
||||||
|
min: 7
|
||||||
|
max: 8
|
||||||
|
treat_lossless: 10
|
||||||
|
prefer_bandwidth: true
|
||||||
|
max_video_resolution:
|
||||||
|
width: 640
|
||||||
|
height: 480
|
||||||
|
dlp:
|
||||||
|
region:
|
||||||
|
x1: 10
|
||||||
|
y1: 10
|
||||||
|
allow_click: false
|
||||||
|
clipboard:
|
||||||
|
send_max: 10000
|
||||||
|
accept_max: 10000
|
||||||
|
delay: 1000
|
||||||
|
keyboard:
|
||||||
|
ratelimit: 30
|
||||||
|
logging:
|
||||||
|
level: verbose
|
||||||
Reference in New Issue
Block a user