Commit graph

1550 commits

Author SHA1 Message Date
Lain Soykaf
08e9d995f8 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into qdrant-search-2 2024-05-27 13:50:22 +04:00
lain
5e43060128 Merge branch 'search-healthcheck' into 'develop'
Search backend healthcheck process

See merge request pleroma/pleroma!4120
2024-05-27 09:46:57 +00:00
Mark Felder
d4769b076a Return a 422 when trying to reply to a deleted status 2024-05-26 15:14:48 -04:00
Mark Felder
03f4b46189 Test that healthchecks behave correctly for the expected HTTP responses 2024-05-26 14:21:24 -04:00
Mark Felder
354b700bed Assert that AWS URLs without query parameters do not crash 2024-05-26 14:01:12 -04:00
Lain Soykaf
a566ad56e1 QdrantSearch: Fix actor / author restriction 2024-05-23 18:55:16 +04:00
Lain Soykaf
94e4f21589 QdrantSearch: Deal with actor restrictions 2024-05-23 14:38:30 +04:00
Lain Soykaf
f726e5fbbd Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into qdrant-search-2 2024-05-22 20:07:43 +04:00
Lain Soykaf
5f1f574f01 WebFingerControllerTest: Restore host after test. 2024-05-22 18:45:34 +04:00
marcin mikołajczak
70cabbf6dc Fix tests
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-05-22 15:53:16 +02:00
marcin mikołajczak
d0b18e338b Fix validate_webfinger when running a different domain for Webfinger
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-05-22 15:52:35 +02:00
Lain Soykaf
206ea92837 Webfinger: Fix test 2024-05-22 12:59:10 +04:00
Alex Gleason
b15f8b0642 Prevent webfinger spoofing 2024-05-22 12:57:45 +04:00
Lain Soykaf
d1b053f3ba Webfinger: Add test showing wrong webfinger behavior 2024-05-22 12:57:30 +04:00
lain
7fca598268 Merge branch 'status-notification-type' into 'develop'
Add "status" notification type

See merge request pleroma/pleroma!3659
2024-05-21 05:01:45 +00:00
Lain Soykaf
c67506ba68 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into auth-fetch-exception 2024-05-20 18:21:46 +04:00
lain
e8cd6662eb Merge branch 'familiar-followers' into 'develop'
Implement `/api/v1/accounts/familiar_followers`

See merge request pleroma/pleroma!4098
2024-05-19 12:05:55 +00:00
Lain Soykaf
72ec261a69 B QdrantSearch: Switch to OpenAI api 2024-05-19 12:17:46 +04:00
Lain Soykaf
cc1321ea2e Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into qdrant-search-2 2024-05-19 11:51:33 +04:00
lain
401aca2548 Merge branch 'mark-read' into 'develop'
PleromaAPI: Simplify marking notifications as read

See merge request pleroma/pleroma!4111
2024-05-19 07:48:32 +00:00
Mark Felder
d07d49227f PleromaAPI: marking notifications as read no longer returns notifications 2024-05-18 18:17:35 +00:00
Lain Soykaf
3345ddd2d4 Linting 2024-05-18 15:02:22 +04:00
Lain Soykaf
7923ede8ba Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into qdrant-search-2 2024-05-18 14:45:26 +04:00
Lain Soykaf
e3933a067f QdrantSearch: Implement post deletion 2024-05-18 14:04:32 +04:00
Lain Soykaf
933117785f QdrantSearch: Add basic test 2024-05-18 13:43:47 +04:00
marcin mikołajczak
2e76ceb5b4 Merge remote-tracking branch 'origin/develop' into status-notification-type
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-05-18 11:30:25 +02:00
feld
9988dc2227 Revert "Merge branch 'strip-object-actor' into 'develop'"
This reverts merge request !4105
2024-05-16 23:33:48 +00:00
feld
e944b15298 Merge branch 'strip-object-actor' into 'develop'
Strip actor from objects before federating

Closes #3269

See merge request pleroma/pleroma!4105
2024-05-15 20:51:47 +00:00
feld
53ef576739 Merge branch 'instance_rules' into 'develop'
Instance rules

See merge request pleroma/pleroma!3669
2024-05-15 20:29:04 +00:00
Mark Felder
16c72d0701 Merge branch 'develop' into fix-muted-web-push 2024-05-11 08:06:04 -04:00
Mark Felder
ccceb41bf3 Add test for StatusView rendering of Cards when missing descriptions 2024-05-08 13:54:57 -04:00
Mark Felder
5e7f4f687e Improve StatusView tests for Cards 2024-05-08 13:52:25 -04:00
Mark Felder
19002fd6c1 Mastodon API: Remove deprecated GET /api/v1/statuses/:id/card endpoint
Removed back in 2019

