Commit Graph

341 Commits (50b7ea810e12b420ac72303d0b0938ea2d644f08)

Author SHA1 Message Date
Claire 81caafbe84
Fix performances of profile directory ()
Claire cddef4c485
Fix language settings for users having selected the `kmr` language ()
Claire 16681e0f20
Add admin notifications for new Mastodon versions ()
Claire ee702e36e5
Change follow recommendation materialized view to be faster in most cases ()
Co-authored-by: Renaud Chaput <renchap@gmail.com>
Claire 90ec88d58b
Add support for `indexable` attribute on remote actors ()
Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
Claire 8c7f3c5332
Remove old non-unique index on preview_cards statuses join table ()
Christian Schmidt 8da99ffb0d
Add alt text for preview card thumbnails ()
Claire 6b896b20cc
Add primary key to preview_cards_statuses join table (includes deduplication migration) ()
Eugen Rochko 7bd8ef355c
Add `published_at` attribute to preview cards ()
Matt Jankowski ce43ed144c
Rails 7.0 update ()
Claire e6a8faae81
Add users index on unconfirmed_email ()
Claire 933ba1a3eb
Add superapp index on `oauth_applications` ()
Eugen Rochko ba06a2f104
Revert "Rails 7 update" ()
Matt Jankowski 50c2a03695
Rails 7 update ()
Matt Jankowski c47cdf6e17
Add index to backups on `user_id` column ()
Eugen Rochko 4c9406bdb0
Add time zone preference ()
Claire f378f10404
Fix compatibility of recent migration with PostgreSQL 10 ()
Eugen Rochko 4eda233e09
Add webhook templating ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Darius Kazemi bacb674921
Add exclusive lists ()
Co-authored-by: Liam Cooke <liam@liamcooke.com>
Co-authored-by: John Holdun <john@johnholdun.com>
Co-authored-by: Effy Elden <effy@effy.space>
Co-authored-by: Lina Reyne <git@lina.pizza>
Co-authored-by: Lina <20880695+necropolina@users.noreply.github.com>
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Claire fe84f7e323
Add missing primary keys to `accounts_tags` and `statuses_tags` ()
Claire 1d588d58f1
Improve various queries against account domains ()
Claire 6693a4fe7c
Change lists to be able to include accounts with pending follow requests ()
Claire 32a030dd74
Rewrite import feature ()
Eugen Rochko a9b5598c97
Change user settings to be stored in a more optimal way ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Claire 66a70ebb6e
Fix pre-4.0 admin action logs ()
* Fix BackfillAdminActionLogs post-deployment migration

* Improve migration tests

* Backfill admin action logs again
Eugen Rochko b1a219552e
Fix featured tags not saving preferred casing ()
Claire 1dca08b76f
Fix admin action logs page ()
* Add tests

* Fix crash when trying to display orphaned action logs

* Add migration for older admin action logs
Eugen Rochko 487d81fb92
Fix IP blocks not having a unique index ()
Takeshi Umeda 53e86747e4
Fix duplicate featured tags ()
* Fix duplicate featured tags

* Add unique tag name validator

* Fix error message
Eugen Rochko b04633a961
Add image processing and generate blurhash for server thumbnail ()
Remove separate server hero setting
Eugen Rochko 45ebdb72ca
Add support for language preferences for trending statuses and links ()
Eugen Rochko 50948b46aa
Add ability to filter followed accounts' posts by language ()
Eugen Rochko c556c3a0d1
Add admin API for managing canonical e-mail blocks ()
Eugen Rochko 0396acf39e
Add audit log entries for user roles ()
* Refactor audit log schema

* Add audit log entries for user roles
Claire 50487db122
Add ability to filter individual posts ()
* Add database table for status-specific filters

* Add REST endpoints, entities and attributes

* Show status filters in /filters interface

* Perform server-side filtering for individual posts filters

* Fix filtering on context mismatch

* Refactor `toServerSideType` by moving it to its own module

* Move loupe and delete icons to their own module

* Add ability to filter individual posts from WebUI

* Replace keyword list by warnings (expired, context mismatch)

* Refactor server-side filtering code

* Add tests
Eugen Rochko c3f0621a59
Add ability to follow hashtags ()
Eugen Rochko e7aa2be828
Change how hashtags are normalized ()
* Change how hashtags are normalized

* Fix tests
Eugen Rochko 44b2ee3485
Add customizable user roles ()
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
Claire 02851848e9
Revamp post filtering system ()
* Add model for custom filter keywords

* Use CustomFilterKeyword internally

Does not change the API

* Fix /filters/edit and /filters/new

* Add migration tests

* Remove whole_word column from custom_filters (covered by custom_filter_keywords)

* Redesign /filters

Instead of a list, present a card that displays more information and handles
multiple keywords per filter.

