From f71aa644b1aedba32c83bad76bc512bfe52e6c75 Mon Sep 17 00:00:00 2001 From: lain Date: Tue, 25 Feb 2020 11:17:51 +0100 Subject: Add :unnamed option to default database configuration --- config/config.exs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 9d1e29c0d..2b7a761ea 100644 --- a/config/config.exs +++ b/config/config.exs @@ -621,7 +621,9 @@ config :pleroma, :modules, runtime_dir: "instance/modules" config :pleroma, configurable_from_database: false -config :pleroma, Pleroma.Repo, parameters: [gin_fuzzy_search_limit: "500"] +config :pleroma, Pleroma.Repo, + parameters: [gin_fuzzy_search_limit: "500"], + prepare: :unnamed # Import environment specific config. This must remain at the bottom # of this file so it overrides the configuration defined above. -- cgit v1.2.3 From 2076c9f8c88b387fd3944f77bf05371261b6cebe Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Wed, 26 Feb 2020 19:50:07 +0300 Subject: unnecessary groups --- config/description.exs | 198 +------------------------------------------------ 1 file changed, 2 insertions(+), 196 deletions(-) (limited to 'config') diff --git a/config/description.exs b/config/description.exs index f0d1077fd..aa8a8d790 100644 --- a/config/description.exs +++ b/config/description.exs @@ -1615,160 +1615,6 @@ config :pleroma, :config_description, [ } ] }, - %{ - group: :pleroma, - key: Pleroma.Web.Endpoint, - type: :group, - description: "Phoenix endpoint configuration", - children: [ - %{ - key: :http, - label: "HTTP", - type: {:keyword, :integer, :tuple}, - description: "http protocol configuration", - suggestions: [ - port: 8080, - ip: {127, 0, 0, 1} - ], - children: [ - %{ - key: :dispatch, - type: {:list, :tuple}, - description: "dispatch settings", - suggestions: [ - {:_, - [ - {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []}, - {"/websocket", Phoenix.Endpoint.CowboyWebSocket, - {Phoenix.Transports.WebSocket, - {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}}, - {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}} - ]} - # end copied from config.exs - ] - }, - %{ - key: :ip, - label: "IP", - type: :tuple, - description: "ip", - suggestions: [ - {0, 0, 0, 0} - ] - }, - %{ - key: :port, - type: :integer, - description: "port", - suggestions: [ - 2020 - ] - } - ] - }, - %{ - key: :url, - label: "URL", - type: {:keyword, :string, :integer}, - description: "configuration for generating urls", - suggestions: [ - host: "example.com", - port: 2020, - scheme: "https" - ], - children: [ - %{ - key: :host, - type: :string, - description: "Host", - suggestions: [ - "example.com" - ] - }, - %{ - key: :port, - type: :integer, - description: "port", - suggestions: [ - 2020 - ] - }, - %{ - key: :scheme, - type: :string, - description: "Scheme", - suggestions: [ - "https", - "https" - ] - } - ] - }, - %{ - key: :instrumenters, - type: {:list, :module}, - suggestions: [Pleroma.Web.Endpoint.Instrumenter] - }, - %{ - key: :protocol, - type: :string, - suggestions: ["https"] - }, - %{ - key: :secret_key_base, - type: :string, - suggestions: ["aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl"] - }, - %{ - key: :signing_salt, - type: :string, - suggestions: ["CqaoopA2"] - }, - %{ - key: :render_errors, - type: :keyword, - suggestions: [view: Pleroma.Web.ErrorView, accepts: ~w(json)], - children: [ - %{ - key: :view, - type: :module, - suggestions: [Pleroma.Web.ErrorView] - }, - %{ - key: :accepts, - type: {:list, :string}, - suggestions: ["json"] - } - ] - }, - %{ - key: :pubsub, - type: :keyword, - suggestions: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2], - children: [ - %{ - key: :name, - type: :module, - suggestions: [Pleroma.PubSub] - }, - %{ - key: :adapter, - type: :module, - suggestions: [Phoenix.PubSub.PG2] - } - ] - }, - %{ - key: :secure_cookie_flag, - type: :boolean - }, - %{ - key: :extra_cookie_attrs, - type: {:list, :string}, - suggestions: ["SameSite=Lax"] - } - ] - }, %{ group: :pleroma, key: :activitypub, @@ -2594,19 +2440,6 @@ config :pleroma, :config_description, [ } ] }, - %{ - group: :pleroma, - key: :database, - type: :group, - description: "Database related settings", - children: [ - %{ - key: :rum_enabled, - type: :boolean, - description: "If RUM indexes should be used. Default: disabled" - } - ] - }, %{ group: :pleroma, key: :rate_limit, @@ -2770,20 +2603,6 @@ config :pleroma, :config_description, [ } ] }, - %{ - group: :prometheus, - key: Pleroma.Web.Endpoint.MetricsExporter, - type: :group, - description: "Prometheus settings", - children: [ - %{ - key: :path, - type: :string, - description: "API endpoint with metrics", - suggestions: ["/api/pleroma/app_metrics"] - } - ] - }, %{ group: :http_signatures, type: :group, @@ -3051,7 +2870,7 @@ config :pleroma, :config_description, [ group: :pleroma, key: :feed, type: :group, - description: "Configure feed rendering.", + description: "Configure feed rendering", children: [ %{ key: :post_title, @@ -3101,7 +2920,7 @@ config :pleroma, :config_description, [ group: :pleroma, key: :modules, type: :group, - description: "Custom Runtime Modules.", + description: "Custom Runtime Modules", children: [ %{ key: :runtime_dir, @@ -3109,18 +2928,5 @@ config :pleroma, :config_description, [ description: "A path to custom Elixir modules (such as MRF policies)." } ] - }, - %{ - group: :pleroma, - type: :group, - description: "Allow instance configuration from database.", - children: [ - %{ - key: :configurable_from_database, - type: :boolean, - description: - "Allow transferring configuration to DB with the subsequent customization from Admin api. Default: disabled" - } - ] } ] -- cgit v1.2.3 From 6f2efb1c450daa75d848dab8e3729ced81ed3904 Mon Sep 17 00:00:00 2001 From: Ivan Tashkinov Date: Thu, 27 Feb 2020 18:46:05 +0300 Subject: Runtime configurability of RateLimiter. Refactoring. Disabled default rate limits in tests. --- config/test.exs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'config') diff --git a/config/test.exs b/config/test.exs index 6bea09380..a17886265 100644 --- a/config/test.exs +++ b/config/test.exs @@ -74,11 +74,7 @@ config :pleroma, Pleroma.ScheduledActivity, total_user_limit: 3, enabled: false -config :pleroma, :rate_limit, - search: [{1000, 30}, {1000, 30}], - app_account_creation: {10_000, 5}, - password_reset: {1000, 30}, - ap_routes: nil +config :pleroma, :rate_limit, %{} config :pleroma, :http_security, report_uri: "https://endpoint.com" -- cgit v1.2.3 From fabcd82f4af4a432e404a936e5cccc0117445bfc Mon Sep 17 00:00:00 2001 From: Steven Fuchs Date: Fri, 28 Feb 2020 04:27:50 +0000 Subject: add confirm field to filtered params --- config/config.exs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 9d1e29c0d..0dde1fc85 100644 --- a/config/config.exs +++ b/config/config.exs @@ -402,6 +402,8 @@ config :phoenix, :format_encoders, json: Jason config :phoenix, :json_library, Jason +config :phoenix, :filter_parameters, ["password", "confirm"] + config :pleroma, :gopher, enabled: false, ip: {0, 0, 0, 0}, -- cgit v1.2.3 From 04b03e476281be412d3505f514bd34d31e735214 Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Sat, 29 Feb 2020 11:24:30 +0300 Subject: streamer group & Oban crontab child --- config/description.exs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'config') diff --git a/config/description.exs b/config/description.exs index aa8a8d790..bcb69bc41 100644 --- a/config/description.exs +++ b/config/description.exs @@ -1903,6 +1903,18 @@ config :pleroma, :config_description, [ suggestions: [50] } ] + }, + %{ + key: :crontab, + type: {:list, :tuple}, + description: "Settings for cron background jobs", + suggestions: [ + {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker}, + {"0 * * * *", Pleroma.Workers.Cron.StatsWorker}, + {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker}, + {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker}, + {"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker} + ] } ] }, @@ -2928,5 +2940,25 @@ config :pleroma, :config_description, [ description: "A path to custom Elixir modules (such as MRF policies)." } ] + }, + %{ + group: :pleroma, + key: :streamer, + type: :group, + description: "Settings for notifications streamer", + children: [ + %{ + key: :workers, + type: :integer, + description: "Number of workers to send notifications.", + suggestions: [3] + }, + %{ + key: :overflow_workers, + type: :integer, + description: "Maximum number of workers created if pool is empty.", + suggestions: [2] + } + ] } ] -- cgit v1.2.3 From ffcebe7e22b4c5ccaf3ba63f3ed2885ac55a6b4d Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 28 Feb 2020 17:44:59 +0300 Subject: timeline controller: rate limit timelines to 3 requests per 500ms per timeline per ip/user --- config/config.exs | 1 + config/description.exs | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'config') diff --git a/config/config.exs b/config/config.exs index 0dde1fc85..9c4eb70a3 100644 --- a/config/config.exs +++ b/config/config.exs @@ -599,6 +599,7 @@ config :http_signatures, config :pleroma, :rate_limit, authentication: {60_000, 15}, + timeline: {500, 3}, search: [{1000, 10}, {1000, 30}], app_account_creation: {1_800_000, 25}, relations_actions: {10_000, 10}, diff --git a/config/description.exs b/config/description.exs index bcb69bc41..9fdcfcd96 100644 --- a/config/description.exs +++ b/config/description.exs @@ -2465,6 +2465,12 @@ config :pleroma, :config_description, [ description: "For the search requests (account & status search etc.)", suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]] }, + %{ + key: :timeline, + type: [:tuple, {:list, :tuple}], + description: "For requests to timelines (each timeline has it's own limiter)", + suggestions: [{1000, 10}, [{10_000, 10}, {10_000, 50}]] + }, %{ key: :app_account_creation, type: [:tuple, {:list, :tuple}], -- cgit v1.2.3