Commit graph

1236 commits

Author SHA1 Message Date
Takeshi Umeda
fd61882f1a Add synchronization of remote featured tags ()
* Add LIMIT of featured tag to instance API response

* Add featured_tags_collection_url to Account

* Add synchronization of remote featured tags

* Deliver update activity when updating featured tag

* Remove featured_tags_collection_url

* Revert "Add featured_tags_collection_url to Account"

This reverts commit cff349fc27b104ded2df6bb5665132dc24dab09c.

* Add hashtag sync from featured collections

* Fix tag name normalize

* Add target option to fetch featured collection

* Refactor fetch_featured_tags_collection_service

* Add LIMIT of featured tag to v1/instance API response
2022-10-20 09:15:52 +02:00
Eugen Rochko
ada6590031 Fix trending statuses returning more than one post by the same author () 2022-10-14 01:44:23 +02:00
Eugen Rochko
e376f33207 Change about page to be mounted in the web UI () 2022-10-13 14:42:37 +02:00
Eugen Rochko
dd1dc1743c Add image processing and generate blurhash for server thumbnail ()
Remove separate server hero setting
2022-10-13 11:29:19 +02:00
Yamagishi Kazutoshi
c6fb0a7555 Fix missing skip_review? () 2022-10-10 08:03:19 +02:00
Eugen Rochko
b24b85b63f Add support for language preferences for trending statuses and links () 2022-10-08 16:45:40 +02:00
Eugen Rochko
b1d0cb83eb Fix privacy policy being empty if custom setting exists but is empty () 2022-10-08 08:34:00 +02:00
Eugen Rochko
378e00b59c Change privacy policy to be rendered in web UI, add REST API ()
Source string no longer localized, Markdown instead of raw HTML
2022-10-08 06:01:11 +02:00
Eugen Rochko
ce7d058a91 Remove setting that disables account deletes () 2022-10-06 10:16:47 +02:00
Eugen Rochko
85a10f182e Change public timelines to be filtered by current locale by default ()
In the absence of an opt-in to multiple specific languages in the
preferences, it makes more sense to filter by the user's presumed
language only (interface language or `lang` override)
2022-10-05 03:48:06 +02:00
Eugen Rochko
58c367fb47 Remove code for rendering public and hashtag timelines outside the web UI () 2022-10-04 20:13:46 +02:00
Eugen Rochko
195560b03a Fix content retention policy settings not accepting a blank value () 2022-09-29 01:15:09 +02:00
Eugen Rochko
f6f08aa610 Fix language dropdown sometimes not appearing in web UI ()
When user has no locale preference saved (such as never changing it
from the default), the preferred posting language is nil, and
the dropdown is not visible
2022-09-28 01:02:15 +02:00
Eugen Rochko
7a482567f8 Add retention policy for cached content and media () 2022-09-27 03:08:19 +02:00
Eugen Rochko
f4e91041b2 Add ability to filter followed accounts' posts by language () 2022-09-20 23:51:21 +02:00
Eugen Rochko
ecddc06474 Change "Allow trends without prior review" setting to include statuses ()
* Change "Allow trends without prior review" setting to include posts

* Fix i18n-tasks
2022-08-28 04:00:39 +02:00
Eugen Rochko
e7cc67d505 Add admin API for managing e-mail domain blocks () 2022-08-28 03:37:55 +02:00
Eugen Rochko
a0bb5674d9 Add admin API for managing canonical e-mail blocks () 2022-08-28 03:31:54 +02:00
Eugen Rochko
71f59e78b8 Add admin API for managing IP blocks () 2022-08-27 20:56:47 +02:00
Eugen Rochko
7300beadd9 Remove digest e-mails ()
* Remove digest e-mails

* Remove digest-related code
2022-08-25 23:38:22 +02:00
Eugen Rochko
1206e691bd Add ability to select all accounts matching search for batch actions () 2022-08-25 23:33:34 +02:00
Eugen Rochko
f9ebc320ed Add audit log entries for user roles ()
* Refactor audit log schema

* Add audit log entries for user roles
2022-08-25 20:39:40 +02:00
Claire
9d14683f86 Add option for EMAIL_DOMAIN_DENYLIST/EMAIL_DOMAIN_ALLOWLIST to apply after confirmation ()
Fixes 
2022-08-25 04:31:10 +02:00
Claire
522fbf9d13 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
2022-08-25 04:27:47 +02:00
Eugen Rochko
e642516264 Change e-mail domain blocks to match subdomains of blocked domains () 2022-08-24 19:00:55 +02:00
Eugen Rochko
b2e1224baa Add ability to block sign-ups from IP () 2022-08-24 19:00:37 +02:00
Eugen Rochko
abb4dca69b Fix unicode regression in () 2022-07-22 03:17:56 +02:00
Eugen Rochko
265c09fef1 Add ability to follow hashtags () 2022-07-17 13:49:29 +02:00
Claire
0e504e67f3 Add support for editing labelling of one's own role ()
Still disallow edition of rank or permissions
2022-07-17 13:37:30 +02:00
Eugen Rochko
57cf1c5a98 Fix nil error when rendering featured hashtags on profile ()
Regression from 
2022-07-14 01:23:10 +02:00
Eugen Rochko
38d04135bf Change how hashtags are normalized ()
* Change how hashtags are normalized

