Crafatar
A blazing fast API for Minecraft faces
Install / Use
/learn @crafatar/CrafatarREADME
Crafatar
<img alt="logo" src="lib/public/logo.png" align="right" width="128px" height="128px"><a href="https://crafatar.com">Crafatar</a> serves Minecraft avatars based on the skin for use in external applications. Inspired by <a href="https://gravatar.com">Gravatar</a> (hence the name) and <a href="https://minotar.net">Minotar</a>.
Image manipulation is done by lwip. 3D renders are created with node-canvas / cairo.
Contributions welcome!
There are usually a few open issues.
We welcome any opinions or advice in discussions as well as pull requests.
Issues tagged with
show where we could especially need your help!
Examples
| | | | |
| :---: | :---: | :---: | :---: |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Usage / Documentation
Please visit the website for details.
Contact
Installation
Docker
docker network create crafatar
docker run --net crafatar -d --name redis redis
docker run --net crafatar -v crafatar-images:/home/app/crafatar/images -e REDIS_URL=redis://redis -p 3000:3000 crafatar/crafatar
Manual
- Install nodejs 12 (LTS)
- Install
redis-server - Run
npm install
If that fails, it's likely because because ofnode-canvasdependencies. Follow this guide to install them. - Run
npm start
Crafatar is now available at http://0.0.0.0:3000.
Configration / Environment variables
See the config.js file.
Operational notes
inodes
Crafatar stores a lot of images on disk. For avatars, these are 8×8 px PNG images with an average file size of ~90 bytes. This can lead to issues on file systems such as ext4, which (by default) has a bytes-per-inode ratio of 16Kb. With thousands of files with an average file size below this ratio, you will run out of available inodes before running out of disk space. (Note that this will still be reported as ENOSPC: no space left on device).
Consider using a different file system, changing the inode ratio, or deleting files before the inode limit is reached.
disk space and memory usage
Eventually you will run out of disk space and/or redis will be out of memory. Make sure to delete image files and/or flush redis before this happens.
Tests
npm test
If you want to debug failing tests:
# show logs during tests
env VERBOSE_TEST=true npm test
It can be helpful to monitor redis commands to debug caching errors:
redis-cli monitor
Related Skills
gh-issues
348.5kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
node-connect
348.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
oracle
348.5kBest practices for using the oracle CLI (prompt + file bundling, engines, sessions, and file attachment patterns).
taskflow-inbox-triage
348.5kname: taskflow-inbox-triage description: Example TaskFlow authoring pattern for inbox triage. Use when messages need different treatment based on intent, with some routes notifying immediately, some w
