Adding widget in guacamole

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding widget in guacamole

Asbern

Is it possible to add any widget in guacamole page?

 

Best Regards,
A. Asbern

 

Reply | Threaded
Open this post in threaded view
|

Re: Adding widget in guacamole

Mike Jumper
On Mon, May 28, 2018, 21:35 Asbern <[hidden email]> wrote:

Is it possible to add any widget in guacamole page?


Can you describe what you're trying to do?

- Mike

Reply | Threaded
Open this post in threaded view
|

Re: Adding widget in guacamole

Asbern
In reply to this post by Asbern

Hi,

 

We want to add a internet speed testing widget code in the login page of Guacamole. Can you please let us know where should we make this change to be done.

 

We tired to make change in the login.html page in the below path

 

/var/lib/tomcat/webapps/ROOT/app/login/templates/

 

But we cloud not find the changes are getting reflected in the login page.

 

Let us know the path where we need to make this change

On 2018/05/29 04:36:55, Mike Jumper <[hidden email]> wrote:
> On Mon, May 28, 2018, 21:35 Asbern <[hidden email]> wrote:>
>
> > Is it possible to add any widget in guacamole page?>
> >>
>
> Can you describe what you're trying to do?>
>
> - Mike>
>

Reply | Threaded
Open this post in threaded view
|

Re: Adding widget in guacamole

Mike Jumper-2
On Tue, May 29, 2018 at 10:00 PM, Asbern <[hidden email]> wrote:

Hi,

 

We want to add a internet speed testing widget code in the login page of Guacamole. Can you please let us know where should we make this change to be done.

 

We tired to make change in the login.html page in the below path

 

/var/lib/tomcat/webapps/ROOT/app/login/templates/

 

But we cloud not find the changes are getting reflected in the login page.

 

Let us know the path where we need to make this change


The HTML of the webapp is cached at build time. Directly editing the contents of the webapp after it has been deployed will not have any effect. Even if it did, this is bad practice: such changes will not be stable across upgrades.

If you want to modify the HTML, you will need to leverage the HTML patching capabilities of extensions:


- Mike

Reply | Threaded
Open this post in threaded view
|

RE: Adding widget in guacamole

Asbern

Hi Mike,

 

In the link that you have given, it is mentioned to have a file called guac-manifest.json, but we couldn’t find that file.

 

Is that file apache dependent? Because am using Nginx as a reverse proxy

 

FYI, my guacamole version is 0. 9.13

 

Best Regards,
A. Asbern

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Mike Jumper
Sent: Wednesday, May 30, 2018 11:28 AM
To: [hidden email]
Subject: Re: Adding widget in guacamole

 

On Tue, May 29, 2018 at 10:00 PM, Asbern <[hidden email]> wrote:

Hi,

 

We want to add a internet speed testing widget code in the login page of Guacamole. Can you please let us know where should we make this change to be done.

 

We tired to make change in the login.html page in the below path

 

/var/lib/tomcat/webapps/ROOT/app/login/templates/

 

But we cloud not find the changes are getting reflected in the login page.

 

Let us know the path where we need to make this change

 

The HTML of the webapp is cached at build time. Directly editing the contents of the webapp after it has been deployed will not have any effect. Even if it did, this is bad practice: such changes will not be stable across upgrades.

 

If you want to modify the HTML, you will need to leverage the HTML patching capabilities of extensions:

 

 

- Mike

 

Reply | Threaded
Open this post in threaded view
|

Re: Adding widget in guacamole

vnick
On Mon, Jun 4, 2018 at 2:12 AM, Asbern <[hidden email]> wrote:

Hi Mike,

 

In the link that you have given, it is mentioned to have a file called guac-manifest.json, but we couldn’t find that file.

 


It's in the source code of every single extension.  For example:


The contents of that file will vary based on whether or not you're implementing an authentication extension (running Java code) or just modifying the HTML code of the page (probably more what you're doing).
 

Is that file apache dependent? Because am using Nginx as a reverse proxy

 


No, it has nothing to do with Apache or Nginx - guac-manifest.json is specific to the Guacamole Client webapp.
 

FYI, my guacamole version is 0. 9.13

 


That should be fine, although 0.9.14 is also available.  I don't think there were any changes between 0.9.13-incubating and 0.9.14 that would impact what you're trying to do, though.

-Nick
Reply | Threaded
Open this post in threaded view
|

