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