Add GitHub alike identicons

This commit is contained in:
2022-01-12 15:32:31 +01:00
parent dac6aa1d8b
commit c93c9a58af
5 changed files with 200 additions and 40 deletions

View File

@ -13,21 +13,19 @@ curl http://localhost:8000/avatar/23463b99b62a72f26ed677cc556c44e8?s=100&c=v2
Instead of requesting identicons for MD5 hashes of usernames or mail addresses, it is possible to use plain username and mail address. The will result in the same generated identicon.
Use request query parameter `s` to request images with specified size. Default value is 80px. The size is limited to a maximum value of 512px.
Query parameter `c` will set color scheme. Available values are `v1` and `v2`.
=== Server settings
Query parameter `c` will set color scheme. Available values are `v1`, `v2` and `gh`.
The latter resembles the color scheme used by GitHub.
You can use `COLORSCHEME` in environment to define the default color scheme to be used. Fallback value will be `v2`.
The request query parameter `d` can be used to request GitHub like patterns by setting the value to `github`.
== Development and local start
=== Configuration
A *Golang* setup is required for development. File `idicon.go` contains the source code. Type
Configuration is available by using environment variables.
....
$ go run
....
You can use `COLORSCHEME` to define the default color scheme to be used. Fallback value will be `v2`.
to run the application on port 8000.
The `PATTERN` environment variable is available to define GitHub like patterns as default by using `github`.
=== Docker build