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.

625 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. config :pleroma, Pleroma.Captcha,
  52. enabled: true,
  53. seconds_valid: 300,
  54. method: Pleroma.Captcha.Native
  55. config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
  56. config :pleroma, :hackney_pools,
  57. federation: [
  58. max_connections: 50,
  59. timeout: 150_000
  60. ],
  61. media: [
  62. max_connections: 50,
  63. timeout: 150_000
  64. ],
  65. upload: [
  66. max_connections: 25,
  67. timeout: 300_000
  68. ]
  69. # Upload configuration
  70. config :pleroma, Pleroma.Upload,
  71. uploader: Pleroma.Uploaders.Local,
  72. filters: [Pleroma.Upload.Filter.Dedupe],
  73. link_name: false,
  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. streaming_enabled: true,
  87. public_endpoint: "https://s3.amazonaws.com"
  88. config :pleroma, :emoji,
  89. shortcode_globs: ["/emoji/custom/**/*.png"],
  90. pack_extensions: [".png", ".gif"],
  91. groups: [
  92. Custom: ["/emoji/*.png", "/emoji/**/*.png"]
  93. ],
  94. default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json",
  95. shared_pack_cache_seconds_per_file: 60
  96. config :pleroma, :uri_schemes,
  97. valid_schemes: [
  98. "https",
  99. "http",
  100. "dat",
  101. "dweb",
  102. "gopher",
  103. "ipfs",
  104. "ipns",
  105. "irc",
  106. "ircs",
  107. "magnet",
  108. "mailto",
  109. "mumble",
  110. "ssb",
  111. "xmpp"
  112. ]
  113. websocket_config = [
  114. path: "/websocket",
  115. serializer: [
  116. {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
  117. {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  118. ],
  119. timeout: 60_000,
  120. transport_log: false,
  121. compress: false
  122. ]
  123. # Configures the endpoint
  124. config :pleroma, Pleroma.Web.Endpoint,
  125. instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
  126. url: [host: "localhost"],
  127. http: [
  128. ip: {127, 0, 0, 1},
  129. dispatch: [
  130. {:_,
  131. [
  132. {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
  133. {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
  134. {Phoenix.Transports.WebSocket,
  135. {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
  136. {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
  137. ]}
  138. ]
  139. ],
  140. protocol: "https",
  141. secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
  142. signing_salt: "CqaoopA2",
  143. render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
  144. pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
  145. secure_cookie_flag: true,
  146. extra_cookie_attrs: [
  147. "SameSite=Lax"
  148. ]
  149. # Configures Elixir's Logger
  150. config :logger, :console,
  151. level: :debug,
  152. format: "\n$time $metadata[$level] $message\n",
  153. metadata: [:request_id]
  154. config :logger, :ex_syslogger,
  155. level: :debug,
  156. ident: "pleroma",
  157. format: "$metadata[$level] $message",
  158. metadata: [:request_id]
  159. config :quack,
  160. level: :warn,
  161. meta: [:all],
  162. webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
  163. config :mime, :types, %{
  164. "application/xml" => ["xml"],
  165. "application/xrd+xml" => ["xrd+xml"],
  166. "application/jrd+json" => ["jrd+json"],
  167. "application/activity+json" => ["activity+json"],
  168. "application/ld+json" => ["activity+json"]
  169. }
  170. config :tesla, adapter: Tesla.Adapter.Hackney
  171. # Configures http settings, upstream proxy etc.
  172. config :pleroma, :http,
  173. proxy_url: nil,
  174. send_user_agent: true,
  175. user_agent: :default,
  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. chat_limit: 5_000,
  191. remote_limit: 100_000,
  192. upload_limit: 16_000_000,
  193. avatar_upload_limit: 2_000_000,
  194. background_upload_limit: 4_000_000,
  195. banner_upload_limit: 4_000_000,
  196. poll_limits: %{
  197. max_options: 20,
  198. max_option_chars: 200,
  199. min_expiration: 0,
  200. max_expiration: 365 * 24 * 60 * 60
  201. },
  202. registrations_open: true,
  203. federating: true,
  204. federation_incoming_replies_max_depth: 100,
  205. federation_reachability_timeout_days: 7,
  206. federation_publisher_modules: [
  207. Pleroma.Web.ActivityPub.Publisher
  208. ],
  209. allow_relay: true,
  210. rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
  211. public: true,
  212. quarantined_instances: [],
  213. managed_config: true,
  214. static_dir: "instance/static/",
  215. allowed_post_formats: [
  216. "text/plain",
  217. "text/html",
  218. "text/markdown",
  219. "text/bbcode"
  220. ],
  221. mrf_transparency: true,
  222. mrf_transparency_exclusions: [],
  223. autofollowed_nicknames: [],
  224. max_pinned_statuses: 1,
  225. attachment_links: false,
  226. welcome_user_nickname: nil,
  227. welcome_message: nil,
  228. max_report_comment_size: 1000,
  229. safe_dm_mentions: false,
  230. healthcheck: false,
  231. remote_post_retention_days: 90,
  232. skip_thread_containment: true,
  233. limit_to_local_content: :unauthenticated,
  234. user_bio_length: 5000,
  235. user_name_length: 100,
  236. max_account_fields: 10,
  237. max_remote_account_fields: 20,
  238. account_field_name_length: 512,
  239. account_field_value_length: 2048,
  240. external_user_synchronization: true,
  241. extended_nickname_format: true,
  242. cleanup_attachments: false
  243. config :pleroma, :feed,
  244. post_title: %{
  245. max_length: 100,
  246. omission: "..."
  247. }
  248. config :pleroma, :markup,
  249. # XXX - unfortunately, inline images must be enabled by default right now, because
  250. # of custom emoji. Issue #275 discusses defanging that somehow.
  251. allow_inline_images: true,
  252. allow_headings: false,
  253. allow_tables: false,
  254. allow_fonts: false,
  255. scrub_policy: [
  256. Pleroma.HTML.Scrubber.Default,
  257. Pleroma.HTML.Transform.MediaProxy
  258. ]
  259. config :pleroma, :frontend_configurations,
  260. pleroma_fe: %{
  261. theme: "pleroma-dark",
  262. logo: "/static/logo.png",
  263. background: "/images/city.jpg",
  264. redirectRootNoLogin: "/main/all",
  265. redirectRootLogin: "/main/friends",
  266. showInstanceSpecificPanel: true,
  267. scopeOptionsEnabled: false,
  268. formattingOptionsEnabled: false,
  269. collapseMessageWithSubject: false,
  270. hidePostStats: false,
  271. hideUserStats: false,
  272. scopeCopy: true,
  273. subjectLineBehavior: "email",
  274. alwaysShowSubjectInput: true
  275. },
  276. masto_fe: %{
  277. showInstanceSpecificPanel: true
  278. }
  279. config :pleroma, :assets,
  280. mascots: [
  281. pleroma_fox_tan: %{
  282. url: "/images/pleroma-fox-tan-smol.png",
  283. mime_type: "image/png"
  284. },
  285. pleroma_fox_tan_shy: %{
  286. url: "/images/pleroma-fox-tan-shy.png",
  287. mime_type: "image/png"
  288. }
  289. ],
  290. default_mascot: :pleroma_fox_tan
  291. config :pleroma, :manifest,
  292. icons: [
  293. %{
  294. src: "/static/logo.png",
  295. type: "image/png"
  296. }
  297. ],
  298. theme_color: "#282c37",
  299. background_color: "#191b22"
  300. config :pleroma, :activitypub,
  301. unfollow_blocked: true,
  302. outgoing_blocks: true,
  303. follow_handshake_timeout: 500,
  304. sign_object_fetches: true,
  305. authorized_fetch_mode: false
  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, :mrf_object_age,
  335. threshold: 172_800,
  336. actions: [:delist, :strip_followers]
  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, :http_security,
  374. enabled: true,
  375. sts: false,
  376. sts_max_age: 31_536_000,
  377. ct_max_age: 2_592_000,
  378. referrer_policy: "same-origin"
  379. config :cors_plug,
  380. max_age: 86_400,
  381. methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  382. expose: [
  383. "Link",
  384. "X-RateLimit-Reset",
  385. "X-RateLimit-Limit",
  386. "X-RateLimit-Remaining",
  387. "X-Request-Id",
  388. "Idempotency-Key"
  389. ],
  390. credentials: true,
  391. headers: ["Authorization", "Content-Type", "Idempotency-Key"]
  392. config :pleroma, Pleroma.User,
  393. restricted_nicknames: [
  394. ".well-known",
  395. "~",
  396. "about",
  397. "activities",
  398. "api",
  399. "auth",
  400. "check_password",
  401. "dev",
  402. "friend-requests",
  403. "inbox",
  404. "internal",
  405. "main",
  406. "media",
  407. "nodeinfo",
  408. "notice",
  409. "oauth",
  410. "objects",
  411. "ostatus_subscribe",
  412. "pleroma",
  413. "proxy",
  414. "push",
  415. "registration",
  416. "relay",
  417. "settings",
  418. "status",
  419. "tag",
  420. "user-search",
  421. "user_exists",
  422. "users",
  423. "web"
  424. ]
  425. config :pleroma, Oban,
  426. repo: Pleroma.Repo,
  427. verbose: false,
  428. prune: {:maxlen, 1500},
  429. queues: [
  430. activity_expiration: 10,
  431. federator_incoming: 50,
  432. federator_outgoing: 50,
  433. web_push: 50,
  434. mailer: 10,
  435. transmogrifier: 20,
  436. scheduled_activities: 10,
  437. background: 5,
  438. attachments_cleanup: 5,
  439. new_users_digest: 1
  440. ],
  441. crontab: [
  442. {"0 0 * * *", Pleroma.Workers.Cron.ClearOauthTokenWorker},
  443. {"0 * * * *", Pleroma.Workers.Cron.StatsWorker},
  444. {"* * * * *", Pleroma.Workers.Cron.PurgeExpiredActivitiesWorker},
  445. {"0 0 * * 0", Pleroma.Workers.Cron.DigestEmailsWorker},
  446. {"0 0 * * *", Pleroma.Workers.Cron.NewUsersDigestWorker}
  447. ]
  448. config :pleroma, :workers,
  449. retries: [
  450. federator_incoming: 5,
  451. federator_outgoing: 5
  452. ]
  453. config :pleroma, :fetch_initial_posts,
  454. enabled: false,
  455. pages: 5
  456. config :auto_linker,
  457. opts: [
  458. extra: true,
  459. # TODO: Set to :no_scheme when it works properly
  460. validate_tld: true,
  461. class: false,
  462. strip_prefix: false,
  463. new_window: false,
  464. rel: "ugc"
  465. ]
  466. config :pleroma, :ldap,
  467. enabled: System.get_env("LDAP_ENABLED") == "true",
  468. host: System.get_env("LDAP_HOST") || "localhost",
  469. port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
  470. ssl: System.get_env("LDAP_SSL") == "true",
  471. sslopts: [],
  472. tls: System.get_env("LDAP_TLS") == "true",
  473. tlsopts: [],
  474. base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
  475. uid: System.get_env("LDAP_UID") || "cn"
  476. config :esshd,
  477. enabled: false
  478. oauth_consumer_strategies =
  479. System.get_env("OAUTH_CONSUMER_STRATEGIES")
  480. |> to_string()
  481. |> String.split()
  482. |> Enum.map(&hd(String.split(&1, ":")))
  483. ueberauth_providers =
  484. for strategy <- oauth_consumer_strategies do
  485. strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
  486. strategy_module = String.to_atom(strategy_module_name)
  487. {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
  488. end
  489. config :ueberauth,
  490. Ueberauth,
  491. base_path: "/oauth",
  492. providers: ueberauth_providers
  493. config :pleroma,
  494. :auth,
  495. enforce_oauth_admin_scope_usage: true,
  496. oauth_consumer_strategies: oauth_consumer_strategies
  497. config :pleroma, Pleroma.Emails.Mailer, adapter: Swoosh.Adapters.Sendmail, enabled: false
  498. config :pleroma, Pleroma.Emails.UserEmail,
  499. logo: nil,
  500. styling: %{
  501. link_color: "#d8a070",
  502. background_color: "#2C3645",
  503. content_background_color: "#1B2635",
  504. header_color: "#d8a070",
  505. text_color: "#b9b9ba",
  506. text_muted_color: "#b9b9ba"
  507. }
  508. config :pleroma, Pleroma.Emails.NewUsersDigestEmail, enabled: false
  509. config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
  510. config :pleroma, Pleroma.ScheduledActivity,
  511. daily_user_limit: 25,
  512. total_user_limit: 300,
  513. enabled: true
  514. config :pleroma, :email_notifications,
  515. digest: %{
  516. active: false,
  517. interval: 7,
  518. inactivity_threshold: 7
  519. }
  520. config :pleroma, :oauth2,
  521. token_expires_in: 600,
  522. issue_new_refresh_token: true,
  523. clean_expired_tokens: false
  524. config :pleroma, :database, rum_enabled: false
  525. config :pleroma, :env, Mix.env()
  526. config :http_signatures,
  527. adapter: Pleroma.Signature
  528. config :pleroma, :rate_limit,
  529. authentication: {60_000, 15},
  530. search: [{1000, 10}, {1000, 30}],
  531. app_account_creation: {1_800_000, 25},
  532. relations_actions: {10_000, 10},
  533. relation_id_action: {60_000, 2},
  534. statuses_actions: {10_000, 15},
  535. status_id_action: {60_000, 3},
  536. password_reset: {1_800_000, 5},
  537. account_confirmation_resend: {8_640_000, 5},
  538. ap_routes: {60_000, 15}
  539. config :pleroma, Pleroma.ActivityExpiration, enabled: true
  540. config :pleroma, Pleroma.Plugs.RemoteIp, enabled: true
  541. config :pleroma, :static_fe, enabled: false
  542. config :pleroma, :web_cache_ttl,
  543. activity_pub: nil,
  544. activity_pub_question: 30_000
  545. config :pleroma, :modules, runtime_dir: "instance/modules"
  546. config :pleroma, configurable_from_database: false
  547. config :pleroma, Pleroma.Repo, parameters: [gin_fuzzy_search_limit: "500"]
  548. # Import environment specific config. This must remain at the bottom
  549. # of this file so it overrides the configuration defined above.
  550. import_config "#{Mix.env()}.exs"