Thank you Nick, that brought me many steps forward!
I added some custom attributes and was able to read them out in my class
ProxmoxConnection extends DelegatingConnection using super.getAttributes().
I got the http connection to the Proxmox API running, I just didn't
combine it all together, yet.
What I was wondering, sometimes the VM ip can get changed or just isn't
static.
I tried to adjust the hostname of the connection inside the connect()
function like this:
GuacamoleConfiguration currentConfig = super.getConfiguration();
currentConfig.setParameter("hostname", "10.20.1.122");
super.setConfiguration(currentConfig);
But it didn't change. Reading the source comments the configuration
might be read already.
Is there a good place to insert a hostname changing ?
Thank you!
Kai
Am 25.11.23 um 16:17 schrieb Nick Couchman:
On Thu, Nov 23, 2023 at 4:30 PM Kai <l1800tu...@gmail.com> wrote:
I'm still struggling with the web frontend.
Can you point me to a documentation of how to manipulate the status
messages during startup of the remote desktop connection?
The simplest thing to do is to change the translation strings for the
status message. Possibly right here:
https://github.com/apache/guacamole-client/blob/687ae4976e84cb79a7de20ec35d3fe97dd30d5e2/guacamole/src/main/frontend/src/translations/en.json#L79
You could change that string to something like: "Starting up VM and
connecting, this could take a few minutes..."
(etc.). Beyond that, I'm not sure that there's a way to send back
arbitrary information. There's a facility for requesting required
information (used for authentication, mainly) and sending that
information back, but that deals mostly in connection parameters used
by guacd and not so much in client interaction between Tomcat and the
Web UI. More on that difference, below...
And for the web interface configuration option:
I read and searched a lot, but I'm still not sure: Do I need to
adjust
the files like in src/main/frontend/src/app/settings?
Or do I create little files inside the extension to add functionality?
Defining the configuration parameters itself can be done inside
the Java
classes, if I understood correctly.
It's important to distinguish between "Connection Attributes" and
"Connection Parameters" - Parameters are passed to guacd and used to
establish the connection, while Attributes remain entirely within
Guacamole Client. If you're doing all of the VM startup functionality
in Java classes within Guacamole Client, then these should be
connection attributes.
To add connection attributes you do not need to directly modify the
web interface, you just need to create the correct fields in the Java
class. There are some existing Java classes that make use of this that
you can look at for guidance - like TOTPuser:
https://github.com/apache/guacamole-client/blob/master/extensions/guacamole-auth-totp/src/main/java/org/apache/guacamole/auth/totp/user/TOTPUser.java
The attributes are defined at the top of the class, but you also need
to add and/or remove them in the getAttributes() and setAttributes()
methods. The TOTPUser class has one exception - the TOTP secret is
intentionally removed from the interface so that it cannot be viewed
(= compromised), so not everything in the TOTPUser class would be
something you need to do. Also, TOTPUser is, of course, a User class,
not a Connection class, but it should translate over pretty easily.
-Nick