|data||2012-08-17||Christian Weiske||[bbeb68] explain configuration options|
|raw||2012-08-16||Christian Weiske||[8f4291] initial working image resizer|
|res||2012-08-17||Christian Weiske||[314a7c] copy www files over when they do not exist|
|www||2012-08-17||Christian Weiske||[fc412b] do not generate double headers|
|.gitignore||2012-08-17||Christian Weiske||[4b589c] phing build file to create and deploy releases|
|ChangeLog||2012-08-27||Christian Weiske||[b4af33] add support for OpenID, prepare 0.2.0|
|LICENSE||2012-08-17||Christian Weiske||[c86341] add license file, docblocks and update readme|
|README.rst||2012-08-27||Christian Weiske||[b4af33] add support for OpenID, prepare 0.2.0|
|build.properties.dist||2012-08-17||Christian Weiske||[4b589c] phing build file to create and deploy releases|
|build.xml||2012-08-27||Christian Weiske||[b4af33] add support for OpenID, prepare 0.2.0|
|surrogator.php||2012-08-27||Christian Weiske||[b4af33] add support for OpenID, prepare 0.2.0|
Simple open source Libravatar compatible avatar image server written in PHP.
Copy data/surrogator.config.php.dist to data/surrogator.config.php (remove the .dist)
Adjust the config file to your needs
(optional) Create a default image and put it into the raw folder, name it default.png
Setup your web server and set the document root to the www/ directory. Make sure you allow the .htaccess file and have mod_rewrite activated.
Add DNS entries for _avatars._tcp and _avatars-sec._tcp. A bind config file excerpt would look like this:
_avatars._tcp.example.org. IN SRV 0 0 80 avatars.example.org _avatars-sec._tcp.example.org. IN SRV 0 0 443 avatars.example.org
This makes the avatar server avatars.example.org responsible for the domain example.org, on ports 80 (HTTP) and 443 (HTTPS).
It is possible to use an existing domain as avatar server. Just copy avatar.php into its document root dir and copy the rewrite rule from .htaccess into the domain's .htaccess file if one exists. If not, copy the whole .htaccess file. After that, you have to point the $cfgFile path at the beginning of the avatar.php file to the correct location.
Put images in raw/ folder. Name has to be email address + image file extension, for example email@example.com. Surrogator supports .png and .jpg.
For OpenIDs, use the url-encoded URL + extension as filename, for example replace / with %2F. The filename for http://example.org/~foo would be http:%2F%2Fexample.org%2F~foo.jpg.
Run php surrogator.php. The small files get generated.
You will get more information with -v
When you run surrogator.php again, it will only generate small files when the raw file is newer than the "square" file in the var folder. You can force the update with --force.
To check if everything is setup correctly, try the following tools:
Surrogator is licensed under the AGPL v3 or later.