Commit Graph

9669 Commits

Author SHA1 Message Date
feld
3b639b467e Merge branch 'dialyzer-fixes' into 'develop'
Dialyzer fixes

See merge request pleroma/pleroma!4128
2024-05-28 17:26:58 +00:00
Mark Felder
79c418bcb7 Dialyzer: fix invalid @spec 2024-05-28 11:07:28 -04:00
Mark Felder
6b6a2adb07 Dialyzer: The function call will not succeed.
:idna.encode/1 expects a charlist even though it will accept a binary string. That functionality is undocumented / not part of its typespec, so we should turn it into a charlist first. Also switch to using match?/2

lib/pleroma/user.ex:2056:call
The function call will not succeed.

:idna.encode(_host :: binary())

will never return since the success typing is:
(string()) :: string()

and the contract is
(string()) :: string()
2024-05-28 10:49:43 -04:00
Mark Felder
6551ca2db7 Dialyzer: overlapping_contract
Wrong @spec name for remove_from_block/2

lib/pleroma/user.ex:2721:overlapping_contract
Overloaded contract for Pleroma.User.add_to_block/2 has
overlapping domains; such contracts are currently unsupported and
are simply ignored.
2024-05-28 10:40:54 -04:00
Mark Felder
8743c6c640 Dialyzer: The pattern can never match the type
We will never pass :plain to query_with/4, so remove that match and change it to query_with/3

lib/pleroma/search/database_search.ex:127:pattern_match
The pattern can never match the type.

Pattern:
_q, :rum, _search_query, :plain

Type:

  %Ecto.Query{
    :aliases => _,
    :assocs => _,
    :combinations => _,
    :distinct => _,
    :from => _,
    :group_bys => _,
    :havings => _,
    :joins => _,
    :limit => _,
    :lock => _,
    :offset => _,
    :order_bys => _,
    :prefix => _,
    :preloads => _,
    :select => _,
    :sources => _,
    :updates => _,
    :wheres => _,
    :windows => _,
    :with_ctes => _
  },
  :rum,
  _,
  :websearch
2024-05-28 10:36:00 -04:00
Mark Felder
1b3c84e241 Dialyzer: no_local_return
WebPushEncryption.send_web_push/4 was written to raise on erroroneus input, so we must guard against that.

lib/pleroma/web/push/impl.ex:65:no_return Function push_message/4 has no local return.
2024-05-28 10:19:35 -04:00
Mark Felder
17ebb2df84 Dialyzer: fix pattern matches preventing video thumbnailing from working
lib/pleroma/web/media_proxy/media_proxy_controller.ex:154:pattern_match
The pattern can never match the type.

Pattern:
{:ok, _thumbnail_binary}

Type:
{:error, boolean() | {:ffmpeg, :command_not_found}}
2024-05-28 10:19:22 -04:00
Mark Felder
18835bf701 Use the configured http client options for mediaproxy 2024-05-28 09:38:36 -04:00
Mark Felder
f8ce639e3f Dialyzer: guard clause can never succeed
lib/pleroma/web/activity_pub/mrf/dnsrbl_policy.ex:106:guard_fail
The guard clause:

when _ ::
  [
    binary()
    | [string() | char()]
    | {string() | integer(), string()}
    | {{byte(), byte(), byte(), byte()}, integer(), binary()}
    | {integer(), integer(), integer(), string() | byte()}
    | {integer(), integer(), string(), string(), string(), string()}
    | {string(), string(), integer(), integer(), integer(), integer(), integer()}
    | {char(), char(), char(), char(), char(), char(), char(), char()}
  ] === nil

can never succeed.
2024-05-28 09:30:19 -04:00
Mark Felder
42c5f7c74e Dialyzer: fix invalid @spec
The callback already defines the @spec and these do not match it.

lib/pleroma/upload/filter/exiftool/strip_location.ex:12:callback_spec_type_mismatch
The @spec return type does not match the expected return type
for filter/1 callback in Pleroma.Upload.Filter behaviour.

Actual:
@spec filter(...) :: {:ok, _}

Expected:
@spec filter(...) :: {:error, _} | {:ok, :filtered | :noop} | {:ok, :filtered, struct()}
2024-05-28 08:55:18 -04:00
Lain Soykaf
cc42b50c5b Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into pleroma-feature/akkoma-prune-old-posts 2024-05-28 16:51:19 +04:00
Mark Felder
0b864c3696 Dialyzer: fix invalid @spec
lib/pleroma/notification.ex:492:invalid_contract
The @spec for the function does not match the success typing of the function.

Function:
Pleroma.Notification.get_notified_from_activity/2

Success typing:
@spec get_notified_from_activity(_, _) :: [any()]
2024-05-28 08:49:34 -04:00
Lain Soykaf
f5978da676 HTTPSignaturePlugTest: Rewrite to use mox. 2024-05-28 14:00:25 +04:00
Lain Soykaf
3b4be5daa2 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into pleroma-secure-mode 2024-05-28 12:31:12 +04:00
lain
25903a4996 Merge branch 'auth-fetch-exception' into 'develop'
HTTPSignaturePlug: Add :authorized_fetch_mode_exceptions

See merge request pleroma/pleroma!4007
2024-05-28 04:42:35 +00:00
lain
8ff0c32903 Merge branch 'httpfixes' into 'develop'
Some HTTP and connection pool improvements

