Configure Gravatar Server

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

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.

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.

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

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

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.

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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published 5 hours ago in Confluence

Three common content challenges + how to manage them

An efficient enterprise content management system, or ECM, is a must-have for companies that create work online (cough   cough, all companies). If content calendars, marketing plans, and bu...

18 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you