You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by benchu yao <ya...@gmail.com> on 2019/10/03 00:33:41 UTC
How to associate a guacamole recording file with a historical connection
record
I am trying to redevelop guacamole. I want to modify the source code of guacamole-client so that the screen file name can contain information such as user name, history connection id, etc., not just a fixed file name. Can you tell me which part of the source code to modify. Thank you Yao benchu yao 邮箱:yaobenchu@gmail.com 签名由 网易邮箱大师 定制
Re: How to associate a guacamole recording file with a historical connection
record
Posted by benchu yao <ya...@gmail.com>.
Thank you, I'll keep track of this issue. Also if there is any other way to locate the recording file through a historical session record, please tell me. Thank you, Yao On 10/09/2019 04:36, Nick Couchman wrote: On Tue, Oct 8, 2019 at 5:12 AM benchu yao <ya...@gmail.com> wrote: The value of ${GUAC-TIME} is the current time, not the same value as the start_date of guacamole_connection_history, and still can't make the connection history correspond to the record file.The problem is still not solved. This is covered with this JIRA issue: https://issues.apache.org/jira/browse/GUACAMOLE-61 It hasn't gotten any attention at this point, so I don't have a solution for you, but it has been noted. -Nick
Re: How to associate a guacamole recording file with a historical
connection record
Posted by Nick Couchman <vn...@apache.org>.
On Tue, Oct 8, 2019 at 5:12 AM benchu yao <ya...@gmail.com> wrote:
> The value of ${GUAC-TIME} is the current time, not the same value as the
> start_date of guacamole_connection_history, and still can't make the
> connection history correspond to the record file.The problem is still not
> solved.
>
>
This is covered with this JIRA issue:
https://issues.apache.org/jira/browse/GUACAMOLE-61
It hasn't gotten any attention at this point, so I don't have a solution
for you, but it has been noted.
-Nick
Re: How to associate a guacamole recording file with a historical connection
record
Posted by benchu yao <ya...@gmail.com>.
The value of ${GUAC-TIME} is the current time, not the same value as the start_date of guacamole_connection_history, and still can't make the connection history correspond to the record file.The problem is still not solved. On 10/04/2019 09:06, Mike Jumper wrote: On Thu, Oct 3, 2019 at 5:12 PM benchu yao <ya...@gmail.com> wrote: I don't understand the way you're talking about modifying the screen file name by configuring parameters. I know that I can define the screen file name when configuring the connection, but that's a fixed value for each connection. No, the value is dynamic if you use parameter tokens. Parameter tokens are dynamically substituted each time the connection is used. Please read through the parameter tokens section: http://guacamole.apache.org/doc/gug/configuring-guacamole.html#parameter-tokens For example, if you set the connection parameter for the recording name to "potato-${GUAC_USERNAME}", the name of the recording will vary by the user accessing it. If you access it as "guacadmin", the recording is saved as "potato-guacadmin". If you access it as "yaobenchu", it's saved as "potato-yaobenchu". All connection parameters can make use of this. You can also always write an extension to serve as the data source backing your connections, in which case it's entirely up to you how dynamic each parameter is. - Mike
Re: How to associate a guacamole recording file with a historical connection
record
Posted by benchu yao <ya...@gmail.com>.
I understand what you mean now. I think I can uniquely locate a session by adding a username and time to the recording file name. My problem has been solved. Also what do you mean about "write an extension to serve as the data source "? Does that mean that I can use other custom parameters as TOKEN_NAME? Thanks, Yao On 10/04/2019 09:06, Mike Jumper wrote: On Thu, Oct 3, 2019 at 5:12 PM benchu yao <ya...@gmail.com> wrote: I don't understand the way you're talking about modifying the screen file name by configuring parameters. I know that I can define the screen file name when configuring the connection, but that's a fixed value for each connection. No, the value is dynamic if you use parameter tokens. Parameter tokens are dynamically substituted each time the connection is used. Please read through the parameter tokens section: http://guacamole.apache.org/doc/gug/configuring-guacamole.html#parameter-tokens For example, if you set the connection parameter for the recording name to "potato-${GUAC_USERNAME}", the name of the recording will vary by the user accessing it. If you access it as "guacadmin", the recording is saved as "potato-guacadmin". If you access it as "yaobenchu", it's saved as "potato-yaobenchu". All connection parameters can make use of this. You can also always write an extension to serve as the data source backing your connections, in which case it's entirely up to you how dynamic each parameter is. - Mike
Re: How to associate a guacamole recording file with a historical
connection record
Posted by Mike Jumper <mj...@apache.org>.
On Thu, Oct 3, 2019 at 5:12 PM benchu yao <ya...@gmail.com> wrote:
> I don't understand the way you're talking about modifying the screen file
> name by configuring parameters. I know that I can define the screen file
> name when configuring the connection, but that's a fixed value for each
> connection.
>
No, the value is dynamic if you use parameter tokens. Parameter tokens are
dynamically substituted each time the connection is used. Please read
through the parameter tokens section:
http://guacamole.apache.org/doc/gug/configuring-guacamole.html#parameter-tokens
For example, if you set the connection parameter for the recording name to
"potato-${GUAC_USERNAME}", the name of the recording will vary by the user
accessing it. If you access it as "guacadmin", the recording is saved as
"potato-guacadmin". If you access it as "yaobenchu", it's saved as
"potato-yaobenchu". All connection parameters can make use of this.
You can also always write an extension to serve as the data source backing
your connections, in which case it's entirely up to you how dynamic each
parameter is.
- Mike
Re: How to associate a guacamole recording file with a historical connection
record
Posted by benchu yao <ya...@gmail.com>.
I don't understand the way you're talking about modifying the screen file name by configuring parameters. I know that I can define the screen file name when configuring the connection, but that's a fixed value for each connection. Do you mean that I can define the record file name for each session by adding recording-name when submitting an http request? If this works, it will reduce the cost of developing your code. As for modifying the source code, if there's no other way, I'll try it. Thanks, Yao On 10/04/2019 00:04, Mike Jumper wrote: On Thu, Oct 3, 2019, 06:37 Lukáš Raška <lu...@gmail.com> wrote: čt 3. 10. 2019 v 15:00 odesílatel Nick Couchman <vn...@apache.org> napsal: First, please do not cross-post to multiple mailing lists - please pick one list and use that. On Wed, Oct 2, 2019 at 8:33 PM benchu yao <ya...@gmail.com> wrote: I am trying to redevelop guacamole. I want to modify the source code of guacamole-client so that the screen file name can contain information such as user name, history connection id, etc., not just a fixed file name. Can you tell me which part of the source code to modify. There's not really an easy/straight-forward way to do this. guacd is what generates the recordings, and it is not aware of any of the user authentication that happens on the Guacamole Client side. That's not to say that it isn't possible - I'm thinking that you could probably make some changes such that, when a connection is successfully established by guacd, it could pass back the name of the recording file to Guacamole Client, and Guacamole Client could, in turn, take that and store that information somewhere. I'm not sure if that's something we'd want to add to the base code (would need further community feedback on that), but certainly something you could try out on your own.. It's quite easy from the protocol side - recording-name is the parameter that tells how the file should be named (see https://guacamole.apache.org/doc/gug/configuring-guacamole.html). So *only* needed thing to do is force this parameter from Guacamole UI (so the opposite logic - don't store the recording name in guacamole-client, but force the name to be something comparable with identifiers in guacamole-client). Starting point is probably here - https://github.com/apache/guacamole-client/blob/develop/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java#L216 , drilling down to the Connectable used which probably gets the protocol parameters (might be better place where to do it, I haven't been working with guacamole-client source that much). I assume there is currently no simple way how to do it in guacamole-client itself, however it's doable with some modifications. Parameter tokens would be the way: http://guacamole.apache.org/doc/gug/configuring-guacamole.html#parameter-tokens The username, etc. can already be added dynamically to the filename without making changes. It is also possible to write extensions that add arbitrary additional tokens. The ID used for the connection history entry, on the other hand, will not be available. Besides that ID being internal to the database, the history entry doesn't exist at the time the connection is being recorded. - Mike
Re: How to associate a guacamole recording file with a historical
connection record
Posted by Mike Jumper <mj...@apache.org>.
On Thu, Oct 3, 2019, 06:37 Lukáš Raška <lu...@gmail.com> wrote:
>
>
> čt 3. 10. 2019 v 15:00 odesílatel Nick Couchman <vn...@apache.org> napsal:
>
>> First, please do not cross-post to multiple mailing lists - please pick
>> one list and use that.
>>
>> On Wed, Oct 2, 2019 at 8:33 PM benchu yao <ya...@gmail.com> wrote:
>>
>>> I am trying to redevelop guacamole.
>>>
>>> I want to modify the source code of guacamole-client so that the screen
>>> file name can contain information such as user name, history connection id,
>>> etc., not just a fixed file name.
>>>
>>> Can you tell me which part of the source code to modify.
>>>
>>
>> There's not really an easy/straight-forward way to do this. guacd is
>> what generates the recordings, and it is not aware of any of the user
>> authentication that happens on the Guacamole Client side.
>>
>> That's not to say that it isn't possible - I'm thinking that you could
>> probably make some changes such that, when a connection is successfully
>> established by guacd, it could pass back the name of the recording file to
>> Guacamole Client, and Guacamole Client could, in turn, take that and store
>> that information somewhere. I'm not sure if that's something we'd want to
>> add to the base code (would need further community feedback on that), but
>> certainly something you could try out on your own..
>>
>
>
> It's quite easy from the protocol side - *recording-name* is the
> parameter that tells how the file should be named (see
> https://guacamole.apache.org/doc/gug/configuring-guacamole.html). So
> *only* needed thing to do is force this parameter from Guacamole UI (so the
> opposite logic - don't store the recording name in guacamole-client, but
> force the name to be something comparable with identifiers in
> guacamole-client).
>
> Starting point is probably here -
> https://github.com/apache/guacamole-client/blob/develop/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java#L216 ,
> drilling down to the *Connectable *used which probably gets the protocol
> parameters (might be better place where to do it, I haven't been working
> with guacamole-client source that much). I assume there is currently no
> simple way how to do it in guacamole-client itself, however it's doable
> with some modifications.
>
Parameter tokens would be the way:
http://guacamole.apache.org/doc/gug/configuring-guacamole.html#parameter-tokens
The username, etc. can already be added dynamically to the filename without
making changes. It is also possible to write extensions that add arbitrary
additional tokens.
The ID used for the connection history entry, on the other hand, will not
be available. Besides that ID being internal to the database, the history
entry doesn't exist at the time the connection is being recorded.
- Mike
>
Re: How to associate a guacamole recording file with a historical
connection record
Posted by Lukáš Raška <lu...@gmail.com>.
čt 3. 10. 2019 v 15:00 odesílatel Nick Couchman <vn...@apache.org> napsal:
> First, please do not cross-post to multiple mailing lists - please pick
> one list and use that.
>
> On Wed, Oct 2, 2019 at 8:33 PM benchu yao <ya...@gmail.com> wrote:
>
>> I am trying to redevelop guacamole.
>>
>> I want to modify the source code of guacamole-client so that the screen
>> file name can contain information such as user name, history connection id,
>> etc., not just a fixed file name.
>>
>> Can you tell me which part of the source code to modify.
>>
>
> There's not really an easy/straight-forward way to do this. guacd is what
> generates the recordings, and it is not aware of any of the user
> authentication that happens on the Guacamole Client side.
>
> That's not to say that it isn't possible - I'm thinking that you could
> probably make some changes such that, when a connection is successfully
> established by guacd, it could pass back the name of the recording file to
> Guacamole Client, and Guacamole Client could, in turn, take that and store
> that information somewhere. I'm not sure if that's something we'd want to
> add to the base code (would need further community feedback on that), but
> certainly something you could try out on your own..
>
It's quite easy from the protocol side - *recording-name* is the parameter
that tells how the file should be named (see
https://guacamole.apache.org/doc/gug/configuring-guacamole.html). So *only*
needed thing to do is force this parameter from Guacamole UI (so the
opposite logic - don't store the recording name in guacamole-client, but
force the name to be something comparable with identifiers in
guacamole-client).
Starting point is probably here -
https://github.com/apache/guacamole-client/blob/develop/guacamole/src/main/java/org/apache/guacamole/tunnel/TunnelRequestService.java#L216
,
drilling down to the *Connectable *used which probably gets the protocol
parameters (might be better place where to do it, I haven't been working
with guacamole-client source that much). I assume there is currently no
simple way how to do it in guacamole-client itself, however it's doable
with some modifications.
>
> -Nick
>
>>
--
Best Regards,
Lukáš Raška
Re: How to associate a guacamole recording file with a historical
connection record
Posted by Nick Couchman <vn...@apache.org>.
First, please do not cross-post to multiple mailing lists - please pick one
list and use that.
On Wed, Oct 2, 2019 at 8:33 PM benchu yao <ya...@gmail.com> wrote:
> I am trying to redevelop guacamole.
>
> I want to modify the source code of guacamole-client so that the screen
> file name can contain information such as user name, history connection id,
> etc., not just a fixed file name.
>
> Can you tell me which part of the source code to modify.
>
There's not really an easy/straight-forward way to do this. guacd is what
generates the recordings, and it is not aware of any of the user
authentication that happens on the Guacamole Client side.
That's not to say that it isn't possible - I'm thinking that you could
probably make some changes such that, when a connection is successfully
established by guacd, it could pass back the name of the recording file to
Guacamole Client, and Guacamole Client could, in turn, take that and store
that information somewhere. I'm not sure if that's something we'd want to
add to the base code (would need further community feedback on that), but
certainly something you could try out on your own..
-Nick
>