Commit Graph

5744 Commits

Author SHA1 Message Date
santiagorodriguez96 e8d41bc2fe
Add WebAuthn as an alternative 2FA method (#14466)
* feat: add possibility of adding WebAuthn security keys to use as 2FA

This adds a basic UI for enabling WebAuthn 2FA. We did a little refactor
to the Settings page for editing the 2FA methods – now it will list the
methods that are available to the user (TOTP and WebAuthn) and from
there they'll be able to add or remove any of them.
Also, it's worth mentioning that for enabling WebAuthn it's required to
have TOTP enabled, so the first time that you go to the 2FA Settings
page, you'll be asked to set it up.
This work was inspired by the one donde by Github in their platform, and
despite it could be approached in different ways, we decided to go with
this one given that we feel that this gives a great UX.

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: add request for WebAuthn as second factor at login if enabled

This commits adds the feature for using WebAuthn as a second factor for
login when enabled.
If users have WebAuthn enabled, now a page requesting for the use of a
WebAuthn credential for log in will appear, although a link redirecting
to the old page for logging in using a two-factor code will also be
present.

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: add possibility of deleting WebAuthn Credentials

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: disable WebAuthn when an Admin disables 2FA for a user

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* feat: remove ability to disable TOTP leaving only WebAuthn as 2FA

Following examples form other platforms like Github, we decided to make
Webauthn 2FA secondary to 2FA with TOTP, so that we removed the
possibility of removing TOTP authentication only, leaving users with
just WEbAuthn as 2FA. Instead, users will have to click on 'Disable 2FA'
in order to remove second factor auth.
The reason for WebAuthn being secondary to TOPT is that in that way,
users will still be able to log in using their code from their phone's
application if they don't have their security keys with them – or maybe
even lost them.

* We had to change a little the flow for setting up TOTP, given that now
  it's possible to setting up again if you already had TOTP, in order to
  let users modify their authenticator app – given that now it's not
  possible for them to disable TOTP and set it up again with another
  authenticator app.
  So, basically, now instead of storing the new `otp_secret` in the
  user, we store it in the session until the process of set up is
  finished.
  This was because, as it was before, when users clicked on 'Edit' in
  the new two-factor methods lists page, but then went back without
  finishing the flow, their `otp_secret` had been changed therefore
  invalidating their previous authenticator app, making them unable to
  log in again using TOTP.

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>

* refactor: fix eslint errors

The PR build was failing given that linting returning some errors.
This commit attempts to fix them.

* refactor: normalize i18n translations

The build was failing given that i18n translations files were not
normalized.
This commits fixes that.

* refactor: avoid having the webauthn gem locked to a specific version

* refactor: use symbols for routes without '/'

* refactor: avoid sending webauthn disabled email when 2FA is disabled

When an admins disable 2FA for users, we were sending two mails
to them, one notifying that 2FA was disabled and the other to notify
that WebAuthn was disabled.
As the second one is redundant since the first email includes it, we can
remove it and send just one email to users.

* refactor: avoid creating new env variable for webauthn_origin config

* refactor: improve flash error messages for webauthn pages

Co-authored-by: Facundo Padula <facundo.padula@cedarcode.com>
2020-08-24 16:46:27 +02:00
Tdxdxoz a3ec9af9b0
Fix: also use custom private boost icon for detailed status (#14471)
* use custom private boost icon for detail status

* only use className
2020-08-24 14:13:44 +02:00
ThibG 720214feb0
Add support for inlined objects in activity audience (#14514)
* Add support for inlined objects in activity audience

* Add tests
2020-08-24 14:11:47 +02:00
Daigo 3 Dango 9669557be1
Better manage subscriptionCounters (#14608)
Before this change:
- unsubscribe() was not called for a disconnection
- It seems that WebSocketClient calls connected() and reconnected().
  subscriptionCounters were incremented twice for a single reconnection,
  first from connected() and second from reconnected()

This might be a an additional change to
https://github.com/tootsuite/mastodon/pull/14579
to recover subscriptions after a reconnect.
2020-08-24 14:06:45 +02:00
proxy 46210a65d1
reword "boost to original audience" as per #14596 (#14598) 2020-08-23 00:08:31 +02:00
Takeshi Umeda debf6ae316
Fix click range discrepancies in gifv (#14615) 2020-08-23 00:08:12 +02:00
ThibG c7cfd4e67a
Fix scrolling issues when closing some dropdown menus (#14606) 2020-08-21 14:14:28 +02:00
ThibG f6a82cb2cd
Fix not being able to unbookmark toots when blocked by their author (#14604)
* Fix not being able to unbookmark toots when blocked by their author

* Add tests
2020-08-19 19:02:06 +02:00
ThibG 62a45ae26e
Fix client-side form validation not accepting handles with uppercase letters (#14599) 2020-08-19 19:00:47 +02:00
ThibG 0f38f9726a
Fix hardcoded non-breaking space in public view (#14568) 2020-08-13 12:04:28 +02:00
ThibG 8d217d7231
Improve email address validation (#14565)
* Increase DNS timeout from 1 second to 5 seconds for MX check

1 seconds is rather short when using a recursive DNS resolver which
hasn't got a cached result already available. Use 5 seconds instead,
which is the timeout value we use for outgoing HTTP queries.

* Add more precise error messages for invalid e-mail addresses
2020-08-12 12:40:25 +02:00
ThibG 7dc4c74265
Add client-side validation in password change forms (#14564)
* Fix client-side username validation at registration

It used the Account::USERNAME_RE regexp which is for *remote* users,
local user validation is stricter. Also take into account max username length.

* Add client-side form validation for password change

* Add client-side form validation to dedicated registration form

Previous changes only applied to the /about page, not the dedicated form on
/auth
2020-08-12 12:11:15 +02:00
ThibG d70c3ab4c3
Add HTML form validation for the registration form (#14560)
* Add HTML-level validation of username in sign-up form

* Make required fields with incorrect values more visible

* Enable HTML form validation for the registration form

* Mark agreement checkbox as required client-side

* Add minimum length to password

* Add client-side password confirmation validation
2020-08-11 23:09:13 +02:00
Eugen Rochko ef057584fd
Add support for managing multiple stream subscriptions in a single connection (#14524) 2020-08-11 18:24:59 +02:00
niwatori24 8b61bb1c3e
Cache result of SQL (#14534) 2020-08-09 15:23:42 +02:00
ThibG bd3420b139
Fix crash when failing to load emoji picker (#14525)
Fixes #14523
2020-08-08 17:57:56 +02:00
abcang 4a4d08f3a0
Fix eslint error (#14521) 2020-08-07 10:40:33 +02:00
ThibG a637344e37
Fallback to previous, more approximative hashtag RE on older browsers (#14513)
Fixes #14511
2020-08-05 22:39:14 +02:00
ThibG 8ce962e148
Fix audio/video player not using CDN_HOST in media paths on public pages (#14486) 2020-08-02 19:03:10 +02:00
ThibG 635b6a0f1a
Fix audio player on Safari (#14485) 2020-08-02 18:47:09 +02:00
ThibG 3ade834830
Fix disabled boost icon being replaced by private boost icon on hover (#14456)
Fixes #14455
2020-08-02 11:21:28 +02:00
ThibG 51b5bb5301
Fix new audio player features not working on Safari (#14465)
Fixes #14462
2020-08-02 11:20:17 +02:00
ThibG 5faf2de938
Fix wrong proptypes for onEditAccountNote (#14481)
Also add missing PropTypes to the correct component

Fixes #14478
2020-08-02 11:20:02 +02:00
kedama cd94854e7d
Fix the hashtag judgment of the compose form to be the same as the server side (#14484) 2020-08-02 11:19:43 +02:00
ThibG bfd5aea206
Fix handling of Reject Follow when a matching follow relationship exists (#14479)
* Add tests

* Fix handling of Reject Follow when a matching follow relationship exists

Regression from #12199
2020-08-01 18:20:37 +02:00
Takeshi Umeda 156af70e4d
Fix following restriction not working when exact match in account search (#14394) 2020-07-26 23:58:36 +02:00
Eugen Rochko 00448db3c8
Fix unnecessary second connection to user stream from account timeline in web UI (#14387)
Fix regression from #14212
2020-07-24 14:55:14 +02:00
Eugen Rochko 054f4af603
New Crowdin updates (#14335)
* New translations en.yml (Kazakh)
[ci skip]

* New translations en.json (Norwegian Nynorsk)
[ci skip]

* New translations simple_form.en.yml (Norwegian Nynorsk)
[ci skip]

* New translations en.yml (Latvian)
[ci skip]

* New translations simple_form.en.yml (Kazakh)
[ci skip]

* New translations en.json (Latvian)
[ci skip]

* New translations doorkeeper.en.yml (Estonian)
[ci skip]

* New translations simple_form.en.yml (Estonian)
[ci skip]

* New translations en.yml (Estonian)
[ci skip]

* New translations en.yml (Norwegian Nynorsk)
[ci skip]

* New translations en.yml (Slovak)
[ci skip]

* New translations doorkeeper.en.yml (Croatian)
[ci skip]

* New translations en.yml (Spanish, Argentina)
[ci skip]

* New translations doorkeeper.en.yml (Portuguese, Brazilian)
[ci skip]

* New translations en.json (Indonesian)
[ci skip]

* New translations simple_form.en.yml (Indonesian)
[ci skip]

* New translations doorkeeper.en.yml (Indonesian)
[ci skip]

* New translations simple_form.en.yml (Persian)
[ci skip]

* New translations doorkeeper.en.yml (Persian)
[ci skip]

* New translations en.json (Tamil)
[ci skip]

* New translations en.yml (Tamil)
[ci skip]

* New translations simple_form.en.yml (Tamil)
[ci skip]

* New translations doorkeeper.en.yml (Tamil)
[ci skip]

* New translations simple_form.en.yml (Spanish, Argentina)
[ci skip]

* New translations simple_form.en.yml (Croatian)
[ci skip]

* New translations doorkeeper.en.yml (Spanish, Argentina)
[ci skip]

* New translations en.json (Bengali)
[ci skip]

* New translations en.yml (Bengali)
[ci skip]

* New translations simple_form.en.yml (Bengali)
[ci skip]

* New translations en.json (Marathi)
[ci skip]

* New translations en.yml (Marathi)
[ci skip]

* New translations doorkeeper.en.yml (Marathi)
[ci skip]

* New translations en.json (Croatian)
[ci skip]

* New translations en.yml (Welsh)
[ci skip]

* New translations en.yml (Croatian)
[ci skip]

* New translations en.json (Welsh)
[ci skip]

* New translations simple_form.en.yml (Asturian)
[ci skip]

* New translations simple_form.en.yml (Welsh)
[ci skip]

* New translations en.yml (Taigi)
[ci skip]

* New translations en.yml (Corsican)
[ci skip]

* New translations simple_form.en.yml (Corsican)
[ci skip]

* New translations doorkeeper.en.yml (Corsican)
[ci skip]

* New translations doorkeeper.en.yml (Kabyle)
[ci skip]

* New translations en.json (Ido)
[ci skip]

* New translations en.yml (Ido)
[ci skip]

* New translations simple_form.en.yml (Ido)
[ci skip]

* New translations doorkeeper.en.yml (Ido)
[ci skip]

* New translations en.json (Taigi)
[ci skip]

* New translations doorkeeper.en.yml (Serbian (Latin))
[ci skip]

* New translations en.json (Silesian)
[ci skip]

* New translations en.yml (Silesian)
[ci skip]

* New translations en.json (Uyghur)
[ci skip]

* New translations en.yml (Uyghur)
[ci skip]

* New translations en.json (Sorani (Kurdish))
[ci skip]

* New translations en.yml (Sorani (Kurdish))
[ci skip]

* New translations simple_form.en.yml (Serbian (Latin))
[ci skip]

* New translations doorkeeper.en.yml (Welsh)
[ci skip]

* New translations en.yml (Breton)
[ci skip]

* New translations en.json (Esperanto)
[ci skip]

* New translations simple_form.en.yml (Esperanto)
[ci skip]

* New translations doorkeeper.en.yml (Esperanto)
[ci skip]

* New translations en.json (Chinese Traditional, Hong Kong)
[ci skip]

* New translations en.yml (Chinese Traditional, Hong Kong)
[ci skip]

* New translations simple_form.en.yml (Chinese Traditional, Hong Kong)
[ci skip]

* New translations doorkeeper.en.yml (Chinese Traditional, Hong Kong)
[ci skip]

* New translations en.json (Malayalam)
[ci skip]

* New translations en.yml (Malayalam)
[ci skip]

* New translations simple_form.en.yml (Malayalam)
[ci skip]

* New translations doorkeeper.en.yml (Malayalam)
[ci skip]

* New translations simple_form.en.yml (Breton)
[ci skip]

* New translations en.yml (Serbian (Latin))
[ci skip]

* New translations doorkeeper.en.yml (Breton)
[ci skip]

* New translations en.json (Kannada)
[ci skip]

* New translations en.yml (Kannada)
[ci skip]

* New translations en.json (Asturian)
[ci skip]

* New translations en.yml (Asturian)
[ci skip]

* New translations en.yml (Portuguese, Brazilian)
[ci skip]

* New translations doorkeeper.en.yml (Asturian)
[ci skip]

* New translations en.yml (Occitan)
[ci skip]

* New translations simple_form.en.yml (Occitan)
[ci skip]

* New translations doorkeeper.en.yml (Occitan)
[ci skip]

* New translations en.json (Serbian (Latin))
[ci skip]

* New translations simple_form.en.yml (Portuguese, Brazilian)
[ci skip]

* New translations doorkeeper.en.yml (Turkish)
[ci skip]

* New translations en.json (Portuguese, Brazilian)
[ci skip]

* New translations en.json (Georgian)
[ci skip]

* New translations doorkeeper.en.yml (Hungarian)
[ci skip]

* New translations en.yml (Armenian)
[ci skip]

* New translations simple_form.en.yml (Armenian)
[ci skip]

* New translations doorkeeper.en.yml (Armenian)
[ci skip]

* New translations en.yml (Italian)
[ci skip]

* New translations simple_form.en.yml (Italian)
[ci skip]

* New translations doorkeeper.en.yml (Italian)
[ci skip]

* New translations simple_form.en.yml (Japanese)
[ci skip]

* New translations doorkeeper.en.yml (Japanese)
[ci skip]

* New translations en.yml (Georgian)
[ci skip]

* New translations simple_form.en.yml (Hebrew)
[ci skip]

* New translations simple_form.en.yml (Georgian)
[ci skip]

* New translations doorkeeper.en.yml (Georgian)
[ci skip]

* New translations en.yml (Korean)
[ci skip]

* New translations simple_form.en.yml (Korean)
[ci skip]

* New translations doorkeeper.en.yml (Korean)
[ci skip]

* New translations en.json (Lithuanian)
[ci skip]

* New translations en.yml (Lithuanian)
[ci skip]

* New translations en.json (Macedonian)
[ci skip]

* New translations en.yml (Macedonian)
[ci skip]

* New translations doorkeeper.en.yml (Hebrew)
[ci skip]

* New translations en.yml (Hebrew)
[ci skip]

* New translations en.json (Occitan)
[ci skip]

* New translations en.json (Sardinian)
[ci skip]

* New translations en.yml (Sardinian)
[ci skip]

* New translations en.json (Slovenian)
[ci skip]

* New translations en.yml (Slovenian)
[ci skip]

* New translations en.yml (Esperanto)
[ci skip]

* New translations en.yml (Russian)
[ci skip]

* New translations en.json (Hebrew)
[ci skip]

* New translations en.json (Slovak)
[ci skip]

* New translations simple_form.en.yml (Russian)
[ci skip]

* New translations simple_form.en.yml (Ukrainian)
[ci skip]

* New translations en.yml (Hungarian)
[ci skip]

* New translations simple_form.en.yml (Hungarian)
[ci skip]

* New translations en.yml (Japanese)
[ci skip]

* New translations simple_form.en.yml (Chinese Simplified)
[ci skip]

* New translations en.yml (Persian)
[ci skip]

* New translations en.json (Ukrainian)
[ci skip]

* New translations en.yml (Ukrainian)
[ci skip]

* New translations simple_form.en.yml (Finnish)
[ci skip]

* New translations doorkeeper.en.yml (Finnish)
[ci skip]

* New translations en.json (Dutch)
[ci skip]

* New translations doorkeeper.en.yml (Icelandic)
[ci skip]

* New translations en.yml (Urdu (Pakistan))
[ci skip]

* New translations doorkeeper.en.yml (Swedish)
[ci skip]

* New translations en.json (Turkish)
[ci skip]

* New translations en.yml (Turkish)
[ci skip]

* New translations simple_form.en.yml (Turkish)
[ci skip]

* New translations en.yml (Indonesian)
[ci skip]

* New translations doorkeeper.en.yml (Ukrainian)
[ci skip]

* New translations en.yml (Chinese Traditional)
[ci skip]

* New translations simple_form.en.yml (Chinese Traditional)
[ci skip]

* New translations doorkeeper.en.yml (Chinese Traditional)
[ci skip]

* New translations en.json (Urdu (Pakistan))
[ci skip]

* New translations en.yml (Swedish)
[ci skip]

* New translations en.yml (Galician)
[ci skip]

* New translations simple_form.en.yml (Galician)
[ci skip]

* New translations doorkeeper.en.yml (Galician)
[ci skip]

* New translations en.json (Icelandic)
[ci skip]

* New translations en.yml (Icelandic)
[ci skip]

* New translations simple_form.en.yml (Icelandic)
[ci skip]

* New translations simple_form.en.yml (Swedish)
[ci skip]

* New translations en.json (Swedish)
[ci skip]

* New translations en.yml (Dutch)
[ci skip]

* New translations simple_form.en.yml (Portuguese)
[ci skip]

* New translations simple_form.en.yml (Dutch)
[ci skip]

* New translations doorkeeper.en.yml (Dutch)
[ci skip]

* New translations en.json (Norwegian)
[ci skip]

* New translations en.yml (Norwegian)
[ci skip]

* New translations simple_form.en.yml (Norwegian)
[ci skip]

* New translations doorkeeper.en.yml (Norwegian)
[ci skip]

* New translations en.json (Polish)
[ci skip]

* New translations en.yml (Polish)
[ci skip]

* New translations simple_form.en.yml (Polish)
[ci skip]

* New translations doorkeeper.en.yml (Polish)
[ci skip]

* New translations en.yml (Portuguese)
[ci skip]

* New translations doorkeeper.en.yml (Portuguese)
[ci skip]

* New translations doorkeeper.en.yml (Serbian (Cyrillic))
[ci skip]

* New translations doorkeeper.en.yml (Russian)
[ci skip]

* New translations simple_form.en.yml (Slovak)
[ci skip]

* New translations doorkeeper.en.yml (Slovak)
[ci skip]

* New translations simple_form.en.yml (Slovenian)
[ci skip]

* New translations doorkeeper.en.yml (Slovenian)
[ci skip]

* New translations en.yml (Albanian)
[ci skip]

* New translations simple_form.en.yml (Albanian)
[ci skip]

* New translations doorkeeper.en.yml (Albanian)
[ci skip]

* New translations en.json (Serbian (Cyrillic))
[ci skip]

* New translations en.yml (Serbian (Cyrillic))
[ci skip]

* New translations simple_form.en.yml (Serbian (Cyrillic))
[ci skip]

* New translations en.json (Portuguese, Brazilian)
[ci skip]

* New translations en.yml (Thai)
[ci skip]

* New translations en.json (French)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations doorkeeper.en.yml (Vietnamese)
[ci skip]

* New translations doorkeeper.en.yml (Vietnamese)
[ci skip]

* New translations simple_form.en.yml (Vietnamese)
[ci skip]

* New translations doorkeeper.en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Chinese Simplified)
[ci skip]

* New translations en.yml (Chinese Simplified)
[ci skip]

* New translations en.yml (Chinese Simplified)
[ci skip]

* New translations en.yml (Chinese Simplified)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Spanish)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Finnish)
[ci skip]

* New translations en.json (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations simple_form.en.yml (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations simple_form.en.yml (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations en.json (Finnish)
[ci skip]

* New translations en.json (Finnish)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Dutch)
[ci skip]

* New translations en.json (Dutch)
[ci skip]

* New translations en.yml (Dutch)
[ci skip]

* New translations en.json (Thai)
[ci skip]

* New translations devise.en.yml (Thai)
[ci skip]

* New translations en.json (Thai)
[ci skip]

* New translations en.json (Korean)
[ci skip]

* New translations en.json (Thai)
[ci skip]

* New translations en.yml (Thai)
[ci skip]

* New translations en.yml (Thai)
[ci skip]

* New translations en.yml (Thai)
[ci skip]

* New translations en.yml (Thai)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Spanish)
[ci skip]

* New translations en.yml (Spanish)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations simple_form.en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations simple_form.en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations simple_form.en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* i18n-tasks normalize

* yarn manage:translations

* Fix normalization
2020-07-24 12:46:46 +02:00
ThibG 753ba9fc23
Fix hover and normal colors for private boost icon being swapped (#14386) 2020-07-24 12:19:30 +02:00
ThibG 956473142c
Add custom icon for private boosts (#14380) 2020-07-23 23:54:19 +02:00
Takeshi Umeda 939a47393c
Fix duplicate notification and delivery of mentions (#14378) 2020-07-23 15:41:49 +02:00
ThibG e93efc0309
Change disabled retweet icon (#14373)
* Change disabled retweet icon

* Hide fontawesome version of boost icon in both reduce-motion and no-reduce-motion
2020-07-22 22:48:51 +02:00
ThibG 5d9acc0ce4
Fix not handling Undo on some activity types when they aren't inlined (#14346)
* Fix not handling Undo on some activity types when they aren't inlined

When receiving an Undo for a non-inlined activity, try looking it up in
database using the URI. The queries are ad-hoc because we don't have a global
index of object URIs, and not all activity types are stored in database with
an index on their URI.

Announces are just statuses, and have an index on URIs, so this check can
be done efficiently.

Accepts cannot be handled at all because we don't record their URI at any
point.

Follows don't have an index on URI, but they have an index on the issuing
account, which should make such queries largely manageable.

Likes don't have an index on URI, they have an index on the issuing account,
but the number of favs per account may be very high, so I decided not to
handle that.

Blocks don't have an index on URI, but they have an index on the issuing
account, which should make such queries largely manageable.

In all cases, if an Undo could not be handled properly, we call `delete_later!`
because that does not require us to know more than the URI of the undone
property.

* Add tests

* Make newer blocks overwrite older ones

Allows re-synchronizing block info by re-blocking and un-blocking again
when the original Undo Block has been lost.
2020-07-22 11:45:35 +02:00
ThibG f55dd193f9
Fix RSS feeds not being cachable (#14368)
* Add tests for some cachable responses

This only covers responses that we should have managed to make cachable
so far. It's not the case of all responses that should be cachable in
the end.

* Fix RSS feeds not being cachable
2020-07-22 11:44:02 +02:00
ThibG bcf85b5208
Dereference object URIs in Create and Update messages (#14359)
* Dereference object URIs in Create and Update messages

Fixes #14353

Signed-off-by: Thibaut Girka <thib@sitedethib.com>

* Refactor, and perform origin check *before* attempting to fetch object

Co-authored-by: Fire Demon <firedemon@creature.cafe>
2020-07-22 11:43:17 +02:00
Takeshi Umeda a8b6524b43
Changed retries and rescued in ActivityPub::ProcessingWorker (#14355)
* Changed the number of retries and rescued exceptions in ActivityPub::ProcessingWorker

* Remove RecordNotUnique from rescue
2020-07-20 11:26:12 +02:00
Takeshi Umeda fcb3f259e5
Fix to add RedisLock to handle Announce activity (#14365) 2020-07-20 11:25:26 +02:00
Takeshi Umeda 7540e235a2
Fix movie width and frame_rate returning nil (#14357)
* Fix movie width and frame_rate returning nil

* Add StreamValidationError and raise

* Fix code style
2020-07-19 22:28:27 +02:00
Takeshi Umeda 47931db1f5
Add thumbnail_remote_url in MediaAttachment REST response (#14358)
* Add thumbnail_remote_url in MediaAttachment REST response

* Change thumbnail_remote_url to preview_remote_url
2020-07-19 19:53:31 +02:00
Ariel 2ada2ae18a
Fix/14021 behaviour on add or remove toots (#14212)
* Add toot send by current user at local state after send a new toot

Related to #14021

* Decrement toot counter at profile when remove a toot

Related to #14021

* Remove semicolon at end of line
2020-07-19 17:04:02 +02:00
mayaeh d87958e177
ran `yarn manage:translations` (#14344) 2020-07-18 19:01:16 +02:00
ThibG 98f6380dee
Fix keyboard navigation in scrollable lists (#14348)
Fixes #14347
2020-07-18 18:55:36 +02:00
Sasha Sorokin 17b1d71536
Fix following_counter plural to include "one" (#14342)
That should've worked just fine, but unfortunately, Crowdin wasn't able
to pick up on our non-existent "one" category, thus appending empty
translation block to people's translations. Empty block WILL BE used by
any ICU FormatMessage library, thus resulting in an empty translation
for "one" category, and that requires immediate fix.

This commit duplicates contents of the "other" plural category.
2020-07-17 07:08:23 +02:00
ThibG 322d74fc2a
Fix boosted toots from blocked account not being retroactively removed from TL (#14339)
* Fix boosted toots from blocked account not being retroactively removed from TL

Fixes #14301

* Add test for clear_from_timeline
2020-07-17 07:07:54 +02:00
ThibG 85bc0f9639
Fix audio player controls color in mastodon-light theme (#14338)
Fixes #14337

The new audio player sets the background and foreground colors automatically
based on the thumbnail of the audio file, but the mastodon-light theme
overrides the controls' colors with a hardcoded color, which sometimes make
them unreadable.
2020-07-17 07:07:18 +02:00
Eugen Rochko 71e85a506d
New Crowdin updates (#14311)
* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* i18n-tasks normalize
2020-07-15 21:11:21 +02:00
ThibG d658af7ff8
Fix removing allowed domains being done synchronously (#14302)
* Fix removing allowed domains being done synchronously

* Add tests
2020-07-15 21:08:19 +02:00
ThibG bfed7dd5f3
Fix error when closing a playing audio or video modal (#14310) 2020-07-15 21:07:53 +02:00
Eugen Rochko d9cad44ca5
New Crowdin updates (#14285)
* New translations en.json (Bulgarian)
[ci skip]

* New translations doorkeeper.en.yml (Romanian)
[ci skip]

* New translations simple_form.en.yml (Bulgarian)
[ci skip]

* New translations en.yml (Finnish)
[ci skip]

* New translations doorkeeper.en.yml (Greek)
[ci skip]

* New translations en.json (Basque)
[ci skip]

* New translations en.yml (Basque)
[ci skip]

* New translations simple_form.en.yml (Basque)
[ci skip]

* New translations doorkeeper.en.yml (Basque)
[ci skip]

* New translations en.json (Finnish)
[ci skip]

* New translations simple_form.en.yml (Finnish)
[ci skip]

* New translations en.yml (Greek)
[ci skip]

* New translations doorkeeper.en.yml (Finnish)
[ci skip]

* New translations en.json (Hebrew)
[ci skip]

* New translations en.yml (Hebrew)
[ci skip]

* New translations simple_form.en.yml (Hebrew)
[ci skip]

* New translations doorkeeper.en.yml (Hebrew)
[ci skip]

* New translations doorkeeper.en.yml (Hungarian)
[ci skip]

* New translations doorkeeper.en.yml (Bulgarian)
[ci skip]

* New translations simple_form.en.yml (Greek)
[ci skip]

* New translations en.json (Armenian)
[ci skip]

* New translations en.json (Greek)
[ci skip]

* New translations en.json (Danish)
[ci skip]

* New translations en.json (Catalan)
[ci skip]

* New translations en.yml (Catalan)
[ci skip]

* New translations doorkeeper.en.yml (German)
[ci skip]

* New translations doorkeeper.en.yml (Catalan)
[ci skip]

* New translations en.json (Czech)
[ci skip]

* New translations en.yml (Czech)
[ci skip]

* New translations simple_form.en.yml (Czech)
[ci skip]

* New translations simple_form.en.yml (Catalan)
[ci skip]

* New translations en.yml (Danish)
[ci skip]

* New translations simple_form.en.yml (Danish)
[ci skip]

* New translations doorkeeper.en.yml (Danish)
[ci skip]

* New translations en.yml (German)
[ci skip]

* New translations en.json (German)
[ci skip]

* New translations simple_form.en.yml (German)
[ci skip]

* New translations doorkeeper.en.yml (Breton)
[ci skip]

* New translations doorkeeper.en.yml (Malayalam)
[ci skip]

* New translations en.json (Breton)
[ci skip]

* New translations en.yml (Breton)
[ci skip]

* New translations simple_form.en.yml (Breton)
[ci skip]

* New translations en.json (Kannada)
[ci skip]

* New translations en.yml (Kannada)
[ci skip]

* New translations en.json (Asturian)
[ci skip]

* New translations en.yml (Asturian)
[ci skip]

* New translations simple_form.en.yml (Asturian)
[ci skip]

* New translations doorkeeper.en.yml (Asturian)
[ci skip]

* New translations en.yml (Occitan)
[ci skip]

* New translations simple_form.en.yml (Malayalam)
[ci skip]

* New translations en.json (Malayalam)
[ci skip]

* New translations en.yml (Malayalam)
[ci skip]

* New translations doorkeeper.en.yml (Chinese Traditional, Hong Kong)
[ci skip]

* New translations simple_form.en.yml (Chinese Traditional, Hong Kong)
[ci skip]

* New translations en.yml (Chinese Traditional, Hong Kong)
[ci skip]

* New translations en.yml (Telugu)
[ci skip]

* New translations en.json (Chinese Traditional, Hong Kong)
[ci skip]

* New translations doorkeeper.en.yml (Esperanto)
[ci skip]

* New translations simple_form.en.yml (Esperanto)
[ci skip]

* New translations en.json (Esperanto)
[ci skip]

* New translations doorkeeper.en.yml (Welsh)
[ci skip]

* New translations simple_form.en.yml (Welsh)
[ci skip]

* New translations simple_form.en.yml (Occitan)
[ci skip]

* New translations en.json (Welsh)
[ci skip]

* New translations en.yml (Welsh)
[ci skip]

* New translations doorkeeper.en.yml (Ido)
[ci skip]

* New translations doorkeeper.en.yml (Occitan)
[ci skip]

* New translations en.yml (Taigi)
[ci skip]

* New translations en.yml (Sorani (Kurdish))
[ci skip]

* New translations en.json (Sorani (Kurdish))
[ci skip]

* New translations en.yml (Uyghur)
[ci skip]

* New translations en.json (Uyghur)
[ci skip]

* New translations en.yml (Silesian)
[ci skip]

* New translations en.json (Silesian)
[ci skip]

* New translations en.json (Taigi)
[ci skip]

* New translations en.json (Serbian (Latin))
[ci skip]

* New translations simple_form.en.yml (Ido)
[ci skip]

* New translations en.yml (Ido)
[ci skip]

* New translations en.json (Ido)
[ci skip]

* New translations doorkeeper.en.yml (Kabyle)
[ci skip]

* New translations simple_form.en.yml (Kabyle)
[ci skip]

* New translations en.yml (Kabyle)
[ci skip]

* New translations en.json (Kabyle)
[ci skip]

* New translations doorkeeper.en.yml (Corsican)
[ci skip]

* New translations simple_form.en.yml (Corsican)
[ci skip]

* New translations en.yml (Corsican)
[ci skip]

* New translations en.json (Corsican)
[ci skip]

* New translations doorkeeper.en.yml (Serbian (Latin))
[ci skip]

* New translations simple_form.en.yml (Serbian (Latin))
[ci skip]

* New translations en.yml (Serbian (Latin))
[ci skip]

* New translations en.json (Telugu)
[ci skip]

* New translations en.json (Bengali)
[ci skip]

* New translations simple_form.en.yml (Portuguese, Brazilian)
[ci skip]

* New translations simple_form.en.yml (Spanish, Argentina)
[ci skip]

* New translations en.yml (Spanish, Argentina)
[ci skip]

* New translations en.json (Spanish, Argentina)
[ci skip]

* New translations doorkeeper.en.yml (Tamil)
[ci skip]

* New translations simple_form.en.yml (Tamil)
[ci skip]

* New translations en.yml (Tamil)
[ci skip]

* New translations en.json (Tamil)
[ci skip]

* New translations doorkeeper.en.yml (Persian)
[ci skip]

* New translations simple_form.en.yml (Persian)
[ci skip]

* New translations en.json (Persian)
[ci skip]

* New translations doorkeeper.en.yml (Indonesian)
[ci skip]

* New translations simple_form.en.yml (Indonesian)
[ci skip]

* New translations en.json (Indonesian)
[ci skip]

* New translations doorkeeper.en.yml (Portuguese, Brazilian)
[ci skip]

* New translations en.yml (Portuguese, Brazilian)
[ci skip]

* New translations en.yml (Bengali)
[ci skip]

* New translations en.json (Portuguese, Brazilian)
[ci skip]

* New translations doorkeeper.en.yml (Icelandic)
[ci skip]

* New translations simple_form.en.yml (Icelandic)
[ci skip]

* New translations en.json (Occitan)
[ci skip]

* New translations en.json (Sardinian)
[ci skip]

* New translations en.yml (Sardinian)
[ci skip]

* New translations en.json (Thai)
[ci skip]

* New translations en.yml (Thai)
[ci skip]

* New translations en.yml (Esperanto)
[ci skip]

* New translations simple_form.en.yml (Thai)
[ci skip]

* New translations en.yml (Indonesian)
[ci skip]

* New translations en.yml (Persian)
[ci skip]

* New translations doorkeeper.en.yml (Spanish, Argentina)
[ci skip]

* New translations simple_form.en.yml (Bengali)
[ci skip]

* New translations en.yml (Malay)
[ci skip]

* New translations simple_form.en.yml (Kazakh)
[ci skip]

* New translations en.json (Malay)
[ci skip]

* New translations en.yml (Hindi)
[ci skip]

* New translations en.json (Hindi)
[ci skip]

* New translations en.yml (Latvian)
[ci skip]

* New translations en.json (Latvian)
[ci skip]

* New translations doorkeeper.en.yml (Estonian)
[ci skip]

* New translations simple_form.en.yml (Estonian)
[ci skip]

* New translations en.yml (Estonian)
[ci skip]

* New translations en.json (Estonian)
[ci skip]

* New translations doorkeeper.en.yml (Kazakh)
[ci skip]

* New translations en.yml (Kazakh)
[ci skip]

* New translations en.json (Kazakh)
[ci skip]

* New translations doorkeeper.en.yml (Norwegian Nynorsk)
[ci skip]

* New translations simple_form.en.yml (Norwegian Nynorsk)
[ci skip]

* New translations en.yml (Norwegian Nynorsk)
[ci skip]

* New translations en.json (Norwegian Nynorsk)
[ci skip]

* New translations doorkeeper.en.yml (Croatian)
[ci skip]

* New translations simple_form.en.yml (Croatian)
[ci skip]

* New translations en.yml (Croatian)
[ci skip]

* New translations en.json (Croatian)
[ci skip]

* New translations doorkeeper.en.yml (Thai)
[ci skip]

* New translations doorkeeper.en.yml (Marathi)
[ci skip]

* New translations en.yml (Marathi)
[ci skip]

* New translations en.json (Marathi)
[ci skip]

* New translations en.yml (Arabic)
[ci skip]

* New translations en.json (Arabic)
[ci skip]

* New translations en.json (Catalan)
[ci skip]

* New translations en.json (Russian)
[ci skip]

* New translations en.json (Kabyle)
[ci skip]

* New translations en.yml (Arabic)
[ci skip]

* New translations en.json (Arabic)
[ci skip]

* New translations en.json (Catalan)
[ci skip]

* New translations en.json (German)
[ci skip]

* New translations en.json (Persian)
[ci skip]

* New translations en.yml (Arabic)
[ci skip]

* New translations en.yml (Arabic)
[ci skip]

* New translations simple_form.en.yml (Arabic)
[ci skip]

* New translations en.json (Corsican)
[ci skip]

* New translations en.json (French)
[ci skip]

* New translations en.json (Italian)
[ci skip]

* New translations en.json (Spanish)
[ci skip]

* New translations en.json (Portuguese)
[ci skip]

* New translations en.json (Russian)
[ci skip]

* New translations en.json (German)
[ci skip]

* New translations en.json (Spanish, Argentina)
[ci skip]

* New translations en.json (Persian)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Japanese)
[ci skip]

* New translations en.json (Kabyle)
[ci skip]

* New translations en.json (Latvian)
[ci skip]

* New translations en.json (Albanian)
[ci skip]

* New translations en.json (Persian)
[ci skip]

* New translations en.json (Kabyle)
[ci skip]

* New translations en.json (Galician)
[ci skip]

* New translations en.json (Chinese Simplified)
[ci skip]

* New translations en.json (Malayalam)
[ci skip]

* New translations en.json (Malayalam)
[ci skip]

* New translations en.json (Chinese Simplified)
[ci skip]

* New translations en.json (Chinese Simplified)
[ci skip]

* New translations en.yml (Chinese Simplified)
[ci skip]

* New translations doorkeeper.en.yml (Malayalam)
[ci skip]

* New translations activerecord.en.yml (Malayalam)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations simple_form.en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations doorkeeper.en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (French)
[ci skip]

* New translations en.yml (French)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations simple_form.en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.yml (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Vietnamese)
[ci skip]

* New translations en.json (Hungarian)
[ci skip]

* New translations en.json (Armenian)
[ci skip]

* New translations simple_form.en.yml (Armenian)
[ci skip]

* New translations simple_form.en.yml (Armenian)
[ci skip]

* New translations en.json (Kabyle)
[ci skip]

* New translations en.yml (Kabyle)
[ci skip]

* New translations simple_form.en.yml (Kabyle)
[ci skip]

* New translations activerecord.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Kabyle)
[ci skip]

* New translations en.yml (Kabyle)
[ci skip]

* New translations devise.en.yml (Breton)
[ci skip]

* New translations en.json (Breton)
[ci skip]

* New translations devise.en.yml (Breton)
[ci skip]

* New translations en.json (Breton)
[ci skip]

* New translations en.json (Breton)
[ci skip]

* New translations en.json (Breton)
[ci skip]

* New translations en.json (Malayalam)
[ci skip]

* New translations en.json (Breton)
[ci skip]

* New translations en.json (Greek)
[ci skip]

* New translations en.json (Breton)
[ci skip]

* New translations en.json (Greek)
[ci skip]

* New translations en.yml (Greek)
[ci skip]

* i18n-tasks normalize

* yarn manage:translations
2020-07-15 14:59:26 +02:00
ThibG 0a8a3fe595
Fix being unable to unboost when blocked by their author (#14308)
Fixes #14307
2020-07-15 14:43:19 +02:00