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.

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