From 92213fb87c7996caf9d1188a94907d2231ba25c8 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Thu, 6 Jun 2019 23:59:51 +0300 Subject: Replace Mix.env with Pleroma.Config.get(:env) Mix.env/0 is not availible in release environments such as distillery or elixir's built-in releases. --- config/config.exs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 4e2b1703b..c6bf71fc8 100644 --- a/config/config.exs +++ b/config/config.exs @@ -500,6 +500,8 @@ config :pleroma, :oauth2, config :pleroma, :database, rum_enabled: false +config :pleroma, :env, Mix.env() + config :http_signatures, adapter: Pleroma.Signature -- cgit v1.2.3 From 593b8b1e6a8502cca9bf5559b8bec86f172bbecb Mon Sep 17 00:00:00 2001 From: lain Date: Fri, 7 Jun 2019 14:28:14 +0200 Subject: Configuration: Skip thread containment by default In my tests the interaction between thread containment and other restrictions makes postgresql create some very bad query plans. This caused direct messages to time out on soykaf, for example. --- 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 c6bf71fc8..95a0e9972 100644 --- a/config/config.exs +++ b/config/config.exs @@ -244,7 +244,7 @@ config :pleroma, :instance, safe_dm_mentions: false, healthcheck: false, remote_post_retention_days: 90, - skip_thread_containment: false, + skip_thread_containment: true, limit_unauthenticated_to_local_content: true config :pleroma, :app_account_creation, enabled: true, max_requests: 25, interval: 1800 -- cgit v1.2.3 From 76fc4c92bb39dd5d6f4349482cb57419c0f0f93e Mon Sep 17 00:00:00 2001 From: lain Date: Fri, 7 Jun 2019 17:16:56 +0200 Subject: Fix tests. --- 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 7861b9598..6d4fcf7d0 100644 --- a/config/test.exs +++ b/config/test.exs @@ -27,7 +27,8 @@ config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Test config :pleroma, :instance, email: "admin@example.com", - notify_email: "noreply@example.com" + notify_email: "noreply@example.com", + skip_thread_containment: false # Configure your database config :pleroma, Pleroma.Repo, -- cgit v1.2.3 From 3d374bf7df6a5cc4bacefefcb133387fe4c5265f Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 8 Jun 2019 17:15:49 +0300 Subject: Basic release skeleton --- config/releases.exs | 1 + 1 file changed, 1 insertion(+) create mode 100644 config/releases.exs (limited to 'config') diff --git a/config/releases.exs b/config/releases.exs new file mode 100644 index 000000000..becde7693 --- /dev/null +++ b/config/releases.exs @@ -0,0 +1 @@ +import Config -- cgit v1.2.3 From 4b98a7ce4ef4b4e7b74f533e6d6ed343e1b34c48 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 8 Jun 2019 17:17:28 +0300 Subject: Set serve_endpoints to true in prod config as setting it in runtime config would cause issues with mix tasks --- config/prod.exs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/prod.exs b/config/prod.exs index d0cfd1ac2..cd5cdb087 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -15,7 +15,8 @@ use Mix.Config # which you typically run after static files are built. config :pleroma, Pleroma.Web.Endpoint, http: [port: 4000], - protocol: "http" + protocol: "http", + serve_endpoints: true # Do not print debug messages in production config :logger, level: :info -- cgit v1.2.3 From 4f5149c93be8d0abffca2aa74984b03d8e27739d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 8 Jun 2019 18:02:57 +0300 Subject: Set default loglevel to `warn` in prod It's rare that info logs are needed to debug the issue, so I would suggest setting them to warn in prod by default to make finding the relevant parts easier and potentially even decrease cpu usage on bigger instances Closes #962 --- config/prod.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/prod.exs b/config/prod.exs index d0cfd1ac2..1179cf3b0 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -18,7 +18,7 @@ config :pleroma, Pleroma.Web.Endpoint, protocol: "http" # Do not print debug messages in production -config :logger, level: :info +config :logger, level: :warn # ## SSL Support # -- cgit v1.2.3 From b6d2db42a759354bb21e2385021dfb6acfe29ef2 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sat, 8 Jun 2019 21:26:00 +0300 Subject: Fix wrong placement of serve_endpoints --- config/prod.exs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/prod.exs b/config/prod.exs index cd5cdb087..adc1c4bb7 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -15,8 +15,9 @@ use Mix.Config # which you typically run after static files are built. config :pleroma, Pleroma.Web.Endpoint, http: [port: 4000], - protocol: "http", - serve_endpoints: true + protocol: "http" + +config :phoenix, serve_endpoints: true # Do not print debug messages in production config :logger, level: :info -- cgit v1.2.3 From bc8f0593670452851d5e9d97bea1ae90f10db354 Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Tue, 11 Jun 2019 14:28:39 +0700 Subject: Add rate limiting for search endpoints --- config/config.exs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 4e2b1703b..d20d4fda9 100644 --- a/config/config.exs +++ b/config/config.exs @@ -503,6 +503,8 @@ config :pleroma, :database, rum_enabled: false config :http_signatures, adapter: Pleroma.Signature +config :pleroma, :rate_limit, search: [{1000, 10}, {1000, 30}] + # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. import_config "#{Mix.env()}.exs" -- cgit v1.2.3 From ad04d12de63d559cc6398c58296afd04321adfbc Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Tue, 11 Jun 2019 16:06:03 +0700 Subject: Replace `MastodonAPIController.account_register/2` rate limiter --- config/config.exs | 6 +++--- config/test.exs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index d20d4fda9..3d2c6d48e 100644 --- a/config/config.exs +++ b/config/config.exs @@ -247,8 +247,6 @@ config :pleroma, :instance, skip_thread_containment: false, limit_unauthenticated_to_local_content: true -config :pleroma, :app_account_creation, enabled: true, max_requests: 25, interval: 1800 - config :pleroma, :markup, # XXX - unfortunately, inline images must be enabled by default right now, because # of custom emoji. Issue #275 discusses defanging that somehow. @@ -503,7 +501,9 @@ config :pleroma, :database, rum_enabled: false config :http_signatures, adapter: Pleroma.Signature -config :pleroma, :rate_limit, search: [{1000, 10}, {1000, 30}] +config :pleroma, :rate_limit, + search: [{1000, 10}, {1000, 30}], + app_account_creation: {1_800_000, 25} # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. diff --git a/config/test.exs b/config/test.exs index 7861b9598..95129f409 100644 --- a/config/test.exs +++ b/config/test.exs @@ -59,7 +59,7 @@ config :pleroma, Pleroma.ScheduledActivity, total_user_limit: 3, enabled: false -config :pleroma, :app_account_creation, max_requests: 5 +config :pleroma, :rate_limit, app_account_creation: {1000, 5} config :pleroma, :http_security, report_uri: "https://endpoint.com" -- cgit v1.2.3 From 5d5a9a3a35cb06c7cbd9c29fdbf7cc0b866785fa Mon Sep 17 00:00:00 2001 From: Hakaba Hitoyo Date: Tue, 11 Jun 2019 11:34:22 +0000 Subject: Better default parameters for suggestion --- 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 0642ee3c3..b73541213 100644 --- a/config/config.exs +++ b/config/config.exs @@ -360,8 +360,8 @@ config :pleroma, :suggestions, third_party_engine: "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}", timeout: 300_000, - limit: 23, - web: "https://vinayaka.distsn.org/?{{host}}+{{user}}" + limit: 40, + web: "https://vinayaka.distsn.org" config :pleroma, :http_security, enabled: true, -- cgit v1.2.3 From 6f29865d43f30303bc05bfb10aa28fe3ebef1bfd Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Tue, 11 Jun 2019 21:25:53 +0700 Subject: Add option to restrict all users to local content --- 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 b73541213..f866e8d2b 100644 --- a/config/config.exs +++ b/config/config.exs @@ -245,7 +245,7 @@ config :pleroma, :instance, healthcheck: false, remote_post_retention_days: 90, skip_thread_containment: true, - limit_unauthenticated_to_local_content: true + limit_to_local_content: :unauthenticated config :pleroma, :markup, # XXX - unfortunately, inline images must be enabled by default right now, because -- cgit v1.2.3 From f0d96534a4645f0996b3fab7ab5ba3b482fd4e23 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 11 Jun 2019 18:55:55 +0300 Subject: Import release config from env variable or /etc/pleroma/config.exs and warn if the file is missing --- config/releases.exs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'config') diff --git a/config/releases.exs b/config/releases.exs index becde7693..f8494dd34 100644 --- a/config/releases.exs +++ b/config/releases.exs @@ -1 +1,16 @@ import Config + +config_path = System.get_env("PLEROMA_CONFIG_PATH") || "/etc/pleroma/config.exs" + +if File.exists?(config_path) do + import_config config_path +else + warning = [ + IO.ANSI.red(), + IO.ANSI.bright(), + "!!! #{config_path} not found! Please ensure it exists and that PLEROMA_CONFIG_PATH is unset or points to an existing file", + IO.ANSI.reset() + ] + + IO.puts(warning) +end -- cgit v1.2.3 From ac3d43e6201a31d274f89185de950e787f2e9708 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 14 Jun 2019 01:38:32 +0300 Subject: Set instance static/uploads to be outside of application directory in release config In case of releases the application directory changes with each version so the contents will not be accessible --- config/releases.exs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'config') diff --git a/config/releases.exs b/config/releases.exs index f8494dd34..98c5ceccd 100644 --- a/config/releases.exs +++ b/config/releases.exs @@ -1,5 +1,8 @@ import Config +config :pleroma, :instance, static_dir: "/var/lib/pleroma/static" +config :pleroma, Pleroma.Uploaders.Local, uploads: "/var/lib/pleroma/uploads" + config_path = System.get_env("PLEROMA_CONFIG_PATH") || "/etc/pleroma/config.exs" if File.exists?(config_path) do -- cgit v1.2.3 From ce823fa88e2586a4edeb2c0698b9cb72b20a4fdc Mon Sep 17 00:00:00 2001 From: Egor Kislitsyn Date: Fri, 14 Jun 2019 19:24:31 +0700 Subject: Fix rate limit test --- config/test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config') diff --git a/config/test.exs b/config/test.exs index 1c5eff794..73a8b82a1 100644 --- a/config/test.exs +++ b/config/test.exs @@ -60,7 +60,7 @@ config :pleroma, Pleroma.ScheduledActivity, total_user_limit: 3, enabled: false -config :pleroma, :rate_limit, app_account_creation: {1000, 5} +config :pleroma, :rate_limit, app_account_creation: {10_000, 5} config :pleroma, :http_security, report_uri: "https://endpoint.com" -- cgit v1.2.3 From c2ca1f22a25d22d6d863406ed05b08c643e5824c Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Fri, 14 Jun 2019 15:45:05 +0000 Subject: it is changed in compile time we can't change module attributes and endpoint settings in runtime --- config/config.exs | 3 ++- config/dev.exs | 3 +++ config/prod.exs | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index f866e8d2b..7f46a8755 100644 --- a/config/config.exs +++ b/config/config.exs @@ -245,7 +245,8 @@ config :pleroma, :instance, healthcheck: false, remote_post_retention_days: 90, skip_thread_containment: true, - limit_to_local_content: :unauthenticated + limit_to_local_content: :unauthenticated, + dynamic_configuration: false config :pleroma, :markup, # XXX - unfortunately, inline images must be enabled by default right now, because diff --git a/config/dev.exs b/config/dev.exs index 0432adce7..71b11f7c3 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -59,3 +59,6 @@ else "!!! RUNNING IN LOCALHOST DEV MODE! !!!\nFEDERATION WON'T WORK UNTIL YOU CONFIGURE A dev.secret.exs" ) end + +if File.exists?("./config/dev.migrated.secret.exs"), + do: import_config("./config/dev.migrated.secret.exs") diff --git a/config/prod.exs b/config/prod.exs index bf1a97de0..42edccf64 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -63,3 +63,6 @@ config :logger, level: :warn # Finally import the config/prod.secret.exs # which should be versioned separately. import_config "prod.secret.exs" + +if File.exists?("./config/prod.migrated.secret.exs"), + do: import_config("./config/prod.migrated.secret.exs") -- cgit v1.2.3 From f30a3241d20be9407335c88fa86deb873de5b872 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Tue, 18 Jun 2019 16:08:18 +0300 Subject: Deps: Update auto_linker --- config/config.exs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 7f46a8755..3962ac019 100644 --- a/config/config.exs +++ b/config/config.exs @@ -442,6 +442,8 @@ config :auto_linker, opts: [ scheme: true, extra: true, + # TODO: Set to :no_scheme when it works properly + validate_tld: true, class: false, strip_prefix: false, new_window: false, -- cgit v1.2.3 From 32320c1ee94a999082f10c9f9a3c6d55ced21e21 Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Thu, 20 Jun 2019 17:43:57 +0000 Subject: Fixes for dynamic configuration --- config/dev.exs | 4 ++-- config/prod.exs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'config') diff --git a/config/dev.exs b/config/dev.exs index 71b11f7c3..7e1e3b4be 100644 --- a/config/dev.exs +++ b/config/dev.exs @@ -60,5 +60,5 @@ else ) end -if File.exists?("./config/dev.migrated.secret.exs"), - do: import_config("./config/dev.migrated.secret.exs") +if File.exists?("./config/dev.exported_from_db.secret.exs"), + do: import_config("dev.exported_from_db.secret.exs") diff --git a/config/prod.exs b/config/prod.exs index 42edccf64..9c205cbd2 100644 --- a/config/prod.exs +++ b/config/prod.exs @@ -64,5 +64,5 @@ config :logger, level: :warn # which should be versioned separately. import_config "prod.secret.exs" -if File.exists?("./config/prod.migrated.secret.exs"), - do: import_config("./config/prod.migrated.secret.exs") +if File.exists?("./config/prod.exported_from_db.secret.exs"), + do: import_config("prod.exported_from_db.secret.exs") -- cgit v1.2.3 From 875100de018d4e0980656a0fc75eb51f97fa0eee Mon Sep 17 00:00:00 2001 From: rinpatch Date: Sun, 23 Jun 2019 09:31:39 +0300 Subject: Bind to 127.0.0.1 instead of 0.0.0.0 by default --- config/config.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 3962ac019..0d07fc692 100644 --- a/config/config.exs +++ b/config/config.exs @@ -139,6 +139,7 @@ config :pleroma, Pleroma.Web.Endpoint, instrumenters: [Pleroma.Web.Endpoint.Instrumenter], url: [host: "localhost"], http: [ + ip: {127, 0, 0, 1}, dispatch: [ {:_, [ -- cgit v1.2.3 From 4ad15ad2a90ca1ac370c8a79f796adc603a90479 Mon Sep 17 00:00:00 2001 From: Maksim Pechnikov Date: Tue, 25 Jun 2019 22:25:37 +0300 Subject: add ignore hosts and TLDs for rich_media --- config/config.exs | 5 ++++- config/test.exs | 6 +++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 0d07fc692..5032b24e6 100644 --- a/config/config.exs +++ b/config/config.exs @@ -330,7 +330,10 @@ config :pleroma, :mrf_keyword, config :pleroma, :mrf_subchain, match_actor: %{} -config :pleroma, :rich_media, enabled: true +config :pleroma, :rich_media, + enabled: true, + ignore_hosts: [], + ignore_tld: ["local", "localdomain", "lan"] config :pleroma, :media_proxy, enabled: false, diff --git a/config/test.exs b/config/test.exs index 73a8b82a1..9d441a7f5 100644 --- a/config/test.exs +++ b/config/test.exs @@ -43,7 +43,11 @@ config :pleroma, Pleroma.Repo, config :pbkdf2_elixir, rounds: 1 config :tesla, adapter: Tesla.Mock -config :pleroma, :rich_media, enabled: false + +config :pleroma, :rich_media, + enabled: false, + ignore_hosts: [], + ignore_tld: ["local", "localdomain", "lan"] config :web_push_encryption, :vapid_details, subject: "mailto:administrator@example.com", -- cgit v1.2.3 From 41e4752950079b80e3d5a06d9806686bd3216dff Mon Sep 17 00:00:00 2001 From: rinpatch Date: Wed, 26 Jun 2019 06:48:59 +0300 Subject: Make default pack extensions configurable and default to png and gif --- config/config.exs | 1 + 1 file changed, 1 insertion(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 0d07fc692..f7019b382 100644 --- a/config/config.exs +++ b/config/config.exs @@ -99,6 +99,7 @@ config :pleroma, Pleroma.Uploaders.MDII, config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"], + pack_extensions: [".png", ".gif"], groups: [ # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md` Custom: ["/emoji/*.png", "/emoji/**/*.png"] -- cgit v1.2.3 From f8ec3e129f8496e6d86e3fe9dc69a1567e1e2768 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Thu, 27 Jun 2019 13:00:22 -0500 Subject: In my experience syslog tags are usually lowercase --- 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 d381a8dc2..e337f00aa 100644 --- a/config/config.exs +++ b/config/config.exs @@ -169,7 +169,7 @@ config :logger, :console, config :logger, :ex_syslogger, level: :debug, - ident: "Pleroma", + ident: "pleroma", format: "$metadata[$level] $message", metadata: [:request_id] -- cgit v1.2.3