https://github.com/mastodon/mastodon/pull/11213
2024-05-08 01:44:58 +00:00
Mark Felder
37de58823f Remove test validating missing descriptions are returned as an empty string 2024-05-08 00:49:29 +00:00
Mark Felder
5bbcf5b8b7 Improve test description 2024-05-08 00:36:16 +00:00
Mark Felder
c16c023ebf Rich Media Cards are fetched asynchonously and not guaranteed to be available on first post render 2024-05-08 00:26:32 +00:00
Mark Felder
fa66bd95dc Rich Media Cards are cached by URL not per status 2024-05-08 00:23:59 +00:00
Mark Felder
d21aa1a77c Respect the TTL returned in OpenGraph tags 2024-05-07 19:54:56 -04:00
Mark Felder
f40084e019 Fix broken tests 2024-05-07 19:54:56 -04:00
feld
750fb25f48 Revert "Merge branch 'pleroma-card-image-description' into 'develop'"
This reverts merge request !4101
2024-05-07 23:20:38 +00:00
Mark Felder
dd03184811 Strip actor from objects before federating 2024-05-07 11:54:45 -04:00
lain
50af909c01 Merge branch 'pleroma-card-image-description' into 'develop'
Include image description in status media cards

See merge request pleroma/pleroma!4101
2024-04-19 07:39:05 +00:00
marcin mikołajczak
6f6bede900 Include image description in status media cards
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-04-19 10:20:31 +04:00
marcin mikołajczak
4f5c4d79c4 FEP-2c59, add "webfinger" to user actor
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-04-11 17:50:11 +02:00
marcin mikołajczak
ccc3ac241f Add hint to rules
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-04-06 11:45:19 +02:00
marcin mikołajczak
9e6cf45906 /api/v1/accounts/familiar_followers
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-04-06 11:43:56 +02:00
marcin mikołajczak
01a5f839c5 Merge remote-tracking branch 'origin/develop' into instance_rules 2024-04-06 10:42:23 +02:00
lain
987f44d811 Merge branch 'bookmark-folders' into 'develop'
Fix BookmarkFolderView, add test

See merge request pleroma/pleroma!4096
2024-03-20 13:26:47 +00:00
marcin mikołajczak
37ec645ff2 Fix BookmarkFolderView, add test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-20 13:24:43 +01:00
Mark Felder
291d531e4c Unify notification push and streaming events for both local and federated activities
This also removes generation of notifications for blocked/filtered/muted users and threads.
2024-03-19 12:11:30 -04:00
Lain Soykaf
9617189e96 Tests: Actually run the bookmark folder tests. 2024-03-19 13:51:04 +04:00
Mark Felder
357553a64a Remove usage of :persistent_term for Postgres version storage, fix test
This test should not have been passing. The search result's activity id should not be the same id as the local post.

capture_log was not being used. Removed.
2024-03-18 16:27:52 -04:00
Mark Felder
b822a912ad Remove test for postgres < 11 2024-03-18 16:15:40 -04:00
marcin mikołajczak
918c406a91 Merge remote-tracking branch 'origin/develop' into instance_rules
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-18 13:50:25 +01:00
lain
2b71f4897f Merge branch 'develop' into 'bookmark-folders'
# Conflicts:
#   docs/development/API/differences_in_mastoapi_responses.md
2024-03-18 10:35:02 +00:00
lain
cf0aa1238c Merge branch 'public-polls' into 'develop'
Expose nonAnonymous field from Smithereen polls

See merge request pleroma/pleroma!3962
2024-03-18 06:26:22 +00:00
Lain Soykaf
caf855cf9c ActivityPub.Publisher: Don't try federating if a user doesn't have an inbox. 2024-03-17 16:57:45 +04:00
lain
95bcd5d28f Merge branch 'force-mention' into 'develop'
Add ForceMention mrf

See merge request pleroma/pleroma!4082
2024-03-17 12:32:14 +00:00
feld
0b5bba23ce Merge branch 'backups' into 'develop'
Include following/followers in backups

