RemoteIp module name
authorAlexander Strizhakov <alex.strizhakov@gmail.com>
Wed, 24 Jun 2020 06:30:32 +0000 (09:30 +0300)
committerAlexander Strizhakov <alex.strizhakov@gmail.com>
Tue, 13 Oct 2020 13:43:50 +0000 (16:43 +0300)
config/config.exs
config/description.exs
config/test.exs
docs/configuration/cheatsheet.md
lib/pleroma/web/endpoint.ex
lib/pleroma/web/plugs/remote_ip.ex
test/pleroma/web/plugs/rate_limiter_test.exs
test/pleroma/web/plugs/remote_ip_test.exs

index d53663d360154a9c2b94c4b841ef1fad1e76cf3f..273da5bb6728faf2daf12f5bee3e66c01347d12b 100644 (file)
@@ -677,7 +677,7 @@ config :pleroma, :rate_limit,
 
 config :pleroma, Pleroma.Workers.PurgeExpiredActivity, enabled: true, min_lifetime: 600
 
 
 config :pleroma, Pleroma.Workers.PurgeExpiredActivity, enabled: true, min_lifetime: 600
 
-config :pleroma, Pleroma.Plugs.RemoteIp,
+config :pleroma, Pleroma.Web.Plugs.RemoteIp,
   enabled: true,
   headers: ["x-forwarded-for"],
   proxies: [],
   enabled: true,
   headers: ["x-forwarded-for"],
   proxies: [],
index 3902b96323f9de47c940b1897c7433e8aeb737d0..6e83a8e094571e8699a857191532c5991d51c9a6 100644 (file)
@@ -3250,10 +3250,10 @@ config :pleroma, :config_description, [
   },
   %{
     group: :pleroma,
   },
   %{
     group: :pleroma,
-    key: Pleroma.Plugs.RemoteIp,
+    key: Pleroma.Web.Plugs.RemoteIp,
     type: :group,
     description: """
     type: :group,
     description: """
-    `Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
+    `Pleroma.Web.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
     **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
     """,
     children: [
     **If your instance is not behind at least one reverse proxy, you should not enable this plug.**
     """,
     children: [
index 95f860f2f82783445444c303d4783c581a2b2cf0..7cc660e3c4c3b5011d5389aa99eb14b342f2e56d 100644 (file)
@@ -113,7 +113,7 @@ config :pleroma, Pleroma.Gun, Pleroma.GunMock
 
 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
 
 
 config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: true
 
-config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
+config :pleroma, Pleroma.Web.Plugs.RemoteIp, enabled: false
 
 config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
 
 
 config :pleroma, Pleroma.Web.ApiSpec.CastAndValidate, strict: true
 
index ea7dfec98ac20325db8044310f3d00b43c50cc6a..a6a152b7eed50fc773dae1cd6424e15adf6f9a2c 100644 (file)
@@ -416,12 +416,12 @@ This will make Pleroma listen on `127.0.0.1` port `8080` and generate urls start
 * ``referrer_policy``: The referrer policy to use, either `"same-origin"` or `"no-referrer"`.
 * ``report_uri``: Adds the specified url to `report-uri` and `report-to` group in CSP header.
 
 * ``referrer_policy``: The referrer policy to use, either `"same-origin"` or `"no-referrer"`.
 * ``report_uri``: Adds the specified url to `report-uri` and `report-to` group in CSP header.
 
-### Pleroma.Plugs.RemoteIp
+### Pleroma.Web.Plugs.RemoteIp
 
 !!! warning
     If your instance is not behind at least one reverse proxy, you should not enable this plug.
 
 
 !!! warning
     If your instance is not behind at least one reverse proxy, you should not enable this plug.
 
-`Pleroma.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
+`Pleroma.Web.Plugs.RemoteIp` is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
 
 Available options:
 
 
 Available options:
 
@@ -434,7 +434,7 @@ Available options:
 ### :rate_limit
 
 !!! note
 ### :rate_limit
 
 !!! note
-   If your instance is behind a reverse proxy ensure [`Pleroma.Plugs.RemoteIp`](#pleroma-plugs-remoteip) is enabled (it is enabled by default).
+   If your instance is behind a reverse proxy ensure [`Pleroma.Web.Plugs.RemoteIp`](#pleroma-plugs-remoteip) is enabled (it is enabled by default).
 
 A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where:
 
 
 A keyword list of rate limiters where a key is a limiter name and value is the limiter configuration. The basic configuration is a tuple where:
 
index 0512b9c614cab45f8780f1717bac42f4f97640c5..003bb1194a642af5d96e2b461e72011aaf2d0cf1 100644 (file)
@@ -122,7 +122,7 @@ defmodule Pleroma.Web.Endpoint do
     extra: extra
   )
 
     extra: extra
   )
 
-  plug(Pleroma.Plugs.RemoteIp)
+  plug(Pleroma.Web.Plugs.RemoteIp)
 
   defmodule Instrumenter do
     use Prometheus.PhoenixInstrumenter
 
   defmodule Instrumenter do
     use Prometheus.PhoenixInstrumenter
index 987022156fdf440ef1ad7f5d2d7e88087d677322..401e2cbfadfb85ca8cfe040adc6aa182a017fa7a 100644 (file)
@@ -2,7 +2,7 @@
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
 # SPDX-License-Identifier: AGPL-3.0-only
 
-defmodule Pleroma.Plugs.RemoteIp do
+defmodule Pleroma.Web.Plugs.RemoteIp do
   @moduledoc """
   This is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
   """
   @moduledoc """
   This is a shim to call [`RemoteIp`](https://git.pleroma.social/pleroma/remote_ip) but with runtime configuration.
   """
index dfc1abcbdb09a078c4d114498fb0646abbe61f29..7c10c97b3f1eeb4ff8b45d245067ef56ebd10c31 100644 (file)
@@ -19,7 +19,7 @@ defmodule Pleroma.Web.Plugs.RateLimiterTest do
 
   describe "config" do
     @limiter_name :test_init
 
   describe "config" do
     @limiter_name :test_init
-    setup do: clear_config([Pleroma.Plugs.RemoteIp, :enabled])
+    setup do: clear_config([Pleroma.Web.Plugs.RemoteIp, :enabled])
 
     test "config is required for plug to work" do
       Config.put([:rate_limit, @limiter_name], {1, 1})
 
     test "config is required for plug to work" do
       Config.put([:rate_limit, @limiter_name], {1, 1})
index 14c5576940aaf9185999bec813f323827967ca42..0bdb4c168757618578be6980d2ae0e3b34905d67 100644 (file)
@@ -6,7 +6,7 @@ defmodule Pleroma.Web.Plugs.RemoteIpTest do
   use ExUnit.Case
   use Plug.Test
 
   use ExUnit.Case
   use Plug.Test
 
-  alias Pleroma.Plugs.RemoteIp
+  alias Pleroma.Web.Plugs.RemoteIp
 
   import Pleroma.Tests.Helpers, only: [clear_config: 2]
 
 
   import Pleroma.Tests.Helpers, only: [clear_config: 2]