You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by jacksonp <ja...@gmail.com> on 2019/03/09 19:56:47 UTC

extend guacamole mysql connection table?

We would like to add a custom field to the connection table to store an
additional attribute of the device we are connecting to.  Is there a best
practice or recommendation for this so we don't break something down the
road?



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

Re: extend guacamole mysql connection table?

Posted by Nick Couchman <vn...@apache.org>.
On Sat, Mar 9, 2019 at 4:01 PM jacksonp <ja...@gmail.com> wrote:

> Thanks Nick, I want to store the vmware machine name and/or UUID we are
> connecting to with guac VNC.  I can then pull this field value and pass it
> to an ansible tower API to do automation tasks on the backend.
>
> Can you point me to some code where you did this?
>

Ah, yeah, very doable.  My WOL code is here:

https://github.com/necouchman/guacamole-client/tree/jira/513/extensions/guacamole-auth-wol

It's a little rough right now - has not been reviewed, yet, but it works
and I've been over it a few times trying to clean things up.  Let me know
if you have specific questions about the code - I've tried to make it as
simple as possible, but no doubt there's something in there that will cause
everyone to scratch their heads and go, "What was he thinking?!"

-Nick

Re: extend guacamole mysql connection table?

Posted by jacksonp <ja...@gmail.com>.
Thanks Nick, I want to store the vmware machine name and/or UUID we are
connecting to with guac VNC.  I can then pull this field value and pass it
to an ansible tower API to do automation tasks on the backend.

Can you point me to some code where you did this?

regards,



--
Sent from: http://apache-guacamole-general-user-mailing-list.2363388.n4.nabble.com/

Re: extend guacamole mysql connection table?

Posted by Nick Couchman <vn...@apache.org>.
On Sat, Mar 9, 2019 at 2:57 PM jacksonp <ja...@gmail.com> wrote:

> We would like to add a custom field to the connection table to store an
> additional attribute of the device we are connecting to.  Is there a best
> practice or recommendation for this so we don't break something down the
> road?
>

It kind of depends on what you're trying to do - more detail might help to
determine that - but the best way to do this (in my opinion) would be to
create a custom extension that decorates the connections, and uses the
ability of the JDBC module to store arbitrary attributes.  An example of
this in practice is the TOTP extension, which decorates User objects from
the database, storing the relevant TOTP information in the
guacamole_user_attribute table.  I've also written a Wake-on-LAN extension
(currently has a pull request) that decorates Connection objects, storing
the MAC address in the guacamole_connection_attribute table.  You can do
similar things for user groups and connection groups.

Using this method would definitely help prevent breaking something down the
road, as you're working within the schema defined in the database and not
modifying it, which has a higher risk of being broken or overridden by
future changes to the database schema.

-Nick