See merge request pleroma/pleroma!4085
2024-03-15 19:32:35 +00:00
marcin mikołajczak
bb0b17f4d9 Include following/followers in backups
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-10 23:53:12 +01:00
marcin mikołajczak
c0c4a9ed0d Merge remote-tracking branch 'origin/develop' into instance-contact-account
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-08 12:12:55 +01:00
marcin mikołajczak
961a5dd4cd Add test
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-07 16:42:22 +01:00
marcin mikołajczak
b7c625db0f Merge remote-tracking branch 'origin/develop' into link-verification 2024-03-07 13:13:49 +01:00
marcin mikołajczak
9cfa4e67b1 Add ForceMention mrf
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-01 18:16:09 +01:00
marcin mikołajczak
d415686bb9 Allow to group bookmarks in folders
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-03-01 11:04:01 +01:00
marcin mikołajczak
c592a0e58d Merge remote-tracking branch 'origin/develop' into HEAD
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-02-22 21:05:20 +01:00
Haelwenn (lanodan) Monnier
7d624c4750
StealEmojiPolicy: Sanitize shortcodes
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3245
2024-02-20 09:09:54 +01:00
feld
4dd8a1a1ca Merge branch 'websocket-refactor' into 'develop'
Websocket refactor to use Phoenix.Socket.Transport

See merge request pleroma/pleroma!4064
2024-02-15 14:36:54 +00:00
Haelwenn
d19642d7eb Merge branch 'bugfix-ccworks' into 'develop'
Bugfix for ccworks AP bridge

Closes #3234

See merge request pleroma/pleroma!4043
2024-02-15 01:30:22 +00:00
Mark Felder
d0f4b2b02f Remove invalid test
It is not allowed to use the Sec-WebSocket-Protocol header for arbitrary values. This was possible due to the raw websocket handling we were doing with Cowboy, but Phoenix.Socket.Transport does not allow this as the value of this header is compared against a static list of subprotocols.

https://hexdocs.pm/phoenix/Phoenix.Endpoint.html#socket/3-websocket-configuration

Additionally I cannot find anywhere that we depended on this behavior. Setting the Sec-WebSocket-Protocol header does not appear to be a part of PleromaFE.
2024-02-14 15:27:12 -05:00
Mark Felder
6b7b443ff9 Pleroma.Web.RichMedia.Parser: Remove test-specific codepaths
Also consolidate Tesla mocks into the HttpRequestMock module.

Tests were not exercising the real codepaths. The Rich Media Preview only works with https, but most of these tests were only mocking http.
2024-02-06 18:33:54 -05:00
Mark Felder
0cc038b67c Ensure URLs with IP addresses for the host do not generate previews 2024-02-05 00:09:37 -05:00
Mark Felder
04fc4eddaa Fix Rich Media Previews for updated activities
The Rich Media Previews were not regenerated when a post was updated due to a cache invalidation issue. They are now cached by the activity id so they can be evicted with the other activity cache objects in the :scrubber_cache.
2024-02-04 23:47:04 -05:00
marcin mikołajczak
226e53fdd7 Merge remote-tracking branch 'origin/develop' into status-notification-type
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-01-31 22:19:33 +01:00
Mark Felder
dec82a6a36 Phoenix.Endpoint.Cowboy2Handler does not exist
This should have always failed as it would not be an existing atom. Unclear how it worked since the upgrade to Phoenix 1.6.
2024-01-30 16:58:19 -05:00
Mark Felder
1e76ceacd5 Revert "Pleroma.Web.AdminAPI.ConfigController: dialyzer error"
This reverts commit 60d89cb404.
2024-01-30 14:19:13 -05:00
Mark Felder
b666710574 Pleroma.Web.MediaProxy.MediaProxyController: dialyzer errors
lib/pleroma/web/media_proxy/media_proxy_controller.ex:55:no_return
Function handle_preview/2 has no local return.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:59:call
The function call will not succeed.

Pleroma.HTTP.request(<<72, 69, 65, 68>>, _media_proxy_url :: any(), [], [], [{:pool, :media}])

will never return since the success typing is:
(
  :delete | :get | :head | :options | :patch | :post | :put | :trace,
  binary(),
  any(),
  [{binary(), binary()}],
  Keyword.t()
) :: any()

and the contract is
(
  method(),
  Pleroma.HTTP.Request.url(),
  String.t(),
  Pleroma.HTTP.Request.headers(),
  :elixir.keyword()
) :: {:ok, Tesla.Env.t()} | {:error, any()}

