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