Ability to toggle activation status and permission group for a group of users
[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 plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
114 end
115
116 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
117 pipe_through(:pleroma_api)
118
119 get("/password_reset/:token", PasswordController, :reset, as: :reset_password)
120 post("/password_reset", PasswordController, :do_reset, as: :reset_password)
121 get("/emoji", UtilController, :emoji)
122 get("/captcha", UtilController, :captcha)
123 get("/healthcheck", UtilController, :healthcheck)
124 end
125
126 scope "/api/pleroma", Pleroma.Web do
127 pipe_through(:pleroma_api)
128 post("/uploader_callback/:upload_path", UploaderController, :callback)
129 end
130
131 scope "/api/pleroma/admin", Pleroma.Web.AdminAPI do
132 pipe_through(:admin_api)
133
134 post("/users/follow", AdminAPIController, :user_follow)
135 post("/users/unfollow", AdminAPIController, :user_unfollow)
136
137 delete("/users", AdminAPIController, :user_delete)
138 post("/users", AdminAPIController, :users_create)
139 patch("/users/activate", AdminAPIController, :user_activate)
140 patch("/users/deactivate", AdminAPIController, :user_deactivate)
141 put("/users/tag", AdminAPIController, :tag_users)
142 delete("/users/tag", AdminAPIController, :untag_users)
143
144 get("/users/:nickname/permission_group", AdminAPIController, :right_get)
145 get("/users/:nickname/permission_group/:permission_group", AdminAPIController, :right_get)
146 post("/users/permission_group/:permission_group", AdminAPIController, :right_add)
147 delete("/users/permission_group/:permission_group", AdminAPIController, :right_delete)
148
149 post("/relay", AdminAPIController, :relay_follow)
150 delete("/relay", AdminAPIController, :relay_unfollow)
151
152 post("/users/invite_token", AdminAPIController, :create_invite_token)
153 get("/users/invites", AdminAPIController, :invites)
154 post("/users/revoke_invite", AdminAPIController, :revoke_invite)
155 post("/users/email_invite", AdminAPIController, :email_invite)
156
157 get("/users/:nickname/password_reset", AdminAPIController, :get_password_reset)
158 patch("/users/:nickname/force_password_reset", AdminAPIController, :force_password_reset)
159
160 get("/users", AdminAPIController, :list_users)
161 get("/users/:nickname", AdminAPIController, :user_show)
162 get("/users/:nickname/statuses", AdminAPIController, :list_user_statuses)
163
164 get("/reports", AdminAPIController, :list_reports)
165 get("/reports/:id", AdminAPIController, :report_show)
166 put("/reports/:id", AdminAPIController, :report_update_state)
167 post("/reports/:id/respond", AdminAPIController, :report_respond)
168
169 put("/statuses/:id", AdminAPIController, :status_update)
170 delete("/statuses/:id", AdminAPIController, :status_delete)
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 post("/reload_emoji", AdminAPIController, :reload_emoji)
180 end
181
182 scope "/api/pleroma/emoji", Pleroma.Web.PleromaAPI do
183 scope "/packs" do
184 # Modifying packs
185 pipe_through(:admin_api)
186
187 post("/import_from_fs", EmojiAPIController, :import_from_fs)
188
189 post("/:pack_name/update_file", EmojiAPIController, :update_file)
190 post("/:pack_name/update_metadata", EmojiAPIController, :update_metadata)
191 put("/:name", EmojiAPIController, :create)
192 delete("/:name", EmojiAPIController, :delete)
193 post("/download_from", EmojiAPIController, :download_from)
194 post("/list_from", EmojiAPIController, :list_from)
195 end
196
197 scope "/packs" do
198 # Pack info / downloading
199 get("/", EmojiAPIController, :list_packs)
200 get("/:name/download_shared/", EmojiAPIController, :download_shared)
201 end
202 end
203
204 scope "/", Pleroma.Web.TwitterAPI do
205 pipe_through(:pleroma_html)
206
207 post("/main/ostatus", UtilController, :remote_subscribe)
208 get("/ostatus_subscribe", UtilController, :remote_follow)
209
210 post("/ostatus_subscribe", UtilController, :do_remote_follow)
211 end
212
213 scope "/api/pleroma", Pleroma.Web.TwitterAPI do
214 pipe_through(:authenticated_api)
215
216 post("/change_email", UtilController, :change_email)
217 post("/change_password", UtilController, :change_password)
218 post("/delete_account", UtilController, :delete_account)
219 put("/notification_settings", UtilController, :update_notificaton_settings)
220 post("/disable_account", UtilController, :disable_account)
221
222 post("/blocks_import", UtilController, :blocks_import)
223 post("/follow_import", UtilController, :follow_import)
224 end
225
226 scope "/oauth", Pleroma.Web.OAuth do
227 scope [] do
228 pipe_through(:oauth)
229 get("/authorize", OAuthController, :authorize)
230 end
231
232 post("/authorize", OAuthController, :create_authorization)
233 post("/token", OAuthController, :token_exchange)
234 post("/revoke", OAuthController, :token_revoke)
235 get("/registration_details", OAuthController, :registration_details)
236
237 scope [] do
238 pipe_through(:browser)
239
240 get("/prepare_request", OAuthController, :prepare_request)
241 get("/:provider", OAuthController, :request)
242 get("/:provider/callback", OAuthController, :callback)
243 post("/register", OAuthController, :register)
244 end
245 end
246
247 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
248 scope [] do
249 pipe_through(:authenticated_api)
250
251 get("/conversations/:id/statuses", PleromaAPIController, :conversation_statuses)
252 get("/conversations/:id", PleromaAPIController, :conversation)
253 end
254
255 scope [] do
256 pipe_through(:authenticated_api)
257
258 patch("/conversations/:id", PleromaAPIController, :update_conversation)
259 post("/notifications/read", PleromaAPIController, :read_notification)
260
261 patch("/accounts/update_avatar", AccountController, :update_avatar)
262 patch("/accounts/update_banner", AccountController, :update_banner)
263 patch("/accounts/update_background", AccountController, :update_background)
264
265 get("/mascot", MascotController, :show)
266 put("/mascot", MascotController, :update)
267
268 post("/scrobble", ScrobbleController, :new_scrobble)
269 end
270
271 scope [] do
272 pipe_through(:api)
273 get("/accounts/:id/favourites", AccountController, :favourites)
274 end
275
276 scope [] do
277 pipe_through(:authenticated_api)
278
279 post("/accounts/:id/subscribe", AccountController, :subscribe)
280 post("/accounts/:id/unsubscribe", AccountController, :unsubscribe)
281 end
282
283 post("/accounts/confirmation_resend", AccountController, :confirmation_resend)
284 end
285
286 scope "/api/v1/pleroma", Pleroma.Web.PleromaAPI do
287 pipe_through(:api)
288 get("/accounts/:id/scrobbles", ScrobbleController, :user_scrobbles)
289 end
290
291 scope "/api/v1", Pleroma.Web.MastodonAPI do
292 pipe_through(:authenticated_api)
293
294 get("/accounts/verify_credentials", AccountController, :verify_credentials)
295
296 get("/accounts/relationships", AccountController, :relationships)
297
298 get("/accounts/:id/lists", AccountController, :lists)
299 get("/accounts/:id/identity_proofs", MastodonAPIController, :empty_array)
300
301 get("/follow_requests", FollowRequestController, :index)
302 get("/blocks", AccountController, :blocks)
303 get("/mutes", AccountController, :mutes)
304
305 get("/timelines/home", TimelineController, :home)
306 get("/timelines/direct", TimelineController, :direct)
307
308 get("/favourites", StatusController, :favourites)
309 get("/bookmarks", StatusController, :bookmarks)
310
311 get("/notifications", NotificationController, :index)
312 get("/notifications/:id", NotificationController, :show)
313 post("/notifications/clear", NotificationController, :clear)
314 post("/notifications/dismiss", NotificationController, :dismiss)
315 delete("/notifications/destroy_multiple", NotificationController, :destroy_multiple)
316
317 get("/scheduled_statuses", ScheduledActivityController, :index)
318 get("/scheduled_statuses/:id", ScheduledActivityController, :show)
319
320 get("/lists", ListController, :index)
321 get("/lists/:id", ListController, :show)
322 get("/lists/:id/accounts", ListController, :list_accounts)
323
324 get("/domain_blocks", DomainBlockController, :index)
325
326 get("/filters", FilterController, :index)
327
328 get("/suggestions", SuggestionController, :index)
329
330 get("/conversations", ConversationController, :index)
331 post("/conversations/:id/read", ConversationController, :read)
332
333 get("/endorsements", AccountController, :endorsements)
334
335 patch("/accounts/update_credentials", AccountController, :update_credentials)
336
337 post("/statuses", StatusController, :create)
338 delete("/statuses/:id", StatusController, :delete)
339
340 post("/statuses/:id/reblog", StatusController, :reblog)
341 post("/statuses/:id/unreblog", StatusController, :unreblog)
342 post("/statuses/:id/favourite", StatusController, :favourite)
343 post("/statuses/:id/unfavourite", StatusController, :unfavourite)
344 post("/statuses/:id/pin", StatusController, :pin)
345 post("/statuses/:id/unpin", StatusController, :unpin)
346 post("/statuses/:id/bookmark", StatusController, :bookmark)
347 post("/statuses/:id/unbookmark", StatusController, :unbookmark)
348 post("/statuses/:id/mute", StatusController, :mute_conversation)
349 post("/statuses/:id/unmute", StatusController, :unmute_conversation)
350
351 put("/scheduled_statuses/:id", ScheduledActivityController, :update)
352 delete("/scheduled_statuses/:id", ScheduledActivityController, :delete)
353
354 post("/polls/:id/votes", PollController, :vote)
355
356 post("/media", MediaController, :create)
357 put("/media/:id", MediaController, :update)
358
359 delete("/lists/:id", ListController, :delete)
360 post("/lists", ListController, :create)
361 put("/lists/:id", ListController, :update)
362
363 post("/lists/:id/accounts", ListController, :add_to_list)
364 delete("/lists/:id/accounts", ListController, :remove_from_list)
365
366 post("/filters", FilterController, :create)
367 get("/filters/:id", FilterController, :show)
368 put("/filters/:id", FilterController, :update)
369 delete("/filters/:id", FilterController, :delete)
370
371 post("/reports", ReportController, :create)
372
373 post("/follows", AccountController, :follows)
374 post("/accounts/:id/follow", AccountController, :follow)
375 post("/accounts/:id/unfollow", AccountController, :unfollow)
376 post("/accounts/:id/block", AccountController, :block)
377 post("/accounts/:id/unblock", AccountController, :unblock)
378 post("/accounts/:id/mute", AccountController, :mute)
379 post("/accounts/:id/unmute", AccountController, :unmute)
380
381 post("/follow_requests/:id/authorize", FollowRequestController, :authorize)
382 post("/follow_requests/:id/reject", FollowRequestController, :reject)
383
384 post("/domain_blocks", DomainBlockController, :create)
385 delete("/domain_blocks", DomainBlockController, :delete)
386
387 post("/push/subscription", SubscriptionController, :create)
388 get("/push/subscription", SubscriptionController, :get)
389 put("/push/subscription", SubscriptionController, :update)
390 delete("/push/subscription", SubscriptionController, :delete)
391 end
392
393 scope "/api/web", Pleroma.Web do
394 pipe_through(:authenticated_api)
395
396 put("/settings", MastoFEController, :put_settings)
397 end
398
399 scope "/api/v1", Pleroma.Web.MastodonAPI do
400 pipe_through(:api)
401
402 post("/accounts", AccountController, :create)
403 get("/accounts/search", SearchController, :account_search)
404
405 get("/instance", InstanceController, :show)
406 get("/instance/peers", InstanceController, :peers)
407
408 post("/apps", AppController, :create)
409 get("/apps/verify_credentials", AppController, :verify_credentials)
410
411 get("/statuses/:id/card", StatusController, :card)
412 get("/statuses/:id/favourited_by", StatusController, :favourited_by)
413 get("/statuses/:id/reblogged_by", StatusController, :reblogged_by)
414
415 get("/custom_emojis", CustomEmojiController, :index)
416
417 get("/trends", MastodonAPIController, :empty_array)
418
419 get("/timelines/public", TimelineController, :public)
420 get("/timelines/tag/:tag", TimelineController, :hashtag)
421 get("/timelines/list/:list_id", TimelineController, :list)
422
423 get("/statuses", StatusController, :index)
424 get("/statuses/:id", StatusController, :show)
425 get("/statuses/:id/context", StatusController, :context)
426
427 get("/polls/:id", PollController, :show)
428
429 get("/accounts/:id/statuses", AccountController, :statuses)
430 get("/accounts/:id/followers", AccountController, :followers)
431 get("/accounts/:id/following", AccountController, :following)
432 get("/accounts/:id", AccountController, :show)
433
434 get("/search", SearchController, :search)
435 end
436
437 scope "/api/v2", Pleroma.Web.MastodonAPI do
438 pipe_through(:api)
439 get("/search", SearchController, :search2)
440 end
441
442 scope "/api", Pleroma.Web do
443 pipe_through(:config)
444
445 get("/help/test", TwitterAPI.UtilController, :help_test)
446 post("/help/test", TwitterAPI.UtilController, :help_test)
447 get("/statusnet/config", TwitterAPI.UtilController, :config)
448 get("/statusnet/version", TwitterAPI.UtilController, :version)
449 get("/pleroma/frontend_configurations", TwitterAPI.UtilController, :frontend_configurations)
450 end
451
452 scope "/api", Pleroma.Web do
453 pipe_through(:api)
454
455 get(
456 "/account/confirm_email/:user_id/:token",
457 TwitterAPI.Controller,
458 :confirm_email,
459 as: :confirm_email
460 )
461 end
462
463 scope "/api", Pleroma.Web, as: :authenticated_twitter_api do
464 pipe_through(:authenticated_api)
465
466 get("/oauth_tokens", TwitterAPI.Controller, :oauth_tokens)
467 delete("/oauth_tokens/:id", TwitterAPI.Controller, :revoke_token)
468
469 post("/qvitter/statuses/notifications/read", TwitterAPI.Controller, :notifications_read)
470 end
471
472 pipeline :ap_service_actor do
473 plug(:accepts, ["activity+json", "json"])
474 end
475
476 pipeline :ostatus do
477 plug(:accepts, ["html", "xml", "atom", "activity+json", "json"])
478 end
479
480 pipeline :oembed do
481 plug(:accepts, ["json", "xml"])
482 end
483
484 scope "/", Pleroma.Web do
485 pipe_through(:ostatus)
486 pipe_through(:http_signature)
487
488 get("/objects/:uuid", OStatus.OStatusController, :object)
489 get("/activities/:uuid", OStatus.OStatusController, :activity)
490 get("/notice/:id", OStatus.OStatusController, :notice)
491 get("/notice/:id/embed_player", OStatus.OStatusController, :notice_player)
492
493 get("/users/:nickname/feed", Feed.FeedController, :feed)
494 get("/users/:nickname", Feed.FeedController, :feed_redirect)
495
496 post("/users/:nickname/salmon", OStatus.OStatusController, :salmon_incoming)
497 post("/push/hub/:nickname", Websub.WebsubController, :websub_subscription_request)
498 get("/push/subscriptions/:id", Websub.WebsubController, :websub_subscription_confirmation)
499 post("/push/subscriptions/:id", Websub.WebsubController, :websub_incoming)
500
501 get("/mailer/unsubscribe/:token", Mailer.SubscriptionController, :unsubscribe)
502 end
503
504 pipeline :activitypub do
505 plug(:accepts, ["activity+json", "json"])
506 plug(Pleroma.Web.Plugs.HTTPSignaturePlug)
507 plug(Pleroma.Web.Plugs.MappedSignatureToIdentityPlug)
508 end
509
510 scope "/", Pleroma.Web.ActivityPub do
511 # XXX: not really ostatus
512 pipe_through(:ostatus)
513
514 get("/users/:nickname/outbox", ActivityPubController, :outbox)
515 end
516
517 pipeline :activitypub_client do
518 plug(:accepts, ["activity+json", "json"])
519 plug(:fetch_session)
520 plug(Pleroma.Plugs.OAuthPlug)
521 plug(Pleroma.Plugs.BasicAuthDecoderPlug)
522 plug(Pleroma.Plugs.UserFetcherPlug)
523 plug(Pleroma.Plugs.SessionAuthenticationPlug)
524 plug(Pleroma.Plugs.LegacyAuthenticationPlug)
525 plug(Pleroma.Plugs.AuthenticationPlug)
526 plug(Pleroma.Plugs.UserEnabledPlug)
527 plug(Pleroma.Plugs.SetUserSessionIdPlug)
528 plug(Pleroma.Plugs.EnsureUserKeyPlug)
529 end
530
531 scope "/", Pleroma.Web.ActivityPub do
532 pipe_through([:activitypub_client])
533
534 get("/api/ap/whoami", ActivityPubController, :whoami)
535 get("/users/:nickname/inbox", ActivityPubController, :read_inbox)
536
537 post("/users/:nickname/outbox", ActivityPubController, :update_outbox)
538 post("/api/ap/upload_media", ActivityPubController, :upload_media)
539
540 get("/users/:nickname/followers", ActivityPubController, :followers)
541 get("/users/:nickname/following", ActivityPubController, :following)
542 end
543
544 scope "/", Pleroma.Web.ActivityPub do
545 pipe_through(:activitypub)
546 post("/inbox", ActivityPubController, :inbox)
547 post("/users/:nickname/inbox", ActivityPubController, :inbox)
548 end
549
550 scope "/relay", Pleroma.Web.ActivityPub do
551 pipe_through(:ap_service_actor)
552
553 get("/", ActivityPubController, :relay)
554
555 scope [] do
556 pipe_through(:http_signature)
557 post("/inbox", ActivityPubController, :inbox)
558 end
559
560 get("/following", ActivityPubController, :following, assigns: %{relay: true})
561 get("/followers", ActivityPubController, :followers, assigns: %{relay: true})
562 end
563
564 scope "/internal/fetch", Pleroma.Web.ActivityPub do
565 pipe_through(:ap_service_actor)
566
567 get("/", ActivityPubController, :internal_fetch)
568 post("/inbox", ActivityPubController, :inbox)
569 end
570
571 scope "/.well-known", Pleroma.Web do
572 pipe_through(:well_known)
573
574 get("/host-meta", WebFinger.WebFingerController, :host_meta)
575 get("/webfinger", WebFinger.WebFingerController, :webfinger)
576 get("/nodeinfo", Nodeinfo.NodeinfoController, :schemas)
577 end
578
579 scope "/nodeinfo", Pleroma.Web do
580 get("/:version", Nodeinfo.NodeinfoController, :nodeinfo)
581 end
582
583 scope "/", Pleroma.Web do
584 pipe_through(:mastodon_html)
585
586 get("/web/login", MastodonAPI.AuthController, :login)
587 delete("/auth/sign_out", MastodonAPI.AuthController, :logout)
588
589 post("/auth/password", MastodonAPI.AuthController, :password_reset)
590
591 get("/web/*path", MastoFEController, :index)
592 end
593
594 pipeline :remote_media do
595 end
596
597 scope "/proxy/", Pleroma.Web.MediaProxy do
598 pipe_through(:remote_media)
599
600 get("/:sig/:url", MediaProxyController, :remote)
601 get("/:sig/:url/:filename", MediaProxyController, :remote)
602 end
603
604 if Pleroma.Config.get(:env) == :dev do
605 scope "/dev" do
606 pipe_through([:mailbox_preview])
607
608 forward("/mailbox", Plug.Swoosh.MailboxPreview, base_path: "/dev/mailbox")
609 end
610 end
611
612 scope "/", Pleroma.Web.MongooseIM do
613 get("/user_exists", MongooseIMController, :user_exists)
614 get("/check_password", MongooseIMController, :check_password)
615 end
616
617 scope "/", Fallback do
618 get("/registration/:token", RedirectController, :registration_page)
619 get("/:maybe_nickname_or_id", RedirectController, :redirector_with_meta)
620 get("/api*path", RedirectController, :api_not_implemented)
621 get("/*path", RedirectController, :redirector)
622
623 options("/*path", RedirectController, :empty)
624 end
625 end