Configure Gravatar Server

Sebastien Erard April 4, 2012

We are running Bamboo and Confluence with the Confluence Avatar Server (https://plugins.atlassian.com/plugins/com.cutlass.confluence.plugin.rest.cas). Bamboo can access a Gravatar server, but is nailed down to gravatar.com. Is is possible to redirect Bamboo to use the Confluence Avatar Server?

2 answers

1 accepted

0 votes
Answer accepted
James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 27, 2012

Hi Sebastien, redirecting Bamboo to use the Confluence Avatar Server isn't possible as we have hard coded gravatar.com in the code and we are unlikely to make this configurable anytime soon.

Sebastien Erard June 21, 2012

There is a ticket about this one: https://jira.atlassian.com/browse/BAM-8451

1 vote
Justin Shapiro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 21, 2012

Vote for that issue! https://jira.atlassian.com/browse/BAM-8451

The workaround is to implement GravatarService yourself. Change GRAVATAR_URL to your server:

private static String GRAVATAR_URL = "https://yourserver/confluence/rest/cas/1.0/avatar/server/";

Compile and install into:

<bambooinstall>webapp/WEB-INF/classes/com/atlassian/bamboo/user/gravatar

problem with this approach is that you need to do it each time you upgrade.

EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 20, 2012

Can you expand that a bit Justin?

I created a GravatarServiceImpl that implements the interface, using my own server, but after placing the compiled class in the directory yuo mention (which i had to create) it blows up!

I used the source downloaded from my.atlassian and changed the variable for server_URL only... not sure why it doesnt have the requred method.

2012-08-21 14:07:05,520 ERROR [http-8085-16] [FiveOhOh] 500 Exception was thrown.
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NoSuchMethodError: com.atlassian.bamboo.user.gravatar.GravatarServiceImpl.access$000(Lcom/atlassian/bamboo/user/gravatar/GravatarServiceImpl;)Lcom/atlassian/bamboo/configuration/AdministrationConfigurationManager;
      
       ....
Caused by: java.lang.NoSuchMethodError: com.atlassian.bamboo.user.gravatar.GravatarServiceImpl.access$000(Lcom/atlassian/bamboo/user/gravatar/GravatarServiceImpl;)Lcom/atlassian/bamboo/configuration/AdministrationConfigurationManager;
        
        ... 201 more

Justin Shapiro
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

I pretty much did the same thing. You would do this in the unpacked war under your java container (?tomcat?). The classes in the classes direcectory are loaded before those in the lib directory which is why yours should get picked up first. I didn't have the code in front of me when I posted that but it would seem I also added:

public void setGravatarUrl(String gravatarUrl) { this.GRAVATAR_URL = gravatarUrl; }

Also I have done this in 3.1.1 and 3.4.4 YMMV

EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

Hmm, maybe it is a change in the AdministrationConfigurationManager.

It uses a lazyreference that seems to be bombing out. I am trying a hard coded boolean for the enabled variable.

EddieW
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 21, 2012

Yes! That was my trouble. The Atlassian provided class used a lazyreference for the boolean as to whether gravatar was enabled or not. ANd (for whatver reason) it blew up trying to access the adminstrationConfigurationManagement property for the actual value.

So I just hard coded a true (if I am deploying a custom class obvuiously I want the service enabled), and added soem explicit logging to alude to that.


So whenever you try to enable/disable the option you get:

2012-08-21 16:26:16,243 WARN [http-8085-3] [GravatarServiceImpl] A custom GravatarService class is in the WEB-INF/classes/com/atlassian/bamboo/user/gravatar directory, and will ignore the admin setting.

2012-08-21 16:26:16,243 WARN [http-8085-3] [GravatarServiceImpl] Gravatar URL : https://myserver/wiki/rest/cas/1.0/avatar/server/

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events