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.

572 lines
15KB

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