On Wed, Jul 18, 2018 at 1:16 AM Mathieu Mailhos <math...@datarepublic.com> wrote:
> Hello, > > I am currently diving into the client source code (both Angular and Java > apps). > My ultimate goal is to build a dashboard with a view of all existing > connections using shared profiles. > > To do that, I see two sub tasks to achieve first: > - Automatically create a shared profile on each new connection > - Populate the shared profile into a database and wrap an API around it. > > Basically you want ActiveConnections to be shared automatically, presumably only with certain users (Admins or Auditors, etc.)? > Starting with the first task, I am trying to understand how shared profiles > are generated. Running JDB on a remote tomcat server, I see the connection > going to jdbc.sharingprofile.SharingProfileService and > rest.sharingprofile.APISharingProfile. > However, I am not able to get the URL String (looking like > server:8080/guacamole/#/?key=BvpYzgswchFdm6m3mKC6ihuELtYqdsfd) in the > objects. > Could you indicate me where I should put my break point to see the entire > object containing this string please? What does the object looks like? > > To start, we probably need to differentiate between a SharingProfile and a SharedConnection. These are two different concepts in the Guacamole Client. The SharingProfile is what determines the attributes/parameters of the SharedConnection (at this point just whether or not the SharedConnection is read-only/viewable or read-write/interactive), and the SharedConnection is what is actually created when someone uses the link within the hidden menu to share the connection. I mention this because you said that you are "trying to understand how shared profiles are generated." SharedProfiles are generated by creating them in the Connection management area for a particular connection. SharedConnections are created when a user who has an ActiveConnection goes to the hidden menu (Ctrl-Shift-Alt) and clicks the Share option to share the ActiveConnection using one of the previously-defined SharingProfiles. It's also important to understand that SharedConnections are not present in the database. SharingProfiles are stored in the database, but neither ActiveConnections nor SharedConnections are - they are only present in-memory. So, if you are expecting to use JDB to see database writes when someone shares a connection, you won't - nor will you see anything for an active connection, because neither of these items are ever written to the database. (ConnectionRecords are written when a connection completes for history tracking.) When you share a connection, the SharedConnection object is create (in-memory) and an associated SharedKey is created (also in-memory) that allows someone with that key to authenticate to the Guacamole Client and automatically enter the SharedConnection associated with that key. > Am I overally going on the right direction? I'd really appreciate any help > that you could provide me. > > Generally speaking, probably so, but I think that you (and several other folks) are looking for some general changes to how SharedConnections are handled. While the current method is great for sharing a connection with anonymous users, there have been several requests for capabilities similar to what you're trying to accomplish: - Allow an admin/auditor to view currently running connections and (potentially) interact with those connections. - Allow someone to share a connection that is then published to the Guacamole Home screen so that other users who log in can see that connection. - Allow a user who has connections already running to join/take-over that existing connection from a different computer. There are several JIRA issues opened that cover these various use-cases: https://issues.apache.org/jira/browse/GUACAMOLE-360 https://issues.apache.org/jira/browse/GUACAMOLE-227 https://issues.apache.org/jira/browse/GUACAMOLE-453 https://issues.apache.org/jira/browse/GUACAMOLE-460 Definitely post back here with any other questions/discussions you may have, and we'd definitely love to have the contributions of code for what you're working on - obviously with four JIRA issues opened going in various directions, and several other mailing list threads asking about this, this is something that a lot of people seem to be looking for in the Guacamole Client. -Nick