See merge request pleroma/pleroma!4124
2024-05-28 04:38:01 +00:00
Lain Soykaf
73d58c22d4 Linting 2024-05-28 08:09:19 +04:00
Mark Felder
bb86a01b9b Credo 2024-05-27 15:20:47 -04:00
Lain Soykaf
687ac4a850 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into auth-fetch-exception 2024-05-27 23:09:17 +04:00
feld
38db406ce4 Merge branch 'simpler-oban-queues' into 'develop'
Oban queue simplification

See merge request pleroma/pleroma!4123
2024-05-27 19:02:53 +00:00
lain
121791882f Merge branch 'explicitly-allow-unsafe-2' into 'develop'
Explicitly allow unsafe 2

See merge request pleroma/pleroma!4125
2024-05-27 18:43:05 +00:00
lain
3316a7ab70 Merge branch 'qdrant-search-2' into 'develop'
Search: Basic Qdrant/Ollama search

See merge request pleroma/pleroma!4109
2024-05-27 18:41:20 +00:00
Lain Soykaf
81e44ced0c HTTPSecurityPlug: Fix tests 2024-05-27 22:13:20 +04:00
Mark Felder
6b8c15a4a1 Remove MediaProxyWarmingPolicy config for ConcurrentLimiter as we are not using it 2024-05-27 14:11:42 -04:00
feld
42150d5581 Merge branch 'logger-metadata' into 'develop'
Logger metadata

See merge request pleroma/pleroma!3990
2024-05-27 17:53:33 +00:00
Mark Felder
0847d9ebaf Oban queue simplification 2024-05-27 13:48:17 -04:00
Lain Soykaf
1c699144d2 HttpSecurityPlug: Don't allow unsafe-eval by default 2024-05-27 21:26:40 +04:00
lain
07b7a8d697 Merge branch 'image-description-summary' into 'develop'
Add support for Honk "summary" + "name"

See merge request pleroma/pleroma!3854
2024-05-27 16:51:07 +00:00
feld
10b7efa98c Merge branch 'anti-mention-spam-mrf' into 'develop'
Anti-mention Spam MRF

See merge request pleroma/pleroma!4072
2024-05-27 16:46:31 +00:00
Mark Felder
cab6372d7a Make user age limit configurable
Switch to milliseconds for consistency with other configuration options in codebase
2024-05-27 12:31:29 -04:00
Alex Gleason
02d8ce8f0b AntiMentionSpamPolicy: remove followers check 2024-05-27 12:25:09 -04:00
Alex Gleason
64cacc3694 AntiMentionSpamPolicy: fix user age check 2024-05-27 12:25:09 -04:00
Alex Gleason
5e963736ce Add AntiMentionSpamPolicy 2024-05-27 12:25:09 -04:00
Mark Felder
0bddca361d DNSRBL in an MRF 2024-05-27 12:23:36 -04:00
Lain Soykaf
f4c0a01f09 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into image-description-summary 2024-05-27 20:03:14 +04:00
Lain Soykaf
e4f1325f78 InetHelper: Don't use deprecated function. 2024-05-27 19:44:41 +04:00
lain
7798fdc711 Merge branch 'show-reposted-replies' into 'develop'
Display reposted replies with exclude_replies: true

See merge request pleroma/pleroma!3961
2024-05-27 15:33:50 +00:00
Lain Soykaf
d3e85da0fd Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into auth-fetch-exception 2024-05-27 19:27:02 +04:00
Mark Felder
37d79b76bb Use the configured http client options for mediaproxy 2024-05-27 11:26:21 -04:00
Mark Felder
d272eb62cd Trust the connection pools to enforce the concurrency limitations 2024-05-27 11:25:19 -04:00
lain
e93ae96e13 Merge branch 'nsfw-api-mrf' into 'develop'
NSFW API Policy

See merge request pleroma/pleroma!3471
2024-05-27 15:20:43 +00:00
Mark Felder
a50c657427 Add a dedicated connection pool for Rich Media
Sharing this pool with regular Media is problematic as Rich Media will connect to many different
domains and thrash the pool, but regular Media will have predictable connections to the webservers
hosting media for the fediverse servers you peer with.
2024-05-27 11:17:02 -04:00
Lain Soykaf
4325b1aec3 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into nsfw-api-mrf 2024-05-27 17:49:31 +04:00
Lain Soykaf
3055c1598b IPFSTest: Fix configuration mocking 2024-05-27 17:22:18 +04:00
Lain Soykaf
825b4122a5 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into pleroma-ipfs_uploader 2024-05-27 16:23:40 +04:00
Lain Soykaf
4d6316b488 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into reject-replies-to-deleted 2024-05-27 15:19:53 +04:00
Lain Soykaf
ddf103eca0 QdrantSearch: Fetch a post in search if possible. 2024-05-27 14:35:08 +04:00
Lain Soykaf
f4c04e6b2d QdrantSearch: Add health checks. 2024-05-27 14:21:55 +04:00
Lain Soykaf
8b76f56050 QdrantSearch: Add healthcheck for qdrant 2024-05-27 14:01:17 +04:00
Lain Soykaf
08e9d995f8 Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into qdrant-search-2 2024-05-27 13:50:22 +04:00