0b41eb2e0b68bc68f62e8fd69c75c6bf8186efdc
[akkoma] / lib / pleroma / web / router.ex
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.Router do
6 use Pleroma.Web, :router
7
8 pipeline :browser do
9 plug(:accepts, ["html"])
10 plug(:fetch_session)
11 end
12
13 pipeline :oauth do
14 plug(:fetch_session)
15 plug(Pleroma.Plugs.OAuthPlug)
16 end
17
18 pipeline :api do
19 plug(:accepts, ["json"])
20 plug(:fetch_session)
21 plug(Pleroma.Plugs.OAuthPlug)
22 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
23 plug(Pleroma.Plugs.UserFetcherPlug)
24 plug(Pleroma.Plugs.SessionAuthenticationPlug)
25 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
26 plug(Pleroma.Plugs.AuthenticationPlug)
27 plug(Pleroma.Plugs.UserEnabledPlug)
28 plug(Pleroma.Plugs.SetUserSessionIdPlug)
29 plug(Pleroma.Plugs.EnsureUserKeyPlug)
30 plug(Pleroma.Plugs.IdempotencyPlug)
31 end
32
33 pipeline :authenticated_api do
34 plug(:accepts, ["json"])
35 plug(:fetch_session)
36 plug(Pleroma.Plugs.OAuthPlug)
37 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
38 plug(Pleroma.Plugs.UserFetcherPlug)
39 plug(Pleroma.Plugs.SessionAuthenticationPlug)
40 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
41 plug(Pleroma.Plugs.AuthenticationPlug)
42 plug(Pleroma.Plugs.UserEnabledPlug)
43 plug(Pleroma.Plugs.SetUserSessionIdPlug)
44 plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
45 plug(Pleroma.Plugs.IdempotencyPlug)
46 end
47
48 pipeline :admin_api do
49 plug(:accepts, ["json"])
50 plug(:fetch_session)
51 plug(Pleroma.Plugs.OAuthPlug)
52 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
53 plug(Pleroma.Plugs.UserFetcherPlug)
54 plug(Pleroma.Plugs.SessionAuthenticationPlug)
55 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
56 plug(Pleroma.Plugs.AuthenticationPlug)
57 plug(Pleroma.Plugs.AdminSecretAuthenticationPlug)
58 plug(Pleroma.Plugs.UserEnabledPlug)
59 plug(Pleroma.Plugs.SetUserSessionIdPlug)
60 plug(Pleroma.Plugs.EnsureAuthenticatedPlug)
61 plug(Pleroma.Plugs.UserIsAdminPlug)
62 plug(Pleroma.Plugs.IdempotencyPlug)
63 end
64
65 pipeline :mastodon_html do
66 plug(:accepts, ["html"])
67 plug(:fetch_session)
68 plug(Pleroma.Plugs.OAuthPlug)
69 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
70 plug(Pleroma.Plugs.UserFetcherPlug)
71 plug(Pleroma.Plugs.SessionAuthenticationPlug)
72 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
73 plug(Pleroma.Plugs.AuthenticationPlug)
74 plug(Pleroma.Plugs.UserEnabledPlug)
75 plug(Pleroma.Plugs.SetUserSessionIdPlug)
76 plug(Pleroma.Plugs.EnsureUserKeyPlug)
77 end
78
79 pipeline :pleroma_html do
80 plug(:accepts, ["html"])
81 plug(:fetch_session)
82 plug(Pleroma.Plugs.OAuthPlug)
83 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
84 plug(Pleroma.Plugs.UserFetcherPlug)
85 plug(Pleroma.Plugs.SessionAuthenticationPlug)
86 plug(Pleroma.Plugs.AuthenticationPlug)
87 plug(Pleroma.Plugs.EnsureUserKeyPlug)
88 end
89
90 pipeline :well_known do
91 plug(:accepts, ["json", "jrd+json", "xml", "xrd+xml"])
92 end
93
94 pipeline :config do
95 plug(:accepts, ["json", "xml"])
96 end
97
98 pipeline :pleroma_api do
99 plug(:accepts, ["html", "json"])
100 end
101
102 pipeline :mailbox_preview do
103 plug(:accepts, ["html"])
104
105 plug(:put_secure_browser_headers, %{
106 "content-security-policy" =>
107 "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline' 'unsafe-eval'"
108 })
109 end
110
111 pipeline :http_signature do
112 plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
113 end
114
115 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
116 pipe_through(:pleroma_api)
117
118 get("/password_reset/:token", PasswordController, :reset, as: :reset_password)
119 post("/password_reset", PasswordController, :do_reset, as: :reset_password)
120 get("/emoji", UtilController, :emoji)
121 get("/captcha", UtilController, :captcha)
122 get("/healthcheck", UtilController, :healthcheck)
123 end
124
125 scope "/api/pleroma", Pleroma.Web do
126 pipe_through(:pleroma_api)
127 post("/uploader_callback/:upload_path", UploaderController, :callback)
128 end
129
130 scope "/api/pleroma/admin", Pleroma.Web.AdminAPI do
131 pipe_through(:admin_api)
132
133 get("/reports", AdminAPIController, :list_reports)
134 get("/reports/:id", AdminAPIController, :report_show)
135 put("/reports/:id", AdminAPIController, :report_update_state)
136 post("/reports/:id/respond", AdminAPIController, :report_respond)
137
138 post("/users/follow", AdminAPIController, :user_follow)
139 post("/users/unfollow", AdminAPIController, :user_unfollow)
140
141 delete("/users", AdminAPIController, :user_delete)
142 post("/users", AdminAPIController, :users_create)
143 patch("/users/:nickname/toggle_activation", AdminAPIController, :user_toggle_activation)
144 put("/users/tag", AdminAPIController, :tag_users)
145 delete("/users/tag", AdminAPIController, :untag_users)
146
147 get("/users/:nickname/permission_group", AdminAPIController, :right_get)
148 get("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_get)
149 post("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_add)
150
151 delete(
152 "/users/:nickname/permission_group/:permission_group",
153 AdminAPIController,
154 :right_delete
155 )
156
157 put("/users/:nickname/activation_status", AdminAPIController, :set_activation_status)
158
159 post("/relay", AdminAPIController, :relay_follow)
160 delete("/relay", AdminAPIController, :relay_unfollow)
161
162 get("/users/invite_token", AdminAPIController, :get_invite_token)
163 get("/users/invites", AdminAPIController, :invites)
164 post("/users/revoke_invite", AdminAPIController, :revoke_invite)
165 post("/users/email_invite", AdminAPIController, :email_invite)
166
167 get("/users/:nickname/password_reset", AdminAPIController, :get_password_reset)
168
169 get("/users", AdminAPIController, :list_users)
170 get("/users/:nickname", AdminAPIController, :user_show)
171
172 get("/config", AdminAPIController, :config_show)
173 post("/config", AdminAPIController, :config_update)
174 get("/config/migrate_to_db", AdminAPIController, :migrate_to_db)
175 get("/config/migrate_from_db", AdminAPIController, :migrate_from_db)
176
177 get("/moderation_log", AdminAPIController, :list_log)
178
179 get("/users/:nickname/statuses", AdminAPIController, :list_user_statuses)
180 put("/statuses/:id", AdminAPIController, :status_update)
181 delete("/statuses/:id", AdminAPIController, :status_delete)
182 end
183
184 scope "/", Pleroma.Web.TwitterAPI do
185 pipe_through(:pleroma_html)
186
187 post("/main/ostatus", UtilController, :remote_subscribe)
188 get("/ostatus_subscribe", UtilController, :remote_follow)
189 post("/ostatus_subscribe", UtilController, :do_remote_follow)
190 end
191
192 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
193 pipe_through(:authenticated_api)
194
195 post("/change_email", UtilController, :change_email)
196 post("/change_password", UtilController, :change_password)
197 post("/delete_account", UtilController, :delete_account)
198 put("/notification_settings", UtilController, :update_notificaton_settings)
199 post("/disable_account", UtilController, :disable_account)
200
201 post("/blocks_import", UtilController, :blocks_import)
202 post("/follow_import", UtilController, :follow_import)
203 end
204
205 scope "/oauth", Pleroma.Web.OAuth do
206 scope [] do
207 pipe_through(:oauth)
208 get("/authorize", OAuthController, :authorize)
209 end
210
211 post("/authorize", OAuthController, :create_authorization)
212 post("/token", OAuthController, :token_exchange)
213 post("/revoke", OAuthController, :token_revoke)
214 get("/registration_details", OAuthController, :registration_details)
215
216 scope [] do
217 pipe_through(:browser)
218
219 get("/prepare_request", OAuthController, :prepare_request)
220 get("/:provider", OAuthController, :request)
221 get("/:provider/callback", OAuthController, :callback)
222 post("/register", OAuthController, :register)
223 end
224 end
225
226 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
227 pipe_through(:authenticated_api)
228
229 get("/conversations/:id/statuses", PleromaAPIController, :conversation_statuses)
230 get("/conversations/:id", PleromaAPIController, :conversation)
231 patch("/conversations/:id", PleromaAPIController, :update_conversation)
232 post("/notifications/read", PleromaAPIController, :read_notification)
233 end
234
235 scope "/api/v1", Pleroma.Web.MastodonAPI do
236 pipe_through(:authenticated_api)
237
238 get("/blocks", MastodonAPIController, :blocks)
239 get("/mutes", MastodonAPIController, :mutes)
240 get("/domain_blocks", MastodonAPIController, :domain_blocks)
241
242 get("/accounts/:id/lists", MastodonAPIController, :account_lists)
243 get("/lists", ListController, :index)
244 get("/lists/:id", ListController, :show)
245 get("/lists/:id/accounts", ListController, :list_accounts)
246
247 post("/notifications/clear", MastodonAPIController, :clear_notifications)
248 post("/notifications/dismiss", MastodonAPIController, :dismiss_notification)
249 get("/notifications", MastodonAPIController, :notifications)
250 get("/notifications/:id", MastodonAPIController, :get_notification)
251
252 delete(
253 "/notifications/destroy_multiple",
254 MastodonAPIController,
255 :destroy_multiple_notifications
256 )
257
258 # Note: not present in Mastodon
259 get("/bookmarks", MastodonAPIController, :bookmarks)
260
261 get("/accounts/:id/identity_proofs", MastodonAPIController, :empty_array)
262
263 get("/favourites", MastodonAPIController, :favourites)
264
265 get("/accounts/relationships", MastodonAPIController, :relationships)
266
267 get("/accounts/verify_credentials", MastodonAPIController, :verify_credentials)
268
269 get("/timelines/home", MastodonAPIController, :home_timeline)
270 get("/timelines/direct", MastodonAPIController, :dm_timeline)
271
272 get("/suggestions", MastodonAPIController, :suggestions)
273 get("/scheduled_statuses", MastodonAPIController, :scheduled_statuses)
274 get("/scheduled_statuses/:id", MastodonAPIController, :show_scheduled_status)
275 get("/follow_requests", MastodonAPIController, :follow_requests)
276 get("/filters", MastodonAPIController, :get_filters)
277 get("/endorsements", MastodonAPIController, :endorsements)
278 get("/conversations", MastodonAPIController, :conversations)
279 post("/conversations/:id/read", MastodonAPIController, :conversation_read)
280
281 delete("/lists/:id", ListController, :delete)
282 post("/lists", ListController, :create)
283 put("/lists/:id", ListController, :update)
284
285 post("/lists/:id/accounts", ListController, :add_to_list)
286 delete("/lists/:id/accounts", ListController, :remove_from_list)
287
288 post("/reports", MastodonAPIController, :create_report)
289
290 patch("/pleroma/accounts/update_avatar", MastodonAPIController, :update_avatar)
291 patch("/pleroma/accounts/update_banner", MastodonAPIController, :update_banner)
292 patch("/pleroma/accounts/update_background", MastodonAPIController, :update_background)
293
294 get("/pleroma/mascot", MastodonAPIController, :get_mascot)
295 put("/pleroma/mascot", MastodonAPIController, :set_mascot)
296
297 post("/media", MastodonAPIController, :upload)
298 put("/media/:id", MastodonAPIController, :update_media)
299
300 patch("/accounts/update_credentials", MastodonAPIController, :update_credentials)
301
302 post("/polls/:id/votes", MastodonAPIController, :poll_vote)
303
304 post("/statuses/:id/reblog", MastodonAPIController, :reblog_status)
305 post("/statuses/:id/unreblog", MastodonAPIController, :unreblog_status)
306
307 post("/statuses/:id/pin", MastodonAPIController, :pin_status)
308 post("/statuses/:id/unpin", MastodonAPIController, :unpin_status)
309
310 post("/statuses/:id/mute", MastodonAPIController, :mute_conversation)
311 post("/statuses/:id/unmute", MastodonAPIController, :unmute_conversation)
312
313 post("/statuses/:id/favourite", MastodonAPIController, :fav_status)
314 post("/statuses/:id/unfavourite", MastodonAPIController, :unfav_status)
315
316 post("/statuses", MastodonAPIController, :post_status)
317 delete("/statuses/:id", MastodonAPIController, :delete_status)
318
319 put("/scheduled_statuses/:id", MastodonAPIController, :update_scheduled_status)
320 delete("/scheduled_statuses/:id", MastodonAPIController, :delete_scheduled_status)
321
322 post("/filters", MastodonAPIController, :create_filter)
323 get("/filters/:id", MastodonAPIController, :get_filter)
324 put("/filters/:id", MastodonAPIController, :update_filter)
325 delete("/filters/:id", MastodonAPIController, :delete_filter)
326
327 post("/follows", MastodonAPIController, :follow)
328 post("/accounts/:id/follow", MastodonAPIController, :follow)
329
330 post("/accounts/:id/unfollow", MastodonAPIController, :unfollow)
331 post("/accounts/:id/block", MastodonAPIController, :block)
332 post("/accounts/:id/unblock", MastodonAPIController, :unblock)
333 post("/accounts/:id/mute", MastodonAPIController, :mute)
334 post("/accounts/:id/unmute", MastodonAPIController, :unmute)
335
336 post("/follow_requests/:id/authorize", MastodonAPIController, :authorize_follow_request)
337 post("/follow_requests/:id/reject", MastodonAPIController, :reject_follow_request)
338
339 post("/domain_blocks", MastodonAPIController, :block_domain)
340 delete("/domain_blocks", MastodonAPIController, :unblock_domain)
341
342 post("/pleroma/accounts/:id/subscribe", MastodonAPIController, :subscribe)
343 post("/pleroma/accounts/:id/unsubscribe", MastodonAPIController, :unsubscribe)
344
345 post("/push/subscription", SubscriptionController, :create)
346 get("/push/subscription", SubscriptionController, :get)
347 put("/push/subscription", SubscriptionController, :update)
348 delete("/push/subscription", SubscriptionController, :delete)
349
350 # Note: not present in Mastodon: bookmark, unbookmark
351 post("/statuses/:id/bookmark", MastodonAPIController, :bookmark_status)
352 post("/statuses/:id/unbookmark", MastodonAPIController, :unbookmark_status)
353 end
354
355 scope "/api/web", Pleroma.Web.MastodonAPI do
356 pipe_through(:authenticated_api)
357
358 put("/settings", MastodonAPIController, :put_settings)
359 end
360
361 scope "/api/v1", Pleroma.Web.MastodonAPI do
362 pipe_through(:api)
363
364 get("/instance", MastodonAPIController, :masto_instance)
365 get("/instance/peers", MastodonAPIController, :peers)
366
367 post("/apps", MastodonAPIController, :create_app)
368 get("/apps/verify_credentials", MastodonAPIController, :verify_app_credentials)
369
370 get("/custom_emojis", MastodonAPIController, :custom_emojis)
371
372 get("/trends", MastodonAPIController, :empty_array)
373
374 get("/accounts/search", SearchController, :account_search)
375
376 get("/timelines/public", MastodonAPIController, :public_timeline)
377 get("/timelines/tag/:tag", MastodonAPIController, :hashtag_timeline)
378 get("/timelines/list/:list_id", MastodonAPIController, :list_timeline)
379
380 get("/polls/:id", MastodonAPIController, :get_poll)
381
382 post("/accounts", MastodonAPIController, :account_register)
383 get("/accounts/:id", MastodonAPIController, :user)
384 get("/accounts/:id/followers", MastodonAPIController, :followers)
385 get("/accounts/:id/following", MastodonAPIController, :following)
386 get("/accounts/:id/statuses", MastodonAPIController, :user_statuses)
387
388 get("/search", SearchController, :search)
389
390 get("/statuses", MastodonAPIController, :get_statuses)
391 get("/statuses/:id", MastodonAPIController, :get_status)
392 get("/statuses/:id/context", MastodonAPIController, :get_context)
393 get("/statuses/:id/card", MastodonAPIController, :status_card)
394 get("/statuses/:id/favourited_by", MastodonAPIController, :favourited_by)
395 get("/statuses/:id/reblogged_by", MastodonAPIController, :reblogged_by)
396
397 get("/pleroma/accounts/:id/favourites", MastodonAPIController, :user_favourites)
398
399 post(
400 "/pleroma/accounts/confirmation_resend",
401 MastodonAPIController,
402 :account_confirmation_resend
403 )
404 end
405
406 scope "/api/v2", Pleroma.Web.MastodonAPI do
407 pipe_through(:api)
408 get("/search", SearchController, :search2)
409 end
410
411 scope "/api", Pleroma.Web do
412 pipe_through(:config)
413
414 get("/help/test", TwitterAPI.UtilController, :help_test)
415 post("/help/test", TwitterAPI.UtilController, :help_test)
416 get("/statusnet/config", TwitterAPI.UtilController, :config)
417 get("/statusnet/version", TwitterAPI.UtilController, :version)
418 get("/pleroma/frontend_configurations", TwitterAPI.UtilController, :frontend_configurations)
419 end
420
421 scope "/api", Pleroma.Web do
422 pipe_through(:api)
423
424 get(
425 "/account/confirm_email/:user_id/:token",
426 TwitterAPI.Controller,
427 :confirm_email,
428 as: :confirm_email
429 )
430 end
431
432 scope "/api", Pleroma.Web, as: :authenticated_twitter_api do
433 pipe_through(:authenticated_api)
434
435 get("/oauth_tokens", TwitterAPI.Controller, :oauth_tokens)
436 delete("/oauth_tokens/:id", TwitterAPI.Controller, :revoke_token)
437 post("/qvitter/statuses/notifications/read", TwitterAPI.Controller, :notifications_read)
438 end
439
440 pipeline :ap_service_actor do
441 plug(:accepts, ["activity+json", "json"])
442 end
443
444 pipeline :ostatus do
445 plug(:accepts, ["html", "xml", "atom", "activity+json", "json"])
446 end
447
448 pipeline :oembed do
449 plug(:accepts, ["json", "xml"])
450 end
451
452 scope "/", Pleroma.Web do
453 pipe_through(:ostatus)
454
455 get("/objects/:uuid", OStatus.OStatusController, :object)
456 get("/activities/:uuid", OStatus.OStatusController, :activity)
457 get("/notice/:id", OStatus.OStatusController, :notice)
458 get("/notice/:id/embed_player", OStatus.OStatusController, :notice_player)
459 get("/users/:nickname/feed", OStatus.OStatusController, :feed)
460 get("/users/:nickname", OStatus.OStatusController, :feed_redirect)
461
462 post("/users/:nickname/salmon", OStatus.OStatusController, :salmon_incoming)
463 post("/push/hub/:nickname", Websub.WebsubController, :websub_subscription_request)
464 get("/push/subscriptions/:id", Websub.WebsubController, :websub_subscription_confirmation)
465 post("/push/subscriptions/:id", Websub.WebsubController, :websub_incoming)
466
467 get("/mailer/unsubscribe/:token", Mailer.SubscriptionController, :unsubscribe)
468 end
469
470 pipeline :activitypub do
471 plug(:accepts, ["activity+json", "json"])
472 plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
473 plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
474 end
475
476 scope "/", Pleroma.Web.ActivityPub do
477 # XXX: not really ostatus
478 pipe_through(:ostatus)
479
480 get("/users/:nickname/outbox", ActivityPubController, :outbox)
481 get("/objects/:uuid/likes", ActivityPubController, :object_likes)
482 end
483
484 pipeline :activitypub_client do
485 plug(:accepts, ["activity+json", "json"])
486 plug(:fetch_session)
487 plug(Pleroma.Plugs.OAuthPlug)
488 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
489 plug(Pleroma.Plugs.UserFetcherPlug)
490 plug(Pleroma.Plugs.SessionAuthenticationPlug)
491 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
492 plug(Pleroma.Plugs.AuthenticationPlug)
493 plug(Pleroma.Plugs.UserEnabledPlug)
494 plug(Pleroma.Plugs.SetUserSessionIdPlug)
495 plug(Pleroma.Plugs.EnsureUserKeyPlug)
496 end
497
498 scope "/", Pleroma.Web.ActivityPub do
499 pipe_through([:activitypub_client])
500
501 get("/api/ap/whoami", ActivityPubController, :whoami)
502 get("/users/:nickname/inbox", ActivityPubController, :read_inbox)
503 post("/users/:nickname/outbox", ActivityPubController, :update_outbox)
504 get("/users/:nickname/followers", ActivityPubController, :followers)
505 get("/users/:nickname/following", ActivityPubController, :following)
506 end
507
508 scope "/", Pleroma.Web.ActivityPub do
509 pipe_through(:activitypub)
510
511 post("/inbox", ActivityPubController, :inbox)
512 post("/users/:nickname/inbox", ActivityPubController, :inbox)
513 end
514
515 scope "/relay", Pleroma.Web.ActivityPub do
516 pipe_through(:ap_service_actor)
517
518 get("/", ActivityPubController, :relay)
519
520 scope [] do
521 pipe_through(:http_signature)
522 post("/inbox", ActivityPubController, :inbox)
523 end
524
525 get("/following", ActivityPubController, :following, assigns: %{relay: true})
526 get("/followers", ActivityPubController, :followers, assigns: %{relay: true})
527 end
528
529 scope "/internal/fetch", Pleroma.Web.ActivityPub do
530 pipe_through(:ap_service_actor)
531
532 get("/", ActivityPubController, :internal_fetch)
533 post("/inbox", ActivityPubController, :inbox)
534 end
535
536 scope "/.well-known", Pleroma.Web do
537 pipe_through(:well_known)
538
539 get("/host-meta", WebFinger.WebFingerController, :host_meta)
540 get("/webfinger", WebFinger.WebFingerController, :webfinger)
541 get("/nodeinfo", Nodeinfo.NodeinfoController, :schemas)
542 end
543
544 scope "/nodeinfo", Pleroma.Web do
545 get("/:version", Nodeinfo.NodeinfoController, :nodeinfo)
546 end
547
548 scope "/", Pleroma.Web.MastodonAPI do
549 pipe_through(:mastodon_html)
550
551 get("/web/login", MastodonAPIController, :login)
552 delete("/auth/sign_out", MastodonAPIController, :logout)
553
554 post("/auth/password", MastodonAPIController, :password_reset)
555
556 get("/web/*path", MastodonAPIController, :index)
557 end
558
559 pipeline :remote_media do
560 end
561
562 scope "/proxy/", Pleroma.Web.MediaProxy do
563 pipe_through(:remote_media)
564
565 get("/:sig/:url", MediaProxyController, :remote)
566 get("/:sig/:url/:filename", MediaProxyController, :remote)
567 end
568
569 if Pleroma.Config.get(:env) == :dev do
570 scope "/dev" do
571 pipe_through([:mailbox_preview])
572
573 forward("/mailbox", Plug.Swoosh.MailboxPreview, base_path: "/dev/mailbox")
574 end
575 end
576
577 scope "/", Pleroma.Web.MongooseIM do
578 get("/user_exists", MongooseIMController, :user_exists)
579 get("/check_password", MongooseIMController, :check_password)
580 end
581
582 scope "/", Fallback do
583 get("/registration/:token", RedirectController, :registration_page)
584 get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
585 get("/api*path", RedirectController, :api_not_implemented)
586 get("/*path", RedirectController, :redirector)
587
588 options("/*path", RedirectController, :empty)
589 end
590 end