A gravatar proxy for your intranet
git clone git://github.com/andreineculau/gravatar-proxy.git
cd gravatar-proxy
npm install
# edit config.coffee as you see fit
npm startHere's what you can configure out-of-the-box: config.coffee.
In production, try
Accessing a gravatar is done via GET /<hash_for_user@example.com>.
In order to make an email (its hash) known, just POST /?email=user@example.com.
If you want to create aliases, just PUT /<hash_for_user@foo.com>?email=user@example.com
By default, gravatar-proxy will, well.. proxy requests straight to gravatar.com .
A common setup is that you have some server that hosts the avatars and you just want a proxy to tie up the MD5 hashes to the usernames, and maybe also restrict the email addresses to those that are known to your group.
You can see an example in getAvatar.redirect.coffee,
assuming that your config.coffee looks like this
getAvatar: require './getAvatar.redirect'
allowUnknownHashes: falseIn addition to the previous setup, you might want to resize the avatars based on
req.query.s(ize) or implement support for req.query.d(efault).
You can see an example in getAvatar.storeAndResize.coffee,
assuming that your config.coffee looks like this
getAvatar: require './getAvatar.storeAndResize'
allowUnknownHashes: trueand you have executed
npm install request lwip
mkdir cacheNOTE: this setup has allowUnknownHashes: true because
getAvatar.storeAndResize.coffee handles unknown hashes on its own.
