Merge branch 'bugfix/KASM-2518-fix-opensuse-cert-dir' into 'master'

Resolve KASM-2518 "Bugfix/ fix opensuse cert dir"

Closes KASM-2518

See merge request kasm-technologies/internal/KasmVNC!79
This commit is contained in:
Matthew McClaskey 2022-11-28 12:39:56 +00:00
commit 848d45b411
3 changed files with 10 additions and 21 deletions

View File

@ -8,23 +8,8 @@ RUN zypper -n install -y \
vim \
xterm
# deps and rpm install
RUN zypper -n install -y \
libglvnd \
libgomp1 \
libjpeg8 \
libpixman-1-0 \
libXdmcp6 \
libXfont2-2 \
libxkbcommon-x11-0 \
openssl \
perl \
x11-tools \
xauth \
xkbcomp \
xkeyboard-config && \
mkdir -p /etc/pki/tls/private
# Cache repo updates, so that package changes don't trigger it on every build.
RUN zypper refresh
ARG KASMVNC_PACKAGE_DIR
COPY $KASMVNC_PACKAGE_DIR/*.rpm /tmp
RUN zypper install -y --allow-unsigned-rpm /tmp/*.rpm

View File

@ -14,7 +14,10 @@ RUN zypper -n install -y \
tree \
vim
# Cache repo updates, so that spec changes don't trigger it on every build.
RUN zypper refresh
COPY opensuse/*.spec /tmp
RUN zypper -n install $(grep BuildRequires /tmp/*.spec | cut -d' ' -f2 | xargs)
RUN useradd -u 1000 -m -d /home/docker docker && \

View File

@ -46,6 +46,7 @@ SRC=$TAR_DATA/usr/local
SRC_BIN=$SRC/bin
DESTDIR=$RPM_BUILD_ROOT
DST_MAN=$DESTDIR/usr/share/man/man1
SSL_CERT_DIR=/usr/share/pki/trust/anchors
mkdir -p $DESTDIR/usr/bin $DESTDIR/usr/share/man/man1 \
$DESTDIR/usr/share/doc/kasmvncserver $DESTDIR/usr/lib \
@ -63,9 +64,9 @@ rsync -r --exclude '.git*' --exclude po2js --exclude xgettext-html \
--exclude www/utils/ --exclude .eslintrc --exclude configure \
$SRC/share/kasmvnc $DESTDIR/usr/share
sed -i -e 's!pem_certificate: .\+$!pem_certificate: /etc/pki/tls/private/kasmvnc.pem!' \
sed -i -e 's!pem_certificate: .\+$!pem_certificate: '$SSL_CERT_DIR'/kasmvnc.pem!' \
$DESTDIR/usr/share/kasmvnc/kasmvnc_defaults.yaml
sed -i -e 's!pem_key: .\+$!pem_key: /etc/pki/tls/private/kasmvnc.pem!' \
sed -i -e 's!pem_key: .\+$!pem_key: '$SSL_CERT_DIR'/kasmvnc.pem!' \
$DESTDIR/usr/share/kasmvnc/kasmvnc_defaults.yaml
sed -e 's/^\([^#]\)/# \1/' $DESTDIR/usr/share/kasmvnc/kasmvnc_defaults.yaml > \
$DESTDIR/etc/kasmvnc/kasmvnc.yaml
@ -104,7 +105,7 @@ cd $DST_MAN && ln -s vncpasswd.1 kasmvncpasswd.1;
}
make_self_signed_certificate() {
local cert_file=/etc/pki/tls/private/kasmvnc.pem
local cert_file="/usr/share/pki/trust/anchors/kasmvnc.pem"
[ -f "$cert_file" ] && return 0
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
@ -119,4 +120,4 @@ cd $DST_MAN && ln -s vncpasswd.1 kasmvncpasswd.1;
make_self_signed_certificate
%postun
rm -f /etc/pki/tls/private/kasmvnc.pem
rm -f /usr/share/pki/trust/anchors/kasmvnc.pem