format
[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.Upload,
14 uploader: Pleroma.Uploaders.Local,
15 strip_exif: false
16
17 config :pleroma, Pleroma.Uploaders.Local,
18 uploads: "uploads",
19 uploads_url: "{{base_url}}/media/{{file}}"
20
21 config :pleroma, Pleroma.Uploaders.S3,
22 bucket: nil,
23 public_endpoint: "https://s3.amazonaws.com",
24 force_media_proxy: false
25
26 config :pleroma, Pleroma.Uploaders.Mdii, host_name: "mdii.sakura.ne.jp"
27
28 config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]
29
30 config :pleroma, :uri_schemes,
31 valid_schemes: [
32 "https",
33 "http",
34 "dat",
35 "dweb",
36 "gopher",
37 "ipfs",
38 "ipns",
39 "irc",
40 "ircs",
41 "magnet",
42 "mailto",
43 "mumble",
44 "ssb",
45 "xmpp"
46 ]
47
48 # Configures the endpoint
49 config :pleroma, Pleroma.Web.Endpoint,
50 url: [host: "localhost"],
51 protocol: "https",
52 secret_key_base: "aK4Abxf29xU9TTDKre9coZPUgevcVCFQJe/5xP/7Lt4BEif6idBIbjupVbOrbKxl",
53 render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
54 pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
55 secure_cookie_flag: true
56
57 # Configures Elixir's Logger
58 config :logger, :console,
59 format: "$time $metadata[$level] $message\n",
60 metadata: [:request_id]
61
62 config :mime, :types, %{
63 "application/xml" => ["xml"],
64 "application/xrd+xml" => ["xrd+xml"],
65 "application/activity+json" => ["activity+json"],
66 "application/ld+json" => ["activity+json"]
67 }
68
69 config :pleroma, :websub, Pleroma.Web.Websub
70 config :pleroma, :ostatus, Pleroma.Web.OStatus
71 config :pleroma, :httpoison, Pleroma.HTTP
72
73 version =
74 with {version, 0} <- System.cmd("git", ["rev-parse", "HEAD"]) do
75 "Pleroma #{Mix.Project.config()[:version]} #{String.trim(version)}"
76 else
77 _ -> "Pleroma #{Mix.Project.config()[:version]} dev"
78 end
79
80 # Configures http settings, upstream proxy etc.
81 config :pleroma, :http, proxy_url: nil
82
83 config :pleroma, :instance,
84 version: version,
85 name: "Pleroma",
86 email: "example@example.com",
87 description: "A Pleroma instance, an alternative fediverse server",
88 limit: 5000,
89 upload_limit: 16_000_000,
90 avatar_upload_limit: 2_000_000,
91 background_upload_limit: 4_000_000,
92 banner_upload_limit: 4_000_000,
93 registrations_open: true,
94 federating: true,
95 allow_relay: true,
96 rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
97 public: true,
98 quarantined_instances: [],
99 managed_config: true,
100 allowed_post_formats: [
101 "text/plain",
102 "text/html",
103 "text/markdown"
104 ],
105 finmoji_enabled: true,
106 mrf_transparency: true
107
108 config :pleroma, :markup,
109 # XXX - unfortunately, inline images must be enabled by default right now, because
110 # of custom emoji. Issue #275 discusses defanging that somehow.
111 allow_inline_images: true,
112 allow_headings: false,
113 allow_tables: false,
114 allow_fonts: false,
115 scrub_policy: [
116 Pleroma.HTML.Transform.MediaProxy,
117 Pleroma.HTML.Scrubber.Default
118 ]
119
120 config :pleroma, :fe,
121 theme: "pleroma-dark",
122 logo: "/static/logo.png",
123 logo_mask: true,
124 logo_margin: "0.1em",
125 background: "/static/aurora_borealis.jpg",
126 redirect_root_no_login: "/main/all",
127 redirect_root_login: "/main/friends",
128 show_instance_panel: true,
129 scope_options_enabled: false,
130 formatting_options_enabled: false,
131 collapse_message_with_subject: false,
132 hide_post_stats: false,
133 hide_user_stats: false
134
135 config :pleroma, :activitypub,
136 accept_blocks: true,
137 unfollow_blocked: true,
138 outgoing_blocks: true,
139 follow_handshake_timeout: 500
140
141 config :pleroma, :user, deny_follow_blocked: true
142
143 config :pleroma, :mrf_normalize_markup, scrub_policy: Pleroma.HTML.Scrubber.Default
144
145 config :pleroma, :mrf_rejectnonpublic,
146 allow_followersonly: false,
147 allow_direct: false
148
149 config :pleroma, :mrf_simple,
150 media_removal: [],
151 media_nsfw: [],
152 federated_timeline_removal: [],
153 reject: [],
154 accept: []
155
156 config :pleroma, :media_proxy,
157 enabled: false,
158 redirect_on_failure: true
159
160 # base_url: "https://cache.pleroma.social"
161
162 config :pleroma, :chat, enabled: true
163
164 config :ecto, json_library: Jason
165
166 config :phoenix, :format_encoders, json: Jason
167
168 config :pleroma, :gopher,
169 enabled: false,
170 ip: {0, 0, 0, 0},
171 port: 9999
172
173 config :pleroma, :suggestions,
174 enabled: false,
175 third_party_engine:
176 "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
177 timeout: 300_000,
178 limit: 23,
179 web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
180
181 config :pleroma, :http_security,
182 enabled: true,
183 sts: false,
184 sts_max_age: 31_536_000,
185 ct_max_age: 2_592_000,
186 referrer_policy: "same-origin"
187
188 config :cors_plug,
189 max_age: 86_400,
190 methods: ["POST", "PUT", "DELETE", "GET", "PATCH", "OPTIONS"],
191 expose: [
192 "Link",
193 "X-RateLimit-Reset",
194 "X-RateLimit-Limit",
195 "X-RateLimit-Remaining",
196 "X-Request-Id",
197 "Idempotency-Key"
198 ],
199 credentials: true,
200 headers: ["Authorization", "Content-Type", "Idempotency-Key"]
201
202 # Import environment specific config. This must remain at the bottom
203 # of this file so it overrides the configuration defined above.
204 import_config "#{Mix.env()}.exs"