Commit Graph

106 Commits (91c75a63616e8a8616cc09484e033bab2780a925)

Author SHA1 Message Date
Tim Rogers 3bdfa3eb4c
Added validator for extra profile field values with empty name ()
Matt Jankowski 342055cb15
Update `rubocop` to version 1.69.1 ()
Matt Jankowski 5405bdd344
Remove unused E2EE messaging code ()
Eugen Rochko e0c27a5047
Add ability to manage which websites can credit you in link previews ()
Matt Jankowski 02df1b4e4a
Finish email allow/deny list naming migration ()
Emelia Smith 4655be0da6
Fix add validation to webpush subscription keys ()
Matt Jankowski 4a77e477ee
Consolidate account scopes for `LOWER` (index using) username/domain queries ()
Claire 38b9d31f63
Improve email address validation ()
Matt Jankowski 67f54c4e75
Fix `Rails/WhereExists` cop in app/validators ()
Claire 6ad0fb5a77
Fix NULL MX handling and tighten DNS resolving specs ()
Matt Jankowski 00c6ebd86f
Reduce `.times` usage in `StatusPin` and add `PIN_LIMIT` constant in validator ()
Matt Jankowski 19900f647e
Add coverage for `UnreservedUsernameValidator` ()
Matt Jankowski f5bc1f20e2
Add coverage for `ExistingUsernameValidator` ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Matt Jankowski 660993b415
Add coverage for `URLValidator` ()
Matt Jankowski 6602edf064
Add coverage for `LanguageValidator` ()
Matt Jankowski 30f5ec7303
Rubocop fix: `Perfomance/UnfreezeString` ()
Matt Jankowski b8b2470cf8
Fix `Style/SlicingWithRange` cop ()
Matt Jankowski 9f5deb310b
Fix Performance/MapCompact cop ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Claire 5cd55d8aaf
Fix being able to vote on your own polls ()
Matt Jankowski 88d33f361f
Fix Lint/DuplicateBranch cop ()
Claire 32a030dd74
Rewrite import feature ()
Matt Jankowski c40d5e5a8f
Misc coverage improvements for validators ()
Matt Jankowski 4bb39ac3c3
Fix single-record invalid condition on PollVote ()
Matt Jankowski 730bb3e211
Remove unused HTML Validator ()
Nick Schonning 717683d1c3
Autofix Rubocop remaining Layout rules ()
Nick Schonning 2177daeae9
Autofix Rubocop Style/RedundantBegin ()
Claire a5a00d7f7a
Fix email with empty domain name labels passing validation ()
* Fix email with empty domain name labels passing validation

`EmailMxValidator` would allow empty labels because `Resolv::DNS` is
particularly lenient about them, but the email would be invalid and
unusable.

* Add tests
Claire 3654c94583
Strip spaces around URL when adding a relay ()
* Strip spaces around URL when adding a relay

Fixes 

* Gracefuly handle URL parsing errors in URL validator
Eugen Rochko 317ec06dc7
Fix error when uploading malformed CSV import ()
Eugen Rochko abf6c87ee8
Fix remote account in contact account setting not being used ()
Eugen Rochko 50948b46aa
Add ability to filter followed accounts' posts by language ()
Eugen Rochko a2871cd747
Add administrative webhooks ()
* Add administrative webhooks

* Fix error when webhook is deleted before delivery worker runs
Eugen Rochko f6d35ed57d
Remove IP matching from e-mail domain blocks ()
Clear out e-mail domain blocks created from automatically resolved DNS records
Eugen Rochko bbc7afa2a2
Fix being able to post URLs longer than 4096 characters ()
Eugen Rochko a29a982eaa
Change e-mail domain blocks to block IPs dynamically ()
* Change e-mail domain blocks to block IPs dynamically

* Update app/workers/scheduler/email_domain_block_refresh_scheduler.rb

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

* Update app/workers/scheduler/email_domain_block_refresh_scheduler.rb

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
Eugen Rochko b6d7726ecb
Remove language detection through cld3 ()
* Remove language detection through cld3

* Update app/helpers/languages_helper.rb

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>

Co-authored-by: Yamagishi Kazutoshi <ykzts@desire.sh>
Claire d5c9feb7b7
Add support for private pinned posts ()
* Add support for private pinned toots

* Allow local user to pin private toots

* Change wording to avoid "direct message"
Claire b21f3aa21d
Minor memory optimizations ()
Reduce constant memory usage by ~100kB and further reduce boot-up memory
allocations and temporary memory use by a further ~200kB.
Eugen Rochko 275fa4746b
Add `configuration` attribute to `GET /api/v1/instance` ()
List various values like file size limits and supported mime types
Eugen Rochko 3639862dee
Fix existing username validator not allowing multiple accounts ()
Fix 
Eugen Rochko daccc07dc1
Change auto-following admin-selected accounts, show in recommendations ()
Eugen Rochko b3ceb3dcc4
Add canonical e-mail blocks for suspended accounts ()
Prevent new accounts from being created using the same underlying
e-mail as a suspended account using extensions and period
permutations. Stores e-mails as a SHA256 hash
Claire 051efed5ed
Bypass MX validation for explicitly allowed domains ()
* Bypass MX validation for explicitly allowed domains

This spares some lookups and prevent issues in some edge cases with
local domains.

* Add tests

* Fix test
Claire a4dcaef53b
Prepare Mastodon for zeitwerk autoloader ()
* Prepare Mastodon for zeitwerk autoloader (Rails 6)

Add inflections and rename/move a few classes.

In particular, app/lib/exceptions.rb and app/lib/sanitize_config.rb
were manually loaded while still in autoload paths.

* Add inflection for Url → URL
Claire 5614e6724e
Fix URL scanning in note length validator and preview card fetching ()
* Add tests

* Fix URL scanning in note length validator and preview card fetching
Claire 65db262550
Update twitter-text from 1.14 to 3.1.0 and fix toot character counting ()
* Update twitter-text from 1.14 to 3.1.0

* Disable emoji parsing

* Properly depend on twitter-text for url detection

* Fix some URLs being wrongly detected client-side

* Add test for server-side validation of non-autolinkable URLs

* Fix server-side status length counting
Eugen Rochko 9aa37b32c3
Add `details` to error response for `POST /api/v1/accounts` in REST API ()
luigi eb51e43fb4
Optimize some regex matching ()
* Use Regex#match?

* Replace =~ too

* Avoid to call match? from Nil

* Keep value of Regexp.last_match
luigi 087ed84367
Optimize map { ... }.compact calls ()
* Optimize map { ... }.compact

using Enumerable#filter_map, supported since Ruby 2.7

* Add poyfill for Enumerable#filter_map
Eugen Rochko eb35be0431
Fix follow limit preventing re-following of a moved account ()