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.

543 lines
15KB

  1. # .i;;;;i.
  2. # iYcviii;vXY:
  3. # .YXi .i1c.
  4. # .YC. . in7.
  5. # .vc. ...... ;1c.
  6. # i7, .. .;1;
  7. # i7, .. ... .Y1i
  8. # ,7v .6MMM@; .YX,
  9. # .7;. ..IMMMMMM1 :t7.
  10. # .;Y. ;$MMMMMM9. :tc.
  11. # vY. .. .nMMM@MMU. ;1v.
  12. # i7i ... .#MM@M@C. .....:71i
  13. # it: .... $MMM@9;.,i;;;i,;tti
  14. # :t7. ..... 0MMMWv.,iii:::,,;St.
  15. # .nC. ..... IMMMQ..,::::::,.,czX.
  16. # .ct: ....... .ZMMMI..,:::::::,,:76Y.
  17. # c2: ......,i..Y$M@t..:::::::,,..inZY
  18. # vov ......:ii..c$MBc..,,,,,,,,,,..iI9i
  19. # i9Y ......iii:..7@MA,..,,,,,,,,,....;AA:
  20. # iIS. ......:ii::..;@MI....,............;Ez.
  21. # .I9. ......:i::::...8M1..................C0z.
  22. # .z9; ......:i::::,.. .i:...................zWX.
  23. # vbv ......,i::::,,. ................. :AQY
  24. # c6Y. .,...,::::,,..:t0@@QY. ................ :8bi
  25. # :6S. ..,,...,:::,,,..EMMMMMMI. ............... .;bZ,
  26. # :6o, .,,,,..:::,,,..i#MMMMMM#v................. YW2.
  27. # .n8i ..,,,,,,,::,,,,.. tMMMMM@C:.................. .1Wn
  28. # 7Uc. .:::,,,,,::,,,,.. i1t;,..................... .UEi
  29. # 7C...::::::::::::,,,,.. .................... vSi.
  30. # ;1;...,,::::::,......... .................. Yz:
  31. # v97,......... .voC.
  32. # izAotX7777777777777777777777777777777777777777Y7n92:
  33. # .;CoIIIIIUAA666666699999ZZZZZZZZZZZZZZZZZZZZ6ov.
  34. #
  35. # !!! ATTENTION !!!
  36. # DO NOT EDIT THIS FILE! THIS FILE CONTAINS THE DEFAULT VALUES FOR THE CON-
  37. # FIGURATION! EDIT YOUR SECRET FILE (either prod.secret.exs, dev.secret.exs).
  38. #
  39. # This file is responsible for configuring your application
  40. # and its dependencies with the aid of the Mix.Config module.
  41. #
  42. # This configuration file is loaded before any dependency and
  43. # is restricted to this project.
  44. use Mix.Config
  45. # General application configuration
  46. config :pleroma, ecto_repos: [Pleroma.Repo]
  47. config :pleroma, Pleroma.Repo,
  48. types: Pleroma.PostgresTypes,
  49. telemetry_event: [Pleroma.Repo.Instrumenter],
  50. migration_lock: nil
  51. config :pleroma, Pleroma.Captcha,
  52. enabled: false,
  53. seconds_valid: 60,
  54. method: Pleroma.Captcha.Kocaptcha
  55. config :pleroma, :hackney_pools,
  56. federation: [
  57. max_connections: 50,
  58. timeout: 150_000
  59. ],
  60. media: [
  61. max_connections: 50,
  62. timeout: 150_000
  63. ],
  64. upload: [
  65. max_connections: 25,
  66. timeout: 300_000
  67. ]
  68. config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
  69. # Upload configuration
  70. config :pleroma, Pleroma.Upload,
  71. uploader: Pleroma.Uploaders.Local,
  72. filters: [Pleroma.Upload.Filter.Dedupe],
  73. link_name: true,
  74. proxy_remote: false,
  75. proxy_opts: [
  76. redirect_on_failure: false,
  77. max_body_length: 25 * 1_048_576,
  78. http: [
  79. follow_redirect: true,
  80. pool: :upload
  81. ]
  82. ]
  83. config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
  84. config :pleroma, Pleroma.Uploaders.S3,
  85. bucket: nil,
  86. public_endpoint: "https://s3.amazonaws.com"
  87. config :pleroma, Pleroma.Uploaders.MDII,
  88. cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
  89. files: "https://mdii.sakura.ne.jp"
  90. config :pleroma, :emoji,
  91. shortcode_globs: ["/emoji/custom/**/*.png"],
  92. pack_extensions: [".png", ".gif"],
  93. groups: [
  94. # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
  95. Custom: ["/emoji/*.png", "/emoji/**/*.png"]
  96. ],
  97. default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json"
  98. config :pleroma, :uri_schemes,
  99. valid_schemes: [
  100. "https",
  101. "http",
  102. "dat",
  103. "dweb",
  104. "gopher",
  105. "ipfs",
  106. "ipns",
  107. "irc",
  108. "ircs",
  109. "magnet",
  110. "mailto",
  111. "mumble",
  112. "ssb",
  113. "xmpp"
  114. ]
  115. websocket_config = [
  116. path: "/websocket",
  117. serializer: [
  118. {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
  119. {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  120. ],
  121. timeout: 60_000,
  122. transport_log: false,
  123. compress: false
  124. ]
  125. # Configures the endpoint
  126. config :pleroma, Pleroma.Web.Endpoint,
  127. instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
  128. url: [host: "localhost"],
  129. http: [
  130. ip: {127, 0, 0, 1},
  131. dispatch: [
  132. {:_,
  133. [
  134. {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
  135. {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
  136. {Phoenix.Transports.WebSocket,
  137. {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
  138. {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
  139. ]}
  140. ]
  141. ],
  142. protocol: "https",
  143. secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
  144. signing_salt: "CqaoopA2",
  145. render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
  146. pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
  147. secure_cookie_flag: true,
  148. extra_cookie_attrs: [
  149. "SameSite=Lax"
  150. ]
  151. # Configures Elixir's Logger
  152. config :logger, :console,
  153. format: "$time $metadata[$level] $message\n",
  154. metadata: [:request_id]
  155. config :logger, :ex_syslogger,
  156. level: :debug,
  157. ident: "pleroma",
  158. format: "$metadata[$level] $message",
  159. metadata: [:request_id]
  160. config :quack,
  161. level: :warn,
  162. meta: [:all],
  163. webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
  164. config :mime, :types, %{
  165. "application/xml" => ["xml"],
  166. "application/xrd+xml" => ["xrd+xml"],
  167. "application/jrd+json" => ["jrd+json"],
  168. "application/activity+json" => ["activity+json"],
  169. "application/ld+json" => ["activity+json"]
  170. }
  171. config :tesla, adapter: Tesla.Adapter.Hackney
  172. # Configures http settings, upstream proxy etc.
  173. config :pleroma, :http,
  174. proxy_url: nil,
  175. send_user_agent: true,
  176. adapter: [
  177. ssl_options: [
  178. # Workaround for remote server certificate chain issues
  179. partial_chain: &:hackney_connect.partial_chain/1,
  180. # We don't support TLS v1.3 yet
  181. versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
  182. ]
  183. ]
  184. config :pleroma, :instance,
  185. name: "Pleroma",
  186. email: "example@example.com",
  187. notify_email: "noreply@example.com",
  188. description: "A Pleroma instance, an alternative fediverse server",
  189. limit: 5_000,
  190. remote_limit: 100_000,
  191. upload_limit: 16_000_000,
  192. avatar_upload_limit: 2_000_000,
  193. background_upload_limit: 4_000_000,
  194. banner_upload_limit: 4_000_000,
  195. poll_limits: %{
  196. max_options: 20,
  197. max_option_chars: 200,
  198. min_expiration: 0,
  199. max_expiration: 365 * 24 * 60 * 60
  200. },
  201. registrations_open: true,
  202. federating: true,
  203. federation_incoming_replies_max_depth: 100,
  204. federation_reachability_timeout_days: 7,
  205. federation_publisher_modules: [
  206. Pleroma.Web.ActivityPub.Publisher,
  207. Pleroma.Web.Websub,
  208. Pleroma.Web.Salmon
  209. ],
  210. allow_relay: true,
  211. rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
  212. public: true,
  213. quarantined_instances: [],
  214. managed_config: true,
  215. static_dir: "instance/static/",
  216. allowed_post_formats: [
  217. "text/plain",
  218. "text/html",
  219. "text/markdown",
  220. "text/bbcode"
  221. ],
  222. mrf_transparency: true,
  223. mrf_transparency_exclusions: [],
  224. autofollowed_nicknames: [],
  225. max_pinned_statuses: 1,
  226. no_attachment_links: false,
  227. welcome_user_nickname: nil,
  228. welcome_message: nil,
  229. max_report_comment_size: 1000,
  230. safe_dm_mentions: false,
  231. healthcheck: false,
  232. remote_post_retention_days: 90,
  233. skip_thread_containment: true,
  234. limit_to_local_content: :unauthenticated,
  235. dynamic_configuration: false,
  236. external_user_synchronization: true
  237. config :pleroma, :markup,
  238. # XXX - unfortunately, inline images must be enabled by default right now, because
  239. # of custom emoji. Issue #275 discusses defanging that somehow.
  240. allow_inline_images: true,
  241. allow_headings: false,
  242. allow_tables: false,
  243. allow_fonts: false,
  244. scrub_policy: [
  245. Pleroma.HTML.Transform.MediaProxy,
  246. Pleroma.HTML.Scrubber.Default
  247. ]
  248. config :pleroma, :frontend_configurations,
  249. pleroma_fe: %{
  250. theme: "pleroma-dark",
  251. logo: "/static/logo.png",
  252. background: "/images/city.jpg",
  253. redirectRootNoLogin: "/main/all",
  254. redirectRootLogin: "/main/friends",
  255. showInstanceSpecificPanel: true,
  256. scopeOptionsEnabled: false,
  257. formattingOptionsEnabled: false,
  258. collapseMessageWithSubject: false,
  259. hidePostStats: false,
  260. hideUserStats: false,
  261. scopeCopy: true,
  262. subjectLineBehavior: "email",
  263. alwaysShowSubjectInput: true
  264. },
  265. masto_fe: %{
  266. showInstanceSpecificPanel: true
  267. }
  268. config :pleroma, :assets,
  269. mascots: [
  270. pleroma_fox_tan: %{
  271. url: "/images/pleroma-fox-tan-smol.png",
  272. mime_type: "image/png"
  273. },
  274. pleroma_fox_tan_shy: %{
  275. url: "/images/pleroma-fox-tan-shy.png",
  276. mime_type: "image/png"
  277. }
  278. ],
  279. default_mascot: :pleroma_fox_tan
  280. config :pleroma, :activitypub,
  281. accept_blocks: true,
  282. unfollow_blocked: true,
  283. outgoing_blocks: true,
  284. follow_handshake_timeout: 500,
  285. sign_object_fetches: true
  286. config :pleroma, :user, deny_follow_blocked: true
  287. config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
  288. config :pleroma, :mrf_rejectnonpublic,
  289. allow_followersonly: false,
  290. allow_direct: false
  291. config :pleroma, :mrf_hellthread,
  292. delist_threshold: 10,
  293. reject_threshold: 20
  294. config :pleroma, :mrf_simple,
  295. media_removal: [],
  296. media_nsfw: [],
  297. federated_timeline_removal: [],
  298. report_removal: [],
  299. reject: [],
  300. accept: [],
  301. avatar_removal: [],
  302. banner_removal: []
  303. config :pleroma, :mrf_keyword,
  304. reject: [],
  305. federated_timeline_removal: [],
  306. replace: []
  307. config :pleroma, :mrf_subchain, match_actor: %{}
  308. config :pleroma, :rich_media,
  309. enabled: true,
  310. ignore_hosts: [],
  311. ignore_tld: ["local", "localdomain", "lan"],
  312. parsers: [
  313. Pleroma.Web.RichMedia.Parsers.TwitterCard,
  314. Pleroma.Web.RichMedia.Parsers.OGP,
  315. Pleroma.Web.RichMedia.Parsers.OEmbed
  316. ],
  317. ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
  318. config :pleroma, :media_proxy,
  319. enabled: false,
  320. proxy_opts: [
  321. redirect_on_failure: false,
  322. max_body_length: 25 * 1_048_576,
  323. http: [
  324. follow_redirect: true,
  325. pool: :media
  326. ]
  327. ],
  328. whitelist: []
  329. config :pleroma, :chat, enabled: true
  330. config :phoenix, :format_encoders, json: Jason
  331. config :pleroma, :gopher,
  332. enabled: false,
  333. ip: {0, 0, 0, 0},
  334. port: 9999
  335. config :pleroma, Pleroma.Web.Metadata,
  336. providers: [
  337. Pleroma.Web.Metadata.Providers.OpenGraph,
  338. Pleroma.Web.Metadata.Providers.TwitterCard,
  339. Pleroma.Web.Metadata.Providers.RelMe
  340. ],
  341. unfurl_nsfw: false
  342. config :pleroma, :suggestions,
  343. enabled: false,
  344. third_party_engine:
  345. "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
  346. timeout: 300_000,
  347. limit: 40,
  348. web: "https://vinayaka.distsn.org"
  349. config :pleroma, :http_security,
  350. enabled: true,
  351. sts: false,
  352. sts_max_age: 31_536_000,
  353. ct_max_age: 2_592_000,
  354. referrer_policy: "same-origin"
  355. config :cors_plug,
  356. max_age: 86_400,
  357. methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  358. expose: [
  359. "Link",
  360. "X-RateLimit-Reset",
  361. "X-RateLimit-Limit",
  362. "X-RateLimit-Remaining",
  363. "X-Request-Id",
  364. "Idempotency-Key"
  365. ],
  366. credentials: true,
  367. headers: ["Authorization", "Content-Type", "Idempotency-Key"]
  368. config :pleroma, Pleroma.User,
  369. restricted_nicknames: [
  370. ".well-known",
  371. "~",
  372. "about",
  373. "activities",
  374. "api",
  375. "auth",
  376. "check_password",
  377. "dev",
  378. "friend-requests",
  379. "inbox",
  380. "internal",
  381. "main",
  382. "media",
  383. "nodeinfo",
  384. "notice",
  385. "oauth",
  386. "objects",
  387. "ostatus_subscribe",
  388. "pleroma",
  389. "proxy",
  390. "push",
  391. "registration",
  392. "relay",
  393. "settings",
  394. "status",
  395. "tag",
  396. "user-search",
  397. "user_exists",
  398. "users",
  399. "web"
  400. ]
  401. config :pleroma, Pleroma.Web.Federator.RetryQueue,
  402. enabled: false,
  403. max_jobs: 20,
  404. initial_timeout: 30,
  405. max_retries: 5
  406. config :pleroma_job_queue, :queues,
  407. federator_incoming: 50,
  408. federator_outgoing: 50,
  409. web_push: 50,
  410. mailer: 10,
  411. transmogrifier: 20,
  412. scheduled_activities: 10,
  413. background: 5
  414. config :pleroma, :fetch_initial_posts,
  415. enabled: false,
  416. pages: 5
  417. config :auto_linker,
  418. opts: [
  419. scheme: true,
  420. extra: true,
  421. # TODO: Set to :no_scheme when it works properly
  422. validate_tld: true,
  423. class: false,
  424. strip_prefix: false,
  425. new_window: false,
  426. rel: false
  427. ]
  428. config :pleroma, :ldap,
  429. enabled: System.get_env("LDAP_ENABLED") == "true",
  430. host: System.get_env("LDAP_HOST") || "localhost",
  431. port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
  432. ssl: System.get_env("LDAP_SSL") == "true",
  433. sslopts: [],
  434. tls: System.get_env("LDAP_TLS") == "true",
  435. tlsopts: [],
  436. base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  437. uid: System.get_env("LDAP_UID") || "cn"
  438. config :esshd,
  439. enabled: false
  440. oauth_consumer_strategies =
  441. System.get_env("OAUTH_CONSUMER_STRATEGIES")
  442. |> to_string()
  443. |> String.split()
  444. |> Enum.map(&hd(String.split(&1, ":")))
  445. ueberauth_providers =
  446. for strategy <- oauth_consumer_strategies do
  447. strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
  448. strategy_module = String.to_atom(strategy_module_name)
  449. {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  450. end
  451. config :ueberauth,
  452. Ueberauth,
  453. base_path: "/oauth",
  454. providers: ueberauth_providers
  455. config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
  456. config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
  457. config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
  458. config :pleroma, Pleroma.ScheduledActivity,
  459. daily_user_limit: 25,
  460. total_user_limit: 300,
  461. enabled: true
  462. config :pleroma, :oauth2,
  463. token_expires_in: 600,
  464. issue_new_refresh_token: true,
  465. clean_expired_tokens: false,
  466. clean_expired_tokens_interval: 86_400_000
  467. config :pleroma, :database, rum_enabled: false
  468. config :pleroma, :env, Mix.env()
  469. config :http_signatures,
  470. adapter: Pleroma.Signature
  471. config :pleroma, :rate_limit,
  472. search: [{1000, 10}, {1000, 30}],
  473. app_account_creation: {1_800_000, 25},
  474. relations_actions: {10_000, 10},
  475. relation_id_action: {60_000, 2},
  476. statuses_actions: {10_000, 15},
  477. status_id_action: {60_000, 3},
  478. password_reset: {1_800_000, 5},
  479. account_confirmation_resend: {8_640_000, 5}
  480. # Import environment specific config. This must remain at the bottom
  481. # of this file so it overrides the configuration defined above.
  482. import_config "#{Mix.env()}.exs"