* Fix tests
2022-07-13 15:03:28 +02:00
Eugen Rochko
89ef936126 Change custom emoji file size limit from 50 KB to 256 KB () 2022-07-09 22:07:17 +02:00
Eugen Rochko
e164d6a687 Add customizable user roles ()
* Add customizable user roles

* Various fixes and improvements

* Add migration for old settings and fix tootctl role management
2022-07-05 02:41:40 +02:00
Jeong Arm
386980c196 Support audio/vnd.wave ()
See: https://datatracker.ietf.org/doc/html/rfc2361
And Misskey uses this mime type for wav file.
2022-06-28 19:49:35 +02:00
Claire
90e5a9bd98 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.
2022-06-28 09:42:13 +02:00
Eugen Rochko
e6eb0a29b9 Add notifications for new reports () 2022-06-27 09:30:15 +02:00
Claire
d0cc795d0f Add /api/v1/admin/domain_allows ()
- `GET /api/v1/admin/domain_allows` lists allowed domains
- `GET /api/v1/admin/domain_allows/:id` shows one by ID
- `DELETE /api/v1/admin/domain_allows/:id` deletes a given domain from the list
  of allowed domains
- `POST /api/v1/admin/domain_allows` to allow a new domain:
  if that domain is already allowed, the existing DomainAllow will be returned
2022-06-23 23:12:01 +02:00
Eugen Rochko
0eb2db6b52 Add administrative webhooks ()
* Add administrative webhooks

* Fix error when webhook is deleted before delivery worker runs
2022-06-09 21:57:36 +02:00
Claire
a0556ea3f1 Remove dependency on running Redis server for db:setup () 2022-06-01 19:23:31 +02:00
Claire
9f3bf956ad Add /api/v1/admin/domain_blocks ()
* Add /api/v1/admin/domain_blocks

Fixes 

- `GET /api/v1/admin/domain_blocks` lists domain blocks
- `GET /api/v1/admin/domain_blocks/:id` shows one by ID
- `DELETE /api/v1/admin/domain_blocks/:id` deletes a given domain block
- `POST /api/v1/admin/domain_blocks` to create a new domain block:
  if it conflicts with an existing one, returns an error with
  an attribute `existing_domain_block` with the rendered domain block

* Simplify conflict handling as suggested in review
2022-06-01 17:31:36 +02:00
Alexander Ivanov
a59e8245f5 Add support for webp uploads () 2022-05-27 20:06:40 +02:00
Claire
73c8032178 Remove unused filtered_languages column ()
* Remove unused `filtered_languages` column

Fixes 

* Fix tests
2022-05-27 20:05:22 +02:00
Eugen Rochko
4bb50e32e4 Fix being able to report otherwise inaccessible statuses () 2022-05-26 22:08:02 +02:00
Eugen Rochko
35ebb5571e Fix follower and other counters being able to go negative () 2022-05-26 20:32:48 +02:00
Eugen Rochko
5be3d071f2 Fix regression in tootctl search deploy caused by unloaded attribute () 2022-05-26 18:05:47 +02:00
Claire
f5e6c776c1 Change unapproved and unconfirmed account to not be accessible in the REST API ()
* Change unapproved and unconfirmed account to not be accessible in the REST API

* Change Account#searchable? to reject unconfirmed and unapproved users

* Disable search for unapproved and unconfirmed users in Account.search_for

* Disable search for unapproved and unconfirmed users in Account.advanced_search_for

* Remove unconfirmed and unapproved accounts from Account.searchable scope

* Prevent mentions to unapproved/unconfirmed accounts

* Fix some old tests for Account.advanced_search_for

* Add some Account.advanced_search_for tests for existing behaviors

* Add some tests for Account.search_for

* Add Account.advanced_search_for tests unconfirmed and unapproved accounts

* Add Account.searchable tests

* Fix Account.without_unapproved scope potentially messing with previously-applied scopes

* Allow lookup of unconfirmed/unapproved accounts through /api/v1/accounts/lookup

This is so that the API can still be used to check whether an username is free
to use.
2022-05-26 15:50:33 +02:00
Claire
e220fcf1d4 Fix unnecessary query on status creation () 2022-05-26 00:20:30 +02:00
Claire
2baba513d9 Fix warning an account outside of a report closing all reports for that account ()
* Fix warning an account outside of a report closing all reports for that account

* Make it clear what actions solve other reports

* Revert "Make it clear what actions solve other reports"

This reverts commit ad006de821f72e75480701298d13f0945b509059.
2022-05-23 20:38:29 +02:00
Eugen Rochko
eda9c41ed8 Change algorithm of tootctl search deploy to improve performance () 2022-05-22 22:16:43 +02:00
Eugen Rochko
9d160dae82 Fix preferred posting language returning unusable value in REST API () 2022-05-16 19:13:36 +02:00