Commit Graph

5578 Commits

Author SHA1 Message Date
Hélène
fb3f6e1975
EmojiReactValidator: use new qualification method 2022-07-25 16:49:23 +02:00
Hélène
388bbc4978
EmojiReactValidator: fix emoji qualification
Tries fully-qualifying emoji when receiving them, by adding the emoji
variation sequence to the received reaction emoji.

This issue arises when other instance software, such as Misskey, tries
reacting with emoji that have unqualified or minimally qualified
variants, like a red heart. Pleroma only accepts fully qualified emoji
in emoji reactions, and refused those emoji. Now, Pleroma will attempt
to properly qualify them first, and reject them if checks still fail.

This commit contains changes to tests proposed by lanodan.

Co-authored-by: Haelwenn <contact+git.pleroma.social@hacktivis.me>
2022-07-24 13:36:06 +02:00
Tusooa Zhu
997f08b350
Make AntiLinkSpamPolicy history-aware 2022-07-24 00:18:09 -04:00
Tusooa Zhu
d877d2a4e7
Make HashtagPolicy history-aware 2022-07-24 00:02:39 -04:00
Tusooa Zhu
82c8fc1ede
Make NoEmptyPolicy work with Update 2022-07-23 23:24:25 -04:00
Tusooa Zhu
46a5c06853
Make NormalizeMarkup history-aware 2022-07-23 22:50:38 -04:00
Tusooa Zhu
fc7ce5f93c
Make NoPlaceholderTextPolicy history-aware 2022-07-23 22:41:04 -04:00
Tusooa Zhu
dce7e42928
Make MediaProxyWarmingPolicy history-aware 2022-07-23 22:34:03 -04:00
Tusooa Zhu
0a337063e1
Make ForceMentionsInContent history-aware 2022-07-23 22:23:57 -04:00
Tusooa Zhu
cd19537f39
Make EnsureRePrepended history-aware 2022-07-23 17:48:39 -04:00
Tusooa Zhu
eba9b0760f
Make MRF Keyword history-aware 2022-07-23 15:56:36 -04:00
tusooa
301ce5bc62 Merge branch 'mute-expiration' into 'develop'
MastoAPI: Show mutes expiration date

See merge request pleroma/pleroma!3682
2022-07-23 00:34:15 +00:00
Haelwenn
cfb21d011f Revert "Merge branch 'fix/emoji-react-qualification' into 'develop'"
This reverts merge request !3684
2022-07-22 23:19:49 +00:00
FloatingGhost
09e0304b9c Add test for broken owncast federation 2022-07-22 20:30:45 +02:00
tusooa
c589b8445f Merge branch 'birthday_fix' into 'develop'
Allow to unset birthday

See merge request pleroma/pleroma!3702
2022-07-21 21:27:16 +00:00
Haelwenn
454f892f37 Merge branch 'fix/emoji-react-qualification' into 'develop'
EmojiReactValidator: fix emoji qualification

See merge request pleroma/pleroma!3684
2022-07-21 17:45:47 +00:00
Tusooa Zhu
4350a205a4
Merge remote-tracking branch 'upstream/develop' into HEAD 2022-07-21 13:44:16 -04:00
Haelwenn
1f18ab36b5 Merge branch 'resolve/notice-compatibility-routes-nginx' into 'develop'
Document way to do notice compatibility routes with Nginx reverse-proxy, fixes #2900

Closes #2900

See merge request pleroma/pleroma!3701
2022-07-20 16:57:05 +00:00
Ilja
ba31af021c Fix flaky/erratic tests in Pleroma.Config.TransferTaskTest
There were async calls happening, so they weren't always finished when assert happened.
2022-07-20 13:26:26 +02:00
marcin mikołajczak
fb268c4378 Allow to unset birthday
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-17 19:46:29 +02:00
Haelwenn
bb4860e222 Merge branch 'from/upstream-develop/tusooa/config-translatable' into 'develop'
Translatable config descriptions

Closes pleroma-meta#65

See merge request pleroma/pleroma!3695
2022-07-17 17:34:21 +00:00
Sean King
64e16e6a4b
Document way to do notice compatibility routes with Nginx reverse-proxy instead 2022-07-16 23:44:37 -06:00
tusooa
8aba7c08d1 Merge branch 'notification_types' into 'develop'
MastoAPI: Use `types` for filtering notifications

See merge request pleroma/pleroma!3648
2022-07-17 03:17:43 +00:00
marcin mikołajczak
597f56b4c4 Use :utc_datetime
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-16 16:28:22 +02:00
Tusooa Zhu
8371fd8ca2
Implement settings api 2022-07-16 01:20:25 -04:00
Tusooa Zhu
1d7e8d6e01
Pass in msgctxt for config translation strings 2022-07-14 17:41:33 -04:00
Tusooa Zhu
36f6d92d98
Add tests for translator compiler 2022-07-13 18:31:01 -04:00
tusooa
fdc71f6051 Merge branch 'short-description' into 'develop'
Add short_description instance field

