[SOLVED] tis-rustdesk-config-template

Questions about WAPT Packaging / Requests and help regarding Wapt packages.
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
smandel
Messages: 111
Registration: May 5, 2022 - 11:30

October 7, 2024 - 4:10 PM

Hello everyone,

I've had a Rustdesk server installed for quite some time now, and I've seen that agent deployment is now possible with a WAPT package.
Currently, I'm using it on demand with the information in the binary name.

I suspect I need to enter the server information in the "rustdesk.cfg" file within the template, but in what format?

Thank you.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 8, 2024 - 9:36 PM

I used the example from the documentation to create the cfg, here https://github.com/techahold/rustdeskin ... ll.sh#L276

Code: Select all

hostname = '192.168.1.1'
apiurl = ''
pubkey = glob.glob('/opt/rustdesk/*.pub')[0]
key = open(pubkey,'r').read()
config = {"host":hostname,"relay":hostname,"key":key,"api":apiurl}
rustdesk_list = list(base64.b64encode(json.dumps(config,separators=(',', ':')).encode('utf-8')).decode('utf-8').replace('=',''))
rustdesk_list.reverse()
rustdesk_cfg = ''.join(rustdesk_list)
print(rustdesk_cfg)
Rustdesk accepts the cfg format like this:

Code: Select all

rustdesk.exe --config JIDEZOD79ZED?
smandel
Messages: 111
Registration: May 5, 2022 - 11:30

October 9, 2024 - 09:11

I'm still having trouble understanding. :?

Is this the content to add to the cfg file?
Does the pubkey seem to be the server-side path?
Is the template to be executed on the server?

Thank you.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 9, 2024 - 9:33 AM

The cfg file actually contains the server's public key, yes. ;)

The code here is fundamentally executed on the server, yes.
smandel
Messages: 111
Registration: May 5, 2022 - 11:30

October 9, 2024 - 10:33

So, this code needs to be executed server-side, which will generate the configuration ID?
Then, this ID needs to be added to the rustdesk.cfg file of the template?
To deploy the configuration to the clients?
Sorry, I'm trying to understand how it works. :)
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 9, 2024 - 10:38

To put it simply

On your own machine, in a Python script, you can run this:

Code: Select all

import base64
import json


# read from /opt/rustdesk/*.pub
key = "ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD"
hostname = '192.168.1.1'
apiurl = ''


config = {"host":hostname,"relay":hostname,"key":key,"api":apiurl}
rustdesk_list = list(base64.b64encode(json.dumps(config,separators=(',', ':')).encode('utf-8')).decode('utf-8').replace('=',''))
rustdesk_list.reverse()
rustdesk_cfg = ''.join(rustdesk_list)
print('CFG:')
print(rustdesk_cfg)
Simply replace "ABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCDABCD" with the content of your Rustedesk server's advertisement
and replace 192.168.1.1 with the IP address of your Rustdesk server

The print command will display the cfg
smandel
Messages: 111
Registration: May 5, 2022 - 11:30

October 9, 2024 - 10:51

Yes, no problem, the CFG will display.
But in the template, it shows that it's reading the rustdesk.cfg file.
What should be put in this rustdesk.cfg file?
The code output?
Thank you.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 9, 2024 - 10:54

Launch the update_package command (from the console).

The GUI will ask you for the cfg file. ;)
smandel
Messages: 111
Registration: May 5, 2022 - 11:30

October 9, 2024 - 11:11

Ah yes, OK!
Perfect. :)
However, we see that the password is transmitted in encrypted form in the audit data.
Where can we find it in plain text in the console?
Thank you.
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

October 9, 2024 - 1:28 PM

smandel wrote: Oct 9, 2024 - 11:11 Where can we find it in plain text in the console?
On the machine's audit data tab, check the "decrypt data" box.
Locked