________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:95:unused_fun
Function handle_preview/3 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:111:unused_fun
Function handle_png_preview/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:134:unused_fun
Function handle_jpeg_preview/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:152:unused_fun
Function handle_video_preview/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:164:unused_fun
Function drop_static_param_and_redirect/1 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:173:unused_fun
Function fallback_on_preview_error/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:177:unused_fun
Function put_preview_response_headers/1 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:177:unused_fun
Function put_preview_response_headers/2 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:187:unused_fun
Function thumbnail_max_dimensions/0 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:196:unused_fun
Function min_content_length_for_preview/0 will never be called.
________________________________________________________________________________
lib/pleroma/web/media_proxy/media_proxy_controller.ex:200:unused_fun
Function media_preview_proxy_config/0 will never be called.
2024-01-29 18:50:50 -05:00
Haelwenn
251c455b91 Merge branch 'deps-bump' into 'develop'
Bump dependencies

See merge request pleroma/pleroma!4044
2024-01-29 17:43:00 +00:00
Mark Felder
60d89cb404 Pleroma.Web.AdminAPI.ConfigController: dialyzer error
lib/pleroma/web/admin_api/controllers/config_controller.ex:162:call
The function call will not succeed.

Phoenix.Controller.render(
  _conn :: %{:body_params => %{:configs => _, _ => _}, _ => _},
  <<105, 110, 100, 101, 120, 46, 106, 115, 111, 110>>,
  %{:configs => [any()], :need_reboot => _}
)

will never return since the success typing is:
(
  %Plug.Conn{
    :adapter => {atom(), _},
    :assigns => %{atom() => _},
    :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :halted => boolean(),
    :host => binary(),
    :method => binary(),
    :owner => pid(),
    :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
    :path_info => [binary()],
    :path_params => %{binary() => binary() | [any()] | map()},
    :port => char(),
    :private => %{atom() => _},
    :query_params => %Plug.Conn.Unfetched{
      :aspect => atom(),
      binary() => binary() | [any()] | map()
    },
    :query_string => binary(),
    :remote_ip =>
      {byte(), byte(), byte(), byte()}
      | {char(), char(), char(), char(), char(), char(), char(), char()},
    :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
    :req_headers => [{_, _}],
    :request_path => binary(),
    :resp_body =>
      nil
      | binary()
      | maybe_improper_list(
          binary() | maybe_improper_list(any(), binary() | []) | byte(),
          binary() | []
        ),
    :resp_cookies => %{binary() => map()},
    :resp_headers => [{_, _}],
    :scheme => :http | :https,
    :script_name => [binary()],
    :secret_key_base => nil | binary(),
    :state =>
      :chunked | :file | :sent | :set | :set_chunked | :set_file | :unset | :upgraded,
    :status => nil | non_neg_integer()
  },
  atom() | binary(),
  atom() | binary() | [{_, _}] | map()
) :: %Plug.Conn{
  :adapter => {atom(), _},
  :assigns => %{atom() => _},
  :body_params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :halted => boolean(),
  :host => binary(),
  :method => binary(),
  :owner => pid(),
  :params => %Plug.Conn.Unfetched{:aspect => atom(), binary() => _},
  :path_info => [binary()],
  :path_params => %{binary() => binary() | [any()] | map()},
  :port => char(),
  :private => %{atom() => _},
  :query_params => %Plug.Conn.Unfetched{
    :aspect => atom(),
    binary() => binary() | [any()] | map()
  },
  :query_string => binary(),
  :remote_ip =>
    {byte(), byte(), byte(), byte()}
    | {char(), char(), char(), char(), char(), char(), char(), char()},
  :req_cookies => %Plug.Conn.Unfetched{:aspect => atom(), binary() => binary()},
  :req_headers => [{_, _}],
  :request_path => binary(),
  :resp_body =>
    nil
    | binary()
    | maybe_improper_list(
        binary() | maybe_improper_list(any(), binary() | []) | byte(),
        binary() | []
      ),
  :resp_cookies => %{binary() => map()},
  :resp_headers => [{_, _}],
  :scheme => :http | :https,
  :script_name => [binary()],
  :secret_key_base => nil | binary(),
  :state => :sent,
  :status => nil | non_neg_integer()
}

and the contract is
(Plug.Conn.t(), binary() | atom(), Keyword.t() | map()) :: Plug.Conn.t()
2024-01-27 16:42:30 -05:00
Mark Felder
1b40ebfa20 Pleroma.Signature: dialyzer error
lib/pleroma/signature.ex:30:pattern_match
The pattern can never match the type.

