Small utility providing user avatar pics in various sizes with good caching.
- install node.js and npm
- go to project folder and run
npm install
.bin/avatar <port>
(starts the server, port is optional)
Note: installation can be a bit tricky, since the required lib (node-canvas) depends on a lib call "cairo", which must be installed properly on the system. (See: https://github.com/LearnBoost/node-canvas#installation)
Query params:
t
- user name or email of the userh
- hash to identify the user (optional, if not set t is used)u
- url of possible user pic (optional)c
- force a color (optional)s
- preferred size of pic (optional, default is 150)
max-age
is set to7 days
etag
is the current date
endpoint: http://getcatchapp.com:8888/ cloudfront: http://d35va0jwnexy3a.cloudfront.net on: web.hojoki.com folder: /var/avatar user: bitbucket
Avatarservice is located at our Webserver (web.hojoki.com). Use the Startscript at:
/opt/hojoki/deploy/trunk/script/webserver/startAvatar.sh
It takes the Parameters start [num]
, stop
and status [num]
.
start [num]
: Startsnum
instances of avatar and installs iptables Rules to balance RR between them. Defaultnum
is 6stop
: Stops all Avatar Processes and deletes RR iptable Rulesstatus [num]
: Checks if the number of Avatarsevices and iptables Rules matchesnum
. On success it will do nothing; on failure it will restart all Avatarservices. Defaultnum
is 6
Timm has a cronjob running, which auto restarts the avatar process on the server using the status
option.