Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Freeing the Cloud, One Service at a Time

Freeing the Cloud, One Service at a Time

This talk presents an approach to building free network services and introduces Libravatar, a Django-based project to provide a federated and Open Source alternative to the Gravatar profile image hosting service, a centralised web service used by a large number of social sites in the cloud.

Francois Marier

March 07, 2012
Tweet

More Decks by Francois Marier

Other Decks in Programming

Transcript

  1. ” “ Developers of network services are encouraged to: •

    Use the GNU Affero GPL, a license designed specifically for network service software, to ensure that users of services have the ability to examine the source or implement their own service. • Develop freely-licensed alternatives to existing popular but non-Free network services. • Develop software that can replace centralized services and data storage with distributed software and data deployment, giving control back to users. Franklin Street Statement, 14 July 2008
  2. 101

  3. Apache (mod_rewrite) Django static files on disk avatars sent to

    third parties photos uploaded or imported by users
  4. Apache (mod_rewrite) Django static files on disk avatars sent to

    third parties photos uploaded or imported by users high traffic (static) low traffic (dynamic)
  5. Apache (mod_rewrite) Django static files on disk avatars sent to

    third parties photos uploaded or imported by users
  6. Apache (mod_rewrite) Django static files on disk avatars sent to

    third parties photos uploaded or imported by users Crop, resize and optimise Gearman Queue
  7. Apache (mod_rewrite) Django static files on disk avatars sent to

    third parties photos uploaded or imported by users Crop, resize and optimise Gearman Queue
  8. Apache (mod_rewrite) Django static files on disk avatars sent to

    third parties photos uploaded or imported by users Crop, resize and optimise Gearman Queue Apache (mod_rewrite) static files on disk avatars sent to third parties Apache (mod_rewrite) static files on disk avatars sent to third parties
  9. --- a/IkiWiki/Plugin/comments.pm +++ b/IkiWiki/Plugin/comments.pm @@ -187,6 +188,16 @@ sub preprocess

    { $commentauthor = $commentuser; } + + eval 'use Libravatar::URL'; + + if (! $@) { + my $email = IkiWiki::userinfo_get($commentuser, 'email'); + + if (defined $email) { + $commentauthoravatar = libravatar_url(email => $email); + } + } } else { if (defined $params{ip}) { --- a/templates/comment.tmpl +++ b/templates/comment.tmpl @@ -1,6 +1,10 @@ <TMPL_IF HTML5><article class="comment" id="<TMPL_VAR COMMENTID>"> <TMPL_ELSE><div class="comment" id="<TMPL_VAR COMMENTID>"></TMPL_IF> +<TMPL_IF COMMENTAUTHORAVATAR><div class="comment-avatar"> +<img src="<TMPL_VAR COMMENTAUTHORAVATAR>" alt="" /> +</div></TMPL_IF> + <TMPL_IF HTML5><header class="comment-subject"> <TMPL_ELSE><div class="comment-subject"></TMPL_IF> <TMPL_IF PERMALINK>
  10. --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -675,6 +678,9 @@ YAHOO.util.Event.onContentReady("furtherm", function

    () { [% ELSE %] <div class="commentline"> [% IF ( ShowReviewer ) %] + [% IF ( review.avatarurl ) %] + <img class="avatar" src="[% review.avatarurl %]" height="80" width="80"/> + [% END %] <h5> Comment by [% review.title %] --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -295,6 +295,13 @@ $template->param( ocoins => GetCOinSBiblio($biblionumber), ); +my $libravatar_available = 0; +eval 'use Libravatar::URL'; +if (! $@) { + $libravatar_available = 1; +} my $reviews = getreviews( $biblionumber, 1 ); my $loggedincommenter; @@ -303,6 +310,9 @@ foreach ( @$reviews ) { $_->{title} = $borrowerData->{'title'}; $_->{surname} = $borrowerData->{'surname'}; $_->{firstname} = $borrowerData->{'firstname'}; + if ($libravatar_available and $borrowerData->{'email'}) { + $_->{avatarurl} = libravatar_url(email => $borrowerData->{'email'}); + } $_->{userid} = $borrowerData->{'userid'}; $_->{cardnumber} = $borrowerData->{'cardnumber'};
  11. Get involved! • write a plugin • host a mirror

    www.libravatar.org launchpad.net/libravatar libravatar.onlinegroups.net #libravatar on chat.freenode.net
  12. Get involved! • write a plugin • host a mirror

    • translate the UI www.libravatar.org launchpad.net/libravatar libravatar.onlinegroups.net #libravatar on chat.freenode.net
  13. Get involved! • write a plugin • host a mirror

    • translate the UI • create an account today! www.libravatar.org launchpad.net/libravatar libravatar.onlinegroups.net #libravatar on chat.freenode.net
  14. Photo credits Storm clouds: http://www.flickr.com/photos/johnson7/1460568819/ Linen texture: http://www.flickr.com/photos/zooboing/4715048673/ Name tag:

    http://www.flickr.com/photos/stevegarfield/833593377/ Cloud sign: http://www.flickr.com/photos/jamescridland/4122948535/ Facebook data center: http://www.flickr.com/photos/traftery/5596941479/ First web server: http://www.flickr.com/photos/scobleizer/2251820987/ Bradley Kuhn: https://secure.wikimedia.org/wikipedia/en/wiki/File:Bkuhn-2008-08-20.jpg Benjamin Mako Hill: http://www.flickr.com/photos/soulfish/2374876735 Mike Linksvayer: http://www.flickr.com/photos/joi/2595169497/ Luis Villa: http://tieguy.org/pics/Wedding/Honeymoon/Highlights/New-Zealand/img_2145 Henri Poole: http://www.flickr.com/photos/weblogsky/9271675/ Evan Prodromou: http://www.flickr.com/photos/christopheducamp/4469158609/ Jonathan Gray: http://www.flickr.com/photos/jwyg/4497000847/ Aaron Swartz: http://www.flickr.com/photos/creativecommons/3111021669/ Evan Prodromou presenting: http://www.flickr.com/photos/walkah/4831658754 Copyright © 2011 François Marier Released under the terms of the Creative Commons Attribution Share Alike 3.0 Unported Licence