1
0
Fork 0
mirror of https://git.pleroma.social/pleroma/pleroma.git synced 2026-02-15 17:16:57 +00:00
Commit graph

17652 commits

Author SHA1 Message Date
Phantasm
619aabbf68
Elixir 1.19: Bump Woodpecker test pipeline to 1.19 2026-02-12 23:46:08 +01:00
Phantasm
6877aacd49
lint 2026-02-12 23:45:06 +01:00
Phantasm
fb415d304e
Elixir 1.19: Set merged logger config correctly, remove log level test 2026-02-12 23:45:06 +01:00
Phantasm
bd4977a4ed
Elixir 1.19: Fix improper deprecation warning wording 2026-02-12 23:45:06 +01:00
Phantasm
dfb910399a
Elixir 1.19: Added changelogs 2026-02-12 23:45:05 +01:00
Phantasm
8effcafa95
Elixir 1.19: Update dependencies in docs
Elixir 1.15 support only OTP>=24
2026-02-12 23:44:31 +01:00
Phantasm
fef11eb280
Elixir 1.19 MRFTest: Replace matchable_regexes with regexes_match! func 2026-02-12 23:44:31 +01:00
Phantasm
467a3728d9
Elixir 1.19: Improve DeprecationWarningsTest Logger reconfiguration test 2026-02-12 23:44:31 +01:00
Phantasm
a1e999dc58
Elixir 1.19: Replace ugly old logger config checks with config merging
Side note: Going up in log levels doesn't work properly.
 - debug->info works
 - info->debug does not work
2026-02-12 23:44:31 +01:00
Phantasm
6895d8efd4
Elixir 1.19: Disable colors for logging in test env
Color ANSI codes end up in the capture_log output and break existing
tests.
2026-02-12 23:44:31 +01:00
Phantasm
69f75c3ee4
Elixir 1.19: Move default configs to the new Logger configuration, again
Trying to do a two-release migration proved to be very hacky and ugly.
Instead this is preparation for moving defaults first and then merging
the old configuration left in admin's config file at runtime while still
emitting a warning. This hopefully will be a lot nicer and less
complicated.
2026-02-12 23:44:31 +01:00
Phantasm
6dde9d02bb
Elixir 1.19: Warn on old config of :console Logger and conflicts 2026-02-12 23:44:31 +01:00
Phantasm
354dfbfb31
Partially revert "Elixir 1.19: Refactor Logger configuration to what Elixir 1.15+ expects"
This partially reverts commit fc35204cc1.
2026-02-12 23:44:30 +01:00
Phantasm
4656e1ca67
Elixir 1.19: Add deprecation warning for :logger, :console configs 2026-02-12 23:44:30 +01:00
Phantasm
16e3176895
Elixir 1.19: Reword Logger backends deprecation warning 2026-02-12 23:44:30 +01:00
Phantasm
093053257e
Lint 2026-02-12 23:44:30 +01:00
Phantasm
6bfc2f05ae
Elixir 1.19: Add non-test Elixir files in test/ to mix.exs filter
This is a new filter introduced in 1.19.
2026-02-12 23:44:30 +01:00
Phantasm
d0dfd0f88d
Elixir 1.19: Only match once on structs
Second match is not needed and a simple Map update is recommended by
the compiler
2026-02-12 23:44:30 +01:00
Phantasm
8eb9b888bf
Elixir 1.19: Inject @compile autoload opt to MRF policies
Descriptions of MRF policies are gathered at compile-time and use
Pleroma.Docs.Generator.list_behaviour_implementations func, which
depends on modules implementing the queried behaviour to be loaded.
Otherwise descriptions for MRFs can be missing from the AdminAPI route.

