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.

339 lines
8.2KB

  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, types: Pleroma.PostgresTypes
  10. config :pleroma, Pleroma.Captcha,
  11. enabled: false,
  12. seconds_valid: 60,
  13. method: Pleroma.Captcha.Kocaptcha
  14. config :pleroma, :hackney_pools,
  15. federation: [
  16. max_connections: 50,
  17. timeout: 150_000
  18. ],
  19. media: [
  20. max_connections: 50,
  21. timeout: 150_000
  22. ],
  23. upload: [
  24. max_connections: 25,
  25. timeout: 300_000
  26. ]
  27. config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
  28. # Upload configuration
  29. config :pleroma, Pleroma.Upload,
  30. uploader: Pleroma.Uploaders.Local,
  31. filters: [],
  32. proxy_remote: false,
  33. proxy_opts: [
  34. redirect_on_failure: false,
  35. max_body_length: 25 * 1_048_576,
  36. http: [
  37. follow_redirect: true,
  38. pool: :upload
  39. ]
  40. ]
  41. config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
  42. config :pleroma, Pleroma.Uploaders.S3,
  43. bucket: nil,
  44. public_endpoint: "https://s3.amazonaws.com"
  45. config :pleroma, Pleroma.Uploaders.MDII,
  46. cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
  47. files: "https://mdii.sakura.ne.jp"
  48. config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
  49. config :pleroma, :uri_schemes,
  50. valid_schemes: [
  51. "https",
  52. "http",
  53. "dat",
  54. "dweb",
  55. "gopher",
  56. "ipfs",
  57. "ipns",
  58. "irc",
  59. "ircs",
  60. "magnet",
  61. "mailto",
  62. "mumble",
  63. "ssb",
  64. "xmpp"
  65. ]
  66. websocket_config = [
  67. path: "/websocket",
  68. serializer: [
  69. {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
  70. {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  71. ],
  72. timeout: 60_000,
  73. transport_log: false,
  74. compress: false
  75. ]
  76. # Configures the endpoint
  77. config :pleroma, Pleroma.Web.Endpoint,
  78. url: [host: "localhost"],
  79. http: [
  80. dispatch: [
  81. {:_,
  82. [
  83. {"/api/v1/streaming", Elixir.Pleroma.Web.MastodonAPI.WebsocketHandler, []},
  84. {"/socket/websocket", Phoenix.Endpoint.CowboyWebSocket,
  85. {nil, {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
  86. {:_, Plug.Adapters.Cowboy.Handler, {Pleroma.Web.Endpoint, []}}
  87. ]}
  88. ]
  89. ],
  90. protocol: "https",
  91. secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
  92. signing_salt: "CqaoopA2",
  93. render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
  94. pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
  95. secure_cookie_flag: true
  96. # Configures Elixir's Logger
  97. config :logger, :console,
  98. format: "$time $metadata[$level] $message\n",
  99. metadata: [:request_id]
  100. config :logger, :ex_syslogger,
  101. level: :debug,
  102. ident: "Pleroma",
  103. format: "$metadata[$level] $message",
  104. metadata: [:request_id]
  105. config :mime, :types, %{
  106. "application/xml" => ["xml"],
  107. "application/xrd+xml" => ["xrd+xml"],
  108. "application/jrd+json" => ["jrd+json"],
  109. "application/activity+json" => ["activity+json"],
  110. "application/ld+json" => ["activity+json"]
  111. }
  112. config :pleroma, :websub, Pleroma.Web.Websub
  113. config :pleroma, :ostatus, Pleroma.Web.OStatus
  114. config :pleroma, :httpoison, Pleroma.HTTP
  115. config :tesla, adapter: Tesla.Adapter.Hackney
  116. # Configures http settings, upstream proxy etc.
  117. config :pleroma, :http, proxy_url: nil
  118. config :pleroma, :instance,
  119. name: "Pleroma",
  120. email: "example@example.com",
  121. description: "A Pleroma instance, an alternative fediverse server",
  122. limit: 5_000,
  123. remote_limit: 100_000,
  124. upload_limit: 16_000_000,
  125. avatar_upload_limit: 2_000_000,
  126. background_upload_limit: 4_000_000,
  127. banner_upload_limit: 4_000_000,
  128. registrations_open: true,
  129. federating: true,
  130. federation_reachability_timeout_days: 7,
  131. allow_relay: true,
  132. rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
  133. public: true,
  134. quarantined_instances: [],
  135. managed_config: true,
  136. static_dir: "instance/static/",
  137. allowed_post_formats: [
  138. "text/plain",
  139. "text/html",
  140. "text/markdown"
  141. ],
  142. finmoji_enabled: true,
  143. mrf_transparency: true,
  144. autofollowed_nicknames: [],
  145. max_pinned_statuses: 1,
  146. no_attachment_links: false
  147. config :pleroma, :markup,
  148. # XXX - unfortunately, inline images must be enabled by default right now, because
  149. # of custom emoji. Issue #275 discusses defanging that somehow.
  150. allow_inline_images: true,
  151. allow_headings: false,
  152. allow_tables: false,
  153. allow_fonts: false,
  154. scrub_policy: [
  155. Pleroma.HTML.Transform.MediaProxy,
  156. Pleroma.HTML.Scrubber.Default
  157. ]
  158. # Deprecated, will be gone in 1.0
  159. config :pleroma, :fe,
  160. theme: "pleroma-dark",
  161. logo: "/static/logo.png",
  162. logo_mask: true,
  163. logo_margin: "0.1em",
  164. background: "/static/aurora_borealis.jpg",
  165. redirect_root_no_login: "/main/all",
  166. redirect_root_login: "/main/friends",
  167. show_instance_panel: true,
  168. scope_options_enabled: false,
  169. formatting_options_enabled: false,
  170. collapse_message_with_subject: false,
  171. hide_post_stats: false,
  172. hide_user_stats: false,
  173. scope_copy: true,
  174. subject_line_behavior: "email",
  175. always_show_subject_input: true
  176. config :pleroma, :frontend_configurations,
  177. pleroma_fe: %{
  178. theme: "pleroma-dark",
  179. logo: "/static/logo.png",
  180. background: "/images/city.jpg",
  181. redirectRootNoLogin: "/main/all",
  182. redirectRootLogin: "/main/friends",
  183. showInstanceSpecificPanel: true,
  184. scopeOptionsEnabled: false,
  185. formattingOptionsEnabled: false,
  186. collapseMessageWithSubject: false,
  187. hidePostStats: false,
  188. hideUserStats: false,
  189. scopeCopy: true,
  190. subjectLineBehavior: "email",
  191. alwaysShowSubjectInput: true
  192. }
  193. config :pleroma, :activitypub,
  194. accept_blocks: true,
  195. unfollow_blocked: true,
  196. outgoing_blocks: true,
  197. follow_handshake_timeout: 500
  198. config :pleroma, :user, deny_follow_blocked: true
  199. config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
  200. config :pleroma, :mrf_rejectnonpublic,
  201. allow_followersonly: false,
  202. allow_direct: false
  203. config :pleroma, :mrf_hellthread,
  204. delist_threshold: 5,
  205. reject_threshold: 10
  206. config :pleroma, :mrf_simple,
  207. media_removal: [],
  208. media_nsfw: [],
  209. federated_timeline_removal: [],
  210. reject: [],
  211. accept: []
  212. config :pleroma, :rich_media, enabled: true
  213. config :pleroma, :media_proxy,
  214. enabled: false,
  215. proxy_opts: [
  216. redirect_on_failure: false,
  217. max_body_length: 25 * 1_048_576,
  218. http: [
  219. follow_redirect: true,
  220. pool: :media
  221. ]
  222. ]
  223. config :pleroma, :chat, enabled: true
  224. config :ecto, json_library: Jason
  225. config :phoenix, :format_encoders, json: Jason
  226. config :pleroma, :gopher,
  227. enabled: false,
  228. ip: {0, 0, 0, 0},
  229. port: 9999
  230. config :pleroma, Pleroma.Web.Metadata, providers: [], unfurl_nsfw: false
  231. config :pleroma, :suggestions,
  232. enabled: false,
  233. third_party_engine:
  234. "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
  235. timeout: 300_000,
  236. limit: 23,
  237. web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
  238. config :pleroma, :http_security,
  239. enabled: true,
  240. sts: false,
  241. sts_max_age: 31_536_000,
  242. ct_max_age: 2_592_000,
  243. referrer_policy: "same-origin"
  244. config :cors_plug,
  245. max_age: 86_400,
  246. methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  247. expose: [
  248. "Link",
  249. "X-RateLimit-Reset",
  250. "X-RateLimit-Limit",
  251. "X-RateLimit-Remaining",
  252. "X-Request-Id",
  253. "Idempotency-Key"
  254. ],
  255. credentials: true,
  256. headers: ["Authorization", "Content-Type", "Idempotency-Key"]
  257. config :pleroma, Pleroma.User,
  258. restricted_nicknames: [
  259. ".well-known",
  260. "~",
  261. "about",
  262. "activities",
  263. "api",
  264. "auth",
  265. "dev",
  266. "friend-requests",
  267. "inbox",
  268. "internal",
  269. "main",
  270. "media",
  271. "nodeinfo",
  272. "notice",
  273. "oauth",
  274. "objects",
  275. "ostatus_subscribe",
  276. "pleroma",
  277. "proxy",
  278. "push",
  279. "registration",
  280. "relay",
  281. "settings",
  282. "status",
  283. "tag",
  284. "user-search",
  285. "users",
  286. "web"
  287. ]
  288. config :pleroma, Pleroma.Web.Federator, max_jobs: 50
  289. config :pleroma, Pleroma.Web.Federator.RetryQueue,
  290. enabled: false,
  291. max_jobs: 20,
  292. initial_timeout: 30,
  293. max_retries: 5
  294. # Import environment specific config. This must remain at the bottom
  295. # of this file so it overrides the configuration defined above.
  296. import_config "#{Mix.env()}.exs"