ttree / identicons
Neos Flow package to generate identicons, based on Github or DonPark styles.
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 4
Forks: 3
Open Issues: 0
Type:neos-package
Requires
- neos/flow: ^5.0
- neos/imagine: ^3.0
This package is auto-updated.
Last update: 2024-11-10 07:54:30 UTC
README
This contains the Flow Framework package "Ttree.Identicons" to generate Identicons. Currently only two generators are available: Don Park (original version) and Github Style (inspired by the space invader style identicons provided by github).
Installation
- Just install and activate the package
- Include the package subroutes in your main Routes.yaml (optional: if you use only the fluid ViewHelper)
- name: 'Identicons' uriPattern: 'i/<IdenticonsSubroutes>' subRoutes: IdenticonsSubroutes: package: Ttree.Identicons
If you change the `uriPattern`
, please read the section Flood Mitigation.
- Configure Imagine to use the
`Imagick`
drive. GD driver generate bad artifacts. - Go to www.yourdomain/i/[yourhash].png (replace [yourhash] by any string)
This package is available on Packagist.org: https://packagist.org/packages/ttree/identicons
Settings
Request Arguments
`s`
: The size of the image, between 32 and 2048 pixels, (default: 420px)`b`
: The background color (default: transparent)
Flood Mitigation
By default this package limit the request rate per minute (for a single IP address) to 30 requests. You can change this in Settings.yaml. The flood mitigation use the caching framework to store request rate statistics, please change the default FileBackend for a production use.
Important: When an IP address is blocked, for a maximum of 1 minute, the Application Firewall block the request early in the Flow bootstrap (when a request arrive at the MVC dispatcher). If you don't use the default URL www.domain/i/hash.png, you need to change the patternValue in Settings.yaml, in the Flow Application Firewall section.
Advanced access limitation
By default this package will generate an identicons for any hash, if you need to limit this, per ex. you need to generate identicon only for existing Party, you can implement the interface AccessValidationInterface and enable access validation in the settings.
You also need to change the default implementation for this interface in your Objects.yaml (check the Objects.yaml from this package for the syntax).
Fluid ViewHelpers
You can insert an identicon in your Fluid template by using the provided ImageViewHelper.
{namespace identicon=Ttree\Identicons\ViewHelpers} <identicon:image hash="ttree" alt="ttree -- identicon" size="42" class="img-polaroid" />
If the identicon doesn't exist for the provided hash, it will be created and persisted automatically.
Warning: Advanced Access Limitation and Flood Mitigation are not supported by the Fluid ViewHelper, you need to take care of your server by yourself.
Tips
You can write your own generator, just implement the GeneratorInterface and change the default implementation in your Objects.yaml (check the Objects.yaml from this package for the syntax).
Warning: if you change the Generator, currently you need to truncate the table "ttree_identicons_domain_model_identicon" manually.