config.exs 8.73 KB
Newer Older
lain's avatar
lain committed
1
2
3
4
5
6
7
8
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
use Mix.Config

# General application configuration
lain's avatar
lain committed
9
config :pleroma, ecto_repos: [Pleroma.Repo]
lain's avatar
lain committed
10

lain's avatar
lain committed
11
config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes
lain's avatar
lain committed
12

13
config :pleroma, Pleroma.Captcha,
vaartis's avatar
vaartis committed
14
  enabled: false,
15
  seconds_valid: 60,
16
17
  method: Pleroma.Captcha.Kocaptcha

href's avatar
href committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
config :pleroma, :hackney_pools,
  federation: [
    max_connections: 50,
    timeout: 150_000
  ],
  media: [
    max_connections: 50,
    timeout: 150_000
  ],
  upload: [
    max_connections: 25,
    timeout: 300_000
  ]

32
config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
33

href's avatar
href committed
34
# Upload configuration
gled's avatar
gled committed
35
config :pleroma, Pleroma.Upload,
Thurloat's avatar
Thurloat committed
36
  uploader: Pleroma.Uploaders.Local,
href's avatar
href committed
37
  filters: [],
href's avatar
href committed
38
  proxy_remote: false,
href's avatar
href committed
39
40
41
42
43
44
45
46
  proxy_opts: [
    redirect_on_failure: false,
    max_body_length: 25 * 1_048_576,
    http: [
      follow_redirect: true,
      pool: :upload
    ]
  ]
href's avatar
href committed
47

href's avatar
href committed
48
config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
49

50
51
config :pleroma, Pleroma.Uploaders.S3,
  bucket: nil,
href's avatar
href committed
52
  public_endpoint: "https://s3.amazonaws.com"
lain's avatar
lain committed
53

hakabahitoyo's avatar
hakabahitoyo committed
54
config :pleroma, Pleroma.Uploaders.MDII,
hakabahitoyo's avatar
hakabahitoyo committed
55
56
  cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
  files: "https://mdii.sakura.ne.jp"
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
57

Jorty's avatar
Jorty committed
58
config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
Jorty's avatar
Jorty committed
59

60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
config :pleroma, :uri_schemes,
  valid_schemes: [
    "https",
    "http",
    "dat",
    "dweb",
    "gopher",
    "ipfs",
    "ipns",
    "irc",
    "ircs",
    "magnet",
    "mailto",
    "mumble",
    "ssb",
    "xmpp"
  ]
77

