From 82c62c5028f517ded121b46b9806053989defdc2 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Mon, 16 Dec 2019 15:32:33 +0700 Subject: [PATCH] Add default endpoint to Pleroma.Captcha.Kocaptcha --- config/test.exs | 2 -- lib/pleroma/captcha/kocaptcha.ex | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/test.exs b/config/test.exs index b48b89c8f..d52ced612 100644 --- a/config/test.exs +++ b/config/test.exs @@ -95,8 +95,6 @@ config :pleroma, Pleroma.ReverseProxy.Client, Pleroma.ReverseProxy.ClientMock -config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch" - if File.exists?("./config/test.secret.exs") do import_config "test.secret.exs" else diff --git a/lib/pleroma/captcha/kocaptcha.ex b/lib/pleroma/captcha/kocaptcha.ex index 4e1a07c59..a3128decb 100644 --- a/lib/pleroma/captcha/kocaptcha.ex +++ b/lib/pleroma/captcha/kocaptcha.ex @@ -5,11 +5,13 @@ defmodule Pleroma.Captcha.Kocaptcha do import Pleroma.Web.Gettext alias Pleroma.Captcha.Service + @behaviour Service + @default_endpoint "https://captcha.kotobank.ch" @impl Service def new do - endpoint = Pleroma.Config.get!([__MODULE__, :endpoint]) + endpoint = Pleroma.Config.get([__MODULE__, :endpoint], @default_endpoint) case Tesla.get(endpoint <> "/new") do {:error, _} ->