Pattern:
%{<<97, 112, 95, 105, 100>> => _ap_id}

Type:
{:error, _} | {:ok, map()}
2024-01-26 21:03:41 -05:00
Mark Felder
06b8923d42 RichMedia.Parser.TTL.AwsSignedUrl: dialyzer fix
lib/pleroma/web/rich_media/parser/ttl/aws_signed_url.ex:9:callback_type_mismatch
Type mismatch for @callback ttl/2 in Pleroma.Web.RichMedia.Parser.TTL behaviour.

Expected type:
nil | integer()

Actual type:
{:error, <<_::64, _::size(8)>>} | {:ok, integer()}
2024-01-26 17:37:32 -05:00
Mark Felder
5b95abaeea Credo.Check.Readability.PredicateFunctionNames
This check was recently improved in Credo and it does make sense for readability.

The offending functions in Pleroma have been renamed and a couple missing the ? suffix have been fixed as well.
2024-01-26 16:59:58 -05:00
Haelwenn (lanodan) Monnier
558b421079
Test incoming federation from Convergence AP Bridge 2024-01-26 17:05:18 +01:00
Haelwenn (lanodan) Monnier
0de1a7629c
Maps: Add filter_empty_values/1 2024-01-26 16:18:29 +01:00
Haelwenn
ab3f03a04a Merge branch 'develop' into 'public-polls'
# Conflicts:
#   docs/development/API/differences_in_mastoapi_responses.md
2024-01-21 12:03:29 +00:00
Haelwenn
3c65a2899d Merge branch 'handle_object_fetch_failures' into 'develop'
Handle object fetch failures gracefully

See merge request pleroma/pleroma!4015
2024-01-19 18:43:00 +00:00
Haelwenn
4c20713ecd Merge branch 'otp26' into 'develop'
OTP26 support

See merge request pleroma/pleroma!4025
2024-01-17 09:51:56 +00:00
Mark Felder
e44f6a2ab3 Skip tests on MacOS/Darwin that have always failed 2024-01-15 20:18:43 -05:00
Mark Felder
012ab87605 Pleroma.Web.MastodonAPI.SubscriptionControllerTest: disable async and use on_exit/1 to ensure web push config gets restored 2024-01-16 00:59:44 +00:00
Mark Felder
ad363c62c3 Fix StatusController test by using the get_query_parameter/2 helper to reliably retrieve the max_id value 2024-01-15 17:32:57 -05:00
Mark Felder
4cbf11d32c Fix ChatController tests validating prev/next URLs by sorting the query parameters before comparison 2024-01-15 17:12:06 -05:00
Haelwenn
9b39bc6aa8 Merge branch 'mrf-regex-error' into 'develop'
MRF: Log sensible regex error for subdomain_match

See merge request pleroma/pleroma!4026
2024-01-15 08:24:54 +00:00
Haelwenn
c29430b018 Merge branch 'mrf-steal-emoji-extname' into 'develop'
MRF.StealEmojiPolicy: Properly add fallback extension to filenames missing one

See merge request pleroma/pleroma!4029
2024-01-15 08:24:24 +00:00
Mark Felder
12c052551b Allow the Remote Fetcher to attempt fetching an unreachable instance 2024-01-14 14:05:43 -05:00
tusooa
d3a4f5b7d7 Merge branch 'nil-contentMap' into 'develop'
Support objects with a nil contentMap (firefish)

Closes #3231

See merge request pleroma/pleroma!4030
2024-01-13 22:23:21 +00:00
Mark Felder
dcb2b1413b Add test to validate shared inboxes are used when multiple recipients from the same instance are recipients 2024-01-11 15:05:15 -05:00
Haelwenn (lanodan) Monnier
7651198508 Support objects with a nil contentMap (firefish)
Closes: https://git.pleroma.social/pleroma/pleroma/-/issues/3231
2024-01-11 07:16:45 +01:00
Haelwenn (lanodan) Monnier
4ca65c6182 MRF.StealEmojiPolicy: Properly add fallback extension to filenames missing one 2024-01-07 19:37:35 +01:00
Ekaterina Vaartis
6a55b680a3 Fix tests 2024-01-07 17:49:08 +03:00
Haelwenn (lanodan) Monnier
6af49270a9 MRF: Log sensible error for subdomains_regex 2024-01-02 15:37:41 +01:00