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.

605 lines
16KB

  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. scheduled_jobs =
  52. with digest_config <- Application.get_env(:pleroma, :email_notifications)[:digest],
  53. true <- digest_config[:active] do
  54. [{digest_config[:schedule], {Pleroma.Daemons.DigestEmailDaemon, :perform, []}}]
  55. else
  56. _ -> []
  57. end
  58. scheduled_jobs =
  59. scheduled_jobs ++
  60. [{"0 */6 * * * *", {Pleroma.Web.Websub, :refresh_subscriptions, []}}]
  61. config :pleroma, Pleroma.Scheduler,
  62. global: true,
  63. overlap: true,
  64. timezone: :utc,
  65. jobs: scheduled_jobs
  66. config :pleroma, Pleroma.Captcha,
  67. enabled: false,
  68. seconds_valid: 60,
  69. method: Pleroma.Captcha.Kocaptcha
  70. config :pleroma, :hackney_pools,
  71. federation: [
  72. max_connections: 50,
  73. timeout: 150_000
  74. ],
  75. media: [
  76. max_connections: 50,
  77. timeout: 150_000
  78. ],
  79. upload: [
  80. max_connections: 25,
  81. timeout: 300_000
  82. ]
  83. config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
  84. # Upload configuration
  85. config :pleroma, Pleroma.Upload,
  86. uploader: Pleroma.Uploaders.Local,
  87. filters: [Pleroma.Upload.Filter.Dedupe],
  88. link_name: true,
  89. proxy_remote: false,
  90. proxy_opts: [
  91. redirect_on_failure: false,
  92. max_body_length: 25 * 1_048_576,
  93. http: [
  94. follow_redirect: true,
  95. pool: :upload
  96. ]
  97. ]
  98. config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
  99. config :pleroma, Pleroma.Uploaders.S3,
  100. bucket: nil,
  101. streaming_enabled: true,
  102. public_endpoint: "https://s3.amazonaws.com"
  103. config :pleroma, Pleroma.Uploaders.MDII,
  104. cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
  105. files: "https://mdii.sakura.ne.jp"
  106. config :pleroma, :emoji,
  107. shortcode_globs: ["/emoji/custom/**/*.png"],
  108. pack_extensions: [".png", ".gif"],
  109. groups: [
  110. # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
  111. Custom: ["/emoji/*.png", "/emoji/**/*.png"]
  112. ],
  113. default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json",
  114. shared_pack_cache_seconds_per_file: 60
  115. config :pleroma, :uri_schemes,
  116. valid_schemes: [
  117. "https",
  118. "http",
  119. "dat",
  120. "dweb",
  121. "gopher",
  122. "ipfs",
  123. "ipns",
  124. "irc",
  125. "ircs",
  126. "magnet",
  127. "mailto",
  128. "mumble",
  129. "ssb",
  130. "xmpp"
  131. ]
  132. websocket_config = [
  133. path: "/websocket",
  134. serializer: [
  135. {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
  136. {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  137. ],
  138. timeout: 60_000,
  139. transport_log: false,
  140. compress: false
  141. ]
  142. # Configures the endpoint
  143. config :pleroma, Pleroma.Web.Endpoint,
  144. instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
  145. url: [host: "localhost"],
  146. http: [
  147. ip: {127, 0, 0, 1},
  148. dispatch: [
  149. {:_,
  150. [
  151. {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
  152. {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
  153. {Phoenix.Transports.WebSocket,
  154. {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
  155. {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
  156. ]}
  157. ]
  158. ],
  159. protocol: "https",
  160. secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
  161. signing_salt: "CqaoopA2",
  162. render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
  163. pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
  164. secure_cookie_flag: true,
  165. extra_cookie_attrs: [
  166. "SameSite=Lax"
  167. ]
  168. # Configures Elixir's Logger
  169. config :logger, :console,
  170. format: "$time $metadata[$level] $message\n",
  171. metadata: [:request_id]
  172. config :logger, :ex_syslogger,
  173. level: :debug,
  174. ident: "pleroma",
  175. format: "$metadata[$level] $message",
  176. metadata: [:request_id]
  177. config :quack,
  178. level: :warn,
  179. meta: [:all],
  180. webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
  181. config :mime, :types, %{
  182. "application/xml" => ["xml"],
  183. "application/xrd+xml" => ["xrd+xml"],
  184. "application/jrd+json" => ["jrd+json"],
  185. "application/activity+json" => ["activity+json"],
  186. "application/ld+json" => ["activity+json"]
  187. }
  188. config :tesla, adapter: Tesla.Adapter.Hackney
  189. # Configures http settings, upstream proxy etc.
  190. config :pleroma, :http,
  191. proxy_url: nil,
  192. send_user_agent: true,
  193. adapter: [
  194. ssl_options: [
  195. # Workaround for remote server certificate chain issues
  196. partial_chain: &:hackney_connect.partial_chain/1,
  197. # We don't support TLS v1.3 yet
  198. versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
  199. ]
  200. ]
  201. config :pleroma, :instance,
  202. name: "Pleroma",
  203. email: "example@example.com",
  204. notify_email: "noreply@example.com",
  205. description: "A Pleroma instance, an alternative fediverse server",
  206. limit: 5_000,
  207. remote_limit: 100_000,
  208. upload_limit: 16_000_000,
  209. avatar_upload_limit: 2_000_000,
  210. background_upload_limit: 4_000_000,
  211. banner_upload_limit: 4_000_000,
  212. poll_limits: %{
  213. max_options: 20,
  214. max_option_chars: 200,
  215. min_expiration: 0,
  216. max_expiration: 365 * 24 * 60 * 60
  217. },
  218. registrations_open: true,
  219. federating: true,
  220. federation_incoming_replies_max_depth: 100,
  221. federation_reachability_timeout_days: 7,
  222. federation_publisher_modules: [
  223. Pleroma.Web.ActivityPub.Publisher,
  224. Pleroma.Web.Websub,
  225. Pleroma.Web.Salmon
  226. ],
  227. allow_relay: true,
  228. rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
  229. public: true,
  230. quarantined_instances: [],
  231. managed_config: true,
  232. static_dir: "instance/static/",
  233. allowed_post_formats: [
  234. "text/plain",
  235. "text/html",
  236. "text/markdown",
  237. "text/bbcode"
  238. ],
  239. mrf_transparency: true,
  240. mrf_transparency_exclusions: [],
  241. autofollowed_nicknames: [],
  242. max_pinned_statuses: 1,
  243. no_attachment_links: false,
  244. welcome_user_nickname: nil,
  245. welcome_message: nil,
  246. max_report_comment_size: 1000,
  247. safe_dm_mentions: false,
  248. healthcheck: false,
  249. remote_post_retention_days: 90,
  250. skip_thread_containment: true,
  251. limit_to_local_content: :unauthenticated,
  252. dynamic_configuration: false,
  253. user_bio_length: 5000,
  254. user_name_length: 100,
  255. max_account_fields: 10,
  256. max_remote_account_fields: 20,
  257. account_field_name_length: 512,
  258. account_field_value_length: 2048,
  259. external_user_synchronization: true,
  260. extended_nickname_format: false
  261. config :pleroma, :markup,
  262. # XXX - unfortunately, inline images must be enabled by default right now, because
  263. # of custom emoji. Issue #275 discusses defanging that somehow.
  264. allow_inline_images: true,
  265. allow_headings: false,
  266. allow_tables: false,
  267. allow_fonts: false,
  268. scrub_policy: [
  269. Pleroma.HTML.Transform.MediaProxy,
  270. Pleroma.HTML.Scrubber.Default
  271. ]
  272. config :pleroma, :frontend_configurations,
  273. pleroma_fe: %{
  274. theme: "pleroma-dark",
  275. logo: "/static/logo.png",
  276. background: "/images/city.jpg",
  277. redirectRootNoLogin: "/main/all",
  278. redirectRootLogin: "/main/friends",
  279. showInstanceSpecificPanel: true,
  280. scopeOptionsEnabled: false,
  281. formattingOptionsEnabled: false,
  282. collapseMessageWithSubject: false,
  283. hidePostStats: false,
  284. hideUserStats: false,
  285. scopeCopy: true,
  286. subjectLineBehavior: "email",
  287. alwaysShowSubjectInput: true
  288. },
  289. masto_fe: %{
  290. showInstanceSpecificPanel: true
  291. }
  292. config :pleroma, :assets,
  293. mascots: [
  294. pleroma_fox_tan: %{
  295. url: "/images/pleroma-fox-tan-smol.png",
  296. mime_type: "image/png"
  297. },
  298. pleroma_fox_tan_shy: %{
  299. url: "/images/pleroma-fox-tan-shy.png",
  300. mime_type: "image/png"
  301. }
  302. ],
  303. default_mascot: :pleroma_fox_tan
  304. config :pleroma, :activitypub,
  305. unfollow_blocked: true,
  306. outgoing_blocks: true,
  307. follow_handshake_timeout: 500,
  308. sign_object_fetches: true
  309. config :pleroma, :streamer,
  310. workers: 3,
  311. overflow_workers: 2
  312. config :pleroma, :user, deny_follow_blocked: true
  313. config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
  314. config :pleroma, :mrf_rejectnonpublic,
  315. allow_followersonly: false,
  316. allow_direct: false
  317. config :pleroma, :mrf_hellthread,
  318. delist_threshold: 10,
  319. reject_threshold: 20
  320. config :pleroma, :mrf_simple,
  321. media_removal: [],
  322. media_nsfw: [],
  323. federated_timeline_removal: [],
  324. report_removal: [],
  325. reject: [],
  326. accept: [],
  327. avatar_removal: [],
  328. banner_removal: []
  329. config :pleroma, :mrf_keyword,
  330. reject: [],
  331. federated_timeline_removal: [],
  332. replace: []
  333. config :pleroma, :mrf_subchain, match_actor: %{}
  334. config :pleroma, :mrf_vocabulary,
  335. accept: [],
  336. reject: []
  337. config :pleroma, :rich_media,
  338. enabled: true,
  339. ignore_hosts: [],
  340. ignore_tld: ["local", "localdomain", "lan"],
  341. parsers: [
  342. Pleroma.Web.RichMedia.Parsers.TwitterCard,
  343. Pleroma.Web.RichMedia.Parsers.OGP,
  344. Pleroma.Web.RichMedia.Parsers.OEmbed
  345. ],
  346. ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
  347. config :pleroma, :media_proxy,
  348. enabled: false,
  349. proxy_opts: [
  350. redirect_on_failure: false,
  351. max_body_length: 25 * 1_048_576,
  352. http: [
  353. follow_redirect: true,
  354. pool: :media
  355. ]
  356. ],
  357. whitelist: []
  358. config :pleroma, :chat, enabled: true
  359. config :phoenix, :format_encoders, json: Jason
  360. config :phoenix, :json_library, Jason
  361. config :pleroma, :gopher,
  362. enabled: false,
  363. ip: {0, 0, 0, 0},
  364. port: 9999
  365. config :pleroma, Pleroma.Web.Metadata,
  366. providers: [
  367. Pleroma.Web.Metadata.Providers.OpenGraph,
  368. Pleroma.Web.Metadata.Providers.TwitterCard,
  369. Pleroma.Web.Metadata.Providers.RelMe,
  370. Pleroma.Web.Metadata.Providers.Feed
  371. ],
  372. unfurl_nsfw: false
  373. config :pleroma, :suggestions,
  374. enabled: false,
  375. third_party_engine:
  376. "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
  377. timeout: 300_000,
  378. limit: 40,
  379. web: "https://vinayaka.distsn.org"
  380. config :pleroma, :http_security,
  381. enabled: true,
  382. sts: false,
  383. sts_max_age: 31_536_000,
  384. ct_max_age: 2_592_000,
  385. referrer_policy: "same-origin"
  386. config :cors_plug,
  387. max_age: 86_400,
  388. methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  389. expose: [
  390. "Link",
  391. "X-RateLimit-Reset",
  392. "X-RateLimit-Limit",
  393. "X-RateLimit-Remaining",
  394. "X-Request-Id",
  395. "Idempotency-Key"
  396. ],
  397. credentials: true,
  398. headers: ["Authorization", "Content-Type", "Idempotency-Key"]
  399. config :pleroma, Pleroma.User,
  400. restricted_nicknames: [
  401. ".well-known",
  402. "~",
  403. "about",
  404. "activities",
  405. "api",
  406. "auth",
  407. "check_password",
  408. "dev",
  409. "friend-requests",
  410. "inbox",
  411. "internal",
  412. "main",
  413. "media",
  414. "nodeinfo",
  415. "notice",
  416. "oauth",
  417. "objects",
  418. "ostatus_subscribe",
  419. "pleroma",
  420. "proxy",
  421. "push",
  422. "registration",
  423. "relay",
  424. "settings",
  425. "status",
  426. "tag",
  427. "user-search",
  428. "user_exists",
  429. "users",
  430. "web"
  431. ]
  432. config :pleroma, Oban,
  433. repo: Pleroma.Repo,
  434. verbose: false,
  435. prune: {:maxlen, 1500},
  436. queues: [
  437. activity_expiration: 10,
  438. federator_incoming: 50,
  439. federator_outgoing: 50,
  440. web_push: 50,
  441. mailer: 10,
  442. transmogrifier: 20,
  443. scheduled_activities: 10,
  444. background: 5
  445. ]
  446. config :pleroma, :workers,
  447. retries: [
  448. federator_incoming: 5,
  449. federator_outgoing: 5
  450. ]
  451. config :pleroma, :fetch_initial_posts,
  452. enabled: false,
  453. pages: 5
  454. config :auto_linker,
  455. opts: [
  456. scheme: true,
  457. extra: true,
  458. # TODO: Set to :no_scheme when it works properly
  459. validate_tld: true,
  460. class: false,
  461. strip_prefix: false,
  462. new_window: false,
  463. rel: "ugc"
  464. ]
  465. config :pleroma, :ldap,
  466. enabled: System.get_env("LDAP_ENABLED") == "true",
  467. host: System.get_env("LDAP_HOST") || "localhost",
  468. port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
  469. ssl: System.get_env("LDAP_SSL") == "true",
  470. sslopts: [],
  471. tls: System.get_env("LDAP_TLS") == "true",
  472. tlsopts: [],
  473. base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  474. uid: System.get_env("LDAP_UID") || "cn"
  475. config :esshd,
  476. enabled: false
  477. oauth_consumer_strategies =
  478. System.get_env("OAUTH_CONSUMER_STRATEGIES")
  479. |> to_string()
  480. |> String.split()
  481. |> Enum.map(&hd(String.split(&1, ":")))
  482. ueberauth_providers =
  483. for strategy <- oauth_consumer_strategies do
  484. strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
  485. strategy_module = String.to_atom(strategy_module_name)
  486. {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  487. end
  488. config :ueberauth,
  489. Ueberauth,
  490. base_path: "/oauth",
  491. providers: ueberauth_providers
  492. config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
  493. config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
  494. config :pleroma, Pleroma.Emails.UserEmail,
  495. logo: nil,
  496. styling: %{
  497. link_color: "#d8a070",
  498. background_color: "#2C3645",
  499. content_background_color: "#1B2635",
  500. header_color: "#d8a070",
  501. text_color: "#b9b9ba",
  502. text_muted_color: "#b9b9ba"
  503. }
  504. config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
  505. config :pleroma, Pleroma.ScheduledActivity,
  506. daily_user_limit: 25,
  507. total_user_limit: 300,
  508. enabled: true
  509. config :pleroma, :email_notifications,
  510. digest: %{
  511. active: false,
  512. schedule: "0 0 * * 0",
  513. interval: 7,
  514. inactivity_threshold: 7
  515. }
  516. config :pleroma, :oauth2,
  517. token_expires_in: 600,
  518. issue_new_refresh_token: true,
  519. clean_expired_tokens: false,
  520. clean_expired_tokens_interval: 86_400_000
  521. config :pleroma, :database, rum_enabled: false
  522. config :pleroma, :env, Mix.env()
  523. config :http_signatures,
  524. adapter: Pleroma.Signature
  525. config :pleroma, :rate_limit, authentication: {60_000, 15}
  526. config :pleroma, Pleroma.ActivityExpiration, enabled: true
  527. config :pleroma, Pleroma.Plugs.RemoteIp, enabled: false
  528. config :pleroma, :web_cache_ttl,
  529. activity_pub: nil,
  530. activity_pub_question: 30_000
  531. # Import environment specific config. This must remain at the bottom
  532. # of this file so it overrides the configuration defined above.
  533. import_config "#{Mix.env()}.exs"