Closes #2865

See merge request pleroma/pleroma!3651
2022-07-13 04:42:24 +00:00
Tusooa Zhu
eb2a1652bf
Add tests for short_description 2022-07-13 00:40:46 -04:00
Tusooa Zhu
c1874bc8f9
Make mutes and blocks behave the same as other lists 2022-07-12 19:03:18 -04:00
tusooa
311fda32f3 Merge branch 'fix/case-sensitivity-restricted-nicknames-blacklisted-domains' into 'develop'
Make checking blacklisted domains and restricted nicknames case-insensitive

Closes #2894 and #2888

See merge request pleroma/pleroma!3687
2022-07-11 04:04:36 +00:00
Haelwenn
420da14b61 Merge branch 'from/upstream-develop/tusooa/2830-remote-fo-mp' into 'develop'
Pass remote follow avatar into media proxy

Closes #2830

See merge request pleroma/pleroma!3690
2022-07-10 16:19:16 +00:00
Sean King
3cf6c2b7ea
Use is_binary instead of is_bitstring for restricted nicknames tests 2022-07-09 23:39:35 -06:00
Tusooa Zhu
2efc0ffcf0
Pass remote follow avatar into media proxy 2022-07-10 00:12:53 -04:00
Tusooa Zhu
04ded94a50
Fix remote emoji in subject disappearing after edits 2022-07-09 18:00:42 -04:00
Ilja
26080b4b5c Fix rate_limiter_test.exs test "it restricts based on config values"
It used a timer to sleep.
But time also goes on when doing other things, so depending on hardware, the timings could be off.
I slightly changed the tests so we still test what we functionally want.
Instead of waiting until the cache expires I now have a function to expire the test and use that.

That means we're not testing any more if the cache really expires after a certain amount of time,
but that's the responsability of the dependency imo, so shouldn't be a problem.

I also changed `Pleroma.Web.Endpoint, :http, :ip` to `127.0.0.1` because that's the setting people typically have,
and I see no reason to do it differently.
Especially since it's an exernal ip, which may come over as weird or suspicious to people.
2022-07-09 07:19:18 +02:00
marcin mikołajczak
0b16ce79f9 Add test for rendering mute expiration date
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2022-07-08 20:59:58 +02:00
Tusooa Zhu
11a6e88420
Test that Question updates are viable 2022-07-07 15:22:04 -04:00
Tusooa Zhu
069554e925
Guard against outdated Updates
It is possible for an earlier Update to be received by us later.
For this, we now
(1) only allows Updates to poll counts if there is no updated field,
    or the updated field is the same as the last updated date or
    creation date;
(2) does not allow updating anything if the updated field
    is older than the last updated date or creation date;
(3) allows updating updatable fields otherwise (normal updates);
(4) if only the updated field is changed, it does not create
    a new history item on its own.
2022-07-07 15:11:29 -04:00
Tusooa Zhu
f84ed44cea
Fix cannot get full history on object fetch 2022-07-06 01:19:53 -04:00
Sean King
0d4aceb9b0
Make checking blacklisted domains and restricted nicknames case-insenstive 2022-07-05 20:36:47 -06:00
Haelwenn
29f4ab640b Merge branch 'from/upstream-develop/tusooa/report-too-long' into 'develop'
Fix long report notes giving errors on creation

See merge request pleroma/pleroma!3679
2022-07-04 05:21:20 +00:00
Haelwenn
8c78fef56f EmojiReactValidator: apply lanodan's suggestions
These changes make the encoding for the fully-qualified heart emoji very visible in editors.
2022-07-04 00:25:54 +00:00
Tusooa Zhu
5ce118d970
Validate object data for incoming Update activities
In Create validator we do not validate the object data,
but that is because the object itself will go through the
pipeline again, which is not the case for Update. Thus,
we added validation for objects in Update activities.
2022-07-03 20:21:46 -04:00
Tusooa Zhu
4367489a3e
Pass history items through ObjectValidator for updatable object types 2022-07-03 20:02:52 -04:00
Tusooa Zhu
4edc867b87 Merge branch 'develop' into 'from/upstream-develop/tusooa/edits'
# Conflicts:
#   lib/pleroma/constants.ex
2022-07-03 22:24:57 +00:00
Haelwenn
de37583c49 Merge branch 'image_description_from_exif_data' into 'develop'
Use EXIF data of image for image description

