Add base CAPTCHA support (currently only kocaptcha)
[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 method: Pleroma.Captcha.Kocaptcha
15
16 # Kocaptcha is a very simple captcha service, the source code is here: https://github.com/koto-bank/kocaptcha
17 config :pleroma, Pleroma.Captcha.Kocaptcha,
18 endpoint: "http://localhost:9093"
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 # Configures the endpoint
58 config :pleroma, Pleroma.Web.Endpoint,
59 url: [host: "localhost"],
60 protocol: "https",
61 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
62 signing_salt: "CqaoopA2",
63 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
64 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
65 secure_cookie_flag: true
66
67 # Configures Elixir's Logger
68 config :logger, :console,
69 format: "$time $metadata[$level] $message\n",
70 metadata: [:request_id]
71
72 config :mime, :types, %{
73 "application/xml" => ["xml"],
74 "application/xrd+xml" => ["xrd+xml"],
75 "application/activity+json" => ["activity+json"],
76 "application/ld+json" => ["activity+json"]
77 }
78
79 config :pleroma, :websub, Pleroma.Web.Websub
80 config :pleroma, :ostatus, Pleroma.Web.OStatus
81 config :pleroma, :httpoison, Pleroma.HTTP
82 config :tesla, adapter: Tesla.Adapter.Hackney
83
84 # Configures http settings, upstream proxy etc.
85 config :pleroma, :http, proxy_url: nil
86
87 config :pleroma, :instance,
88 name: "Pleroma",
89 email: "example@example.com",
90 description: "A Pleroma instance, an alternative fediverse server",
91 limit: 5000,
92 upload_limit: 16_000_000,
93 avatar_upload_limit: 2_000_000,
94 background_upload_limit: 4_000_000,
95 banner_upload_limit: 4_000_000,
96 registrations_open: true,
97 federating: true,
98 allow_relay: true,
99 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
100 public: true,
101 quarantined_instances: [],
102 managed_config: true,
103 allowed_post_formats: [
104 "text/plain",
105 "text/html",
106 "text/markdown"
107 ],
108 finmoji_enabled: true,
109 mrf_transparency: true
110
111 config :pleroma, :markup,
112 # XXX - unfortunately, inline images must be enabled by default right now, because
113 # of custom emoji. Issue #275 discusses defanging that somehow.
114 allow_inline_images: true,
115 allow_headings: false,
116 allow_tables: false,
117 allow_fonts: false,
118 scrub_policy: [
119 Pleroma.HTML.Transform.MediaProxy,
120 Pleroma.HTML.Scrubber.Default
121 ]
122
123 config :pleroma, :fe,
124 theme: "pleroma-dark",
125 logo: "/static/logo.png",
126 logo_mask: true,
127 logo_margin: "0.1em",
128 background: "/static/aurora_borealis.jpg",
129 redirect_root_no_login: "/main/all",
130 redirect_root_login: "/main/friends",
131 show_instance_panel: true,
132 scope_options_enabled: false,
133 formatting_options_enabled: false,
134 collapse_message_with_subject: false,
135 hide_post_stats: false,
136 hide_user_stats: false,
137 scope_copy: true,
138 subject_line_behavior: "email",
139 always_show_subject_input: true
140
141 config :pleroma, :activitypub,
142 accept_blocks: true,
143 unfollow_blocked: true,
144 outgoing_blocks: true,
145 follow_handshake_timeout: 500
146
147 config :pleroma, :user, deny_follow_blocked: true
148
149 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
150
151 config :pleroma, :mrf_rejectnonpublic,
152 allow_followersonly: false,
153 allow_direct: false
154
155 config :pleroma, :mrf_simple,
156 media_removal: [],
157 media_nsfw: [],
158 federated_timeline_removal: [],
159 reject: [],
160 accept: []
161
162 config :pleroma, :media_proxy,
163 enabled: false,
164 # base_url: "https://cache.pleroma.social",
165 proxy_opts: [
166 # inline_content_types: [] | false | true,
167 # http: [:insecure]
168 ]
169
170 config :pleroma, :chat, enabled: true
171
172 config :ecto, json_library: Jason
173
174 config :phoenix, :format_encoders, json: Jason
175
176 config :pleroma, :gopher,
177 enabled: false,
178 ip: {0, 0, 0, 0},
179 port: 9999
180
181 config :pleroma, :suggestions,
182 enabled: false,
183 third_party_engine:
184 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
185 timeout: 300_000,
186 limit: 23,
187 web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
188
189 config :pleroma, :http_security,
190 enabled: true,
191 sts: false,
192 sts_max_age: 31_536_000,
193 ct_max_age: 2_592_000,
194 referrer_policy: "same-origin"
195
196 config :cors_plug,
197 max_age: 86_400,
198 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
199 expose: [
200 "Link",
201 "X-RateLimit-Reset",
202 "X-RateLimit-Limit",
203 "X-RateLimit-Remaining",
204 "X-Request-Id",
205 "Idempotency-Key"
206 ],
207 credentials: true,
208 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
209
210 # Import environment specific config. This must remain at the bottom
211 # of this file so it overrides the configuration defined above.
212 import_config "#{Mix.env()}.exs"