https://github.com/holgerhuo/mravatar
Mastodonwide Recognized Avatars
https://github.com/holgerhuo/mravatar
api avatar flask gravatar mastodon uswgi
Last synced: 5 months ago
JSON representation
Mastodonwide Recognized Avatars
- Host: GitHub
- URL: https://github.com/holgerhuo/mravatar
- Owner: HolgerHuo
- License: agpl-3.0
- Created: 2021-12-18T10:18:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-29T06:26:00.000Z (5 months ago)
- Last Synced: 2025-04-29T06:26:30.752Z (5 months ago)
- Topics: api, avatar, flask, gravatar, mastodon, uswgi
- Language: Python
- Homepage: https://mravatar.dragoncloud.win/
- Size: 31.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mravatar - Mastodonwide Recognized Avatars

A Mastodonwide Recognized Avatar API
This API provides you with avatar link or proxied avatar file through fediverse account name (@username@localpart).
## API Usages
### /avatar/\ (GET)
```
https://mravatar.dragoncloud.win/avatar/@holgerhuo@dragon-fly.club
https://mravatar.dragoncloud.win/avatar/holgerhuo@dragon-fly.club
````GET` request [https://mravatar.dragoncloud.win/avatar/@holgerhuo@dragon-fly.club](https://mravatar.dragoncloud.win/avatar/@holgerhuo@dragon-fly.club) or [https://mravatar.dragoncloud.win/avatar/holgerhuo@dragon-fly.club](https://mravatar.dragoncloud.win/avatar/holgerhuo@dragon-fly.club)
#### Query Strings
- `proxied`
- `true`
Enable proxying from Mravatar
- `false` (default)
Retrieve `302` redirect
- `no-cache`
- `true`
Force request latest avartar
- `false`
Use Mravatar cache (if exists). Cache is refreshed every 3h.
- `default`
- ``
Set fallback image url.
(Defaults to https://cdn.jsdelivr.net/gh/mastodon/mastodon@latest/public/avatars/original/missing.png)Example: `https://mravatar.dragoncloud.win/avatar/holgerhuo@dragon-fly.club?no-cache=true&proxied=true&default=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2F4%2F48%2FMastodon_Logotype_%2528Simple%2529.svg`
## Deployment
### Dependencies
Make sure you have `python3`, `pip3`, `python3-devel` and `virtualenv` installed.
### Procedures
Create a new user. Clone this repo. Setup virtualenv. Copy dist files. Start your server. Enjoy!
```bash
pip3 install virtualenv
useradd mravatar
sudo su - mravatar
git clone https://github.com/HolgerHuo/mravatar.git mravatar
cd mravatar
virtualenv mravatar
source mravatar/bin/activate
pip3 install -r requirement.txt
exit
cp /home/mravatar/mravatar/dist/mravatar.service /etc/systemd/system/mravatar.service
cp /home/mravatar/mravatar/dist/mravatar.conf /etc/nginx/conf.d/mravatar.conf
systemctl enable --now mravatar
systemctl reload nginx
```## License
GNU Affero General Public License v3.0
©️ Holger Huo, Mastodon
[@holgerhuo@dragon-fly.club](https://mast.dragon-fly.club/@holgerhuo)