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