From 09c13d0929f9f0d4b674c38fb9f802a24346f2a4 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Mon, 10 Dec 2018 01:22:50 +0300 Subject: Use "~" as a route namespace symbol on FE --- config/config.exs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 8d2fdd40d..0f30b2985 100644 --- a/config/config.exs +++ b/config/config.exs @@ -119,8 +119,8 @@ config :pleroma, :fe, logo_mask: true, logo_margin: "0.1em", background: "/static/aurora_borealis.jpg", - redirect_root_no_login: "/main/all", - redirect_root_login: "/main/friends", + redirect_root_no_login: "/~/main/all", + redirect_root_login: "/~/main/friends", show_instance_panel: true, scope_options_enabled: false, formatting_options_enabled: false, -- cgit v1.2.3 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 7c522f38f027ba0f9464bcbfc9423b6685b44d16 Mon Sep 17 00:00:00 2001 From: Rin Toshaka Date: Sun, 16 Dec 2018 08:49:23 +0100 Subject: Enable unsecure cookies by default in dev.exs --- config/dev.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/dev.exs b/config/dev.exs index 080a2f8db..8f89aa03c 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -12,6 +12,7 @@ config :pleroma, Pleroma.Web.Endpoint, protocol_options: [max_request_line_length: 8192, max_header_value_length: 8192] ], protocol: "http", + secure_cookie_flag: false, debug_errors: true, code_reloader: true, check_origin: false, -- 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 From 77b5154c825e2ff5996f170c03657eaadcef4680 Mon Sep 17 00:00:00 2001 From: href Date: Mon, 17 Dec 2018 14:39:59 +0100 Subject: Cowboy handler for Mastodon WebSocket --- config/config.exs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 1777a54c0..df6ea09ae 100644 --- a/config/config.exs +++ b/config/config.exs @@ -50,6 +50,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", -- cgit v1.2.3 From b12a90491156f1b31defd7aa1b322a86867dbf2b Mon Sep 17 00:00:00 2001 From: href Date: Mon, 17 Dec 2018 17:09:06 +0100 Subject: Integration tests for mastodon websocket --- 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 5c6acfead..8f4a2dc17 100644 --- a/config/test.exs +++ b/config/test.exs @@ -4,7 +4,8 @@ use Mix.Config # you can enable the server option below. config :pleroma, Pleroma.Web.Endpoint, http: [port: 4001], - server: false + url: [port: 4001], + server: true # Print only warnings and errors during test config :logger, level: :warn -- cgit v1.2.3 From b1860fe85af1d32de937f466ba65d03614952e31 Mon Sep 17 00:00:00 2001 From: href Date: Mon, 17 Dec 2018 22:50:59 +0100 Subject: Instance/Static runtime plug This allows to set-up an arbitrary directory which overrides most of the static files: index.html static/ emoji/ packs/ sounds/ images/ instance/ favicon.png. If the files are not present in the directory, the bundled ones in priv/static will be used. --- config/config.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 036f1ac0b..e4b31bf81 100644 --- a/config/config.exs +++ b/config/config.exs @@ -110,6 +110,7 @@ config :pleroma, :instance, public: true, quarantined_instances: [], managed_config: true, + static_dir: "instance/static/", allowed_post_formats: [ "text/plain", "text/html", -- cgit v1.2.3