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