See merge request pleroma/pleroma!3535
2022-07-03 21:14:25 +00:00
Haelwenn
a15b45a589 Merge branch 'bugfix/mime-validation-no-list' into 'develop'
Bugfix: Validate mediaType only by it's format

See merge request pleroma/pleroma!3597
2022-07-03 21:04:41 +00:00
Haelwenn
6b937d1473 Merge branch 'from/upstream-develop/tusooa/server-announcements' into 'develop'
Server announcements (1st pass)

See merge request pleroma/pleroma!3643
2022-07-03 20:58:20 +00:00
Ilja
56227ef7ba Descriptions from exif data with only whitespeces are considered empty
I noticed that pictures taken with Ubuntu-Touch have whitespace in one of the fields
This should just be ignored imo
2022-07-01 13:47:23 +02:00
Ilja
4a9ed319b8 Change test pictures
The previous pictures were labeled as public domain, but are actually a collage of pictures under other licenses.

I now replaced them with a jpeg of simply a white pixel.
2022-07-01 12:15:02 +02:00
Ilja
81afaee374 Better way of getting keys
I used keyword_list[:key], but if the key doesn't exist, it will return nil. I actually expect a list and further down the code I use that list.
I believe the key should always be present, but in case it's not, it's better to return an empty list instead of nil. That way the code wont fail further down the line.
2022-07-01 12:15:02 +02:00
Ilja
d0d48a9e88 Add deprecation warnings 2022-07-01 12:15:02 +02:00
Ilja
8303af84ce Rename the Exiftool module
No migrations or checks yet
2022-07-01 12:15:02 +02:00
Ilja
551721e41a Rename the new module 2022-07-01 12:13:46 +02:00
Ilja
cd316d7269 Use EXIF data of image to prefill image description
During attachment upload Pleroma returns a "description" field. Pleroma-fe has an MR to use that to pre-fill the image description field, <https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1399>

* This MR allows Pleroma to read the EXIF data during upload and return the description to the FE
    * If a description is already present (e.g. because a previous module added it), it will use that
    * Otherwise it will read from the EXIF data. First it will check -ImageDescription, if that's empty, it will check -iptc:Caption-Abstract
    * If no description is found, it will simply return nil, just like before
* When people set up a new instance, they will be asked if they want to read metadata and this module will be activated if so

This was taken from an MR i did on Pleroma and isn't finished yet.
2022-07-01 12:13:46 +02:00
Hélène
11f9f2ef27
EmojiReactValidator: fix emoji qualification
Tries fully-qualifying emoji when receiving them, by adding the emoji
variation sequence to the received reaction emoji.

