Commit graph

6,555 commits

Author SHA1 Message Date
Mark Felder
9f79df7508 Add test demonstrating public getting stripped from unlisted activity CC 2025-06-12 21:32:43 -07:00
Mark Felder
27ec46814c Revert "Public getting stripped from unlisted activity CC: Add possible tests"
This reverts commit ded40182b0.
2025-06-12 21:27:19 -07:00
Mark Felder
8488362248 Merge remote-tracking branch 'origin/develop' into unlisted-fix 2025-06-12 21:20:34 -07:00
Ekaterina Vaartis
a361b84fc9 Relax alsoKnownAs requirements to just being a URI 2025-06-11 23:24:18 +03:00
Mark Felder
3d422ef325 Reachability refactor
The result of Oban jobs determine the reachability status.

Publisher jobs will cancel themselves at execution time if the target server is now unreachable.

Receiving activities does not immediately mark a server as reachable, but creates a ReachabilityWorker job to validate.

A Cron will execute daily to test all unreachable servers.
2025-06-06 12:32:09 -07:00
Mark Felder
a2ad2d8d23 Remove unused import 2025-06-05 16:54:05 -07:00
vaartis
8484e09424 Merge branch 'elixir-1.18' into 'develop'
Elixir 1.18 warnings

See merge request pleroma/pleroma!4358
2025-06-05 09:00:39 +00:00
Phantasm
dc26f74961
Revert to previous tag_validator behavior
This paritally reverts commit 9710063fdc
and reverts commit 7ddae61414

See thread: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/4358#note_112761
2025-06-04 19:16:59 +02:00
Ekaterina Vaartis
7ddae61414 Change the test that assumes that a hashtag with # will remain as-is
This does not seem to be the intended behaviour, as the code that produces it
did not actually ever do anything and just returned the tag as-is.

See
lib/pleroma/web/activity_pub/object_validators/tag_validator.ex
and
https://git.pleroma.social/pleroma/pleroma/-/merge_requests/4358#note_112681

At least Mastodon and Misskey output tags without the # from their API,
so in reality tags with the hash should rarely happen.
2025-06-04 12:28:59 +03:00
Ekaterina Vaartis
d95e1066b9 Fix formatting 2025-06-04 12:03:54 +03:00
Phantasm
1be8deda73
Remove Pleroma.OTPVersion module
Its last use was a check in lib/application.ex that was removed in
commit 0e53cb4940

Major OTP version can be fetched with System.otp_release/0.
If checking against minor versions and patch levels is needed,
revert this commit since it uses the recommended way of getting
a full OTP version string.
2025-06-03 23:17:39 +02:00
lain
93ce56418e Merge branch 'permissive-webfinger' into 'develop'
WebFinger query default to return JSON when no or unrecognized accept header is provided.

Closes #3381

See merge request pleroma/pleroma!4345
2025-05-29 08:41:27 +00:00
Phantasm
7c13abb3d9
Elixir 1.18 Use NaiveDateTime.compare/2 instead of <>= comparisons
warning: comparison with structs found:

        left <= right

    given types:

        dynamic() <= dynamic(%NaiveDateTime{})

    where "left" (context ExUnit.Assertions) was given the type:

        # type: dynamic()
        # from: test/pleroma/web/plugs/user_tracking_plug_test.exs:25
        left = user.last_active_at

    where "right" (context ExUnit.Assertions) was given the type:

        # type: dynamic(%NaiveDateTime{})
        # from: test/pleroma/web/plugs/user_tracking_plug_test.exs:25
        right = NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)

    Comparison operators (>, <, >=, <=, min, and max) perform structural and not semantic comparison. Comparing with a struct won't give meaningful results. Structs that can be compared typically define a compare/2 function within their modules that can be used for semantic comparison.

    typing violation found at:
    │
 25 │     assert user.last_active_at <= NaiveDateTime.truncate(NaiveDateTime.utc_now(), :second)
    │                                ~
    │
    └─ test/pleroma/web/plugs/user_tracking_plug_test.exs:25:32: Pleroma.Web.Plugs.UserTrackingPlugTest."test updates last_active_at for a new user"/1
