IntegratedProfiles v0.8.0
Wonderfully sick so luckily there's nothing better I can do but a write-up on the latest release of IntegratedProfiles v0.8.0, released just a few hours ago (at the time of writing). You can download it on GitHub now!
New configurations in v0.8.0
- $wgIntegratedProfilesUploadBaseUrl
- $wgIntegratedProfilesCacheType
- $wgIntegratedProfilesGroupPriority
- $wgIntegratedProfilesEnableAnimatedBanners
- $wgIntegratedProfilesThumbnailers
- $wgIntegratedProfilesVipsCommand
- $wgIntegratedProfilesPurgeMediaUrls
These should all be pretty stable, but the extension is still in beta, so technically these are subject to breaking changes. I don't expect there to be any, but there may be.
MediaWiki 1.44
I tested both MediaWiki 1.43 and 1.44, and only 1.44 worked, so I knocked down the extension.json minimum version to v1.44, but I do not intend to support it. I would encourage using at least MediaWiki 1.45, as MediaWiki 1.44 may break at any time.
Configurable group priority
This was mostly thrown in as an extra way of customization when I was redesigning the group chips to always fit within one row by default. Usually, the first 3 groups will be shown by default, so fit any important groups in the first three. By default:
$wgIntegratedProfilesGroupPriority = [ "sysop", "bureaucrat", "interface-admin", "checkuser", "oversight", "steward" ];And anything else just goes to the end in alphabetical order. Personally, my configuration would be:
$wgIntegratedProfilesGroupPriority = [ "bot", "steward", "bureaucrat", "sysop", "interface-admin" ];Anyway, with this comes better UI:
Rather than trying to squeeze every group chip in (and subsequently wrapping into multiple rows), groups that don't fit are now hidden behind a toggle (+N), so it doesn't look awkward. Therefore, you can assign as many groups as you want without it looking awful. On my dev wiki, my TestUser account has seven user groups, which used to cause the layout to break, and it doesn't anymore!
This affects other skins a lot more than Citizen. Speaking of other skins, I also focused on improving the experience on other skins in this update too, so it should look a lot nicer. Citizen still remains the best skin to user IP on, but now, the experience is optimized for both! I would also love to explore some other skins with specific/custom areas of implementation just like Citizen's toolbar.
Rights & Permissions overhaul
Permissions are changing to allow for more fine-grained powers to be assigned to users. For one, you can now disable/restrict uploading avatars and banners (individually), as well as provide moderators with the ability to delete/remove profile items (avatars, banners, fields, etc.) without being able to replace them. These type of actions are now also logged in Special:Log/integratedprofiles, rather than being completely invisible.
Additionally, you can now assign permissions to upload animated avatars/banners individually too, as well as assigning the ability to few private profiles without being able to manage/moderate them. This does not include suppressed users, only users that choicefully hid their own profiles.
// ..."GroupPermissions": { "user": { "integratedprofiles-upload-avatar": true, "integratedprofiles-upload-banner": true }, "sysop": { "integratedprofiles-manage": true, "integratedprofiles-view-private": true, "integratedprofiles-remove": true, "integratedprofiles-animated-avatar": true, "integratedprofiles-animated-banner": true }},// ...If a user whom uploaded a banner or an avatar has that permission/right taken away, they can always remove their own banner/avatar whenever they want, regardless of permission.
The default avatar SVG is now square
So now you can enforce square avatars without the default avatar looking round and odd. Fun fact, originally I made the default avatar silhouette very wide. That did not end up being used, but it was titled fatchud.svg. The next attempt, the one that ended up being used, had normal proportions, and is called chud.svg. This new one is now called squarechud.svg. Do with that what you will.
Sanitization
A little underwhelming but avatars and banners are now correctly sanitized on upload. All EXIF data (minus orientation data) is stripped from photos that have it, reducing storage (in some cases) and preventing people from sharing information they probably didn't intend to through a PFP on a wiki. Granted, this is probably very rare, but worth having anyway!
Farm cache improvements
Caches are purged when a user changes an important detail of their profile (e.g., visibility). This isn't perfect by any means and will likely need to be improved in the future, but it does count as an improvement! It also ties into another new feature...
Thumbnailing
Originally one of the largest drawbacks of using IntegratedProfiles was that it stored and served the full-resolution original that the user uploaded. For me, on my development wiki, this meant a 7.2 MB GIF loaded on every page in the header (albiet cached). While this worked for small-scale projects, it doesn't really make sense if you want a large amount of profiles showcased on one page. It's also terribly inefficient and wastes egress and initial load times.
So, in this version (v0.8.0), IntegratedProfiles now has automatic thumbnailing! This makes pages load faster and stops wasting resources on extra detail that won't be noticed. It also works on animated GIF avatars, like mine, and dropped the header image down from a 7.2 MB GIF to a 33 KB animated WebP, much better!
Thumbnails come in five sizes for avatars: 32px, 64px, 128px, 256px, and 512px And three for banners: 640px, 1280px, and 1920px
Although, not all uploads are large enough to reach the highest size. In that case, the highest available size will be returned instead. Retrieving specific sizes is also available through the API, and fetching an avatar without specifying a size will eventually return a thumbnail instead of the original upload, like it does now.
This does not mean you should limit access to the originals. I still intend to keep them obtainable via the API, as I believe it is better for exporting.
If you are updating to v0.8.0 before this update, you will get a lot of benefit from the migration/backfill maintenance script. You can run it like so, and it should figure itself out:
php maintenance/run.php IntegratedProfiles:GenerateThumbnailsThere's also more options available:
php maintenance/run.php IntegratedProfiles:GenerateThumbnails [--type=avatar|banner|all] [--owner=ID] [--start=ID] [--force] [--dry-run] [--no-purge] [--purge-batch=N] [--sleep=MS]If you get an error during this, it's likely because of the way your storage is configured. You will need to list the new thumbnail containers in the FileBackend configuration. It is unlikely you will need to do this unless you are running a farm.
$wgFileBackends[] = [ 'name' => 'ip-shared', 'class' => \Wikimedia\FileBackend\FSFileBackend::class, 'domainId' => 'ip-farm', // must be identical on every wiki 'lockManager' => 'nullLockManager', 'containerPaths' => [ 'ipavatars' => $IP . '/images/ipavatars', 'ipbanners' => $IP . '/images/ipbanners', 'ipavatars-thumbs' => $IP . '/images/ipavatars-thumbs', 'ipbanners-thumbs' => $IP . '/images/ipbanners-thumbs', ], 'fileMode' => 0644,];I would recommend installing libvips, as it works the best here. Although, ImageMagick (imagick) will still work just fine. GD doesn't support animations. Also, thank you to Alistair3149, because I used some of his implementation from Thumbro to pull this off.
Moderation integrations
There's a new hook similar to core's UploadVerifyUpload hook, which allows extensions to intercept, scan, and reject inappropriate images based on their own code and criteria. This will make automatic moderation easier within IP, as previously there was no way to intercept an upload. Keep in mind that the user will have to wait. Example:
public function onIntegratedProfilesVerifyImageUpload( string $kind, string $path, string $mime, int $central_id, ?UserIdentity $user, &$error ) { return false; // intercept and reject the upload}Returning nothing will allow the upload to passthrough.
This is already being used in an extension I am working on to automatically scan all uploads/images for bad-faith content. This was harder than I was hoping it would be, but I hope to share more eventually, still!
Misc
Aside from those, there were:
- Bug fixes
- Better farm support ($wgIntegratedProfilesUploadBaseUrl, this turned out to be needed for https://test.obby.wiki)
- Configurable cache types
- Rate limits
That's it! Happy Halloween!
Related
IntegratedProfiles v0.7.02 new features and some housekeeping.
IntegratedProfiles v0.6.0Major performance improvements!
IntegratedProfiles v0.5.0Small features and large refinements!
IntegratedProfiles v0.4.0Large feature release with no breaking changes and important fixes, as well as MediaWiki 1.45 support.