summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/config.exs36
-rw-r--r--config/dev.exs3
-rw-r--r--config/dokku.exs25
-rw-r--r--config/prod.exs7
-rw-r--r--config/releases.exs19
-rw-r--r--config/test.exs9
6 files changed, 85 insertions, 14 deletions
diff --git a/config/config.exs b/config/config.exs
index e90821d66..3962ac019 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -184,9 +184,6 @@ config :mime, :types, %{
"application/ld+json" => ["activity+json"]
}
-config :pleroma, :websub, Pleroma.Web.Websub
-config :pleroma, :ostatus, Pleroma.Web.OStatus
-config :pleroma, :httpoison, Pleroma.HTTP
config :tesla, adapter: Tesla.Adapter.Hackney
# Configures http settings, upstream proxy etc.
@@ -211,6 +208,12 @@ config :pleroma, :instance,
avatar_upload_limit: 2_000_000,
background_upload_limit: 4_000_000,
banner_upload_limit: 4_000_000,
+ poll_limits: %{
+ max_options: 20,
+ max_option_chars: 200,
+ min_expiration: 0,
+ max_expiration: 365 * 24 * 60 * 60
+ },
registrations_open: true,
federating: true,
federation_reachability_timeout_days: 7,
@@ -240,9 +243,10 @@ config :pleroma, :instance,
max_report_comment_size: 1000,
safe_dm_mentions: false,
healthcheck: false,
- remote_post_retention_days: 90
-
-config :pleroma, :app_account_creation, enabled: true, max_requests: 25, interval: 1800
+ remote_post_retention_days: 90,
+ skip_thread_containment: true,
+ limit_to_local_content: :unauthenticated,
+ dynamic_configuration: false
config :pleroma, :markup,
# XXX - unfortunately, inline images must be enabled by default right now, because
@@ -323,6 +327,8 @@ config :pleroma, :mrf_keyword,
federated_timeline_removal: [],
replace: []
+config :pleroma, :mrf_subchain, match_actor: %{}
+
config :pleroma, :rich_media, enabled: true
config :pleroma, :media_proxy,
@@ -355,8 +361,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,
@@ -436,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,
@@ -456,7 +464,11 @@ config :pleroma, :ldap,
config :esshd,
enabled: false
-oauth_consumer_strategies = String.split(System.get_env("OAUTH_CONSUMER_STRATEGIES") || "")
+oauth_consumer_strategies =
+ System.get_env("OAUTH_CONSUMER_STRATEGIES")
+ |> to_string()
+ |> String.split()
+ |> Enum.map(&hd(String.split(&1, ":")))
ueberauth_providers =
for strategy <- oauth_consumer_strategies do
@@ -489,9 +501,15 @@ config :pleroma, :oauth2,
config :pleroma, :database, rum_enabled: false
+config :pleroma, :env, Mix.env()
+
config :http_signatures,
adapter: Pleroma.Signature
+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.
import_config "#{Mix.env()}.exs"
diff --git a/config/dev.exs b/config/dev.exs
index 0432adce7..7e1e3b4be 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.exported_from_db.secret.exs"),
+ do: import_config("dev.exported_from_db.secret.exs")
diff --git a/config/dokku.exs b/config/dokku.exs
new file mode 100644
index 000000000..9ea0ec450
--- /dev/null
+++ b/config/dokku.exs
@@ -0,0 +1,25 @@
+use Mix.Config
+
+config :pleroma, Pleroma.Web.Endpoint,
+ http: [
+ port: String.to_integer(System.get_env("PORT") || "4000"),
+ protocol_options: [max_request_line_length: 8192, max_header_value_length: 8192]
+ ],
+ protocol: "http",
+ secure_cookie_flag: false,
+ url: [host: System.get_env("APP_HOST"), scheme: "https", port: 443],
+ secret_key_base: "+S+ULgf7+N37c/lc9K66SMphnjQIRGklTu0BRr2vLm2ZzvK0Z6OH/PE77wlUNtvP"
+
+database_url =
+ System.get_env("DATABASE_URL") ||
+ raise """
+ environment variable DATABASE_URL is missing.
+ For example: ecto://USER:PASS@HOST/DATABASE
+ """
+
+config :pleroma, Pleroma.Repo,
+ # ssl: true,
+ url: database_url,
+ pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
+
+config :pleroma, :instance, name: "#{System.get_env("APP_NAME")} CI Instance"
diff --git a/config/prod.exs b/config/prod.exs
index d0cfd1ac2..9c205cbd2 100644
--- a/config/prod.exs
+++ b/config/prod.exs
@@ -17,8 +17,10 @@ config :pleroma, Pleroma.Web.Endpoint,
http: [port: 4000],
protocol: "http"
+config :phoenix, serve_endpoints: true
+
# Do not print debug messages in production
-config :logger, level: :info
+config :logger, level: :warn
# ## SSL Support
#
@@ -61,3 +63,6 @@ config :logger, level: :info
# Finally import the config/prod.secret.exs
# which should be versioned separately.
import_config "prod.secret.exs"
+
+if File.exists?("./config/prod.exported_from_db.secret.exs"),
+ do: import_config("prod.exported_from_db.secret.exs")
diff --git a/config/releases.exs b/config/releases.exs
new file mode 100644
index 000000000..98c5ceccd
--- /dev/null
+++ b/config/releases.exs
@@ -0,0 +1,19 @@
+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
+ 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
diff --git a/config/test.exs b/config/test.exs
index 6100989c4..73a8b82a1 100644
--- a/config/test.exs
+++ b/config/test.exs
@@ -17,6 +17,8 @@ config :pleroma, Pleroma.Captcha,
# Print only warnings and errors during test
config :logger, level: :warn
+config :pleroma, :auth, oauth_consumer_strategies: []
+
config :pleroma, Pleroma.Upload, filters: [], link_name: false
config :pleroma, Pleroma.Uploaders.Local, uploads: "test/uploads"
@@ -25,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,
@@ -39,8 +42,6 @@ config :pleroma, Pleroma.Repo,
# Reduce hash rounds for testing
config :pbkdf2_elixir, rounds: 1
-config :pleroma, :websub, Pleroma.Web.WebsubMock
-config :pleroma, :ostatus, Pleroma.Web.OStatusMock
config :tesla, adapter: Tesla.Mock
config :pleroma, :rich_media, enabled: false
@@ -59,7 +60,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: {10_000, 5}
config :pleroma, :http_security, report_uri: "https://endpoint.com"