# WEBRDP **webrdp** is modular multi-protocol *(currently only windows RDP implemented)* remote desktop client designed to be accessed via web ui by any modern browser. ## Design: 1. **webrdp** binary itself - is a small core application which implements load balancing, networking, websocket based internal protocol and remote desktop protocol module loading, currently all built into one static binary, with a little effort it is possible to implement dynamic module loading. 2. static web data *(html + js code)* which implements client side protocol, drawing functions and user input handling ## Compiling: ### webrdp: 1. to simplify compilation process - `builder.sh` script placed into repository root directory. this script allow to speed up build process, run `./builder.sh -h` to see available actions. building via script will also fetch and build few dependencies with appropriate versions which may be unavailable or have unsupported versions installed on current system. 2. **webrdp** itself can be built from **codelite** workspace, but it is recommended to compile required dependencies via `builder.sh` script before any attempts to compile webrdp from codelite. 3. you can try to build/link against your system libraries, but this is not recommended and unsupported, also you will require to edit project's settings in codelite and/or edit `builder.sh` script. 4. it is also possible to build in guix/nix container *(in this case you will unable to compile webrdp from codelite directly)*, script `guix_build_env.sh` to create suitable guix environment is available, this may be necessary on systems with incompatible base libraries for example libressl instead of openssl *(my system)* ### static web data: 1. static web data is ready for use, does not need to compile anything, just upload to properly configured http(s) server. ## Configuration: ### webrdp: you can read config sample with comments at `doc/config_sample` this file always contain up to date information about all available settings ### static web data: you can read config example for nginx web server at `doc/nginx_location` ## Runing: ### webrdp: you can see all available command line options via `-h` command line option. most settings read from config file. default config file locations are: * < path > passed by `-c` command line option * ~/.config/webrdp/config * /etc/webrdp/config ### static web data: just start properly configure web server as usual. ## Debugging: ### General: webrdp itself does not have anything sepcial for debugging process, you can debug it just as any other C code with preffered debugger. ### SafeConnect: as **webrdp** is often *(always?)* used as part of **SafeConnect** solution, it's wise to have information about SafeConnect configuration in order to have convenient way to debug **webrdp** with **SafeConnect**. SafeConnect configuration steps description follows: 1. install **SafeConnect**, do initial configuration. 2. switch to debug mode via `sc-playbook /opt/sc-ansible/configs/debug-local.yml` command in root shell on **SafeConnect** machine 3. on web ui of **SafeConnect** go to "Ресурсы" and add new resource with following settings: * "Протокол": RDP * "Адрес": address of some machine with working RDP server **(regular machine with rdp server, not webrdp)** * "Порт": port on which RDP server is listening (default 3389) * "Название": resource name - does not matter 4. on web ui of **SafeConnect** go to "Учетные записи" and add new account, where: * "Логин": login name on destination RDP server **(not webrdp server)** * "Пароль": password on destination RDP server **(not webrdp server)** * "Название": name - does not matter 5. on web ui of **SafeConnect** go to "Политики" and edit "Глобальная политика" (press button with pencil on the top left column), in opened window you need to set `gate_address` to URI pointing web server hosting **static web data (not directly to webrdp port/socket), it may be necessary to edit `www/index.html` depending on web server setup, by default static web data expect to have webrdp accesible at /wrdp on current domain** 6. on web ui of **SafeConnect** go to "Задания" click "Добавить" in opened window on "Исполнители" table click "Добавить" in opened window click on checkbox near "Газвание группы" at left, to select all available groups then click "Применить", on "Доступы" table click "Добавить", in opened window at "Ресурс" list select resource created at step 3, at "Удаленная учетная запись" list select account created at step 4. *NOTE: to see available entries in lists, start typing something at editbox* 7. on web ui of **SafeConnect** go to "Главная", if all preveous steps done properly, you should see resource created at step 3, now you can finally start debugging of webrdp by clicking on this resource and on opened windows clicking on entry in list