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