RE: Adding widget in guacamole

Asbern

Hi,

 

Thanks for your response, we still have some things to be clarified

 

We are using the pre built versions of the web application(guacamole-0.9.13-incubating.war) to build the guacamole. When we  extract this war file, we could not find the file as guac-manifest.json.

 

We are not using any extensions, as we are using the pre built version of web application(.war),

 

Pl tell us how we can make modification to the html page, if we use the (.war) implementation

 

Best Regards,
A. Asbern

 

From: Nick Couchman [mailto:[hidden email]]
Sent: Monday, June 04, 2018 3:47 PM
To: [hidden email]
Subject: Re: Adding widget in guacamole

 

On Mon, Jun 4, 2018 at 2:12 AM, Asbern <[hidden email]> wrote:

Hi Mike,

 

In the link that you have given, it is mentioned to have a file called guac-manifest.json, but we couldn’t find that file.

 

 

It's in the source code of every single extension.  For example:

 

The contents of that file will vary based on whether or not you're implementing an authentication extension (running Java code) or just modifying the HTML code of the page (probably more what you're doing).

 

Is that file apache dependent? Because am using Nginx as a reverse proxy

 

 

No, it has nothing to do with Apache or Nginx - guac-manifest.json is specific to the Guacamole Client webapp.

 

FYI, my guacamole version is 0. 9.13

 

 

That should be fine, although 0.9.14 is also available.  I don't think there were any changes between 0.9.13-incubating and 0.9.14 that would impact what you're trying to do, though.

 

-Nick

Reply | Threaded
Open this post in threaded view
|

Re: Adding widget in guacamole

Mike Jumper
On Tue, Jun 5, 2018, 00:12 Asbern <[hidden email]> wrote:

Hi,

 

Thanks for your response, we still have some things to be clarified

 

We are using the pre built versions of the web application(guacamole-0.9.13-incubating.war) to build the guacamole. When we  extract this war file, we could not find the file as guac-manifest.json.


guac-manifest.json is not part of the web application. It is a file which is part of the extension you will need to write to patch the HTML as you describe. It is documented in the extension format:


We are not using any extensions, as we are using the pre built version of web application(.war),


The mechanism provided by Guacamole (which is the .war) to achieve what you ask *is* the extension system.

Pl tell us how we can make modification to the html page, if we use the (.war) implementation


Write a minimal extension which includes the patch HTML that you wish to apply as documented above. Install that extension as you would any other Guacamole extension.

There is no ".war implementation" which is distinct from what is being recommended here. The extension system is a feature of the Guacamole web application, and that web application is packaged as a .war file, but the fact that the application is packaged as a .war has no bearing on how the HTML is patched at run-time, which is through extensions as described above.

- Mike

Reply | Threaded
Open this post in threaded view
|

RE: Adding widget in guacamole

Asbern

Hi,

 

Thanks for your response,

 

We used the below guacamole client for our deployment

 

guacamole-client-0.9.13-incubating.tar.gz

 

To build guacamole-client, we ran mvn package and that produced the .war file, which contained the entire application.

 

To modify the already existing login.html page in the application, we followed the below steps:

1.            We made minor changes in the login.html  ( /var/lib/tomcat/webapps/guacamole/app/login/templates)  and saved it (We just added a <p> tag with a content in it)

2.            Used the HTML patching capability and added this file in the guac-manifest.json

 

{

 

    "guacamoleVersion" : "1.0.0",

 

    "name"      : "LDAP Authentication",

    "namespace" : "guac-ldap",

 

    "authProviders" : [

        "org.apache.guacamole.auth.ldap.LDAPAuthenticationProvider"

    ],

 

    "translations" : [

        "translations/en.json"

 

    "html" : [ "login.html" ],

 

    ]

 

}

3.            Restarted the Tomcat server and guacd

 

We couldn’t see any changes being reflected in the login page.

 

Please let us know, if the steps that we are following are correct or not, to update the login page.

 

If it is wrong, please guide us on where we have gone wrong and give us some guidelines

 

 

Best Regards,
A. Asbern

 

From: Mike Jumper [mailto:[hidden email]]
Sent: Tuesday, June 05, 2018 12:52 PM
To: [hidden email]
Subject: Re: Adding widget in guacamole

 

On Tue, Jun 5, 2018, 00:12 Asbern <[hidden email]> wrote:

