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.

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