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.

601 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. config :pleroma, :markup,
  261. # XXX - unfortunately, inline images must be enabled by default right now, because
  262. # of custom emoji. Issue #275 discusses defanging that somehow.
  263. allow_inline_images: true,
  264. allow_headings: false,
  265. allow_tables: false,
  266. allow_fonts: false,
  267. scrub_policy: [
  268. Pleroma.HTML.Transform.MediaProxy,
  269. Pleroma.HTML.Scrubber.Default
  270. ]
  271. config :pleroma, :frontend_configurations,
  272. pleroma_fe: %{
  273. theme: "pleroma-dark",
  274. logo: "/static/logo.png",
  275. background: "/images/city.jpg",
  276. redirectRootNoLogin: "/main/all",
  277. redirectRootLogin: "/main/friends",
  278. showInstanceSpecificPanel: true,
  279. scopeOptionsEnabled: false,
  280. formattingOptionsEnabled: false,
  281. collapseMessageWithSubject: false,
  282. hidePostStats: false,
  283. hideUserStats: false,
  284. scopeCopy: true,
  285. subjectLineBehavior: "email",
  286. alwaysShowSubjectInput: true
  287. },
  288. masto_fe: %{
  289. showInstanceSpecificPanel: true
  290. }
  291. config :pleroma, :assets,
  292. mascots: [
  293. pleroma_fox_tan: %{
  294. url: "/images/pleroma-fox-tan-smol.png",
  295. mime_type: "image/png"
  296. },
  297. pleroma_fox_tan_shy: %{
  298. url: "/images/pleroma-fox-tan-shy.png",
  299. mime_type: "image/png"
  300. }
  301. ],
  302. default_mascot: :pleroma_fox_tan
  303. config :pleroma, :activitypub,
  304. unfollow_blocked: true,
  305. outgoing_blocks: true,
  306. follow_handshake_timeout: 500,
  307. sign_object_fetches: true
  308. config :pleroma, :streamer,
  309. workers: 3,
  310. overflow_workers: 2
  311. config :pleroma, :user, deny_follow_blocked: true
  312. config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
  313. config :pleroma, :mrf_rejectnonpublic,
  314. allow_followersonly: false,
  315. allow_direct: false
  316. config :pleroma, :mrf_hellthread,
  317. delist_threshold: 10,
  318. reject_threshold: 20
  319. config :pleroma, :mrf_simple,
  320. media_removal: [],
  321. media_nsfw: [],
  322. federated_timeline_removal: [],
  323. report_removal: [],
  324. reject: [],
  325. accept: [],
  326. avatar_removal: [],
  327. banner_removal: []
  328. config :pleroma, :mrf_keyword,
  329. reject: [],
  330. federated_timeline_removal: [],
  331. replace: []
  332. config :pleroma, :mrf_subchain, match_actor: %{}
  333. config :pleroma, :mrf_vocabulary,
  334. accept: [],
  335. reject: []
  336. config :pleroma, :rich_media,
  337. enabled: true,
  338. ignore_hosts: [],
  339. ignore_tld: ["local", "localdomain", "lan"],
  340. parsers: [
  341. Pleroma.Web.RichMedia.Parsers.TwitterCard,
  342. Pleroma.Web.RichMedia.Parsers.OGP,
  343. Pleroma.Web.RichMedia.Parsers.OEmbed
  344. ],
  345. ttl_setters: [Pleroma.Web.RichMedia.Parser.TTL.AwsSignedUrl]
  346. config :pleroma, :media_proxy,
  347. enabled: false,
  348. proxy_opts: [
  349. redirect_on_failure: false,
  350. max_body_length: 25 * 1_048_576,
  351. http: [
  352. follow_redirect: true,
  353. pool: :media
  354. ]
  355. ],
  356. whitelist: []
  357. config :pleroma, :chat, enabled: true
  358. config :phoenix, :format_encoders, json: Jason
  359. config :phoenix, :json_library, Jason
  360. config :pleroma, :gopher,
  361. enabled: false,
  362. ip: {0, 0, 0, 0},
  363. port: 9999
  364. config :pleroma, Pleroma.Web.Metadata,
  365. providers: [
  366. Pleroma.Web.Metadata.Providers.OpenGraph,
  367. Pleroma.Web.Metadata.Providers.TwitterCard,
  368. Pleroma.Web.Metadata.Providers.RelMe
  369. ],
  370. unfurl_nsfw: false
  371. config :pleroma, :suggestions,
  372. enabled: false,
  373. third_party_engine:
  374. "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
  375. timeout: 300_000,
  376. limit: 40,
  377. web: "https://vinayaka.distsn.org"
  378. config :pleroma, :http_security,
  379. enabled: true,
  380. sts: false,
  381. sts_max_age: 31_536_000,
  382. ct_max_age: 2_592_000,
  383. referrer_policy: "same-origin"
  384. config :cors_plug,
  385. max_age: 86_400,
  386. methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  387. expose: [
  388. "Link",
  389. "X-RateLimit-Reset",
  390. "X-RateLimit-Limit",
  391. "X-RateLimit-Remaining",
  392. "X-Request-Id",
  393. "Idempotency-Key"
  394. ],
  395. credentials: true,
  396. headers: ["Authorization", "Content-Type", "Idempotency-Key"]
  397. config :pleroma, Pleroma.User,
  398. restricted_nicknames: [
  399. ".well-known",
  400. "~",
  401. "about",
  402. "activities",
  403. "api",
  404. "auth",
  405. "check_password",
  406. "dev",
  407. "friend-requests",
  408. "inbox",
  409. "internal",
  410. "main",
  411. "media",
  412. "nodeinfo",
  413. "notice",
  414. "oauth",
  415. "objects",
  416. "ostatus_subscribe",
  417. "pleroma",
  418. "proxy",
  419. "push",
  420. "registration",
  421. "relay",
  422. "settings",
  423. "status",
  424. "tag",
  425. "user-search",
  426. "user_exists",
  427. "users",
  428. "web"
  429. ]
  430. config :pleroma, Oban,
  431. repo: Pleroma.Repo,
  432. verbose: false,
  433. prune: {:maxlen, 1500},
  434. queues: [
  435. activity_expiration: 10,
  436. federator_incoming: 50,
  437. federator_outgoing: 50,
  438. web_push: 50,
  439. mailer: 10,
  440. transmogrifier: 20,
  441. scheduled_activities: 10,
  442. background: 5
  443. ]
  444. config :pleroma, :workers,
  445. retries: [
  446. federator_incoming: 5,
  447. federator_outgoing: 5
  448. ]
  449. config :pleroma, :fetch_initial_posts,
  450. enabled: false,
  451. pages: 5
  452. config :auto_linker,
  453. opts: [
  454. scheme: true,
  455. extra: true,
  456. # TODO: Set to :no_scheme when it works properly
  457. validate_tld: true,
  458. class: false,
  459. strip_prefix: false,
  460. new_window: false,
  461. rel: "ugc"
  462. ]
  463. config :pleroma, :ldap,
  464. enabled: System.get_env("LDAP_ENABLED") == "true",
  465. host: System.get_env("LDAP_HOST") || "localhost",
  466. port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
  467. ssl: System.get_env("LDAP_SSL") == "true",
  468. sslopts: [],
  469. tls: System.get_env("LDAP_TLS") == "true",
  470. tlsopts: [],
  471. base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  472. uid: System.get_env("LDAP_UID") || "cn"
  473. config :esshd,
  474. enabled: false
  475. oauth_consumer_strategies =
  476. System.get_env("OAUTH_CONSUMER_STRATEGIES")
  477. |> to_string()
  478. |> String.split()
  479. |> Enum.map(&hd(String.split(&1, ":")))
  480. ueberauth_providers =
  481. for strategy <- oauth_consumer_strategies do
  482. strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
  483. strategy_module = String.to_atom(strategy_module_name)
  484. {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  485. end
  486. config :ueberauth,
  487. Ueberauth,
  488. base_path: "/oauth",
  489. providers: ueberauth_providers
  490. config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
  491. config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
  492. config :pleroma, Pleroma.Emails.UserEmail,
  493. logo: nil,
  494. styling: %{
  495. link_color: "#d8a070",
  496. background_color: "#2C3645",
  497. content_background_color: "#1B2635",
  498. header_color: "#d8a070",
  499. text_color: "#b9b9ba",
  500. text_muted_color: "#b9b9ba"
  501. }
  502. config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
  503. config :pleroma, Pleroma.ScheduledActivity,
  504. daily_user_limit: 25,
  505. total_user_limit: 300,
  506. enabled: true
  507. config :pleroma, :email_notifications,
  508. digest: %{
  509. active: false,
  510. schedule: "0 0 * * 0",
  511. interval: 7,
  512. inactivity_threshold: 7
  513. }
  514. config :pleroma, :oauth2,
  515. token_expires_in: 600,
  516. issue_new_refresh_token: true,
  517. clean_expired_tokens: false,
  518. clean_expired_tokens_interval: 86_400_000
  519. config :pleroma, :database, rum_enabled: false
  520. config :pleroma, :env, Mix.env()
  521. config :http_signatures,
  522. adapter: Pleroma.Signature
  523. config :pleroma, :rate_limit, nil
  524. config :pleroma, Pleroma.ActivityExpiration, enabled: true
  525. config :pleroma, :web_cache_ttl,
  526. activity_pub: nil,
  527. activity_pub_question: 30_000
  528. # Import environment specific config. This must remain at the bottom
  529. # of this file so it overrides the configuration defined above.
  530. import_config "#{Mix.env()}.exs"