web.php 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <?php
  2. Route::domain(config('pixelfed.domain.admin'))->prefix('i/admin')->group(function () {
  3. Route::redirect('/', '/dashboard');
  4. Route::redirect('timeline', config('app.url').'/timeline');
  5. Route::get('dashboard', 'AdminController@home')->name('admin.home');
  6. Route::get('reports', 'AdminController@reports')->name('admin.reports');
  7. Route::get('reports/show/{id}', 'AdminController@showReport');
  8. Route::post('reports/show/{id}', 'AdminController@updateReport');
  9. Route::post('reports/bulk', 'AdminController@bulkUpdateReport');
  10. Route::redirect('statuses', '/statuses/list');
  11. Route::get('statuses/list', 'AdminController@statuses')->name('admin.statuses');
  12. Route::get('statuses/show/{id}', 'AdminController@showStatus');
  13. Route::redirect('profiles', '/i/admin/profiles/list');
  14. Route::get('profiles/list', 'AdminController@profiles')->name('admin.profiles');
  15. Route::get('profiles/edit/{id}', 'AdminController@profileShow');
  16. Route::redirect('users', '/users/list');
  17. Route::get('users/list', 'AdminController@users')->name('admin.users');
  18. Route::get('users/show/{id}', 'AdminController@userShow');
  19. Route::get('users/edit/{id}', 'AdminController@userEdit');
  20. Route::post('users/edit/{id}', 'AdminController@userEditSubmit');
  21. Route::get('users/activity/{id}', 'AdminController@userActivity');
  22. Route::get('users/message/{id}', 'AdminController@userMessage');
  23. Route::post('users/message/{id}', 'AdminController@userMessageSend');
  24. Route::get('users/modtools/{id}', 'AdminController@userModTools');
  25. Route::get('users/modlogs/{id}', 'AdminController@userModLogs');
  26. Route::post('users/modlogs/{id}', 'AdminController@userModLogsMessage');
  27. Route::post('users/modlogs/{id}/delete', 'AdminController@userModLogDelete');
  28. Route::get('users/delete/{id}', 'AdminController@userDelete');
  29. Route::post('users/delete/{id}', 'AdminController@userDeleteProcess');
  30. Route::post('users/moderation/update', 'AdminController@userModerate');
  31. Route::get('media', 'AdminController@media')->name('admin.media');
  32. Route::redirect('media/list', '/i/admin/media');
  33. Route::get('media/show/{id}', 'AdminController@mediaShow');
  34. Route::get('settings', 'AdminController@settings')->name('admin.settings');
  35. Route::post('settings', 'AdminController@settingsHomeStore');
  36. Route::get('settings/config', 'AdminController@settingsConfig')->name('admin.settings.config');
  37. Route::post('settings/config', 'AdminController@settingsConfigStore');
  38. Route::post('settings/config/restore', 'AdminController@settingsConfigRestore');
  39. Route::get('settings/features', 'AdminController@settingsFeatures')->name('admin.settings.features');
  40. Route::get('settings/pages', 'AdminController@settingsPages')->name('admin.settings.pages');
  41. Route::get('settings/pages/edit', 'PageController@edit')->name('admin.settings.pages.edit');
  42. Route::post('settings/pages/edit', 'PageController@store');
  43. Route::post('settings/pages/delete', 'PageController@delete');
  44. Route::post('settings/pages/create', 'PageController@generatePage');
  45. Route::get('settings/maintenance', 'AdminController@settingsMaintenance')->name('admin.settings.maintenance');
  46. Route::get('settings/backups', 'AdminController@settingsBackups')->name('admin.settings.backups');
  47. Route::get('settings/storage', 'AdminController@settingsStorage')->name('admin.settings.storage');
  48. Route::get('settings/system', 'AdminController@settingsSystem')->name('admin.settings.system');
  49. Route::get('instances', 'AdminController@instances')->name('admin.instances');
  50. Route::post('instances', 'AdminController@instanceScan');
  51. Route::get('instances/show/{id}', 'AdminController@instanceShow');
  52. Route::post('instances/edit/{id}', 'AdminController@instanceEdit');
  53. Route::get('apps/home', 'AdminController@appsHome')->name('admin.apps');
  54. Route::get('hashtags/home', 'AdminController@hashtagsHome')->name('admin.hashtags');
  55. Route::get('discover/home', 'AdminController@discoverHome')->name('admin.discover');
  56. Route::get('discover/category/create', 'AdminController@discoverCreateCategory')->name('admin.discover.create-category');
  57. Route::post('discover/category/create', 'AdminController@discoverCreateCategoryStore');
  58. Route::get('discover/category/edit/{id}', 'AdminController@discoverCategoryEdit');
  59. Route::post('discover/category/edit/{id}', 'AdminController@discoverCategoryUpdate');
  60. Route::post('discover/category/hashtag/create', 'AdminController@discoveryCategoryTagStore')->name('admin.discover.create-hashtag');
  61. Route::get('messages/home', 'AdminController@messagesHome')->name('admin.messages');
  62. Route::get('messages/show/{id}', 'AdminController@messagesShow');
  63. Route::post('messages/mark-read', 'AdminController@messagesMarkRead');
  64. Route::redirect('site-news', '/i/admin/newsroom');
  65. Route::get('newsroom', 'AdminController@newsroomHome')->name('admin.newsroom.home');
  66. Route::get('newsroom/create', 'AdminController@newsroomCreate')->name('admin.newsroom.create');
  67. Route::get('newsroom/edit/{id}', 'AdminController@newsroomEdit');
  68. Route::post('newsroom/edit/{id}', 'AdminController@newsroomUpdate');
  69. Route::delete('newsroom/edit/{id}', 'AdminController@newsroomDelete');
  70. Route::post('newsroom/create', 'AdminController@newsroomStore');
  71. });
  72. Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofactor', 'localization'])->group(function () {
  73. Route::get('/', 'SiteController@home')->name('timeline.personal');
  74. Route::post('/', 'StatusController@store');
  75. Auth::routes();
  76. Route::get('.well-known/webfinger', 'FederationController@webfinger')->name('well-known.webfinger');
  77. Route::get('.well-known/nodeinfo', 'FederationController@nodeinfoWellKnown')->name('well-known.nodeinfo');
  78. Route::get('.well-known/host-meta', 'FederationController@hostMeta')->name('well-known.hostMeta');
  79. Route::redirect('.well-known/change-password', '/settings/password');
  80. Route::get('/home', 'HomeController@index')->name('home');
  81. Route::get('discover/c/{slug}', 'DiscoverController@showCategory');
  82. Route::redirect('discover/personal', '/discover');
  83. Route::get('discover', 'DiscoverController@home')->name('discover');
  84. Route::get('discover/loops', 'DiscoverController@showLoops');
  85. Route::get('discover/profiles', 'DiscoverController@profilesDirectory')->name('discover.profiles');
  86. Route::group(['prefix' => 'api'], function () {
  87. Route::get('search', 'SearchController@searchAPI');
  88. Route::get('nodeinfo/2.0.json', 'FederationController@nodeinfo');
  89. Route::group(['prefix' => 'v2'], function() {
  90. Route::get('config', 'ApiController@siteConfiguration');
  91. Route::get('discover', 'InternalApiController@discover');
  92. Route::get('discover/posts', 'InternalApiController@discoverPosts')->middleware('auth:api');
  93. Route::get('profile/{username}/status/{postid}', 'PublicApiController@status');
  94. Route::get('comments/{username}/status/{postId}', 'PublicApiController@statusComments');
  95. Route::get('likes/profile/{username}/status/{id}', 'PublicApiController@statusLikes');
  96. Route::get('shares/profile/{username}/status/{id}', 'PublicApiController@statusShares');
  97. Route::get('status/{id}/replies', 'InternalApiController@statusReplies');
  98. Route::post('moderator/action', 'InternalApiController@modAction');
  99. Route::get('discover/categories', 'InternalApiController@discoverCategories');
  100. Route::get('loops', 'DiscoverController@loopsApi');
  101. Route::post('loops/watch', 'DiscoverController@loopWatch');
  102. Route::get('discover/tag', 'DiscoverController@getHashtags');
  103. Route::post('status/compose', 'InternalApiController@composePost')->middleware('throttle:maxPostsPerHour,60')->middleware('throttle:maxPostsPerDay,1440');
  104. });
  105. Route::group(['prefix' => 'pixelfed'], function() {
  106. Route::group(['prefix' => 'v1'], function() {
  107. Route::get('accounts/verify_credentials', 'ApiController@verifyCredentials');
  108. Route::get('accounts/relationships', 'Api\ApiV1Controller@accountRelationshipsById');
  109. Route::get('accounts/search', 'Api\ApiV1Controller@accountSearch');
  110. Route::get('accounts/{id}/statuses', 'PublicApiController@accountStatuses');
  111. Route::get('accounts/{id}/following', 'PublicApiController@accountFollowing');
  112. Route::get('accounts/{id}/followers', 'PublicApiController@accountFollowers');
  113. Route::post('accounts/{id}/block', 'Api\ApiV1Controller@accountBlockById');
  114. Route::post('accounts/{id}/unblock', 'Api\ApiV1Controller@accountUnblockById');
  115. Route::get('accounts/{id}', 'PublicApiController@account');
  116. Route::post('avatar/update', 'ApiController@avatarUpdate');
  117. Route::get('custom_emojis', 'Api\ApiV1Controller@customEmojis');
  118. Route::get('likes', 'ApiController@hydrateLikes');
  119. Route::post('media', 'ApiController@uploadMedia');
  120. Route::delete('media', 'ApiController@deleteMedia');
  121. Route::get('notifications', 'ApiController@notifications');
  122. Route::get('timelines/public', 'PublicApiController@publicTimelineApi');
  123. Route::get('timelines/home', 'PublicApiController@homeTimelineApi');
  124. Route::get('newsroom/timeline', 'NewsroomController@timelineApi');
  125. Route::post('newsroom/markasread', 'NewsroomController@markAsRead');
  126. });
  127. Route::group(['prefix' => 'v2'], function() {
  128. Route::get('config', 'ApiController@siteConfiguration');
  129. Route::get('discover', 'InternalApiController@discover');
  130. Route::get('discover/posts', 'InternalApiController@discoverPosts');
  131. Route::get('discover/profiles', 'DiscoverController@profilesDirectoryApi');
  132. Route::get('profile/{username}/status/{postid}', 'PublicApiController@status');
  133. Route::get('comments/{username}/status/{postId}', 'PublicApiController@statusComments');
  134. Route::get('likes/profile/{username}/status/{id}', 'PublicApiController@statusLikes');
  135. Route::get('shares/profile/{username}/status/{id}', 'PublicApiController@statusShares');
  136. Route::get('status/{id}/replies', 'InternalApiController@statusReplies');
  137. Route::post('moderator/action', 'InternalApiController@modAction');
  138. Route::get('discover/categories', 'InternalApiController@discoverCategories');
  139. Route::get('loops', 'DiscoverController@loopsApi');
  140. Route::post('loops/watch', 'DiscoverController@loopWatch');
  141. Route::get('discover/tag', 'DiscoverController@getHashtags');
  142. Route::post('status/compose', 'InternalApiController@composePost')->middleware('throttle:maxPostsPerHour,60')->middleware('throttle:maxPostsPerDay,1440');
  143. });
  144. });
  145. Route::group(['prefix' => 'local'], function () {
  146. // Route::get('accounts/verify_credentials', 'ApiController@verifyCredentials');
  147. // Route::get('accounts/relationships', 'PublicApiController@relationships');
  148. // Route::get('accounts/{id}/statuses', 'PublicApiController@accountStatuses');
  149. // Route::get('accounts/{id}/following', 'PublicApiController@accountFollowing');
  150. // Route::get('accounts/{id}/followers', 'PublicApiController@accountFollowers');
  151. // Route::get('accounts/{id}', 'PublicApiController@account');
  152. // Route::post('avatar/update', 'ApiController@avatarUpdate');
  153. // Route::get('likes', 'ApiController@hydrateLikes');
  154. // Route::post('media', 'ApiController@uploadMedia');
  155. // Route::delete('media', 'ApiController@deleteMedia');
  156. // Route::get('notifications', 'ApiController@notifications');
  157. // Route::get('timelines/public', 'PublicApiController@publicTimelineApi');
  158. // Route::get('timelines/home', 'PublicApiController@homeTimelineApi');
  159. Route::post('status/compose', 'InternalApiController@composePost')->middleware('throttle:maxPostsPerHour,60')->middleware('throttle:maxPostsPerDay,1440');
  160. Route::get('exp/rec', 'ApiController@userRecommendations');
  161. Route::post('discover/tag/subscribe', 'HashtagFollowController@store')->middleware('throttle:maxHashtagFollowsPerHour,60')->middleware('throttle:maxHashtagFollowsPerDay,1440');;
  162. Route::get('discover/tag/list', 'HashtagFollowController@getTags');
  163. // Route::get('profile/sponsor/{id}', 'ProfileSponsorController@get');
  164. Route::get('bookmarks', 'InternalApiController@bookmarks');
  165. Route::get('collection/items/{id}', 'CollectionController@getItems');
  166. Route::post('collection/item', 'CollectionController@storeId');
  167. Route::delete('collection/item', 'CollectionController@deleteId');
  168. Route::get('collection/{id}', 'CollectionController@get');
  169. Route::post('collection/{id}', 'CollectionController@store');
  170. Route::delete('collection/{id}', 'CollectionController@delete')->middleware('throttle:maxCollectionsPerHour,60')->middleware('throttle:maxCollectionsPerDay,1440')->middleware('throttle:maxCollectionsPerMonth,43800');
  171. Route::post('collection/{id}/publish', 'CollectionController@publish')->middleware('throttle:maxCollectionsPerHour,60')->middleware('throttle:maxCollectionsPerDay,1440')->middleware('throttle:maxCollectionsPerMonth,43800');
  172. Route::get('profile/collections/{id}', 'CollectionController@getUserCollections');
  173. Route::post('compose/media/update/{id}', 'MediaController@composeUpdate')->middleware('throttle:maxComposeMediaUpdatesPerHour,60')->middleware('throttle:maxComposeMediaUpdatesPerDay,1440')->middleware('throttle:maxComposeMediaUpdatesPerMonth,43800');
  174. Route::get('compose/location/search', 'ApiController@composeLocationSearch');
  175. });
  176. Route::group(['prefix' => 'admin'], function () {
  177. Route::post('moderate', 'Api\AdminApiController@moderate');
  178. });
  179. Route::group(['prefix' => 'stories'], function () {
  180. Route::get('v0/recent', 'StoryController@apiV1Recent');
  181. Route::post('v0/add', 'StoryController@apiV1Add')->middleware('throttle:maxStoriesPerDay,1440');
  182. Route::get('v0/fetch/{id}', 'StoryController@apiV1Fetch');
  183. Route::get('v0/profile/{id}', 'StoryController@apiV1Profile');
  184. Route::get('v0/exists/{id}', 'StoryController@apiV1Exists');
  185. Route::delete('v0/delete/{id}', 'StoryController@apiV1Delete')->middleware('throttle:maxStoryDeletePerDay,1440');
  186. Route::get('v0/me', 'StoryController@apiV1Me');
  187. Route::get('v0/item/{id}', 'StoryController@apiV1Item');
  188. });
  189. });
  190. Route::get('discover/tags/{hashtag}', 'DiscoverController@showTags');
  191. Route::get('discover/places', 'PlaceController@directoryHome')->name('discover.places');
  192. Route::get('discover/places/{id}/{slug}', 'PlaceController@show');
  193. Route::get('discover/location/country/{country}', 'PlaceController@directoryCities');
  194. Route::group(['prefix' => 'i'], function () {
  195. Route::redirect('/', '/');
  196. Route::get('compose', 'StatusController@compose')->name('compose');
  197. Route::post('comment', 'CommentController@store')->middleware('throttle:maxCommentsPerHour,60')->middleware('throttle:maxCommentsPerDay,1440');
  198. Route::post('delete', 'StatusController@delete');
  199. Route::post('mute', 'AccountController@mute');
  200. Route::post('unmute', 'AccountController@unmute');
  201. Route::post('block', 'AccountController@block');
  202. Route::post('unblock', 'AccountController@unblock');
  203. Route::post('like', 'LikeController@store')->middleware('throttle:maxLikesPerHour,60')->middleware('throttle:maxLikesPerDay,1440');
  204. Route::post('share', 'StatusController@storeShare')->middleware('throttle:maxSharesPerHour,60')->middleware('throttle:maxSharesPerDay,1440');
  205. Route::post('follow', 'FollowerController@store');
  206. Route::post('bookmark', 'BookmarkController@store');
  207. Route::get('lang/{locale}', 'SiteController@changeLocale');
  208. Route::get('restored', 'AccountController@accountRestored');
  209. Route::get('verify-email', 'AccountController@verifyEmail');
  210. Route::post('verify-email', 'AccountController@sendVerifyEmail');
  211. Route::get('confirm-email/{userToken}/{randomToken}', 'AccountController@confirmVerifyEmail');
  212. Route::get('auth/sudo', 'AccountController@sudoMode');
  213. Route::post('auth/sudo', 'AccountController@sudoModeVerify');
  214. Route::get('auth/checkpoint', 'AccountController@twoFactorCheckpoint');
  215. Route::post('auth/checkpoint', 'AccountController@twoFactorVerify');
  216. Route::get('media/preview/{profileId}/{mediaId}/{timestamp}', 'ApiController@showTempMedia')->name('temp-media');
  217. Route::get('results', 'SearchController@results');
  218. Route::post('visibility', 'StatusController@toggleVisibility');
  219. Route::post('metro/dark-mode', 'SettingsController@metroDarkMode');
  220. Route::group(['prefix' => 'report'], function () {
  221. Route::get('/', 'ReportController@showForm')->name('report.form');
  222. Route::post('/', 'ReportController@formStore');
  223. Route::get('not-interested', 'ReportController@notInterestedForm')->name('report.not-interested');
  224. Route::get('spam', 'ReportController@spamForm')->name('report.spam');
  225. Route::get('spam/comment', 'ReportController@spamCommentForm')->name('report.spam.comment');
  226. Route::get('spam/post', 'ReportController@spamPostForm')->name('report.spam.post');
  227. Route::get('spam/profile', 'ReportController@spamProfileForm')->name('report.spam.profile');
  228. Route::get('sensitive/comment', 'ReportController@sensitiveCommentForm')->name('report.sensitive.comment');
  229. Route::get('sensitive/post', 'ReportController@sensitivePostForm')->name('report.sensitive.post');
  230. Route::get('sensitive/profile', 'ReportController@sensitiveProfileForm')->name('report.sensitive.profile');
  231. Route::get('abusive/comment', 'ReportController@abusiveCommentForm')->name('report.abusive.comment');
  232. Route::get('abusive/post', 'ReportController@abusivePostForm')->name('report.abusive.post');
  233. Route::get('abusive/profile', 'ReportController@abusiveProfileForm')->name('report.abusive.profile');
  234. });
  235. Route::get('collections/create', 'CollectionController@create');
  236. Route::get('me', 'ProfileController@meRedirect');
  237. Route::get('intent/follow', 'SiteController@followIntent');
  238. Route::post('stories/viewed', 'StoryController@apiV1Viewed');
  239. Route::get('stories/new', 'StoryController@compose');
  240. Route::get('my/story', 'StoryController@iRedirect');
  241. });
  242. Route::group(['prefix' => 'account'], function () {
  243. Route::redirect('/', '/');
  244. Route::get('activity', 'AccountController@notifications')->name('notifications');
  245. Route::get('follow-requests', 'AccountController@followRequests')->name('follow-requests');
  246. Route::post('follow-requests', 'AccountController@followRequestHandle');
  247. });
  248. Route::group(['prefix' => 'settings'], function () {
  249. Route::redirect('/', '/settings/home');
  250. Route::get('home', 'SettingsController@home')
  251. ->name('settings');
  252. Route::post('home', 'SettingsController@homeUpdate');
  253. Route::get('avatar', 'SettingsController@avatar')->name('settings.avatar');
  254. Route::post('avatar', 'AvatarController@store');
  255. Route::delete('avatar', 'AvatarController@deleteAvatar');
  256. Route::get('password', 'SettingsController@password')->name('settings.password')->middleware('dangerzone');
  257. Route::post('password', 'SettingsController@passwordUpdate')->middleware('dangerzone');
  258. Route::get('email', 'SettingsController@email')->name('settings.email');
  259. Route::post('email', 'SettingsController@emailUpdate');
  260. Route::get('notifications', 'SettingsController@notifications')->name('settings.notifications');
  261. Route::get('privacy', 'SettingsController@privacy')->name('settings.privacy');
  262. Route::post('privacy', 'SettingsController@privacyStore');
  263. Route::get('privacy/muted-users', 'SettingsController@mutedUsers')->name('settings.privacy.muted-users');
  264. Route::post('privacy/muted-users', 'SettingsController@mutedUsersUpdate');
  265. Route::get('privacy/blocked-users', 'SettingsController@blockedUsers')->name('settings.privacy.blocked-users');
  266. Route::post('privacy/blocked-users', 'SettingsController@blockedUsersUpdate');
  267. Route::get('privacy/blocked-instances', 'SettingsController@blockedInstances')->name('settings.privacy.blocked-instances');
  268. Route::post('privacy/blocked-instances', 'SettingsController@blockedInstanceStore')->middleware('throttle:maxInstanceBansPerDay,1440');
  269. Route::post('privacy/blocked-instances/unblock', 'SettingsController@blockedInstanceUnblock')->name('settings.privacy.blocked-instances.unblock');
  270. Route::get('privacy/blocked-keywords', 'SettingsController@blockedKeywords')->name('settings.privacy.blocked-keywords');
  271. Route::post('privacy/account', 'SettingsController@privateAccountOptions')->name('settings.privacy.account');
  272. Route::get('reports', 'SettingsController@reportsHome')->name('settings.reports');
  273. Route::group(['prefix' => 'remove', 'middleware' => 'dangerzone'], function() {
  274. Route::get('request/temporary', 'SettingsController@removeAccountTemporary')->name('settings.remove.temporary');
  275. Route::post('request/temporary', 'SettingsController@removeAccountTemporarySubmit');
  276. Route::get('request/permanent', 'SettingsController@removeAccountPermanent')->name('settings.remove.permanent');
  277. Route::post('request/permanent', 'SettingsController@removeAccountPermanentSubmit');
  278. });
  279. Route::group(['prefix' => 'security', 'middleware' => 'dangerzone'], function() {
  280. Route::get(
  281. '/',
  282. 'SettingsController@security'
  283. )->name('settings.security');
  284. Route::get(
  285. '2fa/setup',
  286. 'SettingsController@securityTwoFactorSetup'
  287. )->name('settings.security.2fa.setup');
  288. Route::post(
  289. '2fa/setup',
  290. 'SettingsController@securityTwoFactorSetupStore'
  291. );
  292. Route::get(
  293. '2fa/edit',
  294. 'SettingsController@securityTwoFactorEdit'
  295. )->name('settings.security.2fa.edit');
  296. Route::post(
  297. '2fa/edit',
  298. 'SettingsController@securityTwoFactorUpdate'
  299. );
  300. Route::get(
  301. '2fa/recovery-codes',
  302. 'SettingsController@securityTwoFactorRecoveryCodes'
  303. )->name('settings.security.2fa.recovery');
  304. Route::post(
  305. '2fa/recovery-codes',
  306. 'SettingsController@securityTwoFactorRecoveryCodesRegenerate'
  307. );
  308. });
  309. Route::get('applications', 'SettingsController@applications')->name('settings.applications')->middleware('dangerzone');
  310. Route::get('data-export', 'SettingsController@dataExport')->name('settings.dataexport')->middleware('dangerzone');
  311. Route::post('data-export/following', 'SettingsController@exportFollowing')->middleware('dangerzone');
  312. Route::post('data-export/followers', 'SettingsController@exportFollowers')->middleware('dangerzone');
  313. Route::post('data-export/mute-block-list', 'SettingsController@exportMuteBlockList')->middleware('dangerzone');
  314. Route::post('data-export/account', 'SettingsController@exportAccount')->middleware('dangerzone');
  315. Route::post('data-export/statuses', 'SettingsController@exportStatuses')->middleware('dangerzone');
  316. Route::get('developers', 'SettingsController@developers')->name('settings.developers')->middleware('dangerzone');
  317. Route::get('labs', 'SettingsController@labs')->name('settings.labs');
  318. Route::post('labs', 'SettingsController@labsStore');
  319. Route::get('accessibility', 'SettingsController@accessibility')->name('settings.accessibility');
  320. Route::post('accessibility', 'SettingsController@accessibilityStore');
  321. Route::group(['prefix' => 'relationships'], function() {
  322. Route::redirect('/', '/settings/relationships/home');
  323. Route::get('home', 'SettingsController@relationshipsHome')->name('settings.relationships');
  324. });
  325. Route::get('invites/create', 'UserInviteController@create')->name('settings.invites.create');
  326. Route::post('invites/create', 'UserInviteController@store');
  327. Route::get('invites', 'UserInviteController@show')->name('settings.invites');
  328. // Route::get('sponsor', 'SettingsController@sponsor')->name('settings.sponsor');
  329. // Route::post('sponsor', 'SettingsController@sponsorStore');
  330. });
  331. Route::group(['prefix' => 'site'], function () {
  332. Route::redirect('/', '/');
  333. Route::get('about', 'SiteController@about')->name('site.about');
  334. Route::view('help', 'site.help')->name('site.help');
  335. Route::view('developer-api', 'site.developer')->name('site.developers');
  336. Route::view('fediverse', 'site.fediverse')->name('site.fediverse');
  337. Route::view('open-source', 'site.opensource')->name('site.opensource');
  338. Route::view('banned-instances', 'site.bannedinstances')->name('site.bannedinstances');
  339. Route::get('terms', 'SiteController@terms')->name('site.terms');
  340. Route::get('privacy', 'SiteController@privacy')->name('site.privacy');
  341. Route::view('platform', 'site.platform')->name('site.platform');
  342. Route::view('language', 'site.language')->name('site.language');
  343. Route::get('contact', 'ContactController@show')->name('site.contact');
  344. Route::post('contact', 'ContactController@store');
  345. Route::group(['prefix'=>'kb'], function() {
  346. Route::view('getting-started', 'site.help.getting-started')->name('help.getting-started');
  347. Route::view('sharing-media', 'site.help.sharing-media')->name('help.sharing-media');
  348. Route::view('your-profile', 'site.help.your-profile')->name('help.your-profile');
  349. Route::view('stories', 'site.help.stories')->name('help.stories');
  350. Route::view('embed', 'site.help.embed')->name('help.embed');
  351. Route::view('hashtags', 'site.help.hashtags')->name('help.hashtags');
  352. Route::view('discover', 'site.help.discover')->name('help.discover');
  353. Route::view('direct-messages', 'site.help.dm')->name('help.dm');
  354. Route::view('timelines', 'site.help.timelines')->name('help.timelines');
  355. Route::view('what-is-the-fediverse', 'site.help.what-is-fediverse')->name('help.what-is-fediverse');
  356. Route::view('safety-tips', 'site.help.safety-tips')->name('help.safety-tips');
  357. Route::get('community-guidelines', 'SiteController@communityGuidelines')->name('help.community-guidelines');
  358. Route::view('controlling-visibility', 'site.help.controlling-visibility')->name('help.controlling-visibility');
  359. Route::view('blocking-accounts', 'site.help.blocking-accounts')->name('help.blocking-accounts');
  360. Route::view('report-something', 'site.help.report-something')->name('help.report-something');
  361. Route::view('data-policy', 'site.help.data-policy')->name('help.data-policy');
  362. });
  363. Route::get('newsroom/{year}/{month}/{slug}', 'NewsroomController@show');
  364. Route::get('newsroom/archive', 'NewsroomController@archive');
  365. Route::get('newsroom/search', 'NewsroomController@search');
  366. Route::get('newsroom', 'NewsroomController@index');
  367. });
  368. Route::group(['prefix' => 'timeline'], function () {
  369. Route::redirect('/', '/');
  370. Route::get('public', 'TimelineController@local')->name('timeline.public');
  371. });
  372. Route::group(['prefix' => 'users'], function () {
  373. Route::redirect('/', '/');
  374. Route::get('{user}.atom', 'ProfileController@showAtomFeed');
  375. Route::get('{username}/outbox', 'FederationController@userOutbox');
  376. Route::get('{username}/followers', 'FederationController@userFollowers');
  377. Route::get('{username}/following', 'FederationController@userFollowing');
  378. Route::get('{username}', 'ProfileController@permalinkRedirect');
  379. });
  380. Route::get('stories/{username}', 'ProfileController@stories');
  381. Route::get('c/{collection}', 'CollectionController@show');
  382. Route::get('p/{username}/{id}/c', 'CommentController@showAll');
  383. Route::get('p/{username}/{id}/embed', 'StatusController@showEmbed');
  384. Route::get('p/{username}/{id}/edit', 'StatusController@edit');
  385. Route::post('p/{username}/{id}/edit', 'StatusController@editStore')->middleware('throttle:maxPostEditsPerHour,60')->middleware('throttle:maxPostEditsPerDay,1440');
  386. Route::get('p/{username}/{id}.json', 'StatusController@showObject');
  387. Route::get('p/{username}/{id}', 'StatusController@show');
  388. Route::get('{username}/embed', 'ProfileController@embed');
  389. Route::get('{username}', 'ProfileController@show');
  390. });