GithubHelp home page GithubHelp logo

libravatar.cgi's Introduction

Libravatar.cgi

Small Libravatar implementation in C.

Warning: This software is not compatible with rust zealots.

Contents

  1. Synopsis
  2. Install
  3. Tests
  4. Contributing
  5. License

Synopsis

libravatar.cgi is an open source CGI written in C implementing the Libravatar protocol. Its goal is to be minimal, secure and BCHS.

This implementation only serves existing avatars in the PNG format located in /var/www/htdocs/avatars and does not provide any way to upload a file. This should be the responsability of a separate system.

To request an avatar the following steps should be done :

  • Create a hash of a lowercased email address using md5 or sha256 ;
  • Call the CGI with a HTTP request on the path /avatar/$hash.

A few options are accepted as GET parameters :

  • size: control the size of the image, must be between 1 and 512 with a default value of 80 ;
  • default: 404, mm and blank are supported ;
  • rating: only kept for compatibility with Gravatar this option does nothing ;
  • forcedefault: y or n.

The current version is only tested on OpenBSD but builds without errors on FreeBSD and Alpine.

Install

Requires

  • C compiler ;
  • kcgi ;
  • libpng.

For testing

  • curl ;
  • sharness ;
  • pnginfo (optional).

Build

Configure your http server of choice to receive this CGI. An example and minimalistic configuration file is provided in the config/ folder for OpenBSD httpd(8).

# mkdir /var/www/htdocs/avatars/
# cp config/default.png /var/www/htdocs/avatars/
$ ./configure
$ make
# make install

Tests

Regression tests are provided in the regress/ folder. They test this implementation and two others: the old Libravatar from Francois Marier and ivatar from Oliver Falk.

Contributing

Either send send GitHub pull requests or send patches on SourceHut.

License

All sources use the ISC license excepts oil_libpng.{c,h}, and oil_resample.{c,h} which use the MIT license. These files are sourced from the liboil project.

libravatar.cgi's People

Contributors

clime avatar perlun avatar tleguern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

clime perlun

libravatar.cgi's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.