[#534] Merged `upstream/develop`.
[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, types: Pleroma.PostgresTypes
12
13 config :pleroma, Pleroma.Captcha,
14 enabled: false,
15 seconds_valid: 60,
16 method: Pleroma.Captcha.Kocaptcha
17
18 config :pleroma, Pleroma.Captcha.Kocaptcha, endpoint: "https://captcha.kotobank.ch"
19
20 # Upload configuration
21 config :pleroma, Pleroma.Upload,
22 uploader: Pleroma.Uploaders.Local,
23 filters: [],
24 proxy_remote: false,
25 proxy_opts: []
26
27 config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"
28
29 config :pleroma, Pleroma.Uploaders.S3,
30 bucket: nil,
31 public_endpoint: "https://s3.amazonaws.com"
32
33 config :pleroma, Pleroma.Uploaders.MDII,
34 cgi: "https://mdii.sakura.ne.jp/mdii-post.cgi",
35 files: "https://mdii.sakura.ne.jp"
36
37 config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
38
39 config :pleroma, :uri_schemes,
40 valid_schemes: [
41 "https",
42 "http",
43 "dat",
44 "dweb",
45 "gopher",
46 "ipfs",
47 "ipns",
48 "irc",
49 "ircs",
50 "magnet",
51 "mailto",
52 "mumble",
53 "ssb",
54 "xmpp"
55 ]
56
57 websocket_config = [
58 path: "/websocket",
59 serializer: [
60 {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
61 {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
62 ],
63 timeout: 60_000,
64 transport_log: false,
65 compress: false
66 ]
67
68 # Configures the endpoint
69 config :pleroma, Pleroma.Web.Endpoint,
70 url: [host: "localhost"],
71 http: [
72 dispatch: [
73 {:_,
74 [
75 {"/api/v1/streaming", Elixir.Pleroma.Web.MastodonAPI.WebsocketHandler, []},
76 {"/socket/websocket", Phoenix.Endpoint.CowboyWebSocket,
77 {nil, {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
78 {:_, Plug.Adapters.Cowboy.Handler, {Pleroma.Web.Endpoint, []}}
79 ]}
80 ]
81 ],
82 protocol: "https",
83 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
84 signing_salt: "CqaoopA2",
85 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
86 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
87 secure_cookie_flag: true
88
89 # Configures Elixir's Logger
90 config :logger, :console,
91 format: "$time $metadata[$level] $message\n",
92 metadata: [:request_id]
93
94 config :logger, :ex_syslogger,
95 level: :debug,
96 ident: "Pleroma",
97 format: "$date $time $metadata[$level] $message",
98 metadata: [:request_id]
99
100 config :mime, :types, %{
101 "application/xml" => ["xml"],
102 "application/xrd+xml" => ["xrd+xml"],
103 "application/jrd+json" => ["jrd+json"],
104 "application/activity+json" => ["activity+json"],
105 "application/ld+json" => ["activity+json"]
106 }
107
108 config :pleroma, :websub, Pleroma.Web.Websub
109 config :pleroma, :ostatus, Pleroma.Web.OStatus
110 config :pleroma, :httpoison, Pleroma.HTTP
111 config :tesla, adapter: Tesla.Adapter.Hackney
112
113 # Configures http settings, upstream proxy etc.
114 config :pleroma, :http, proxy_url: nil
115
116 config :pleroma, :instance,
117 name: "Pleroma",
118 email: "example@example.com",
119 description: "A Pleroma instance, an alternative fediverse server",
120 limit: 5_000,
121 remote_limit: 100_000,
122 upload_limit: 16_000_000,
123 avatar_upload_limit: 2_000_000,
124 background_upload_limit: 4_000_000,
125 banner_upload_limit: 4_000_000,
126 registrations_open: true,
127 federating: true,
128 federation_reachability_timeout_days: 7,
129 allow_relay: true,
130 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
131 public: true,
132 quarantined_instances: [],
133 managed_config: true,
134 static_dir: "instance/static/",
135 allowed_post_formats: [
136 "text/plain",
137 "text/html",
138 "text/markdown"
139 ],
140 finmoji_enabled: true,
141 mrf_transparency: true,
142 autofollowed_nicknames: [],
143 max_pinned_statuses: 1,
144 no_attachment_links: false
145
146 config :pleroma, :markup,
147 # XXX - unfortunately, inline images must be enabled by default right now, because
148 # of custom emoji. Issue #275 discusses defanging that somehow.
149 allow_inline_images: true,
150 allow_headings: false,
151 allow_tables: false,
152 allow_fonts: false,
153 scrub_policy: [
154 Pleroma.HTML.Transform.MediaProxy,
155 Pleroma.HTML.Scrubber.Default
156 ]
157
158 config :pleroma, :fe,
159 theme: "pleroma-dark",
160 logo: "/static/logo.png",
161 logo_mask: true,
162 logo_margin: "0.1em",
163 background: "/static/aurora_borealis.jpg",
164 redirect_root_no_login: "/main/all",
165 redirect_root_login: "/main/friends",
166 show_instance_panel: true,
167 scope_options_enabled: false,
168 formatting_options_enabled: false,
169 collapse_message_with_subject: false,
170 hide_post_stats: false,
171 hide_user_stats: false,
172 scope_copy: true,
173 subject_line_behavior: "email",
174 always_show_subject_input: true
175
176 config :pleroma, :activitypub,
177 accept_blocks: true,
178 unfollow_blocked: true,
179 outgoing_blocks: true,
180 follow_handshake_timeout: 500
181
182 config :pleroma, :user, deny_follow_blocked: true
183
184 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
185
186 config :pleroma, :mrf_rejectnonpublic,
187 allow_followersonly: false,
188 allow_direct: false
189
190 config :pleroma, :mrf_hellthread, threshold: 10
191
192 config :pleroma, :mrf_simple,
193 media_removal: [],
194 media_nsfw: [],
195 federated_timeline_removal: [],
196 reject: [],
197 accept: []
198
199 config :pleroma, :media_proxy, enabled: false
200
201 config :pleroma, :chat, enabled: true
202
203 config :ecto, json_library: Jason
204
205 config :phoenix, :format_encoders, json: Jason
206
207 config :pleroma, :gopher,
208 enabled: false,
209 ip: {0, 0, 0, 0},
210 port: 9999
211
212 config :pleroma, Pleroma.Web.Metadata, providers: [], unfurl_nsfw: false
213
214 config :pleroma, :suggestions,
215 enabled: false,
216 third_party_engine:
217 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
218 timeout: 300_000,
219 limit: 23,
220 web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
221
222 config :pleroma, :http_security,
223 enabled: true,
224 sts: false,
225 sts_max_age: 31_536_000,
226 ct_max_age: 2_592_000,
227 referrer_policy: "same-origin"
228
229 config :cors_plug,
230 max_age: 86_400,
231 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
232 expose: [
233 "Link",
234 "X-RateLimit-Reset",
235 "X-RateLimit-Limit",
236 "X-RateLimit-Remaining",
237 "X-Request-Id",
238 "Idempotency-Key"
239 ],
240 credentials: true,
241 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
242
243 config :pleroma, Pleroma.User,
244 restricted_nicknames: [
245 ".well-known",
246 "~",
247 "about",
248 "activities",
249 "api",
250 "auth",
251 "dev",
252 "friend-requests",
253 "inbox",
254 "internal",
255 "main",
256 "media",
257 "nodeinfo",
258 "notice",
259 "oauth",
260 "objects",
261 "ostatus_subscribe",
262 "pleroma",
263 "proxy",
264 "push",
265 "registration",
266 "relay",
267 "settings",
268 "status",
269 "tag",
270 "user-search",
271 "users",
272 "web"
273 ]
274
275 config :pleroma, Pleroma.Web.Federator, max_jobs: 50
276
277 config :pleroma, Pleroma.Web.Federator.RetryQueue,
278 enabled: false,
279 max_jobs: 20,
280 initial_timeout: 30,
281 max_retries: 5
282
283 # Import environment specific config. This must remain at the bottom
284 # of this file so it overrides the configuration defined above.
285 import_config "#{Mix.env()}.exs"