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