2025-05-14 16:37:43 +02:00
Phantasm
5addbf39fb
Elixir 1.18 Deal with :warnings_as_errors deprecation in compiler_options/1
warning: :warnings_as_errors is deprecated as part of Code.get_compiler_option/1
  (elixir 1.18.3) lib/code.ex:1597: Code.get_compiler_option/1
  (elixir 1.18.3) lib/code.ex:1572: anonymous fn/2 in Code.compiler_options/1
  (elixir 1.18.3) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3
  (elixir 1.18.3) lib/code.ex:1571: Code.compiler_options/1
  (pleroma 2.9.1-77-g8ec49c59-elixir-1-18+test) lib/pleroma/application.ex:104: Pleroma.Application.start/2
  (kernel 10.2.6) application_master.erl:295: :application_master.start_it_old/4

warning: :warnings_as_errors is deprecated as part of Code.put_compiler_option/2, instead you must pass it as a --warnings-as-errors flag. If you need to set it as a default in a mix task, you can also set it under aliases: [compile: "compile --warnings-as-errors"]
  (elixir 1.18.3) lib/code.ex:1710: Code.put_compiler_option/2
  (elixir 1.18.3) lib/code.ex:1573: anonymous fn/2 in Code.compiler_options/1
  (elixir 1.18.3) lib/enum.ex:2546: Enum."-reduce/3-lists^foldl/2-0-"/3
  (elixir 1.18.3) lib/code.ex:1571: Code.compiler_options/1
  (pleroma 2.9.1-77-g8ec49c59-elixir-1-18+test) lib/pleroma/application.ex:104: Pleroma.Application.start/2
  (kernel 10.2.6) application_master.erl:295: :application_master.start_it_old/4
2025-05-13 14:02:47 +02:00
Lain Soykaf
ded40182b0 Public getting stripped from unlisted activity CC: Add possible tests 2025-05-05 15:48:34 +04:00
Ekaterina Vaartis
51a0cee405 Add expiring blocks
- `/api/v1/accounts/:id/block` now has a "duration" parameter
- `/api/v1/blocks` returns "block_expires_at" to indicate when the block
will expire
- MuteExpireWorker also processes block expiration
- Remove unused OpenAPI parameters from mute endpoint
- Add pleroma:block_expiration to nodeinfo features
2025-04-15 12:55:09 +03:00
lain
1775a4db08 Merge branch 'siteinfo-baseurls' into 'develop'
Provide media proxy and upload base urls in siteinfo

See merge request pleroma/pleroma!4349
2025-04-02 13:00:42 +00:00
Moon Man
93aa563cfe implemented 2025-04-02 07:00:45 -04:00
Nicole Mikołajczyk
4d4174c339 fix a few typos
Signed-off-by: Nicole Mikołajczyk <git@mkljczk.pl>
2025-03-28 18:47:00 +01:00
Moon Man
43a124bb14 formatting 2025-03-20 12:51:43 -04:00
Moon Man
7624af92cf tests for webfinger 2025-03-20 12:46:03 -04:00
lain
254b31bf1c Merge branch 'more-emoji-likes' into 'develop'
More emoji likes

Closes #3364

See merge request pleroma/pleroma!4342
2025-03-20 09:12:09 +00:00
lain
81960dccf2 Merge branch 'translate-posts' into 'develop'
Support translation providers (DeepL, LibreTranslate)

