1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-30 22:48:38 +09:00
Commit Graph

55 Commits

Author SHA1 Message Date
Matt Jankowski
564ebfefcf
Remove hard reference from status pin validator spec () 2024-05-27 09:20:28 +00:00
Matt Jankowski
2447497a4c
Status length validation spec updates () 2024-05-02 08:31:06 +00:00
Matt Jankowski
6262ceeb70
Fix RSpec/DescribedClass cop () 2024-03-13 15:42:39 +00:00
Matt Jankowski
1df2ffc3ee
Use subject in blacklist email validator spec () 2024-02-16 07:42:03 +00:00
Matt Jankowski
a9e91eb955
Add common stub setup for resolv dns in email mx validator spec () 2024-02-08 14:26:45 +00:00
Claire
6ad0fb5a77
Fix NULL MX handling and tighten DNS resolving specs () 2024-01-05 11:07:57 +00:00
Matt Jankowski
c03bd2a238
Don't stub SUT in FollowLimitValidator spec () 2023-11-08 12:49:46 +00:00
Matt Jankowski
49e2772064
Fix RSpec/MessageSpies cop () 2023-11-07 09:46:28 +00:00
Matt Jankowski
19900f647e
Add coverage for UnreservedUsernameValidator () 2023-10-17 13:05:28 +02:00
Matt Jankowski
f5bc1f20e2
Add coverage for ExistingUsernameValidator ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-10-16 15:41:23 +02:00
Matt Jankowski
660993b415
Add coverage for URLValidator () 2023-07-28 23:12:25 +02:00
Matt Jankowski
6602edf064
Add coverage for LanguageValidator () 2023-07-28 23:12:09 +02:00
Matt Jankowski
74806deb2c
Fix RSpec/SubjectStub cop ()
Co-authored-by: Claire <claire.github-309c@sitedethib.com>
2023-07-12 10:02:19 +02:00
Matt Jankowski
05f9e39b32
Fix RSpec/VerifiedDoubles cop () 2023-06-22 14:55:22 +02:00
Matt Jankowski
c42591356d
Fix RSpec/DescribedClass cop () 2023-06-06 13:58:33 +02:00
Matt Jankowski
710745e16b
Fix RSpec/ContextWording cop () 2023-05-04 05:49:08 +02:00
Matt Jankowski
c40d5e5a8f
Misc coverage improvements for validators () 2023-03-04 17:00:00 +01:00
Nick Schonning
0cfdd1a401
Enable Rubocop Style/StringConcatenation defaults () 2023-02-22 09:54:36 +09:00
Nick Schonning
4552685f6b
Autofix Rubocop RSpec/LeadingSubject () 2023-02-20 13:24:14 +09:00
Nick Schonning
65ba0d92ef
Enable Rubocop RSpec/NotToNot () 2023-02-20 02:33:27 +01:00
Nick Schonning
a2fdb388eb
Autofix Rubocop RSpec/ReturnFromStub () 2023-02-20 02:32:10 +01:00
Nick Schonning
3680e032b4
Autofix Rubocop RSpec/EmptyLineAfterFinalLet () 2023-02-19 07:10:19 +09:00
Nick Schonning
669f6d2c0a
Run rubocop formatting except line length () 2023-02-18 06:56:20 +09:00
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
2023-01-24 20:18:41 +01:00
Eugen Rochko
a2871cd747
Add administrative webhooks ()
* Add administrative webhooks

* Fix error when webhook is deleted before delivery worker runs
2022-06-09 21:57:36 +02:00
Eugen Rochko
f6d35ed57d
Remove IP matching from e-mail domain blocks ()
Clear out e-mail domain blocks created from automatically resolved DNS records
2022-04-29 23:27:03 +02:00
Eugen Rochko
bbc7afa2a2
Fix being able to post URLs longer than 4096 characters () 2022-03-30 14:46:03 +02:00
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>
2022-02-24 17:28:23 +01:00
luzpaz
73f5e4a1d9
Fix various typos ()
Found via `codespell -q 3 -S ./CHANGELOG.md,./AUTHORS.md,./config/locales,./app/javascript/mastodon/locales -L ba,keypair,medias,ro`
2022-02-22 20:14:17 +01:00
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"
2022-01-17 00:49:55 +01:00
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
2021-04-17 03:14:25 +02:00
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
2021-03-19 23:48:47 +01:00
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
2021-03-19 02:42:43 +01:00
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
2021-03-04 00:12:26 +01:00
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
2021-03-02 12:02:56 +01:00
Eugen Rochko
9aa37b32c3
Add details to error response for POST /api/v1/accounts in REST API () 2021-03-01 04:59:13 +01:00
ThibG
8d217d7231
Improve email address validation ()
* 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
abcang
61a7390b66
Search account domain in lowercase ()
* Search account domain in lowercase

* fix rubocop error

* fix spec/models/account_spec.rb
2020-02-01 15:42:24 +01:00
Eugen Rochko
ae2198bd95
Fix validations of reactions limit () 2020-01-25 16:00:29 +01:00
Eugen Rochko
115dab78f1
Change admin UI for hashtags and add back whitelisted trends ()
Fix 

Add back the `GET /api/v1/trends` API with the caveat that it does
not return tags that have not been allowed to trend by the staff.

When a hashtag begins to trend (internally) and that hashtag has
not been previously reviewed by the staff, the staff is notified.

The new admin UI for hashtags allows filtering hashtags by where
they are used (e.g. in the profile directory), whether they have
been reviewed or are pending reviewal, they show by how many people
the hashtag is used in the directory, how many people used it
today, how many statuses with it have been created today, and it
allows fixing the name of the hashtag to make it more readable.

The disallowed hashtags feature has been reworked. It is now
controlled from the admin UI for hashtags instead of from
the file `config/settings.yml`
2019-08-05 19:54:29 +02:00
ThibG
ae18386558 Fix “invited by” not showing up for invited accounts in admin interface () 2019-05-19 21:40:36 +02:00
Eugen Rochko
7cb369d4c6
Change e-mail whitelist/blacklist to not be checked when invited ()
* Change e-mail whitelist/blacklist to not be checked when invited

And only when creating an account, not when updating it later

Fix 

* Fix test
2019-05-03 23:44:44 +02:00
Hinaloe
48f466daf1 Allow set the voting period to just 5 minutes ()
* Add spec of PollValidator for 

* Raise fraction less than 1 second

* format

* simplify time initialize
2019-04-09 17:02:12 +02:00
Franck Zoccolo
4f0322dcae Add support for IPv6 only MXes in Email validation ()
* Add support for IPv6 only MXes

* Fixed email validator tests
2019-02-12 14:48:04 +01:00
ysksn
5efedb5d5e Add specs for UrlValidator () 2019-01-03 13:10:20 +09:00
ysksn
19abf4ef0b Add specs for UnreservedUsernameValidator ()
* Add specs for UnreservedUsernameValidator

* Use instance variable
2019-01-03 13:10:02 +09:00
ysksn
fb08039de5 Add specs for FollowLimitValidator () 2018-12-29 08:24:52 +01:00
ysksn
05edec6917 Add specs for BlackListedEmailValidator ()
* Add specs for BlackListedEmailValidator

* Use instance variable
2018-12-29 07:23:44 +01:00
ysksn
4725aeec9f Add specs for DisallowedHashtagsValidator ()
In order to implement tests easier, `#select_tags` created.
2018-12-29 07:22:51 +01:00
ysksn
d01c840e14 Add specs for StatusPinValidator () 2018-12-28 18:09:32 +09:00