Hi,

 

Thanks for your response, we still have some things to be clarified

 

We are using the pre built versions of the web application(guacamole-0.9.13-incubating.war) to build the guacamole. When we  extract this war file, we could not find the file as guac-manifest.json.

 

guac-manifest.json is not part of the web application. It is a file which is part of the extension you will need to write to patch the HTML as you describe. It is documented in the extension format:

 

 

We are not using any extensions, as we are using the pre built version of web application(.war),

 

The mechanism provided by Guacamole (which is the .war) to achieve what you ask *is* the extension system.

 

Pl tell us how we can make modification to the html page, if we use the (.war) implementation

 

Write a minimal extension which includes the patch HTML that you wish to apply as documented above. Install that extension as you would any other Guacamole extension.

 

There is no ".war implementation" which is distinct from what is being recommended here. The extension system is a feature of the Guacamole web application, and that web application is packaged as a .war file, but the fact that the application is packaged as a .war has no bearing on how the HTML is patched at run-time, which is through extensions as described above.

 

- Mike

 

Reply | Threaded
Open this post in threaded view
|

Re: Adding widget in guacamole

mjumper
Administrator
Asbern,

Please, please read the documentation that we have directed you toward. The chapter in question covers how HTML can be patched.


We used the below guacamole client for our deployment

 

guacamole-client-0.9.13-incubating.tar.gz

 

To build guacamole-client, we ran mvn package and that produced the .war file, which contained the entire application.

 

To modify the already existing login.html page in the application, we followed the below steps:

1.            We made minor changes in the login.html  ( /var/lib/tomcat/webapps/guacamole/app/login/templates)  and saved it (We just added a <p> tag with a content in it)


You should not make changes to the files in the exploded webapp. Any such changes will not have any effect. Make such changes using the patching functionality of extensions (see link above).

2.            Used the HTML patching capability and added this file in the guac-manifest.json

 


The HTML patching capability is NOT simply listing a filename within guac-manifest.json. The HTML patches are specially-formatted HTML files which contain a "<meta>" tag defining how the HTML is to be modified and an HTML snippet containing the modification:


{

 

    "guacamoleVersion" : "1.0.0",

 


If you are using 0.9.13-incubating, then this should say "0.9.13-incubating" or "*". Specifying a different version will result in the extension not loading, and Guacamole will log a message in the logs noting that it has refused to load the extension due to the version number not matching.


    "name"      : "LDAP Authentication",


For the sake of readable logs, you should define a meaningful name for your extension. Your theming/branding/etc. extension is presumably not "LDAP Authentication".
 

    "namespace" : "guac-ldap",


The "namespace" has special meaning. You should not reuse the namespace of an existing extension.

 

    "authProviders" : [

        "org.apache.guacamole.auth.ldap.LDAPAuthenticationProvider"

    ],

 


Why are you referencing an authentication provider?
 

    "translations" : [

        "translations/en.json"

 

    "html" : [ "login.html" ],

 

    ]


This is invalid JSON. Your "html" property is defined in the middle of the array specified for the "translations" property.

 

}

3.            Restarted the Tomcat server and guacd



You do not need to restart guacd. You only need to restart Tomcat.

You will need to place your extension's .jar file within GUACAMOLE_HOME/extrensions for it to load.

We couldn’t see any changes being reflected in the login page.

 

Please let us know, if the steps that we are following are correct or not, to update the login page.


Please read the documentation linked above thoroughly. It covers the proper format of guac-manifest.json as well as the HTML patches. If you have installed your extension and things still do not work:

* Check the Tomcat logs to verify your extension is loading. Look for errors or warnings regarding your extension.
* Test that your extension's guac-manifest.json is valid.
* Read through the documentation again, verifying that your extension follows the documented format.

- Mike

Reply | Threaded
Open this post in threaded view
|

RE: Adding widget in guacamole

Asbern

Hi Mike,

 

Thanks for your response,

 

As per your guidelines and the document you suggested we have created a new extension file and also placed .jar file in GUACAMOLE_HOME (usr/share/tomcat/.guacamole/extensions) but we don’t see any difference in Login page, we did check the logs to the extension is not loaded

 

FYI, I have attached the .jar file, kindly takes a look into it.

Best Regards,
A. Asbern

 

From: Mike Jumper [mailto:[hidden email]]
Sent: Monday, June 11, 2018 11:53 AM
To: [hidden email]
Subject: Re: Adding widget in guacamole

 

