From a2399c1c7c17ee1c8e85ae0b6095405c7cb9f6f1 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sat, 15 Dec 2018 01:31:19 +0300 Subject: Add base CAPTCHA support (currently only kocaptcha) --- config/config.exs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 1401b0a3d..df4c618a7 100644 --- a/config/config.exs +++ b/config/config.exs @@ -10,6 +10,13 @@ config :pleroma, ecto_repos: [Pleroma.Repo] config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes +config :pleroma, Pleroma.Captcha, + method: Pleroma.Captcha.Kocaptcha + +# Kocaptcha is a very simple captcha service, the source code is here: https://github.com/koto-bank/kocaptcha +config :pleroma, Pleroma.Captcha.Kocaptcha, + endpoint: "http://localhost:9093" + # Upload configuration config :pleroma, Pleroma.Upload, uploader: Pleroma.Uploaders.Local, -- cgit v1.2.3 From 28c43a417e89ad68674f6e60d7d3025fbb4655ff Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sat, 15 Dec 2018 02:00:00 +0300 Subject: Add an ability to disabled captcha --- config/config.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index df4c618a7..32593045c 100644 --- a/config/config.exs +++ b/config/config.exs @@ -11,6 +11,7 @@ config :pleroma, ecto_repos: [Pleroma.Repo] config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes config :pleroma, Pleroma.Captcha, + enabled: false, method: Pleroma.Captcha.Kocaptcha # Kocaptcha is a very simple captcha service, the source code is here: https://github.com/koto-bank/kocaptcha -- cgit v1.2.3 From 23549d39521386f217a57ef1aeb3d660eff06860 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sat, 15 Dec 2018 22:08:26 +0300 Subject: Formatting fixes --- config/config.exs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 32593045c..b7d439e9d 100644 --- a/config/config.exs +++ b/config/config.exs @@ -15,8 +15,7 @@ config :pleroma, Pleroma.Captcha, method: Pleroma.Captcha.Kocaptcha # Kocaptcha is a very simple captcha service, the source code is here: https://github.com/koto-bank/kocaptcha -config :pleroma, Pleroma.Captcha.Kocaptcha, - endpoint: "http://localhost:9093" +config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "http://localhost:9093" # Upload configuration config :pleroma, Pleroma.Upload, -- cgit v1.2.3 From 98e10c0d4f9d0aa32e34d706c9aa5919a64c2db2 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sat, 15 Dec 2018 22:12:20 +0300 Subject: Add captcha documentation to config.md --- config/config.exs | 1 - config/config.md | 12 +++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index b7d439e9d..5149e9c41 100644 --- a/config/config.exs +++ b/config/config.exs @@ -14,7 +14,6 @@ config :pleroma, Pleroma.Captcha, enabled: false, method: Pleroma.Captcha.Kocaptcha -# Kocaptcha is a very simple captcha service, the source code is here: https://github.com/koto-bank/kocaptcha config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "http://localhost:9093" # Upload configuration diff --git a/config/config.md b/config/config.md index 8282eab14..e8b5e52cb 100644 --- a/config/config.md +++ b/config/config.md @@ -7,7 +7,7 @@ If you run Pleroma with ``MIX_ENV=prod`` the file is ``prod.secret.exs``, otherw * `uploader`: Select which `Pleroma.Uploaders` to use * `filters`: List of `Pleroma.Upload.Filter` to use. * `base_url`: The base URL to access a user-uploaded file. Useful when you want to proxy the media files via another host. -* `proxy_remote`: If you're using a remote uploader, Pleroma will proxy media requests instead of redirecting to it. +* `proxy_remote`: If you\'re using a remote uploader, Pleroma will proxy media requests instead of redirecting to it. * `proxy_opts`: Proxy options, see `Pleroma.ReverseProxy` documentation. Note: `strip_exif` has been replaced by `Pleroma.Upload.Filter.Mogrify`. @@ -163,3 +163,13 @@ Web Push Notifications configuration. You can use the mix task `mix web_push.gen * ``subject``: a mailto link for the administrative contact. It’s best if this email is not a personal email address, but rather a group email so that if a person leaves an organization, is unavailable for an extended period, or otherwise can’t respond, someone else on the list can. * ``public_key``: VAPID public key * ``private_key``: VAPID private key + +## Pleroma.Captcha +* `enabled`: Whether the captcha should be shown on registration +* `method`: The method/service to use for captcha + +### Pleroma.Captcha.Kocaptcha +Kocaptcha is a very simple captcha service with a single API endpoint, +the source code is here: https://github.com/koto-bank/kocaptcha + +* `endpoint`: the kocaptcha endpoint to use \ No newline at end of file -- cgit v1.2.3 From e8537208bd9af701cbfc788ca307b8352306a36b Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sat, 15 Dec 2018 22:38:39 +0300 Subject: Add a captcha mock for tests --- config/test.exs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config') diff --git a/config/test.exs b/config/test.exs index 5c6acfead..f5348bd46 100644 --- a/config/test.exs +++ b/config/test.exs @@ -6,6 +6,11 @@ config :pleroma, Pleroma.Web.Endpoint, http: [port: 4001], server: false +# Disable captha for tests +config :pleroma, Pleroma.Captcha, + enabled: true, + method: Pleroma.Captcha.Mock # A fake captcha service for tests + # Print only warnings and errors during test config :logger, level: :warn -- cgit v1.2.3 From c859cd1d61d81db4999c594ef61164d752d76145 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sat, 15 Dec 2018 23:39:23 +0300 Subject: Fix style --- config/test.exs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/test.exs b/config/test.exs index f5348bd46..5670e11a0 100644 --- a/config/test.exs +++ b/config/test.exs @@ -9,7 +9,8 @@ config :pleroma, Pleroma.Web.Endpoint, # Disable captha for tests config :pleroma, Pleroma.Captcha, enabled: true, - method: Pleroma.Captcha.Mock # A fake captcha service for tests + # A fake captcha service for tests + method: Pleroma.Captcha.Mock # Print only warnings and errors during test config :logger, level: :warn -- cgit v1.2.3 From 6062885df6178c09544b6a0b5b731a554786397e Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sun, 16 Dec 2018 22:04:43 +0300 Subject: Add a configurable auto-cleanup for captchas --- config/config.exs | 1 + config/config.md | 1 + 2 files changed, 2 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 5149e9c41..21cdc0537 100644 --- a/config/config.exs +++ b/config/config.exs @@ -12,6 +12,7 @@ config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes config :pleroma, Pleroma.Captcha, enabled: false, + minutes_retained: 5, method: Pleroma.Captcha.Kocaptcha config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "http://localhost:9093" diff --git a/config/config.md b/config/config.md index e8b5e52cb..65f0866fd 100644 --- a/config/config.md +++ b/config/config.md @@ -167,6 +167,7 @@ Web Push Notifications configuration. You can use the mix task `mix web_push.gen ## Pleroma.Captcha * `enabled`: Whether the captcha should be shown on registration * `method`: The method/service to use for captcha +* `minutes_retained`: The time in minutes for which the captcha is valid (stored in the cache) ### Pleroma.Captcha.Kocaptcha Kocaptcha is a very simple captcha service with a single API endpoint, -- cgit v1.2.3 From 1d31fd0722c27803adc077e2efb424229f31d361 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sun, 16 Dec 2018 22:37:16 +0300 Subject: Make the hosted kocaptcha the default value --- config/config.exs | 2 +- config/config.md | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 21cdc0537..eba401d3e 100644 --- a/config/config.exs +++ b/config/config.exs @@ -15,7 +15,7 @@ config :pleroma, Pleroma.Captcha, minutes_retained: 5, method: Pleroma.Captcha.Kocaptcha -config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "http://localhost:9093" +config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch" # Upload configuration config :pleroma, Pleroma.Upload, diff --git a/config/config.md b/config/config.md index 65f0866fd..324f837ce 100644 --- a/config/config.md +++ b/config/config.md @@ -171,6 +171,7 @@ Web Push Notifications configuration. You can use the mix task `mix web_push.gen ### Pleroma.Captcha.Kocaptcha Kocaptcha is a very simple captcha service with a single API endpoint, -the source code is here: https://github.com/koto-bank/kocaptcha +the source code is here: https://github.com/koto-bank/kocaptcha. The default endpoint +`https://captcha.kotobank.ch` is hosted by the developer. * `endpoint`: the kocaptcha endpoint to use \ No newline at end of file -- cgit v1.2.3 From 3a31fdaf0668b4fb4d05c3087674c2b32b6afbe9 Mon Sep 17 00:00:00 2001 From: Ekaterina Vaartis Date: Sun, 16 Dec 2018 22:40:44 +0300 Subject: Change minutes_retained config to seconds_retained --- config/config.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index eba401d3e..45a22f5da 100644 --- a/config/config.exs +++ b/config/config.exs @@ -12,7 +12,7 @@ config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes config :pleroma, Pleroma.Captcha, enabled: false, - minutes_retained: 5, + seconds_retained: 180, method: Pleroma.Captcha.Kocaptcha config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch" -- cgit v1.2.3 From 6e2f64a0a65a2c6fe2aacab164ab0a08341be919 Mon Sep 17 00:00:00 2001 From: vaartis Date: Mon, 17 Dec 2018 06:41:41 +0000 Subject: minutes->seconds_retained in config.md --- config/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/config.md b/config/config.md index 324f837ce..edabd6e0f 100644 --- a/config/config.md +++ b/config/config.md @@ -167,7 +167,7 @@ Web Push Notifications configuration. You can use the mix task `mix web_push.gen ## Pleroma.Captcha * `enabled`: Whether the captcha should be shown on registration * `method`: The method/service to use for captcha -* `minutes_retained`: The time in minutes for which the captcha is valid (stored in the cache) +* `seconds_retained`: The time in seconds for which the captcha is valid (stored in the cache) ### Pleroma.Captcha.Kocaptcha Kocaptcha is a very simple captcha service with a single API endpoint, -- cgit v1.2.3