A page in your DokuWiki was added or changed. Here are the details: Browser : Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0 IP Address : 137.26.240.242 Hostname : 137-026-240-242.biz.spectrum.com Old Revision : https://wiki.x2go.org/doku.php/wiki:advanced:x2gohtmlclient?rev=1640979011 New Revision : https://wiki.x2go.org/doku.php/wiki:advanced:x2gohtmlclient Date of New Revision: 2021/12/31 20:49 Edit Summary : Revise instructions after working through real install User : mikep There may be newer changes after this revision. If this happens, a message will be shown on the top of the rev page. @@ -1,5 +1,4 @@ - ====== Introduction ====== X2Go's HTML client makes use of HTML5, JavaScript, and WebSockets to provide graphical access to a remote host with no client-side requirements other than a modern browser. The x2gohtmlclient package, served by a web server, provides the JavaScript front-end. X2gohtmlclient works with the x2gowebrpc and x2gowswrapper packages, which run on the server. Aside from the aforementioned X2Go packages, the server-side requirements include * a web server, @@ -7,14 +6,18 @@ * Qt 5 and Qt 5 X11 Extras, * the CGI, JSON, Encode, Expect, and File::Touch Perl modules, and * python-websockify. X2Go provides instructions for configuring the NGINX web server, but you can substitute another server if you prefer. Your operating system distribution likely provides packages containing the dependencies not provided by X2Go. + + {{:wiki:advanced:client.png?400|}} + {{:wiki:advanced:kdr.png?400|}} ====== Components ====== ===== X2GoHTMLClient ===== ==== index.html ==== + Client HTML page. This page can be modified or embedded in existing webpage. It has two modes: native client and embedded client. User can use native client if recent version of X2Go client is installed on the system. In this case, the page will generate x2go session file, which will be automatically opened with x2go client. Second mode is to use embedded HTML Client (only supports X2GoKdrive). The HTML page provides user input for the next settings: <code> X2Go Server address Username @@ -33,47 +36,44 @@ function getProxy() function getProxyUser() function getProxyPass() </code> + ==== x2gokdriveclient.html ==== + The HTML Page to run X2Go client in separate window. By default the session's window is embedded in the start page. User can "detach" the session to separate window using "new window" button. After that session will be shown in the separate window and can be resized, opened in full screen, etc. ==== CSS/x2gostyle.css ==== + WEB styles for HTML pages ==== SRC/*png SRC/*svg ==== + Image resources ==== SRC/x2godomcontroller.js ==== + Communication between HTML page and X2Go HTML Client + ==== SRC/x2gohtmlclient.js ==== + Communication between X2Go RPC script and X2Go HTML Client + ==== SRC/x2gokdrivehtmlclient.js ==== + X2GoKdrive JS client ===== x2gorpc.cgi ===== + CGI script for communication between HTML Client and X2Go server. It connects to X2Go server using ssh, starts/resuming sessions, opens SSH tunnels, etc ===== x2gowswrapper ===== - The application which is connecting TCP sockets of X2GoKdrive agent with web sockets for HTML Client. + The application that is connecting TCP sockets of X2GoKdrive agent with web sockets for HTML Client. - ====== Building ====== + ====== Configuring the Web Server ====== - ====== JS classes ====== - JS classes should be compiled in one using script minify.sh. The resulting file x2goclient.js will be placed in subdir "dist" - - ====== x2gowswrapper ====== - Build using qmake - <code> - $qmake-qt5 && make - </code> - - ====== Installation ====== - - Prerequements: Web Browser with support for CGI and Web sockets (for example nginx). - - Example of nginx configuration (in this case with fcgiwrap https://www.nginx.com/resources/wiki/start/topics/examples/fcgiwrap/) + We describe how to configure NGINX and fcgiwrap, but you can substitute any web server that provides the needed features. ''/etc/nginx/sites-available/<your host>-ssl:'' <file> server { @@ -121,55 +121,40 @@ } } </file> - X2Go HTML client files: - <code> - <WEB ROOT>/assets/x2go-plugin/ - CSS/x2gostyle.css - IMG/*.png - IMG/x2gobg.svg - JS/x2goclient.js - RPC/x2gorpc.cgi - index.html - x2gokdriveclient.html + ====== Building and Installing ====== - </code> + ===== x2gohtmlclient ===== - This location can be changed, in this case the changes should be also done in the WEB Server configuration file and in index.html file: - <code> - var RPC_path="/assets/x2go-plugin/RPC/x2gorpc.cgi"; - var asset_path="/assets/x2go-plugin/IMG/"; - </code> - x2gorpc.cgi should be executable + Run ./minify.sh to combine x2gohtmlclient's JavaScript classes and remove the whitespace from the result. + The output will be dist/x2gokdriveclient.min.js, and you should copy this file to $WEBROOT/assets/js/. - install x2gowswrapper to /usr/bin + The other assets should be installed as follows: + * Place index.html in $WEBROOT/assets/css/. + * Place css/* in $WEBROOT/assets/css/. + * Place img/*/*/* in $WEBROOT/assets/img/. - x2gowswarpper configuration: + ===== x2gowebrpc ===== - /etc/x2go/x2gows/x2gows.options - <file> - ws_proto=wss - ssl_cert=<your SSL cert> - ssl_key=<your SSL cert key> - ssl_only=true - log_dir=/var/log/x2gows - </file> - the SSL key should be same which used for WEB server. + Copy x2gorpc.cgi to $WEBROOT/assets/rpc/. - Because x2gowswrapper is started from CGI, be sure that config and SSL Certs are accessible for web server user (www-data in debian) + ===== x2gowswrapper ===== - create log directory for x2gowswarpper: + Build x2gowswrapper using qmake: <code> - #mkdir /var/log/x2gows - #chown www-data /var/log/x2gows + $ qmake-qt5 && make </code> + Install the resulting program named x2gowswrapper to /usr/sbin/. - to use x2go HTML client open in web browser: + Create the directory /var/log/x2gows, and ensure the web server's user can create and modify files therein. + Create the file named /etc/x2go/x2gows/x2gows.options which contains the following: <code> - https://<your host>/assets/x2go-plugin/ + ws_proto=wss + ssl_cert=/etc/pki/nginx/server.crt + ssl_key=/etc/pki/nginx/private/server.key + ssl_only=true + log_dir=/var/log/x2gows </code> - - {{:wiki:advanced:client.png?400|}} - {{:wiki:advanced:kdr.png?400|}} - + Ensure the values of ssl_cert and ssl_key match NGINX's similar values, + and ensure the user running NGINX can read the files at both paths as well as the configuration file itself. -- This mail was generated by DokuWiki at https://wiki.x2go.org/