From 3c09971484e26dc6d71a73cda170fc08c85b5e6a Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Wed, 3 Nov 2021 23:01:00 +0100 Subject: [PATCH] xrdp_apphost: Add configuration for Estlcam --- roles/xrdp_apphost/README.md | 24 ++++++++++++ roles/xrdp_apphost/defaults/main.yml | 5 +++ roles/xrdp_apphost/tasks/main.yml | 38 ++++++++++++++++++- .../templates/estlcam_xsession.j2 | 3 ++ roles/xrdp_apphost/templates/smb.conf.j2 | 14 ++++++- roles/xrdp_apphost/templates/xrdp.ini.j2 | 9 +++++ 6 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 roles/xrdp_apphost/README.md create mode 100644 roles/xrdp_apphost/templates/estlcam_xsession.j2 diff --git a/roles/xrdp_apphost/README.md b/roles/xrdp_apphost/README.md new file mode 100644 index 0000000..29f5c28 --- /dev/null +++ b/roles/xrdp_apphost/README.md @@ -0,0 +1,24 @@ +xrdp_apphost +============ + +Manual installation steps +------------------------- + +After the role has applied several manual installation steps have to be applied +by a admin user. + +* Estlcam + * Create a .xsession file for the admin user with the following content: + xfwm4 & + exec xterm + * Login as admin user and execute the following commands + $ xhost si:localuser:estlcam + $ sudo -u estlcam --preserve-env=DISPLAY /bin/bash + $ cd ~ + $ export WINEPREFIX=~/.wine32 + $ export WINEARCH=win32 + $ wineboot + $ winetricks dotnet40 gdiplus d3dx9_36 + $ wget http://www.estlcam.de/downloads/Estlcam_32_11243.exe + $ wine Estlcam_32_11243.exe + $ echo "Hide tooltips=no" >> ~/.wine32/drive_c/ProgramData/Estlcam/V11/Settings\ Estlcam.txt \ No newline at end of file diff --git a/roles/xrdp_apphost/defaults/main.yml b/roles/xrdp_apphost/defaults/main.yml index 4062151..7f3b336 100644 --- a/roles/xrdp_apphost/defaults/main.yml +++ b/roles/xrdp_apphost/defaults/main.yml @@ -30,3 +30,8 @@ lightburn_checksum: sha256:30d3cd573f5036edf74922ce56515304e668c345b5921fa078624 lightburn_version: 1.0.04 lightburn_url: https://github.com/LightBurnSoftware/deployment/releases/download/{{ lightburn_version }}/LightBurn-Linux64-v{{ lightburn_version }}.run lightburn_target: /home/{{ lightburn_user }}/LightBurn-Linux64-v{{ lightburn_version }}.run + +estlcam_user: estlcam +estlcam_group: estlcam +estlcam_pass: fckgw01estlcam +estlcam_salt: $1$SomeSalt$ diff --git a/roles/xrdp_apphost/tasks/main.yml b/roles/xrdp_apphost/tasks/main.yml index 8e8f3c3..89032c3 100644 --- a/roles/xrdp_apphost/tasks/main.yml +++ b/roles/xrdp_apphost/tasks/main.yml @@ -55,4 +55,40 @@ - name: Download LightBurn binary get_url: url={{ lightburn_url }} dest={{ lightburn_target }} checksum={{ lightburn_checksum }} mode=0755 - notify: Install LightBurn \ No newline at end of file + notify: Install LightBurn + + +- name: Enable contrib repositories + apt_repository: + repo: deb http://deb.debian.org/debian {{ ansible_distribution_release }} contrib + +- name: Add i386 Architecture + command: dpkg --add-architecture i386 + args: + creates: /var/lib/dpkg/arch + when: ansible_architecture != 'i386' + register: archrc + +- name: Update APT Cache for i386 + apt: + update_cache: true + when: archrc is defined and archrc.changed + +- name: Install Estlcam dependencies + apt: + name: + - winetricks + - wine32 + - xfwm4 + +- name: Create Estlcam group + group: name={{ estlcam_group }} + +- name: Create Estlcam user + user: name={{ estlcam_user }} password={{ estlcam_pass | password_hash('sha512', estlcam_salt) }} home=/home/{{ estlcam_user }} group={{ estlcam_group }} + +- name: Create Estlcam .xsession + template: src=estlcam_xsession.j2 dest=/home/{{ estlcam_user }}/.xsession + +- name: Create Estlcam data directory + file: path=/home/{{ estlcam_user }}/data state=directory mode=0755 owner={{ estlcam_user }} group={{ estlcam_group }} \ No newline at end of file diff --git a/roles/xrdp_apphost/templates/estlcam_xsession.j2 b/roles/xrdp_apphost/templates/estlcam_xsession.j2 new file mode 100644 index 0000000..9b04904 --- /dev/null +++ b/roles/xrdp_apphost/templates/estlcam_xsession.j2 @@ -0,0 +1,3 @@ +export WINEPREFIX=~/.wine32 +xfwm4 & +exec wine "/home/{{ estlcam_user }}/.wine32/drive_c/Program Files/Estlcam11/Estlcam.exe" \ No newline at end of file diff --git a/roles/xrdp_apphost/templates/smb.conf.j2 b/roles/xrdp_apphost/templates/smb.conf.j2 index d29a7cc..58a472d 100644 --- a/roles/xrdp_apphost/templates/smb.conf.j2 +++ b/roles/xrdp_apphost/templates/smb.conf.j2 @@ -244,4 +244,16 @@ create mask = 0600 directory mask = 0700 force user = {{ lightburn_user }} - hide dot files = yes \ No newline at end of file + hide dot files = yes + +# Estlcam share +[estlcam] + comment = Estlcam data folder + path = /home/{{ estlcam_user }}/data + browseable = yes + read only = no + guest ok = yes + create mask = 0600 + directory mask = 0700 + force user = {{ estlcam_user }} + hide dot files = yes diff --git a/roles/xrdp_apphost/templates/xrdp.ini.j2 b/roles/xrdp_apphost/templates/xrdp.ini.j2 index 756de3f..5a8be61 100644 --- a/roles/xrdp_apphost/templates/xrdp.ini.j2 +++ b/roles/xrdp_apphost/templates/xrdp.ini.j2 @@ -189,6 +189,15 @@ ip=127.0.0.1 port=-1 code=20 +[Estlcam] +name=Estlcam +lib=libxup.so +username={{ estlcam_user }} +password={{ estlcam_pass }} +ip=127.0.0.1 +port=-1 +code=20 + [Xorg] name=Xorg lib=libxup.so