900140797e4c3920ba6829582c4245778949e71f
[akkoma] / config / config.exs
1 # This file is responsible for configuring your application
2 # and its dependencies with the aid of the Mix.Config module.
3 #
4 # This configuration file is loaded before any dependency and
5 # is restricted to this project.
6 use Mix.Config
7
8 # General application configuration
9 config :pleroma, ecto_repos: [Pleroma.Repo]
10
11 config :pleroma, Pleroma.Repo,
12 types: Pleroma.PostgresTypes,
13 telemetry_event: [Pleroma.Repo.Instrumenter]
14
15 config :pleroma, Pleroma.Captcha,
16 enabled: false,
17 seconds_valid: 60,
18 method: Pleroma.Captcha.Kocaptcha
19
20 config :pleroma, :hackney_pools,
21 federation: [
22 max_connections: 50,
23 timeout: 150_000
24 ],
25 media: [
26 max_connections: 50,
27 timeout: 150_000
28 ],
29 upload: [
30 max_connections: 25,
31 timeout: 300_000
32 ]
33
34 config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
35
36 # Upload configuration
37 config :pleroma, Pleroma.Upload,
38 uploader: Pleroma.Uploaders.Local,
39 filters: [Pleroma.Upload.Filter.Dedupe],
40 link_name: true,
41 proxy_remote: false,
42 proxy_opts: [
43 redirect_on_failure: false,
44 max_body_length: 25 * 1_048_576,
45 http: [
46 follow_redirect: true,
47 pool: :upload
48 ]
49 ]
50
51 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
52
53 config :pleroma, Pleroma.Uploaders.S3,
54 bucket: nil,
55 public_endpoint: "https://s3.amazonaws.com"
56
57 config :pleroma, Pleroma.Uploaders.MDII,
58 cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
59 files: "https://mdii.sakura.ne.jp"
60
61 config :pleroma, :emoji,
62 shortcode_globs: ["/emoji/custom/**/*.png"],
63 groups: [
64 # Put groups that have higher priority than defaults here. Example in `docs/config/custom_emoji.md`
65 Finmoji: "/finmoji/128px/*-128.png",
66 Custom: ["/emoji/*.png", "/emoji/custom/*.png"]
67 ]
68
69 config :pleroma, :uri_schemes,
70 valid_schemes: [
71 "https",
72 "http",
73 "dat",
74 "dweb",
75 "gopher",
76 "ipfs",
77 "ipns",
78 "irc",
79 "ircs",
80 "magnet",
81 "mailto",
82 "mumble",
83 "ssb",
84 "xmpp"
85 ]
86
87 websocket_config = [
88 path: "/websocket",
89 serializer: [
90 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
91 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
92 ],
93 timeout: 60_000,
94 transport_log: false,
95 compress: false
96 ]
97
98 # Configures the endpoint
99 config :pleroma, Pleroma.Web.Endpoint,
100 instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
101 url: [host: "localhost"],
102 http: [
103 dispatch: [
104 {:_,
105 [
106 {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
107 {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
108 {Phoenix.Transports.WebSocket,
109 {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
110 {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
111 ]}
112 ]
113 ],
114 protocol: "https",
115 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
116 signing_salt: "CqaoopA2",
117 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
118 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
119 secure_cookie_flag: true
120
121 # Configures Elixir's Logger
122 config :logger, :console,
123 format: "$time $metadata[$level] $message\n",
124 metadata: [:request_id]
125
126 config :logger, :ex_syslogger,
127 level: :debug,
128 ident: "Pleroma",
129 format: "$metadata[$level] $message",
130 metadata: [:request_id]
131
132 config :quack,
133 level: :warn,
134 meta: [:all],
135 webhook_url: "https://hooks.slack.com/services/YOUR-KEY-HERE"
136
137 config :mime, :types, %{
138 "application/xml" => ["xml"],
139 "application/xrd+xml" => ["xrd+xml"],
140 "application/jrd+json" => ["jrd+json"],
141 "application/activity+json" => ["activity+json"],
142 "application/ld+json" => ["activity+json"]
143 }
144
145 config :pleroma, :websub, Pleroma.Web.Websub
146 config :pleroma, :ostatus, Pleroma.Web.OStatus
147 config :pleroma, :httpoison, Pleroma.HTTP
148 config :tesla, adapter: Tesla.Adapter.Hackney
149
150 # Configures http settings, upstream proxy etc.
151 config :pleroma, :http,
152 proxy_url: nil,
153 adapter: [
154 ssl_options: [
155 # We don't support TLS v1.3 yet
156 versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"]
157 ]
158 ]
159
160 config :pleroma, :instance,
161 name: "Pleroma",
162 email: "example@example.com",
163 description: "A Pleroma instance, an alternative fediverse server",
164 limit: 5_000,
165 remote_limit: 100_000,
166 upload_limit: 16_000_000,
167 avatar_upload_limit: 2_000_000,
168 background_upload_limit: 4_000_000,
169 banner_upload_limit: 4_000_000,
170 registrations_open: true,
171 federating: true,
172 federation_reachability_timeout_days: 7,
173 allow_relay: true,
174 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
175 public: true,
176 quarantined_instances: [],
177 managed_config: true,
178 static_dir: "instance/static/",
179 allowed_post_formats: [
180 "text/plain",
181 "text/html",
182 "text/markdown"
183 ],
184 finmoji_enabled: true,
185 mrf_transparency: true,
186 autofollowed_nicknames: [],
187 max_pinned_statuses: 1,
188 no_attachment_links: false,
189 welcome_user_nickname: nil,
190 welcome_message: nil,
191 max_report_comment_size: 1000,
192 safe_dm_mentions: false
193
194 config :pleroma, :markup,
195 # XXX - unfortunately, inline images must be enabled by default right now, because
196 # of custom emoji. Issue #275 discusses defanging that somehow.
197 allow_inline_images: true,
198 allow_headings: false,
199 allow_tables: false,
200 allow_fonts: false,
201 scrub_policy: [
202 Pleroma.HTML.Transform.MediaProxy,
203 Pleroma.HTML.Scrubber.Default
204 ]
205
206 # Deprecated, will be gone in 1.0
207 config :pleroma, :fe,
208 theme: "pleroma-dark",
209 logo: "/static/logo.png",
210 logo_mask: true,
211 logo_margin: "0.1em",
212 background: "/static/aurora_borealis.jpg",
213 redirect_root_no_login: "/main/all",
214 redirect_root_login: "/main/friends",
215 show_instance_panel: true,
216 scope_options_enabled: false,
217 formatting_options_enabled: false,
218 collapse_message_with_subject: false,
219 hide_post_stats: false,
220 hide_user_stats: false,
221 scope_copy: true,
222 subject_line_behavior: "email",
223 always_show_subject_input: true
224
225 config :pleroma, :frontend_configurations,
226 pleroma_fe: %{
227 theme: "pleroma-dark",
228 logo: "/static/logo.png",
229 background: "/images/city.jpg",
230 redirectRootNoLogin: "/main/all",
231 redirectRootLogin: "/main/friends",
232 showInstanceSpecificPanel: true,
233 scopeOptionsEnabled: false,
234 formattingOptionsEnabled: false,
235 collapseMessageWithSubject: false,
236 hidePostStats: false,
237 hideUserStats: false,
238 scopeCopy: true,
239 subjectLineBehavior: "email",
240 alwaysShowSubjectInput: true
241 },
242 masto_fe: %{
243 showInstanceSpecificPanel: true
244 }
245
246 config :pleroma, :activitypub,
247 accept_blocks: true,
248 unfollow_blocked: true,
249 outgoing_blocks: true,
250 follow_handshake_timeout: 500
251
252 config :pleroma, :user, deny_follow_blocked: true
253
254 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
255
256 config :pleroma, :mrf_rejectnonpublic,
257 allow_followersonly: false,
258 allow_direct: false
259
260 config :pleroma, :mrf_hellthread,
261 delist_threshold: 10,
262 reject_threshold: 20
263
264 config :pleroma, :mrf_simple,
265 media_removal: [],
266 media_nsfw: [],
267 federated_timeline_removal: [],
268 reject: [],
269 accept: []
270
271 config :pleroma, :mrf_keyword,
272 reject: [],
273 federated_timeline_removal: [],
274 replace: []
275
276 config :pleroma, :rich_media, enabled: true
277
278 config :pleroma, :media_proxy,
279 enabled: false,
280 proxy_opts: [
281 redirect_on_failure: false,
282 max_body_length: 25 * 1_048_576,
283 http: [
284 follow_redirect: true,
285 pool: :media
286 ]
287 ]
288
289 config :pleroma, :chat, enabled: true
290
291 config :phoenix, :format_encoders, json: Jason
292
293 config :pleroma, :gopher,
294 enabled: false,
295 ip: {0, 0, 0, 0},
296 port: 9999
297
298 config :pleroma, Pleroma.Web.Metadata, providers: [], unfurl_nsfw: false
299
300 config :pleroma, :suggestions,
301 enabled: false,
302 third_party_engine:
303 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
304 timeout: 300_000,
305 limit: 23,
306 web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
307
308 config :pleroma, :http_security,
309 enabled: true,
310 sts: false,
311 sts_max_age: 31_536_000,
312 ct_max_age: 2_592_000,
313 referrer_policy: "same-origin"
314
315 config :cors_plug,
316 max_age: 86_400,
317 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
318 expose: [
319 "Link",
320 "X-RateLimit-Reset",
321 "X-RateLimit-Limit",
322 "X-RateLimit-Remaining",
323 "X-Request-Id",
324 "Idempotency-Key"
325 ],
326 credentials: true,
327 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
328
329 config :pleroma, Pleroma.User,
330 restricted_nicknames: [
331 ".well-known",
332 "~",
333 "about",
334 "activities",
335 "api",
336 "auth",
337 "dev",
338 "friend-requests",
339 "inbox",
340 "internal",
341 "main",
342 "media",
343 "nodeinfo",
344 "notice",
345 "oauth",
346 "objects",
347 "ostatus_subscribe",
348 "pleroma",
349 "proxy",
350 "push",
351 "registration",
352 "relay",
353 "settings",
354 "status",
355 "tag",
356 "user-search",
357 "users",
358 "web"
359 ]
360
361 config :pleroma, Pleroma.Web.Federator.RetryQueue,
362 enabled: false,
363 max_jobs: 20,
364 initial_timeout: 30,
365 max_retries: 5
366
367 config :pleroma_job_queue, :queues,
368 federator_incoming: 50,
369 federator_outgoing: 50,
370 mailer: 10,
371 scheduled_activities: 10
372
373 config :pleroma, :fetch_initial_posts,
374 enabled: false,
375 pages: 5
376
377 config :auto_linker,
378 opts: [
379 scheme: true,
380 extra: true,
381 class: false,
382 strip_prefix: false,
383 new_window: false,
384 rel: false
385 ]
386
387 config :pleroma, :ldap,
388 enabled: System.get_env("LDAP_ENABLED") == "true",
389 host: System.get_env("LDAP_HOST") || "localhost",
390 port: String.to_integer(System.get_env("LDAP_PORT") || "389"),
391 ssl: System.get_env("LDAP_SSL") == "true",
392 sslopts: [],
393 tls: System.get_env("LDAP_TLS") == "true",
394 tlsopts: [],
395 base: System.get_env("LDAP_BASE") || "dc=example,dc=com",
396 uid: System.get_env("LDAP_UID") || "cn"
397
398 oauth_consumer_strategies = String.split(System.get_env("OAUTH_CONSUMER_STRATEGIES") || "")
399
400 ueberauth_providers =
401 for strategy <- oauth_consumer_strategies do
402 strategy_module_name = "Elixir.Ueberauth.Strategy.#{String.capitalize(strategy)}"
403 strategy_module = String.to_atom(strategy_module_name)
404 {String.to_atom(strategy), {strategy_module, [callback_params: ["state"]]}}
405 end
406
407 config :ueberauth,
408 Ueberauth,
409 base_path: "/oauth",
410 providers: ueberauth_providers
411
412 config :pleroma, :auth, oauth_consumer_strategies: oauth_consumer_strategies
413
414 config :pleroma, Pleroma.Mailer, adapter: Swoosh.Adapters.Sendmail
415
416 config :prometheus, Pleroma.Web.Endpoint.MetricsExporter, path: "/api/pleroma/app_metrics"
417
418 config :pleroma, Pleroma.ScheduledActivity,
419 daily_user_limit: 25,
420 total_user_limit: 300,
421 enabled: true
422
423 # Import environment specific config. This must remain at the bottom
424 # of this file so it overrides the configuration defined above.
425 import_config "#{Mix.env()}.exs"