Merge branch 'captcha' into 'develop'
authorlambda <pleromagit@rogerbraun.net>
Mon, 17 Dec 2018 19:45:14 +0000 (19:45 +0000)
committerlambda <pleromagit@rogerbraun.net>
Mon, 17 Dec 2018 19:45:14 +0000 (19:45 +0000)
Captcha

See merge request pleroma/pleroma!550

1  2 
config/config.exs
config/test.exs

diff --combined config/config.exs
index df6ea09ae4c894dfa0d85fc5d43c5763a44b6716,45a22f5da1a7e45c4104de2038a1a4c77f24bb45..036f1ac0b34fdb50bd713499cd2982b56d6794a5
@@@ -10,6 -10,13 +10,13 @@@ config :pleroma, ecto_repos: [Pleroma.R
  
  config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes
  
+ config :pleroma, Pleroma.Captcha,
+   enabled: false,
+   seconds_retained: 180,
+   method: Pleroma.Captcha.Kocaptcha
+ config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
  # Upload configuration
  config :pleroma, Pleroma.Upload,
    uploader: Pleroma.Uploaders.Local,
@@@ -50,15 -57,6 +57,15 @@@ config :pleroma, :uri_schemes
  # Configures the endpoint
  config :pleroma, Pleroma.Web.Endpoint,
    url: [host: "localhost"],
 +  http: [
 +    dispatch: [
 +      {:_,
 +       [
 +         {"/api/v1/streaming", Elixir.Pleroma.Web.MastodonAPI.WebsocketHandler, []},
 +         {:_, Plug.Adapters.Cowboy.Handler, {Pleroma.Web.Endpoint, []}}
 +       ]}
 +    ]
 +  ],
    protocol: "https",
    secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
    signing_salt: "CqaoopA2",
@@@ -74,7 -72,6 +81,7 @@@ config :logger, :console
  config :mime, :types, %{
    "application/xml" => ["xml"],
    "application/xrd+xml" => ["xrd+xml"],
 +  "application/jrd+json" => ["jrd+json"],
    "application/activity+json" => ["activity+json"],
    "application/ld+json" => ["activity+json"]
  }
diff --combined config/test.exs
index 8f4a2dc17bf5ab5f7e35012c0851db17167f5839,5670e11a0411b4de661a251baa06d8b06aea7b0f..51aace4077debd3dfa1d567dc8968825388ad473
@@@ -4,9 -4,14 +4,15 @@@ use Mix.Confi
  # you can enable the server option below.
  config :pleroma, Pleroma.Web.Endpoint,
    http: [port: 4001],
 -  server: false
 +  url: [port: 4001],
 +  server: true
  
+ # Disable captha for tests
+ config :pleroma, Pleroma.Captcha,
+   enabled: true,
+   # A fake captcha service for tests
+   method: Pleroma.Captcha.Mock
  # Print only warnings and errors during test
  config :logger, level: :warn