lain's avatar
lain committed
78
79
80
81
82
83
84
85
86
87
88
websocket_config = [
  path: "/websocket",
  serializer: [
    {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
    {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  ],
  timeout: 60_000,
  transport_log: false,
  compress: false
]

lain's avatar
lain committed
89
90
91
# Configures the endpoint
config :pleroma, Pleroma.Web.Endpoint,
  url: [host: "localhost"],
href's avatar
href committed
92
93
94
95
  http: [
    dispatch: [
      {:_,
       [
96
         {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
kaniini's avatar
kaniini committed
97
98
99
         {"/websocket", Phoenix.Endpoint.CowboyWebSocket,
          {Phoenix.Transports.WebSocket,
           {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
100
         {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
href's avatar
href committed
101
102
103
       ]}
    ]
  ],
lain's avatar
lain committed
104
  protocol: "https",
lain's avatar
lain committed
105
  secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
href's avatar
href committed
106
  signing_salt: "CqaoopA2",
lain's avatar
lain committed
107
  render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
108
109
  pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
  secure_cookie_flag: true
lain's avatar
lain committed
110
111
112
113
114
115

# Configures Elixir's Logger
config :logger, :console,
  format: "$time $metadata[$level] $message\n",
  metadata: [:request_id]

116
117
118
config :logger, :ex_syslogger,
  level: :debug,
  ident: "Pleroma",
119
  format: "$metadata[$level] $message",
120
121
  metadata: [:request_id]

lain's avatar
lain committed
122
config :mime, :types, %{
123
  "application/xml" => ["xml"],
lain's avatar
lain committed
124
  "application/xrd+xml" => ["xrd+xml"],
125
  "application/jrd+json" => ["jrd+json"],
lain's avatar
lain committed
126
127
  "application/activity+json" => ["activity+json"],
  "application/ld+json" => ["activity+json"]
lain's avatar
lain committed
128
129
}

lain's avatar
lain committed
130
131
config :pleroma, :websub, Pleroma.Web.Websub
config :pleroma, :ostatus, Pleroma.Web.OStatus
132
config :pleroma, :httpoison, Pleroma.HTTP
133
config :tesla, adapter: Tesla.Adapter.Hackney
134

jeff's avatar
docs    
jeff committed
135
# Configures http settings, upstream proxy etc.
lain's avatar
lain committed
136
config :pleroma, :http, proxy_url: nil
137

lain's avatar
lain committed
138
139
config :pleroma, :instance,
  name: "Pleroma",
140
  email: "example@example.com",
141
  description: "A Pleroma instance, an alternative fediverse server",
142
  limit: 5_000,
lain's avatar
lain committed
143
  remote_limit: 100_000,
144
  upload_limit: 16_000_000,
145
146
147
  avatar_upload_limit: 2_000_000,
  background_upload_limit: 4_000_000,
  banner_upload_limit: 4_000_000,
lain's avatar
lain committed
148
  registrations_open: true,
149
  federating: true,
150
  federation_reachability_timeout_days: 7,
151
  allow_relay: true,
lain's avatar
lain committed
152
  rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
153
  public: true,
154
  quarantined_instances: [],
155
  managed_config: true,
href's avatar
href committed
156
  static_dir: "instance/static/",
157
158
159
160
  allowed_post_formats: [
    "text/plain",
    "text/html",
    "text/markdown"
161
  ],
scarlett's avatar
scarlett committed
162
  finmoji_enabled: true,
163
  mrf_transparency: true,
164
  autofollowed_nicknames: [],
feld's avatar
feld committed
165
  max_pinned_statuses: 1,
lain's avatar
lain committed
166
167
  no_attachment_links: false,
  welcome_user_nickname: nil,
minibikini's avatar
Reports    
minibikini committed
168
169
  welcome_message: nil,
  max_report_comment_size: 1000
lain's avatar
lain committed
170

171
config :pleroma, :markup,
172
173
174
  # XXX - unfortunately, inline images must be enabled by default right now, because
  # of custom emoji.  Issue #275 discusses defanging that somehow.
  allow_inline_images: true,
175
176
177
  allow_headings: false,
  allow_tables: false,
  allow_fonts: false,
178
179
180
181
  scrub_policy: [
    Pleroma.HTML.Transform.MediaProxy,
    Pleroma.HTML.Scrubber.Default
  ]
182

lain's avatar
lain committed
183
# Deprecated, will be gone in 1.0
184
185
186
config :pleroma, :fe,
  theme: "pleroma-dark",
  logo: "/static/logo.png",
187
188
  logo_mask: true,
  logo_margin: "0.1em",
189
  background: "/static/aurora_borealis.jpg",
lain's avatar
lain committed
190
191
  redirect_root_no_login: "/main/all",
  redirect_root_login: "/main/friends",
192
  show_instance_panel: true,
193
  scope_options_enabled: false,
194
  formatting_options_enabled: false,
195
196
  collapse_message_with_subject: false,
  hide_post_stats: false,
197
198
199
200
  hide_user_stats: false,
  scope_copy: true,
  subject_line_behavior: "email",
  always_show_subject_input: true
201

lain's avatar
lain committed
202
203
204
205
config :pleroma, :frontend_configurations,
  pleroma_fe: %{
    theme: "pleroma-dark",
    logo: "/static/logo.png",
lain's avatar
lain committed
206
    background: "/images/city.jpg",
lain's avatar
lain committed
207
208
209
210
211
212
213
214
215
216
217
    redirectRootNoLogin: "/main/all",
    redirectRootLogin: "/main/friends",
    showInstanceSpecificPanel: true,
    scopeOptionsEnabled: false,
    formattingOptionsEnabled: false,
    collapseMessageWithSubject: false,
    hidePostStats: false,
    hideUserStats: false,
    scopeCopy: true,
    subjectLineBehavior: "email",
    alwaysShowSubjectInput: true
Haelwenn's avatar
Haelwenn committed
218
219
220
  },
  masto_fe: %{
    showInstanceSpecificPanel: true
lain's avatar
lain committed
221
222
  }

223
224
225
config :pleroma, :activitypub,
  accept_blocks: true,
  unfollow_blocked: true,
226
227
  outgoing_blocks: true,
  follow_handshake_timeout: 500
228

squidboi's avatar
squidboi committed
229
config :pleroma, :user, deny_follow_blocked: true
230

231
232
config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default

233
234
235
236
config :pleroma, :mrf_rejectnonpublic,
  allow_followersonly: false,
  allow_direct: false

Karen Konou's avatar
Karen Konou committed
237
config :pleroma, :mrf_hellthread,
238
239
  delist_threshold: 10,
  reject_threshold: 20
Karen Konou's avatar
Karen Konou committed
240

241
242
243
244
config :pleroma, :mrf_simple,
  media_removal: [],
  media_nsfw: [],
  federated_timeline_removal: [],
kaniini's avatar
kaniini committed
245
246
  reject: [],
  accept: []
rinpatch's avatar
rinpatch committed
247

248
249
config :pleroma, :mrf_keyword,
  reject: [],
250
  federated_timeline_removal: [],
251
252
  replace: []

rinpatch's avatar
rinpatch committed
253
config :pleroma, :rich_media, enabled: true
254

href's avatar
href committed
255
256
257
258
259
260
261
262
263
264
config :pleroma, :media_proxy,
  enabled: false,
  proxy_opts: [
    redirect_on_failure: false,
    max_body_length: 25 * 1_048_576,
    http: [
      follow_redirect: true,
      pool: :media
    ]
  ]
lain's avatar
lain committed
265
266

config :pleroma, :chat, enabled: true
267

lain's avatar
lain committed
268
269
config :ecto, json_library: Jason

lain's avatar
lain committed
270
config :phoenix, :format_encoders, json: Jason
lain's avatar
lain committed
271

lain's avatar
lain committed
272
273
274
275
276
config :pleroma, :gopher,
  enabled: false,
  ip: {0, 0, 0, 0},
  port: 9999

rinpatch's avatar
rinpatch committed
277
config :pleroma, Pleroma.Web.Metadata, providers: [], unfurl_nsfw: false
278

Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
279
280
281
config :pleroma, :suggestions,
  enabled: false,
  third_party_engine:
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
282
    "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
283
  timeout: 300_000,
284
  limit: 23,
Hakaba Hitoyo's avatar
Hakaba Hitoyo committed
285
  web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
hakabahitoyo's avatar
hakabahitoyo committed
286

kaniini's avatar
kaniini committed
287
config :pleroma, :http_security,
288
289
  enabled: true,
  sts: false,
290
  sts_max_age: 31_536_000,
291
292
  ct_max_age: 2_592_000,
  referrer_policy: "same-origin"
293

kaniini's avatar
kaniini committed
294
295
296
297
298
299
300
301
302
303
304
305
306
307
config :cors_plug,
  max_age: 86_400,
  methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
  expose: [
    "Link",
    "X-RateLimit-Reset",
    "X-RateLimit-Limit",
    "X-RateLimit-Remaining",
    "X-Request-Id",
    "Idempotency-Key"
  ],
  credentials: true,
  headers: ["Authorization", "Content-Type", "Idempotency-Key"]

lain's avatar
lain committed
308
309
config :pleroma, Pleroma.User,
  restricted_nicknames: [
feld's avatar
feld committed
310
    ".well-known",
lain's avatar
lain committed
311
    "~",
feld's avatar
feld committed
312
    "about",
lain's avatar
lain committed
313
314
    "activities",
    "api",
feld's avatar
feld committed
315
316
317
318
319
320
321
322
    "auth",
    "dev",
    "friend-requests",
    "inbox",
    "internal",
    "main",
    "media",
    "nodeinfo",
lain's avatar
lain committed
323
324
    "notice",
    "oauth",
feld's avatar
feld committed
325
326
327
328
    "objects",
    "ostatus_subscribe",
    "pleroma",
    "proxy",
lain's avatar
lain committed
329
    "push",
feld's avatar
feld committed
330
    "registration",
lain's avatar
lain committed
331
    "relay",
feld's avatar
feld committed
332
333
334
335
336
337
    "settings",
    "status",
    "tag",
    "user-search",
    "users",
    "web"
lain's avatar
lain committed
338
339
  ]

lain's avatar
lain committed
340
341
342
343
344
345
config :pleroma, Pleroma.Web.Federator.RetryQueue,
  enabled: false,
  max_jobs: 20,
  initial_timeout: 30,
  max_retries: 5

minibikini's avatar
minibikini committed
346
347
config :pleroma, Pleroma.Jobs,
  federator_incoming: [max_jobs: 50],
minibikini's avatar
Reports    
minibikini committed
348
349
  federator_outgoing: [max_jobs: 50],
  mailer: [max_jobs: 10]
minibikini's avatar
minibikini committed
350

351
352
353
354
config :pleroma, :fetch_initial_posts,
  enabled: false,
  pages: 5

minibikini's avatar
minibikini committed
355
356
357
358
359
360
361
362
363
364
config :auto_linker,
  opts: [
    scheme: true,
    extra: true,
    class: false,
    strip_prefix: false,
    new_window: false,
    rel: false
  ]

lain's avatar
lain committed
365
366
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
lain's avatar
lain committed
367
import_config "#{Mix.env()}.exs"