See merge request pleroma/pleroma!4102
2025-03-20 09:11:57 +00:00
Mark Felder
7763b9a87f Truncate the length of Rich Media title and description fields
Some sites like Instagram are serving obnoxiously long metadata fields
2025-03-19 10:29:45 -07:00
mkljczk
08de5f94e3 Merge remote-tracking branch 'origin/develop' into translate-posts
Signed-off-by: mkljczk <git@mkljczk.pl>
2025-03-19 17:59:24 +01:00
Lain Soykaf
f9bff8f5e5 Transmogrifier: Keep likes as likes if the content is obviously wrong 2025-03-19 16:00:27 +04:00
Lain Soykaf
950bf60765 LikeHandlingTest: Add test for invalid content 2025-03-19 15:57:08 +04:00
Lain Soykaf
e19ca7606d Transmogrifier: Also accept mitra emoji likes. 2025-03-18 15:53:27 +04:00
mkljczk
fa76bb66f9 Merge remote-tracking branch 'origin/develop' into language-detection
Signed-off-by: mkljczk <git@mkljczk.pl>
2025-03-11 20:38:56 +01:00
Lain Soykaf
5ce612b272 Linting 2025-03-11 18:21:27 +04:00
Lain Soykaf
2293d0826a Tests: Fix tests. 2025-03-11 17:53:05 +04:00
Lain Soykaf
51c1d6fb2d Containment: Never fetch locally 2025-03-11 16:37:17 +04:00
Lain Soykaf
b0c2ec5fb9 Fetcher Tests: Add tests validating the content-type 2025-03-11 16:15:14 +04:00
Lain Soykaf
adb5cb96d3 Object.Fetcher: Don't do cross-site redirects. 2025-03-11 15:50:17 +04:00
Lain Soykaf
577b7cb061 StealEmojiPolicy: Sanitise emoji names. 2025-03-11 14:59:06 +04:00
Lain Soykaf
c143653364 ReverseProxy: Sanitize content. 2025-03-11 14:18:36 +04:00
Lain Soykaf
d9ae9b676c InstanceStatic: Extra-sanitize emoji 2025-03-11 14:09:31 +04:00
Lain Soykaf
b1309bdb40 More fixes for InstanceStatic 2025-03-10 18:44:17 +04:00
Lain Soykaf
1dd9ba5d6f Sanitize media uploads. 2025-03-10 17:23:21 +04:00
Lain Soykaf
b469b9d9d3 . 2025-03-10 16:48:54 +04:00
Lain Soykaf
edcd816730 Merge branch 'assorted-test-fixes' into secfix 2025-03-10 16:04:46 +04:00
Lain Soykaf
a184eccde7 Safezip: Fix test (issue was a difference in file ordering between otp26 and otp27) 2025-03-02 23:18:51 +04:00
Lain Soykaf
cd5f018206 SafeZip Test: Skip failing CI tests for the release (tests work fine locally) 2025-03-01 20:08:19 +04:00
Lain Soykaf
32acdf0936 Merge branch 'security-2.9' into release/2.9.0 2025-03-01 17:45:28 +04:00
Oneric
13a88bd1a5 Register APNG MIME type
The newest git HEAD of MIME already knows about APNG, but this
hasn’t been released yet. Without this, APNG attachments from
remote posts won’t display as images in frontends.

Fixes: akkoma#657
2025-03-01 17:26:46 +04:00
Lain Soykaf
706bfffcda Linting 2025-03-01 17:16:48 +04:00
Lain Soykaf
88ee385302 Transmogrifier: Strip internal fields 2025-03-01 17:13:47 +04:00
Lain Soykaf
4604f2944e Merge branch 'pleroma-ensure-authorized-fetch' into security-2.9 2025-03-01 14:07:02 +04:00
feld
a8e863e0d6 Merge branch 'rich-media-ordering' into 'develop'
Rich Media Parser should use first image found

Closes #3356

See merge request pleroma/pleroma!4329
2025-03-01 02:01:22 +00:00
Mark Felder
ac0882e348 Filter the parsed OpenGraph/Twittercard tags and only retain the ones we intend to use. 2025-02-28 17:24:23 -08:00