Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

428 lines
11KB

  1. # This file is responsible for configuring your application
  2. # and its dependencies with the aid of the Mix.Config module.
  3. #
  4. # This configuration file is loaded before any dependency and
  5. # is restricted to this project.
  6. use Mix.Config
  7. # General application configuration
  8. config :pleroma, ecto_repos: [Pleroma.Repo]
  9. config :pleroma, Pleroma.Repo,
  10. types: Pleroma.PostgresTypes,
  11. telemetry_event: [Pleroma.Repo.Instrumenter]
  12. config :pleroma, Pleroma.Captcha,
  13. enabled: false,
  14. seconds_valid: 60,
  15. method: Pleroma.Captcha.Kocaptcha
  16. config :pleroma, :hackney_pools,
  17. federation: [
  18. max_connections: 50,
  19. timeout: 150_000
  20. ],
  21. media: [
  22. max_connections: 50,
  23. timeout: 150_000
  24. ],
  25. upload: [
  26. max_connections: 25,
  27. timeout: 300_000
  28. ]
  29. config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
  30. # Upload configuration
  31. config :pleroma, Pleroma.Upload,
  32. uploader: Pleroma.Uploaders.Local,
  33. filters: [Pleroma.Upload.Filter.Dedupe],
  34. link_name: true,
  35. proxy_remote: false,
  36. proxy_opts: [
  37. redirect_on_failure: false,
  38. max_body_length: 25 * 1_048_576,
  39. http: [
  40. follow_redirect: true,
  41. pool: :upload
  42. ]
  43. ]
  44. config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
  45. config :pleroma, Pleroma.Uploaders.S3,
  46. bucket: nil,
  47. public_endpoint: "https://s3.amazonaws.com"
  48. config :pleroma, Pleroma.Uploaders.MDII,
  49. cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
  50. files: "https://mdii.sakura.ne.jp"
  51. config :pleroma, :emoji,
  52. shortcode_globs: ["/emoji/custom/**/*.png"],
  53. groups: [
  54. # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
  55. Finmoji: "/finmoji/128px/*-128.png",
  56. Custom: ["/emoji/*.png", "/emoji/custom/*.png"]
  57. ]
  58. config :pleroma, :uri_schemes,
  59. valid_schemes: [
  60. "https",
  61. "http",
  62. "dat",
  63. "dweb",
  64. "gopher",
  65. "ipfs",
  66. "ipns",
  67. "irc",
  68. "ircs",
  69. "magnet",
  70. "mailto",
  71. "mumble",
  72. "ssb",
  73. "xmpp"
  74. ]
  75. websocket_config = [
  76. path: "/websocket",
  77. serializer: [
  78. {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
  79. {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  80. ],
  81. timeout: 60_000,
  82. transport_log: false,
  83. compress: false
  84. ]
  85. # Configures the endpoint
  86. config :pleroma, Pleroma.Web.Endpoint,
  87. instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
  88. url: [host: "localhost"],
  89. http: [
  90. dispatch: [
  91. {:_,
  92. [
  93. {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
  94. {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
  95. {Phoenix.Transports.WebSocket,
  96. {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
  97. {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
  98. ]}
  99. ]
  100. ],
  101. protocol: "https",
  102. secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
  103. signing_salt: "CqaoopA2",
  104. render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
  105. pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
  106. secure_cookie_flag: true
  107. # Configures Elixir's Logger
  108. config :logger, :console,
  109. format: "$time $metadata[$level] $message\n",
  110. metadata: [:request_id]
  111. config :logger, :ex_syslogger,
  112. level: :debug,
  113. ident: "Pleroma",
  114. format: "$metadata[$level] $message",
  115. metadata: [:request_id]
  116. config :quack,
  117. level: :warn,
  118. meta: [:all],
  119. webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
  120. config :mime, :types, %{
  121. "application/xml" => ["xml"],
  122. "application/xrd+xml" => ["xrd+xml"],
  123. "application/jrd+json" => ["jrd+json"],
  124. "application/activity+json" => ["activity+json"],
  125. "application/ld+json" => ["activity+json"]
  126. }
  127. config :pleroma, :websub, Pleroma.Web.Websub
  128. config :pleroma, :ostatus, Pleroma.Web.OStatus
  129. config :pleroma, :httpoison, Pleroma.HTTP
  130. config :tesla, adapter: Tesla.Adapter.Hackney
  131. # Configures http settings, upstream proxy etc.
  132. config :pleroma, :http,
  133. proxy_url: nil,
  134. adapter: [
  135. ssl_options: [
  136. # We don't support TLS v1.3 yet
  137. versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
  138. ]
  139. ]
  140. config :pleroma, :instance,
  141. name: "Pleroma",
  142. email: "example@example.com",
  143. description: "A Pleroma instance, an alternative fediverse server",
  144. limit: 5_000,
  145. remote_limit: 100_000,
  146. upload_limit: 16_000_000,
  147. avatar_upload_limit: 2_000_000,
  148. background_upload_limit: 4_000_000,
  149. banner_upload_limit: 4_000_000,
  150. registrations_open: true,
  151. federating: true,
  152. federation_reachability_timeout_days: 7,
  153. allow_relay: true,
  154. rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
  155. public: true,
  156. quarantined_instances: [],
  157. managed_config: true,
  158. static_dir: "instance/static/",
  159. allowed_post_formats: [
  160. "text/plain",
  161. "text/html",
  162. "text/markdown"
  163. ],
  164. finmoji_enabled: true,
  165. mrf_transparency: true,
  166. autofollowed_nicknames: [],
  167. max_pinned_statuses: 1,
  168. no_attachment_links: false,
  169. welcome_user_nickname: nil,
  170. welcome_message: nil,
  171. max_report_comment_size: 1000,
  172. safe_dm_mentions: false
  173. config :pleroma, :markup,
  174. # XXX - unfortunately, inline images must be enabled by default right now, because
  175. # of custom emoji. Issue #275 discusses defanging that somehow.
  176. allow_inline_images: true,
  177. allow_headings: false,
  178. allow_tables: false,
  179. allow_fonts: false,
  180. scrub_policy: [
  181. Pleroma.HTML.Transform.MediaProxy,
  182. Pleroma.HTML.Scrubber.Default
  183. ]
  184. # Deprecated, will be gone in 1.0
  185. config :pleroma, :fe,
  186. theme: "pleroma-dark",
  187. logo: "/static/logo.png",
  188. logo_mask: true,
  189. logo_margin: "0.1em",
  190. background: "/static/aurora_borealis.jpg",
  191. redirect_root_no_login: "/main/all",
  192. redirect_root_login: "/main/friends",
  193. show_instance_panel: true,
  194. scope_options_enabled: false,
  195. formatting_options_enabled: false,
  196. collapse_message_with_subject: false,
  197. hide_post_stats: false,
  198. hide_user_stats: false,
  199. scope_copy: true,
  200. subject_line_behavior: "email",
  201. always_show_subject_input: true
  202. config :pleroma, :frontend_configurations,
  203. pleroma_fe: %{
  204. theme: "pleroma-dark",
  205. logo: "/static/logo.png",
  206. background: "/images/city.jpg",
  207. redirectRootNoLogin: "/main/all",
  208. redirectRootLogin: "/main/friends",
  209. showInstanceSpecificPanel: true,
  210. scopeOptionsEnabled: false,
  211. formattingOptionsEnabled: false,
  212. collapseMessageWithSubject: false,
  213. hidePostStats: false,
  214. hideUserStats: false,
  215. scopeCopy: true,
  216. subjectLineBehavior: "email",
  217. alwaysShowSubjectInput: true
  218. },
  219. masto_fe: %{
  220. showInstanceSpecificPanel: true
  221. }
  222. config :pleroma, :activitypub,
  223. accept_blocks: true,
  224. unfollow_blocked: true,
  225. outgoing_blocks: true,
  226. follow_handshake_timeout: 500
  227. config :pleroma, :user, deny_follow_blocked: true
  228. config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
  229. config :pleroma, :mrf_rejectnonpublic,
  230. allow_followersonly: false,
  231. allow_direct: false
  232. config :pleroma, :mrf_hellthread,
  233. delist_threshold: 10,
  234. reject_threshold: 20
  235. config :pleroma, :mrf_simple,
  236. media_removal: [],
  237. media_nsfw: [],
  238. federated_timeline_removal: [],
  239. reject: [],
  240. accept: []
  241. config :pleroma, :mrf_keyword,
  242. reject: [],
  243. federated_timeline_removal: [],
  244. replace: []
  245. config :pleroma, :rich_media, enabled: true
  246. config :pleroma, :media_proxy,
  247. enabled: false,
  248. proxy_opts: [
  249. redirect_on_failure: false,
  250. max_body_length: 25 * 1_048_576,
  251. http: [
  252. follow_redirect: true,
  253. pool: :media
  254. ]
  255. ]
  256. config :pleroma, :chat, enabled: true
  257. config :phoenix, :format_encoders, json: Jason
  258. config :pleroma, :gopher,
  259. enabled: false,
  260. ip: {0, 0, 0, 0},
  261. port: 9999
  262. config :pleroma, Pleroma.Web.Metadata, providers: [], unfurl_nsfw: false
  263. config :pleroma, :suggestions,
  264. enabled: false,
  265. third_party_engine:
  266. "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
  267. timeout: 300_000,
  268. limit: 23,
  269. web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
  270. config :pleroma, :http_security,
  271. enabled: true,
  272. sts: false,
  273. sts_max_age: 31_536_000,
  274. ct_max_age: 2_592_000,
  275. referrer_policy: "same-origin"
  276. config :cors_plug,
  277. max_age: 86_400,
  278. methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  279. expose: [
  280. "Link",
  281. "X-RateLimit-Reset",
  282. "X-RateLimit-Limit",
  283. "X-RateLimit-Remaining",
  284. "X-Request-Id",
  285. "Idempotency-Key"
  286. ],
  287. credentials: true,
  288. headers: ["Authorization", "Content-Type", "Idempotency-Key"]
  289. config :pleroma, Pleroma.User,
  290. restricted_nicknames: [
  291. ".well-known",
  292. "~",
  293. "about",
  294. "activities",
  295. "api",
  296. "auth",
  297. "dev",
  298. "friend-requests",
  299. "inbox",
  300. "internal",
  301. "main",
  302. "media",
  303. "nodeinfo",
  304. "notice",
  305. "oauth",
  306. "objects",
  307. "ostatus_subscribe",
  308. "pleroma",
  309. "proxy",
  310. "push",
  311. "registration",
  312. "relay",
  313. "settings",
  314. "status",
  315. "tag",
  316. "user-search",
  317. "users",
  318. "web"
  319. ]
  320. config :pleroma, Pleroma.Web.Federator.RetryQueue,
  321. enabled: false,
  322. max_jobs: 20,
  323. initial_timeout: 30,
  324. max_retries: 5
  325. config :pleroma_job_queue, :queues,
  326. federator_incoming: 50,
  327. federator_outgoing: 50,
  328. web_push: 50,
  329. mailer: 10,
  330. transmogrifier: 20,
  331. scheduled_activities: 10
  332. config :pleroma, :fetch_initial_posts,
  333. enabled: false,
  334. pages: 5
  335. config :auto_linker,
  336. opts: [
  337. scheme: true,
  338. extra: true,
  339. class: false,
  340. strip_prefix: false,
  341. new_window: false,
  342. rel: false
  343. ]
  344. config :pleroma, :ldap,
  345. enabled: System.get_env("LDAP_ENABLED") == "true",
  346. host: System.get_env("LDAP_HOST") || "localhost",
  347. port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
  348. ssl: System.get_env("LDAP_SSL") == "true",
  349. sslopts: [],
  350. tls: System.get_env("LDAP_TLS") == "true",
  351. tlsopts: [],
  352. base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  353. uid: System.get_env("LDAP_UID") || "cn"
  354. oauth_consumer_strategies = String.split(System.get_env("OAUTH_CONSUMER_STRATEGIES") || "")
  355. ueberauth_providers =
  356. for strategy <- oauth_consumer_strategies do
  357. strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
  358. strategy_module = String.to_atom(strategy_module_name)
  359. {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  360. end
  361. config :ueberauth,
  362. Ueberauth,
  363. base_path: "/oauth",
  364. providers: ueberauth_providers
  365. config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
  366. config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Sendmail
  367. config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
  368. config :pleroma, Pleroma.ScheduledActivity,
  369. daily_user_limit: 25,
  370. total_user_limit: 300,
  371. enabled: true
  372. # Import environment specific config. This must remain at the bottom
  373. # of this file so it overrides the configuration defined above.
  374. import_config "#{Mix.env()}.exs"