* Redesign /filters/new and /filters/edit to add and remove keywords

This adds a new gem dependency: cocoon, as well as a npm dependency:
cocoon-js-vanilla. Those are used to easily populate and remove form fields
from the user interface when manipulating multiple keyword filters at once.

* Add /api/v2/filters to edit filter with multiple keywords

Entities:
- `Filter`: `id`, `title`, `filter_action` (either `hide` or `warn`), `context`
  `keywords`
- `FilterKeyword`: `id`, `keyword`, `whole_word`

API endpoits:
- `GET /api/v2/filters` to list filters (including keywords)
- `POST /api/v2/filters` to create a new filter
  `keywords_attributes` can also be passed to create keywords in one request
- `GET /api/v2/filters/:id` to read a particular filter
- `PUT /api/v2/filters/:id` to update a new filter
  `keywords_attributes` can also be passed to edit, delete or add keywords in
   one request
- `DELETE /api/v2/filters/:id` to delete a particular filter
- `GET /api/v2/filters/:id/keywords` to list keywords for a filter
- `POST /api/v2/filters/:filter_id/keywords/:id` to add a new keyword to a
   filter
- `GET /api/v2/filter_keywords/:id` to read a particular keyword
- `PUT /api/v2/filter_keywords/:id` to edit a particular keyword
- `DELETE /api/v2/filter_keywords/:id` to delete a particular keyword

* Change from `irreversible` boolean to `action` enum

* Remove irrelevent `irreversible_must_be_within_context` check

* Fix /filters/new and /filters/edit with update for filter_action

* Fix Rubocop/Codeclimate complaining about task names

* Refactor FeedManager#phrase_filtered?

This moves regexp building and filter caching to the `CustomFilter` class.

This does not change the functional behavior yet, but this changes how the
cache is built, doing per-custom_filter regexps so that filters can be matched
independently, while still offering caching.

* Perform server-side filtering and output result in REST API

* Fix numerous filters_changed events being sent when editing multiple keywords at once

* Add some tests

* Use the new API in the WebUI

- use client-side logic for filters we have fetched rules for.
  This is so that filter changes can be retroactively applied without
  reloading the UI.
- use server-side logic for filters we haven't fetched rules for yet
  (e.g. network error, or initial timeline loading)

* Minor optimizations and refactoring

* Perform server-side filtering on the streaming server

* Change the wording of filter action labels

* Fix issues pointed out by linter

* Change design of “Show anyway” link in accordence to review comments

* Drop “irreversible” filtering behavior

* Move /api/v2/filter_keywords to /api/v1/filters/keywords

* Rename `filter_results` attribute to `filtered`

* Rename REST::LegacyFilterSerializer to REST::V1::FilterSerializer

* Fix systemChannelId value in streaming server

* Simplify code by removing client-side filtering code

The simplifcation comes at a cost though: filters aren't retroactively
applied anymore.
Eugen Rochko a2871cd747
Add administrative webhooks ()
* Add administrative webhooks

* Fix error when webhook is deleted before delivery worker runs
Claire e34dd3644c
Remove unused `filtered_languages` column ()
* Remove unused `filtered_languages` column

Fixes 

* Fix tests
Eugen Rochko f6d35ed57d
Remove IP matching from e-mail domain blocks ()
Clear out e-mail domain blocks created from automatically resolved DNS records
Claire 9b4024a389
Add some missing indexes on foreign keys ()
Claire b07906bdb0
Fix wrong language code for Kurdish languages ()
Eugen Rochko 75e33fd08f
Fix null values being included in some indexes ()
* Fix null values being included in some indexes

* Update lib/mastodon/migration_helpers.rb

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Add documentation link to corruption error message

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Claire 07a178fd37
Fix existing boosts possibly referencing deleted toots ()
Follow-up to 
Eugen Rochko d17fb70131
Change how changes to media attachments are stored for edits ()
* Change how changes to media attachments are stored for edits

Fix not being able to re-order media attachments

* Fix not broadcasting updates when polls/media is changed through ActivityPub

* Various fixes and improvements

* Update app/models/report.rb

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

* Add tracking of media attachment description changes

* Change poll in status edit to have a structure closer to the real one

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Eugen Rochko 318d34d528
Fix data integrity of featured tags ()
Eugen Rochko edf09ec747
Add `/api/v1/accounts/familiar_followers` to REST API ()
* Add `/api/v1/accounts/familiar_followers` to REST API

* Change hide network preference to be stored consistently for local and remote accounts

* Add dummy classes to migration

* Apply suggestions from code review

Co-authored-by: Claire <claire.github-309c@sitedethib.com>

Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Eugen Rochko 50ea54b3ed
Change authorized applications page ()
* Change authorized applications page

* Hide revoke button for superapps and suspended accounts

* Clean up db/schema.rb