Note: @behaviour cannot be injected in the __using__ macro. It causes a
loop in the compiler which leads to memory exhaustion. Hence why
@behaviour is still defined separately in the MRFs.
2026-02-12 23:44:29 +01:00
Phantasm
941c99d317
Elixir 1.19: Disable logging with colors in test environment
Can break some tests capture logs and then match on an expected text.
Since color codes end up being in the captured log.
2026-02-12 23:44:29 +01:00
Phantasm
b35573c6b5
Elixir 1.19: Warn on adding :console to Logger backends
Logger.Backend.Console still exists, but it is unused in our
configuration. Instead logging to console is done from Logger's
"default_handler".
2026-02-12 23:44:29 +01:00
Phantasm
bfae2e790d
Elixir 1.19: Move deprecated logger syntax check to DeprecationWarnings 2026-02-12 23:44:29 +01:00
Phantasm
45bf97c1a1
Elixir 1.19: Add tests for new Logger configuration 2026-02-12 23:44:29 +01:00
Phantasm
a50458ad23
Only warn about bad clear_config usage if warned usage is met 2026-02-12 23:44:29 +01:00
Phantasm
108a0fb3a9
Elixir 1.19: Move Logger backends under a specific config key 2026-02-12 23:44:29 +01:00
Phantasm
6e6e3e1ae6
Elixir 1.19: Refactor Logger configuration to what Elixir 1.15+ expects
Elixir 1.19 started emitting warnings about our use of:
config :logger, :console and
config :logger, backends: []
which got split in 1.15 to :default_handler, :default_formatter, and
LoggerBackends.add(backend) respectively.

On Pleroma startup it is now necessary to add the additional logger
backends at runtime (done with configure_logger() in application.ex).
New config key :pleroma, :logger_backends: [] has replaced the older
backends array. The logger_backends package is now used to facilitate
usage of other logger backends besides the default one (:logger_std_h
from OTP).

Warnings were added to Pleroma startup to warn about the usage of
:logger, backends and additional logic was introduced to make addition
of ExSyslogger to admin's configuration less dumb.

Ref: https://hexdocs.pm/logger/1.15.0/Logger.html#module-backends-and-backwards-compatibility
2026-02-12 23:44:28 +01:00
Phantasm
c577c8d058
lint 2026-02-12 23:44:28 +01:00
Phantasm
de970927fd
Elixir 1.19: Fix Mastodon StatusControllerTest DateTime difference 2026-02-12 23:44:28 +01:00
Phantasm
d4cd9987e9
Elixir 1.19: Fix MRFTest regex tests
It is no longer possible to match regexes. Instead at least match that
the sources of the regexes (regexes themselves) are the same.

Notice the +1 Reference number below.