Asbern,

 

Please, please read the documentation that we have directed you toward. The chapter in question covers how HTML can be patched.

 

 

We used the below guacamole client for our deployment

 

guacamole-client-0.9.13-incubating.tar.gz

 

To build guacamole-client, we ran mvn package and that produced the .war file, which contained the entire application.

 To modify the already existing login.html page in the application, we followed the below steps:

1.            We made minor changes in the login.html  ( /var/lib/tomcat/webapps/guacamole/app/login/templates)  and saved it (We just added a <p> tag with a content in it)

 

You should not make changes to the files in the exploded webapp. Any such changes will not have any effect. Make such changes using the patching functionality of extensions (see link above).

 

2.            Used the HTML patching capability and added this file in the guac-manifest.json

 

 

The HTML patching capability is NOT simply listing a filename within guac-manifest.json. The HTML patches are specially-formatted HTML files which contain a "<meta>" tag defining how the HTML is to be modified and an HTML snippet containing the modification:

 

 

{

     "guacamoleVersion" : "1.0.0",

 If you are using 0.9.13-incubating, then this should say "0.9.13-incubating" or "*". Specifying a different version will result in the extension not loading, and Guacamole will log a message in the logs noting that it has refused to load the extension due to the version number not matching.

 

 

    "name"      : "LDAP Authentication",

 

For the sake of readable logs, you should define a meaningful name for your extension. Your theming/branding/etc. extension is presumably not "LDAP Authentication".

 

    "namespace" : "guac-ldap",

 

The "namespace" has special meaning. You should not reuse the namespace of an existing extension.

 

 

    "authProviders" : [

        "org.apache.guacamole.auth.ldap.LDAPAuthenticationProvider"

    ],

 

 

Why are you referencing an authentication provider?

 

    "translations" : [

        "translations/en.json"

 

    "html" : [ "login.html" ],

 

    ]

 

This is invalid JSON. Your "html" property is defined in the middle of the array specified for the "translations" property.

 

 

}

3.            Restarted the Tomcat server and guacd

 

 

You do not need to restart guacd. You only need to restart Tomcat.

 

You will need to place your extension's .jar file within GUACAMOLE_HOME/extrensions for it to load.

 

We couldn’t see any changes being reflected in the login page.

 

Please let us know, if the steps that we are following are correct or not, to update the login page.

 

Please read the documentation linked above thoroughly. It covers the proper format of guac-manifest.json as well as the HTML patches. If you have installed your extension and things still do not work:

 

* Check the Tomcat logs to verify your extension is loading. Look for errors or warnings regarding your extension.

* Test that your extension's guac-manifest.json is valid.

* Read through the documentation again, verifying that your extension follows the documented format.

 

- Mike

 


generic-customize-extension.jar (78K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RE: Adding widget in guacamole

mjumper
Administrator
On 2018/06/19 10:15:16, "Asbern" <[hidden email]> wrote:
> Hi Mike,
>
> Thanks for your response,
>
> As per your guidelines and the document you suggested we have created a new extension file and also placed .jar file in GUACAMOLE_HOME (usr/share/tomcat/.guacamole/extensions) but we don’t see any difference in Login page, we did check the logs to the extension is not loaded
>

If you look at the Tomcat logs, you will see an error message from Guacamole like:

"Extension "generic-customize-extension.jar" could not be loaded: Extension generic-customize-extension.jar is missing guac-manifest.json"

This is because your extension has its "guac-manifest.json" nested within a directory. This is not the format used by Guacamole extensions. The "guac-manifest.json" should be at the root level of the .jar. See:

http://guacamole.apache.org/doc/gug/guacamole-ext.html#ext-file-format

Your "guac-manifest.json" is also invalid JSON. If you correct the extension such that is has the correct structure as documented above, you will see a new error in your Tomcat logs after Tomcat is restarted:

"Extension "generic-customize-extension.jar" could not be loaded: guac-manifest.json is not valid JSON: generic-customize-extension.jar"

This is due to the trailing comma at the end of the body of the main object within the JSON.

> FYI, I have attached the .jar file, kindly takes a look into it.
>

Going forward, if you want to post a .jar file, it would be better to host that .jar elsewhere and link to it within your email. In my case, the email was blocked due to the .jar attachment. I'm probably not the only one.

- Mike