This issue arises when other instance software, such as Misskey, tries
reacting with emoji that have unqualified or minimally qualified
variants, like a red heart. Pleroma only accepts fully qualified emoji
in emoji reactions, and refused those emoji. Now, Pleroma will attempt
to properly qualify them first, and reject them if checks still fail.
2022-06-28 21:33:57 +02:00
Tusooa Zhu
014096aeef
Make outbound transmogrifier aware of edit history 2022-06-25 11:20:46 -04:00
Tusooa Zhu
5321fd0012
Do not put meta[:object_data] for local Updates 2022-06-25 10:03:19 -04:00
Tusooa Zhu
9c6dae942d
Fix local updates causing emojis to be lost 2022-06-25 09:23:09 -04:00
Tusooa Zhu
e98579b1da
Verify that formerRepresentation provided in Update is used 2022-06-25 01:17:09 -04:00
Tusooa Zhu
40953a8f5c
Reuse formerRepresentations from remote if possible 2022-06-25 01:03:46 -04:00
Tusooa Zhu
ee07383191
Use meta[:object_data] in SideEffects for Update 2022-06-24 10:28:58 -04:00
Tusooa Zhu
01321c88b5
Convert incoming Updated object into Pleroma format 2022-06-24 10:25:22 -04:00
Tusooa Zhu
44613db853
Show original status at the first of history 2022-06-11 19:52:07 -04:00
Tusooa Zhu
7451f0e81f
Send the correct update in streamer
get_create_by_ap_id_with_object() seems to fetch the old object.
Why this happens needs further investigation.
2022-06-11 12:02:16 -04:00
Tusooa Zhu
27f3d802f2
Expose history and source apis to anon users 2022-06-11 10:35:36 -04:00
Tusooa Zhu
c3593639ad
Fix incorrectly cached content after editing 2022-06-09 11:39:51 -04:00
Tusooa Zhu
aafd7a687d
Return the corresponding object id in attachment view 2022-06-08 11:45:24 -04:00
Tusooa Zhu
237b220d71
Add object id to uploaded attachments 2022-06-08 11:05:48 -04:00
Tusooa Zhu
532f6ae3ed
Return update notification in mastodon api 2022-06-05 16:34:42 -04:00
Tusooa Zhu
06a3998013
Create Update notifications 2022-06-05 15:02:25 -04:00
Tusooa Zhu
97eabb2047
Fix CommonAPITest 2022-06-04 13:15:07 -04:00
Tusooa Zhu
fe2d4778ee
Expose content type of status sources 2022-06-04 12:57:30 -04:00
Tusooa Zhu
72ac940618
Fix SideEffectsTest 2022-06-03 21:50:49 -04:00
Tusooa Zhu
3249ac1f12
Show edited_at in MastodonAPI/show 2022-06-03 21:47:40 -04:00
Tusooa Zhu
fdaa864083
Test that own edits are streamed 2022-06-03 21:17:16 -04:00
Tusooa Zhu
8bac8147d4
Stream out edits 2022-06-03 21:15:17 -04:00
Tusooa Zhu
b096fbba1a
Fix long report notes giving errors on creation 2022-06-02 01:28:39 -04:00
Tusooa Zhu
fa31ae50e6
Inject history when object is refetched 2022-06-01 19:49:04 -04:00
Tusooa Zhu
410e177b2a
Strip internal fields in formerRepresentation 2022-06-01 12:02:03 -04:00
Tusooa Zhu
b613a9ec6b
Implement mastodon api for editing status 2022-05-31 14:32:28 -04:00
Pierre-Louis Bonicoli
6f23fc8e08
Add tlsv1.3 to suggestions 2022-05-31 00:51:48 +02:00
Tusooa Zhu
393b508846
Implement viewing source 2022-05-30 00:59:23 -04:00
Tusooa Zhu
c004eb0fa2
Implement mastodon api for showing edit history 2022-05-29 23:50:31 -04:00
Tusooa Zhu
8acfe95f3e
Allow updating polls 2022-05-29 22:16:03 -04:00
Tusooa Zhu
5e8aac0e07
Record edit history for Note and Question Updates 2022-05-29 13:54:16 -04:00
Tusooa Zhu
0f6a5eb9a2
Handle Note and Question Updates 2022-05-29 12:54:57 -04:00
Tusooa Zhu
547def67a7
Allow Updates by every actor on the same origin 2022-05-29 11:36:00 -04:00
Hélène
a74ce2d77a
StealEmojiPolicy: fix String rejected_shortcodes
* rejected_shortcodes is defined as a list of strings in the
  configuration description. As such, database-based configuration was
  led to handle those settings as strings, and not as the actually
  expected type, Regex.
* This caused each message passing through this MRF, if a rejected
  shortcode was set and the emoji did not exist already on the instance,
  to fail federating, as an exception was raised, swiftly caught and
  mostly silenced.
* This commit fixes the issue by introducing new behavior: strings are
  now handled as perfect matches for an emoji shortcode (meaning that if
  the emoji-to-be-pulled's shortcode is in the blacklist, it will be
  rejected), while still supporting Regex types as before.
2022-05-18 21:25:10 +02:00
Tusooa Zhu
6e5ef7f2eb
Test local-only in ap c2s outbox
Ref: fix-local-public
2022-05-09 18:53:32 -04:00
Tusooa Zhu
38444aa92a
Allow authenticated users to access local-only posts in MastoAPI
Ref: fix-local-public
2022-05-09 18:53:18 -04:00
Haelwenn
4605efe272 Merge branch 'improve_anti_followbot_policy' into 'develop'
Also use actor_type to determine if an account is a bot in antiFollowbotPolicy

Closes #2561

See merge request pleroma/pleroma!3498
2022-05-08 18:10:40 +00:00
Ilja
a8093732bd Also use actor_type to determine if an account is a bot in antiFollowbotPolicy 2022-05-08 18:10:40 +00:00
Tusooa Zhu
221cb3fb81
Allow users to create backups without providing email address
Ref: backup-without-email
2022-05-07 00:23:55 -04:00
Tusooa Zhu
fe933b9bf2
Prevent remote access of local-only posts via /objects
Ref: fix-local-public
2022-05-06 13:54:21 -04:00
Tusooa Zhu
466568ae36
Lint
Ref: fix-local-public
2022-05-06 13:54:13 -04:00
Tusooa Zhu
826deb7375
Make local-only statuses searchable
Ref: fix-local-public
2022-05-06 13:54:13 -04:00
Tusooa Zhu
38af42968d
Test that anonymous users cannot see local-only posts
Ref: fix-local-public
2022-05-06 13:54:12 -04:00
Tusooa Zhu
c48be59f58
Show local-only statuses in public timeline for authenticated users
Ref: fix-local-public
2022-05-06 13:54:02 -04:00