2) test subdomain_match/2 wildcard domains with one subdomain (Pleroma.Web.ActivityPub.MRFTest)
   test/pleroma/web/activity_pub/mrf_test.exs:36
   Assertion with == failed
   code:  assert regexes == [~r/^(.*\.)*unsafe.tld$/i]
   left:  [%Regex{opts: [:caseless], re_pattern: {:re_pattern, 1, 0, 0, #Reference<0.378940835.3277193222.129648>}, source: "^(.*\\.)*unsafe.tld$"}]
   right: [%Regex{opts: [:caseless], re_pattern: {:re_pattern, 1, 0, 0, #Reference<0.378940835.3277193222.129649>}, source: "^(.*\\.)*unsafe.tld$"}]
   stacktrace:
     test/pleroma/web/activity_pub/mrf_test.exs:39: (test)
2026-02-12 23:44:28 +01:00
Phantasm
57216baa0b
Elixir 1.19: Fix ConfigDBTest regex tests
It is not possible match regexes anymore as this worked by accident
previously. Instead, at least check that the sources of the regex (the
regex itself) match.

Notice the +1 difference in the regex Reference below.

1) test to_elixir_types/1 complex keyword with sigil (Pleroma.ConfigDBTest)
   test/pleroma/config_db_test.exs:460
   Assertion with == failed
   code:  assert ConfigDB.to_elixir_types([
            %{"tuple" => [":federated_timeline_removal", []]},
            %{"tuple" => [":reject", ["~r/comp[lL][aA][iI][nN]er/"]]},
            %{"tuple" => [":replace", []]}
          ]) == [federated_timeline_removal: [], reject: [~r/comp[lL][aA][iI][nN]er/], replace: []]
   left:  [federated_timeline_removal: [], reject: [%Regex{opts: [], re_pattern: {:re_pattern, 0, 0, 0, #Reference<0.230935836.591265794.259515>}, source: "comp[lL][aA][iI][nN]er"}], replace: []]
   right: [federated_timeline_removal: [], reject: [%Regex{opts: [], re_pattern: {:re_pattern, 0, 0, 0, #Reference<0.230935836.591265794.259516>}, source: "comp[lL][aA][iI][nN]er"}], replace: []]
   stacktrace:
     test/pleroma/config_db_test.exs:461: (test)
2026-02-12 23:44:28 +01:00
Phantasm
90b268bca2
Elixir 1.19: Fix deprecation warning when invoking ParallelCompiler
warning: you must pass return_diagnostics: true when invoking Kernel.ParallelCompiler functions
  (elixir 1.19.5) lib/kernel/parallel_compiler.ex:324: Kernel.ParallelCompiler.spawn_workers/3
  (pleroma 2.10.0-7-ga7a74d5e-elixir-1-19+test) lib/pleroma/html.ex:13: Pleroma.HTML.compile_scrubbers/0
  (pleroma 2.10.0-7-ga7a74d5e-elixir-1-19+test) lib/pleroma/application.ex:48: Pleroma.Application.start/2
  (kernel 10.5) application_master.erl:299: :application_master.start_it_old/4

warning: you must pass return_diagnostics: true when invoking Kernel.ParallelCompiler functions
  (elixir 1.19.5) lib/kernel/parallel_compiler.ex:324: Kernel.ParallelCompiler.spawn_workers/3
  (pleroma 2.10.0-7-ga7a74d5e-elixir-1-19+test) lib/pleroma/application.ex:121: Pleroma.Application.load_custom_modules/0
  (pleroma 2.10.0-7-ga7a74d5e-elixir-1-19+test) lib/pleroma/application.ex:60: Pleroma.Application.start/2
  (kernel 10.5) application_master.erl:299: :application_master.start_it_old/4
2026-02-12 23:44:28 +01:00
Phantasm
9eadc07361
Elixir 1.19: Fix typing violation in MarkerTest
warning: a struct for Pleroma.Marker is expected on struct update:

        %Pleroma.Marker{refresh_record(marker) | unread_count: 2}

    but got type:

        dynamic()

    where "marker" was given the type:

        # type: dynamic()
        # from: test/pleroma/marker_test.exs:35:14
        marker = Pleroma.Factory.insert(:marker, user: user)

    you must assign "refresh_record(marker)" to variable and pattern match on "%Pleroma.Marker{}".

    hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

        user = some_function()
        %User{user | name: "John Doe"}

    it is enough to write:

        %User{} = user = some_function()
        %{user | name: "John Doe"}

    typing violation found at:
    │
 43 │              ) == [%Marker{refresh_record(marker) | unread_count: 2}]
    │                    ~
    │
    └─ test/pleroma/marker_test.exs:43:20: Pleroma.MarkerTest."test get_markers/2 returns user markers"/1
2026-02-12 23:44:27 +01:00
Phantasm
ecfcb47a09
Elixir 1.19: Fix typing violation in RepoTest
warning: a struct for Pleroma.Web.OAuth.Token is expected on struct update:

        %Pleroma.Web.OAuth.Token{Pleroma.Factory.insert(:oauth_token) | user: user}

    but got type:

        dynamic()

    you must assign "Pleroma.Factory.insert(:oauth_token)" to variable and pattern match on "%Pleroma.Web.OAuth.Token{}".

    hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

        user = some_function()
        %User{user | name: "John Doe"}

    it is enough to write:

        %User{} = user = some_function()
        %{user | name: "John Doe"}

    typing violation found at:
    │
 27 │       token = %Pleroma.Web.OAuth.Token{insert(:oauth_token) | user: user}
    │               ~
    │
    └─ test/pleroma/repo_test.exs:27:15: Pleroma.RepoTest."test get_assoc/2 get assoc from preloaded data"/1
2026-02-12 23:44:27 +01:00
Phantasm
b160a73924
Elixir 1.19: Fix typing violation in MediaControllerTest
warning: a struct for Plug.Upload is expected on struct update:

         %Plug.Upload{image | filename: "../../../../../nested/file.jpg"}

     but got type:

         dynamic()

     where "image" was given the type:

         # type: dynamic()
         # from: test/pleroma/web/mastodon_api/controllers/media_controller_test.exs:132:42
         %{conn: conn, image: image}

     when defining the variable "image", you must also pattern match on "%Plug.Upload{}".

     hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

         user = some_function()
         %User{user | name: "John Doe"}

     it is enough to write:

         %User{} = user = some_function()
         %{user | name: "John Doe"}

     typing violation found at:
     │
 133 │       image = %Plug.Upload{
     │               ~
     │
     └─ test/pleroma/web/mastodon_api/controllers/media_controller_test.exs:133:15: Pleroma.Web.MastodonAPI.MediaControllerTest."test Upload media Do not allow nested filename"/1
2026-02-12 23:44:27 +01:00
Phantasm
a051497b59
Elixir 1.19: Fix typing violations in ActivityPubTest 2026-02-12 23:44:27 +01:00
Phantasm
336cdf9a66
Elixir 1.19: Fix typing violation on struct updates in CommonAPI.Activity*
warning: a struct for Pleroma.Web.CommonAPI.ActivityDraft is expected on struct update:

         %Pleroma.Web.CommonAPI.ActivityDraft{draft | object: object}

     but got type:

         dynamic()

     where "draft" was given the type:

         # type: dynamic()
         # from: lib/pleroma/web/common_api/activity_draft.ex:91:22
         draft

     when defining the variable "draft", you must also pattern match on "%Pleroma.Web.CommonAPI.ActivityDraft{}".

     hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

         user = some_function()
         %User{user | name: "John Doe"}

     it is enough to write:

         %User{} = user = some_function()
         %{user | name: "John Doe"}

     typing violation found at:
     │
 102 │     %__MODULE__{draft | object: object}
     │     ~
     │
     └─ lib/pleroma/web/common_api/activity_draft.ex:102:5: Pleroma.Web.CommonAPI.ActivityDraft.listen_object/1
2026-02-12 23:44:27 +01:00
Phantasm
a84e091c4e
Elixir 1.19: Fix typing violation on struct updates in Web.ApiSpec.Rend*
warning: a struct for OpenApiSpex.Cast.Error is expected on struct update:

        %OpenApiSpex.Cast.Error{err | name: err.value}

    but got type:

        dynamic(%{..., name: nil, reason: :invalid_enum})

    where "err" was given the type:

        # type: dynamic(%{..., name: nil, reason: :invalid_enum})
        # from: lib/pleroma/web/api_spec/render_error.ex:20:45
        %{name: nil, reason: :invalid_enum} = err

    when defining the variable "err", you must also pattern match on "%OpenApiSpex.Cast.Error{}".

    hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

        user = some_function()
        %User{user | name: "John Doe"}

    it is enough to write:

        %User{} = user = some_function()
        %{user | name: "John Doe"}

    typing violation found at:
    │
 21 │           %OpenApiSpex.Cast.Error{err | name: err.value}
    │           ~
    │
    └─ lib/pleroma/web/api_spec/render_error.ex:21:11: Pleroma.Web.ApiSpec.RenderError.call/2
2026-02-12 23:44:27 +01:00
Phantasm
7d2518a9ae
Elixir 1.19: Fix typing violation on struct updates in Web.ApiSpec.Cast*
warning: a struct for Plug.Conn is expected on struct update:

         %Plug.Conn{conn | query_params: query_params}

     but got type:

         dynamic()

     where "conn" was given the type:

         # type: dynamic()
         # from: lib/pleroma/web/api_spec/cast_and_validate.ex:109:43
         conn

     when defining the variable "conn", you must also pattern match on "%Plug.Conn{}".

     hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

         user = some_function()
         %User{user | name: "John Doe"}

     it is enough to write:

         %User{} = user = some_function()
         %{user | name: "John Doe"}

     typing violation found at:
     │
 133 │         conn = %Conn{conn | query_params: query_params}
     │                ~
     │
     └─ lib/pleroma/web/api_spec/cast_and_validate.ex:133:16: Pleroma.Web.ApiSpec.CastAndValidate.cast_and_validate/6
2026-02-12 23:44:27 +01:00
Phantasm
40f4f1a99f
Elixir 1.19: Fix typing violation on struct updates in Pleroma.Upload
warning: a struct for Pleroma.Upload is expected on struct update:

        %Pleroma.Upload{
          upload
          | path:
              case upload.path do
                x when x === false or x === nil ->
                  <<to_string(upload.id)::binary, "/", to_string(upload.name)::binary>>

                x ->
                  x
              end
        }

    but got type:

        dynamic()

    where "upload" was given the type:

        # type: dynamic()
        # from: lib/pleroma/upload.ex:95:24
        {:ok, upload} <- prepare_upload(upload, opts)

    when defining the variable "upload", you must also pattern match on "%Pleroma.Upload{}".

    hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

        user = some_function()
        %User{user | name: "John Doe"}

    it is enough to write:

        %User{} = user = some_function()
        %{user | name: "John Doe"}

    typing violation found at:
    │
 96 │          upload = %__MODULE__{upload | path: upload.path || "#{upload.id}/#{upload.name}"},
    │                   ~
    │
    └─ lib/pleroma/upload.ex:96:19: Pleroma.Upload.store/2
2026-02-12 23:44:26 +01:00
Phantasm
d36e9c8a0d
Elixir 1.19: Fix typing violation on struct updates in MFA.Changeset
warning: a struct for Pleroma.MFA.Settings is expected on struct update:

        %Pleroma.MFA.Settings{settings | enabled: false}

    but got type:

        dynamic()

    where "settings" was given the type:

        # type: dynamic()
        # from: lib/pleroma/mfa/changeset.ex:11:14
        settings = Pleroma.MFA.fetch_settings(Ecto.Changeset.apply_changes(changeset))

    when defining the variable "settings", you must also pattern match on "%Pleroma.MFA.Settings{}".

    hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

        user = some_function()
        %User{user | name: "John Doe"}

    it is enough to write:

        %User{} = user = some_function()
        %{user | name: "John Doe"}

    typing violation found at:
    │
 17 │       put_change(changeset, %Settings{settings | enabled: false})
    │                             ~
    │
    └─ lib/pleroma/mfa/changeset.ex:17:29: Pleroma.MFA.Changeset.disable/2

---

    warning: a struct for Pleroma.MFA.Settings is expected on struct update:

        %Pleroma.MFA.Settings{
          settings
          | totp: %Pleroma.MFA.Settings.TOTP{confirmed: false, delivery_type: "app", secret: nil}
        }

    but got type:

        dynamic()

    where "settings" was given the type:

        # type: dynamic()
        # from: lib/pleroma/mfa/changeset.ex:23:74
        %Pleroma.User{multi_factor_authentication_settings: settings} = user

    when defining the variable "settings", you must also pattern match on "%Pleroma.MFA.Settings{}".

    hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

        user = some_function()
        %User{user | name: "John Doe"}

    it is enough to write:

        %User{} = user = some_function()
        %{user | name: "John Doe"}

    typing violation found at:
    │
 25 │     |> put_change(%Settings{settings | totp: %Settings.TOTP{}})
    │                   ~
    │
    └─ lib/pleroma/mfa/changeset.ex:25:19: Pleroma.MFA.Changeset.disable_totp/1
2026-02-12 23:44:26 +01:00
Phantasm
6279907754
Elixir 1.19: Fix typing violation on struct updates in Pleroma.Marker
warning: a struct for Pleroma.Marker is expected on struct update:

        %Pleroma.Marker{marker | user: user}

    but got type:

        dynamic()

    where "marker" was given the type:

        # type: dynamic()
        # from: lib/pleroma/marker.ex
        {:ok, marker}

    when defining the variable "marker", you must also pattern match on "%Pleroma.Marker{}".

    hint: given pattern matching is enough to catch typing errors, you may optionally convert the struct update into a map update. For example, instead of:

        user = some_function()
        %User{user | name: "John Doe"}

    it is enough to write:

        %User{} = user = some_function()
        %{user | name: "John Doe"}

    typing violation found at:
    │
 81 │       {:ok, marker} -> %__MODULE__{marker | user: user}
    │                        ~
    │
    └─ lib/pleroma/marker.ex:81:24: Pleroma.Marker.get_marker/2
2026-02-12 23:44:26 +01:00
feld
1c685ea41a Update README.md
fix logo
2026-02-12 00:34:08 +00:00
lain
ec6ffa4fdf Merge pull request 'CI: Add basic woodpecker file' (#7816) from woodpecker-ci into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7816
2026-02-09 17:46:19 +00:00
Lain Soykaf
4693dc837b CI: Only run on PR 2026-02-09 10:13:29 +04:00
Lain Soykaf
feda4d0718 CI: Add basic woodpecker file 2026-02-09 09:01:16 +04:00
nicole mikołajczyk
cb78699a3b Merge branch 'instance-profile-fields' into 'develop'
Add /api/v2/instance profile fields limits info used by Mastodon

See merge request pleroma/pleroma!4434
2026-01-30 23:04:49 +01:00
nicole mikołajczyk
833e9829ba Merge branch 'relationship-expires-at' into 'develop'
MastoAPI AccountView: Add mute/block expiry to the relationship object (simplified)

See merge request pleroma/pleroma!4433
2026-01-30 07:08:21 +01:00
nicole mikołajczyk
bd30d461b0 Add /api/v2/instance profile fields limits info used by Mastodon
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-01-30 07:05:45 +01:00
nicole mikołajczyk
5001fb3a78 Update changelog
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-01-28 14:02:55 +01:00
nicole mikołajczyk
bc0c7fb310 Fix tests, relationship should always define _expires_at
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
2026-01-28 13:58:33 +01:00