Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into websearch
authorlain <lain@soykaf.club>
Mon, 23 Nov 2020 14:18:19 +0000 (15:18 +0100)
committerlain <lain@soykaf.club>
Mon, 23 Nov 2020 14:18:19 +0000 (15:18 +0100)
1  2 
CHANGELOG.md
lib/pleroma/application.ex

diff --combined CHANGELOG.md
index 598fd59e3dbf4da79c68b92865cbc634aaff6f44,281f067294eaed80d40ae58bb50299da54d6ffcd..f4ef66408574649af2c092a8d0662912f27afc46
@@@ -10,7 -10,6 +10,7 @@@ The format is based on [Keep a Changelo
  
  - Polls now always return a `voters_count`, even if they are single-choice.
  - Admin Emails: The ap id is used as the user link in emails now.
 +- Search: When using Postgres 11+, Pleroma will use the `websearch_to_tsvector` function to parse search queries.
  
  ### Added
  
@@@ -36,7 -35,9 +36,9 @@@
  
  ### Fixed
  
- - <details>
+ - Users with `is_discoverable` field set to false (default value) will appear in in-service search results but be hidden from external services (search bots etc.).
+ <details>
    <summary>API Changes</summary>
    - Mastodon API: Current user is now included in conversation if it's the only participant.
    - Mastodon API: Fixed last_status.account being not filled with account data.
@@@ -46,8 -47,6 +48,6 @@@
  
  ### Changed
  
- - Fix ability to update Pleroma Chat push notifications with PUT /api/v1/push/subscription and alert type pleroma:chat_mention
  ### Fixed
  
  - Config generation: rename `Pleroma.Upload.Filter.ExifTool` to `Pleroma.Upload.Filter.Exiftool`.
  - S3 Uploads with Elixir 1.11.
  - Emoji Reaction activity filtering from blocked and muted accounts.
  - Mix task pleroma.user delete_activities for source installations.
+ - Fix ability to update Pleroma Chat push notifications with PUT /api/v1/push/subscription and alert type pleroma:chat_mention
+ - Forwarded reports duplication from Pleroma instances.
+ <details>
+   <summary>API</summary>
+ - Statuses were not displayed for Mastodon forwarded reports.
+ </details>
  
  ## [2.2.0] - 2020-11-12
  
@@@ -72,7 -79,7 +80,7 @@@
  - Renamed `:await_up_timeout` in `:connections_pool` namespace to `:connect_timeout`, old name is deprecated.
  - Renamed `:timeout` in `pools` namespace to `:recv_timeout`, old name is deprecated.
  - The `discoverable` field in the `User` struct will now add a NOINDEX metatag to profile pages when false.
- - Users with the `discoverable` field set to false will not show up in searches.
+ - Users with the `is_discoverable` field set to false will not show up in searches ([bug](https://git.pleroma.social/pleroma/pleroma/-/issues/2301)).
  - Minimum lifetime for ephmeral activities changed to 10 minutes and made configurable (`:min_lifetime` option).
  - Introduced optional dependencies on `ffmpeg`, `ImageMagick`, `exiftool` software packages. Please refer to `docs/installation/optional/media_graphics_packages.md`.
  - <details>
index 17a241cdfddb628a3653997aa17cc8323fb79c5f,ced14f87ff510b68b9531f263b400b16cdd234c5..22936bd7f245e7f7c128b1c7581c0f87bd4d4d82
@@@ -57,6 -57,7 +57,7 @@@ defmodule Pleroma.Application d
      setup_instrumenters()
      load_custom_modules()
      Pleroma.Docs.JSON.compile()
+     limiters_setup()
  
      adapter = Application.get_env(:tesla, :adapter)
  
      # See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
      # for other strategies and supported options
      opts = [strategy: :one_for_one, name: Pleroma.Supervisor]
 -    Supervisor.start_link(children, opts)
 +    result = Supervisor.start_link(children, opts)
 +
 +    set_postgres_server_version()
 +
 +    result
 +  end
 +
 +  defp set_postgres_server_version do
 +    version =
 +      with %{rows: [[version]]} <- Ecto.Adapters.SQL.query!(Pleroma.Repo, "show server_version"),
 +           {num, _} <- Float.parse(version) do
 +        num
 +      else
 +        e ->
 +          Logger.warn(
 +            "Could not get the postgres version: #{inspect(e)}.\nSetting the default value of 9.6"
 +          )
 +
 +          9.6
 +      end
 +
 +    Application.put_env(:postgres, :version, version)
    end
  
    def load_custom_modules do
    end
  
    defp http_children(_, _), do: []
+   @spec limiters_setup() :: :ok
+   def limiters_setup do
+     [Pleroma.Web.RichMedia.Helpers, Pleroma.Web.MediaProxy]
+     |> Enum.each(&ConcurrentLimiter.new(&1, 1, 0))
+   end
  end