1
0
Fork 0
pixelfed/routes/web.php

307 lines
19 KiB
PHP
Raw Normal View History

2018-04-15 23:56:48 +00:00
<?php
2018-08-28 03:07:36 +00:00
Route::domain(config('pixelfed.domain.admin'))->prefix('i/admin')->group(function () {
Route::redirect('/', '/dashboard');
Route::redirect('timeline', config('app.url').'/timeline');
Route::get('dashboard', 'AdminController@home')->name('admin.home');
2018-09-01 02:26:56 +00:00
Route::get('reports', 'AdminController@reports')->name('admin.reports');
Route::get('reports/show/{id}', 'AdminController@showReport');
Route::post('reports/show/{id}', 'AdminController@updateReport');
2018-09-02 03:50:27 +00:00
Route::post('reports/bulk', 'AdminController@bulkUpdateReport');
2018-08-28 03:07:36 +00:00
Route::redirect('statuses', '/statuses/list');
Route::get('statuses/list', 'AdminController@statuses')->name('admin.statuses');
Route::get('statuses/show/{id}', 'AdminController@showStatus');
2019-02-11 05:04:09 +00:00
Route::redirect('profiles', '/i/admin/profiles/list');
Route::get('profiles/list', 'AdminController@profiles')->name('admin.profiles');
2019-02-12 08:11:26 +00:00
Route::get('profiles/edit/{id}', 'AdminController@profileShow');
2018-08-28 03:07:36 +00:00
Route::redirect('users', '/users/list');
Route::get('users/list', 'AdminController@users')->name('admin.users');
2018-09-03 01:25:33 +00:00
Route::get('users/edit/{id}', 'AdminController@editUser');
2019-02-11 05:04:09 +00:00
Route::get('media', 'AdminController@media')->name('admin.media');
Route::redirect('media/list', '/i/admin/media');
Route::get('media/show/{id}', 'AdminController@mediaShow');
Route::get('settings', 'AdminController@settings')->name('admin.settings');
Route::post('settings', 'AdminController@settingsHomeStore');
Route::get('settings/config', 'AdminController@settingsConfig')->name('admin.settings.config');
Route::get('settings/features', 'AdminController@settingsFeatures')->name('admin.settings.features');
Route::get('settings/pages', 'AdminController@settingsPages')->name('admin.settings.pages');
Route::get('settings/pages/edit', 'PageController@edit')->name('admin.settings.pages.edit');
Route::post('settings/pages/edit', 'PageController@store');
Route::get('settings/maintenance', 'AdminController@settingsMaintenance')->name('admin.settings.maintenance');
Route::get('settings/backups', 'AdminController@settingsBackups')->name('admin.settings.backups');
Route::get('settings/storage', 'AdminController@settingsStorage')->name('admin.settings.storage');
Route::get('settings/system', 'AdminController@settingsSystem')->name('admin.settings.system');
Route::get('instances', 'AdminController@instances')->name('admin.instances');
Route::post('instances', 'AdminController@instanceScan');
Route::get('instances/show/{id}', 'AdminController@instanceShow');
Route::post('instances/edit/{id}', 'AdminController@instanceEdit');
Route::get('apps/home', 'AdminController@appsHome')->name('admin.apps');
Route::get('hashtags/home', 'AdminController@hashtagsHome')->name('admin.hashtags');
Route::get('discover/home', 'AdminController@discoverHome')->name('admin.discover');
Route::get('discover/category/create', 'AdminController@discoverCreateCategory')->name('admin.discover.create-category');
Route::post('discover/category/create', 'AdminController@discoverCreateCategoryStore');
Route::get('discover/category/edit/{id}', 'AdminController@discoverCategoryEdit');
Route::post('discover/category/edit/{id}', 'AdminController@discoverCategoryUpdate');
Route::post('discover/category/hashtag/create', 'AdminController@discoveryCategoryTagStore')->name('admin.discover.create-hashtag');
2018-04-15 23:56:48 +00:00
});
2018-04-16 00:00:49 +00:00
Route::domain(config('pixelfed.domain.app'))->middleware(['validemail', 'twofactor', 'localization'])->group(function () {
2018-08-28 03:07:36 +00:00
Route::get('/', 'SiteController@home')->name('timeline.personal');
2019-01-07 03:29:46 +00:00
Route::post('/', 'StatusController@store');
2018-06-01 03:35:22 +00:00
2018-08-28 03:07:36 +00:00
Auth::routes();
2018-06-01 03:35:22 +00:00
2018-11-09 01:32:08 +00:00
Route::get('.well-known/webfinger', 'FederationController@webfinger')->name('well-known.webfinger');
Route::get('.well-known/nodeinfo', 'FederationController@nodeinfoWellKnown')->name('well-known.nodeinfo');
Route::get('.well-known/host-meta', 'FederationController@hostMeta')->name('well-known.hostMeta');
Route::redirect('.well-known/change-password', '/settings/password');
2018-06-01 03:35:22 +00:00
2018-08-28 03:07:36 +00:00
Route::get('/home', 'HomeController@index')->name('home');
2018-06-01 03:35:22 +00:00
2019-03-02 07:21:16 +00:00
Route::get('discover/c/{slug}', 'DiscoverController@showCategory');
Route::get('discover/personal', 'DiscoverController@showPersonal');
2018-08-28 03:07:36 +00:00
Route::get('discover', 'DiscoverController@home')->name('discover');
2019-05-26 00:56:21 +00:00
Route::get('discover/loops', 'DiscoverController@showLoops');
2019-03-02 07:21:16 +00:00
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'api'], function () {
2019-04-18 02:36:14 +00:00
Route::get('search', 'SearchController@searchAPI');
2018-08-28 03:07:36 +00:00
Route::get('nodeinfo/2.0.json', 'FederationController@nodeinfo');
Route::group(['prefix' => 'v1'], function () {
2018-12-11 03:41:41 +00:00
Route::get('accounts/verify_credentials', 'ApiController@verifyCredentials');
2019-02-14 01:46:37 +00:00
Route::get('accounts/relationships', 'PublicApiController@relationships');
2019-02-11 05:04:09 +00:00
Route::get('accounts/{id}/statuses', 'PublicApiController@accountStatuses');
2019-02-25 04:30:02 +00:00
Route::get('accounts/{id}/following', 'PublicApiController@accountFollowing');
Route::get('accounts/{id}/followers', 'PublicApiController@accountFollowers');
2019-02-14 01:46:37 +00:00
Route::get('accounts/{id}', 'PublicApiController@account');
2018-08-28 03:07:36 +00:00
Route::post('avatar/update', 'ApiController@avatarUpdate');
Route::get('likes', 'ApiController@hydrateLikes');
2019-01-07 03:29:46 +00:00
Route::post('media', 'ApiController@uploadMedia');
2019-02-28 04:12:14 +00:00
Route::delete('media', 'ApiController@deleteMedia');
2018-12-11 03:41:41 +00:00
Route::get('notifications', 'ApiController@notifications');
Route::get('timelines/public', 'PublicApiController@publicTimelineApi');
Route::get('timelines/home', 'PublicApiController@homeTimelineApi');
2019-04-18 04:22:48 +00:00
// Route::get('timelines/network', 'PublicApiController@homeTimelineApi');
2018-08-28 03:07:36 +00:00
});
2018-11-09 01:32:08 +00:00
Route::group(['prefix' => 'v2'], function() {
2019-03-25 03:34:54 +00:00
Route::get('config', 'ApiController@siteConfiguration');
2018-11-09 07:00:44 +00:00
Route::get('discover', 'InternalApiController@discover');
2018-11-27 09:17:27 +00:00
Route::get('discover/posts', 'InternalApiController@discoverPosts');
2018-11-20 02:47:34 +00:00
Route::get('profile/{username}/status/{postid}', 'PublicApiController@status');
Route::get('comments/{username}/status/{postId}', 'PublicApiController@statusComments');
2018-12-02 05:06:03 +00:00
Route::get('likes/profile/{username}/status/{id}', 'PublicApiController@statusLikes');
Route::get('shares/profile/{username}/status/{id}', 'PublicApiController@statusShares');
2018-12-11 05:42:53 +00:00
Route::get('status/{id}/replies', 'InternalApiController@statusReplies');
2019-02-11 05:04:09 +00:00
Route::post('moderator/action', 'InternalApiController@modAction');
2019-03-02 07:21:16 +00:00
Route::get('discover/categories', 'InternalApiController@discoverCategories');
2019-03-26 04:23:17 +00:00
Route::post('status/compose', 'InternalApiController@composePost');
2019-06-03 19:13:19 +00:00
Route::get('loops', 'DiscoverController@loopsApi');
Route::post('loops/watch', 'DiscoverController@loopWatch');
2018-11-09 01:32:08 +00:00
});
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'local'], function () {
Route::get('i/follow-suggestions', 'ApiController@followSuggestions');
2019-01-07 03:29:46 +00:00
Route::post('status/compose', 'InternalApiController@compose');
2019-04-28 23:02:49 +00:00
Route::get('exp/rec', 'ApiController@userRecommendations');
2018-08-28 03:07:36 +00:00
});
});
2018-06-01 03:35:22 +00:00
2018-08-28 03:07:36 +00:00
Route::get('discover/tags/{hashtag}', 'DiscoverController@showTags');
Route::group(['prefix' => 'i'], function () {
Route::redirect('/', '/');
Route::get('compose', 'StatusController@compose')->name('compose');
2019-01-07 03:29:46 +00:00
Route::post('comment', 'CommentController@store');
Route::post('delete', 'StatusController@delete');
2018-12-11 03:41:41 +00:00
Route::post('mute', 'AccountController@mute');
2019-04-08 03:10:00 +00:00
Route::post('unmute', 'AccountController@unmute');
2018-12-11 03:41:41 +00:00
Route::post('block', 'AccountController@block');
2019-04-08 03:10:00 +00:00
Route::post('unblock', 'AccountController@unblock');
2019-01-07 03:29:46 +00:00
Route::post('like', 'LikeController@store');
Route::post('share', 'StatusController@storeShare');
Route::post('follow', 'FollowerController@store');
Route::post('bookmark', 'BookmarkController@store');
2018-08-28 03:07:36 +00:00
Route::get('lang/{locale}', 'SiteController@changeLocale');
2018-12-25 06:02:29 +00:00
Route::get('restored', 'AccountController@accountRestored');
2018-09-17 01:54:35 +00:00
2018-08-28 03:07:36 +00:00
Route::get('verify-email', 'AccountController@verifyEmail');
2019-01-07 03:29:46 +00:00
Route::post('verify-email', 'AccountController@sendVerifyEmail');
Route::get('confirm-email/{userToken}/{randomToken}', 'AccountController@confirmVerifyEmail');
2018-08-28 03:07:36 +00:00
2018-09-10 05:12:51 +00:00
Route::get('auth/sudo', 'AccountController@sudoMode');
Route::post('auth/sudo', 'AccountController@sudoModeVerify');
2018-09-17 01:54:35 +00:00
Route::get('auth/checkpoint', 'AccountController@twoFactorCheckpoint');
Route::post('auth/checkpoint', 'AccountController@twoFactorVerify');
2018-09-10 05:12:51 +00:00
2018-10-23 01:53:24 +00:00
Route::get('media/preview/{profileId}/{mediaId}', 'ApiController@showTempMedia')->name('temp-media');
2019-04-03 04:56:18 +00:00
Route::get('results', 'SearchController@results');
Route::post('visibility', 'StatusController@toggleVisibility');
2018-10-23 01:53:24 +00:00
2019-04-22 05:44:02 +00:00
Route::post('metro/dark-mode', 'SettingsController@metroDarkMode');
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'report'], function () {
Route::get('/', 'ReportController@showForm')->name('report.form');
2019-01-07 03:29:46 +00:00
Route::post('/', 'ReportController@formStore');
2018-08-28 03:07:36 +00:00
Route::get('not-interested', 'ReportController@notInterestedForm')->name('report.not-interested');
Route::get('spam', 'ReportController@spamForm')->name('report.spam');
Route::get('spam/comment', 'ReportController@spamCommentForm')->name('report.spam.comment');
Route::get('spam/post', 'ReportController@spamPostForm')->name('report.spam.post');
Route::get('spam/profile', 'ReportController@spamProfileForm')->name('report.spam.profile');
Route::get('sensitive/comment', 'ReportController@sensitiveCommentForm')->name('report.sensitive.comment');
Route::get('sensitive/post', 'ReportController@sensitivePostForm')->name('report.sensitive.post');
Route::get('sensitive/profile', 'ReportController@sensitiveProfileForm')->name('report.sensitive.profile');
Route::get('abusive/comment', 'ReportController@abusiveCommentForm')->name('report.abusive.comment');
Route::get('abusive/post', 'ReportController@abusivePostForm')->name('report.abusive.post');
Route::get('abusive/profile', 'ReportController@abusiveProfileForm')->name('report.abusive.profile');
});
});
2018-06-01 03:35:22 +00:00
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'account'], function () {
Route::redirect('/', '/');
Route::get('activity', 'AccountController@notifications')->name('notifications');
2018-09-03 04:05:44 +00:00
Route::get('follow-requests', 'AccountController@followRequests')->name('follow-requests');
Route::post('follow-requests', 'AccountController@followRequestHandle');
2018-08-28 03:07:36 +00:00
});
2018-08-10 05:20:27 +00:00
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'settings'], function () {
Route::redirect('/', '/settings/home');
2018-09-17 01:54:35 +00:00
Route::get('home', 'SettingsController@home')
->name('settings');
2019-01-07 03:29:46 +00:00
Route::post('home', 'SettingsController@homeUpdate');
2018-08-28 03:07:36 +00:00
Route::get('avatar', 'SettingsController@avatar')->name('settings.avatar');
2018-12-26 22:51:53 +00:00
Route::post('avatar', 'AvatarController@store');
2019-04-06 22:46:06 +00:00
Route::delete('avatar', 'AvatarController@deleteAvatar');
2018-09-10 05:12:51 +00:00
Route::get('password', 'SettingsController@password')->name('settings.password')->middleware('dangerzone');
2019-01-07 03:29:46 +00:00
Route::post('password', 'SettingsController@passwordUpdate')->middleware('dangerzone');
2018-08-28 03:07:36 +00:00
Route::get('email', 'SettingsController@email')->name('settings.email');
Route::get('notifications', 'SettingsController@notifications')->name('settings.notifications');
Route::get('privacy', 'SettingsController@privacy')->name('settings.privacy');
2019-01-07 03:29:46 +00:00
Route::post('privacy', 'SettingsController@privacyStore');
2018-08-31 04:28:09 +00:00
Route::get('privacy/muted-users', 'SettingsController@mutedUsers')->name('settings.privacy.muted-users');
2019-01-07 03:29:46 +00:00
Route::post('privacy/muted-users', 'SettingsController@mutedUsersUpdate');
2018-08-31 04:28:09 +00:00
Route::get('privacy/blocked-users', 'SettingsController@blockedUsers')->name('settings.privacy.blocked-users');
2019-01-07 03:29:46 +00:00
Route::post('privacy/blocked-users', 'SettingsController@blockedUsersUpdate');
2018-08-31 04:28:09 +00:00
Route::get('privacy/blocked-instances', 'SettingsController@blockedInstances')->name('settings.privacy.blocked-instances');
2019-02-11 05:04:09 +00:00
Route::post('privacy/blocked-instances', 'SettingsController@blockedInstanceStore');
Route::post('privacy/blocked-instances/unblock', 'SettingsController@blockedInstanceUnblock')->name('settings.privacy.blocked-instances.unblock');
Route::get('privacy/blocked-keywords', 'SettingsController@blockedKeywords')->name('settings.privacy.blocked-keywords');
2018-09-17 01:54:35 +00:00
2019-02-11 05:04:09 +00:00
Route::get('reports', 'SettingsController@reportsHome')->name('settings.reports');
2018-12-24 00:12:08 +00:00
// Todo: Release in 0.7.2
2018-12-25 06:02:29 +00:00
Route::group(['prefix' => 'remove', 'middleware' => 'dangerzone'], function() {
Route::get('request/temporary', 'SettingsController@removeAccountTemporary')->name('settings.remove.temporary');
Route::post('request/temporary', 'SettingsController@removeAccountTemporarySubmit');
Route::get('request/permanent', 'SettingsController@removeAccountPermanent')->name('settings.remove.permanent');
Route::post('request/permanent', 'SettingsController@removeAccountPermanentSubmit');
});
2018-12-21 06:18:48 +00:00
2018-09-17 01:54:35 +00:00
Route::group(['prefix' => 'security', 'middleware' => 'dangerzone'], function() {
Route::get(
'/',
'SettingsController@security'
)->name('settings.security');
Route::get(
'2fa/setup',
'SettingsController@securityTwoFactorSetup'
)->name('settings.security.2fa.setup');
Route::post(
'2fa/setup',
'SettingsController@securityTwoFactorSetupStore'
);
Route::get(
'2fa/edit',
'SettingsController@securityTwoFactorEdit'
)->name('settings.security.2fa.edit');
Route::post(
'2fa/edit',
'SettingsController@securityTwoFactorUpdate'
);
Route::get(
'2fa/recovery-codes',
'SettingsController@securityTwoFactorRecoveryCodes'
)->name('settings.security.2fa.recovery');
2018-12-28 04:33:15 +00:00
Route::post(
'2fa/recovery-codes',
'SettingsController@securityTwoFactorRecoveryCodesRegenerate'
);
2018-09-17 01:54:35 +00:00
});
2019-02-11 05:04:09 +00:00
Route::get('applications', 'SettingsController@applications')->name('settings.applications')->middleware('dangerzone');
2019-04-22 05:44:02 +00:00
Route::get('data-export', 'SettingsController@dataExport')->name('settings.dataexport')->middleware('dangerzone');
Route::post('data-export/following', 'SettingsController@exportFollowing')->middleware('dangerzone');
Route::post('data-export/followers', 'SettingsController@exportFollowers')->middleware('dangerzone');
Route::post('data-export/mute-block-list', 'SettingsController@exportMuteBlockList')->middleware('dangerzone');
2019-04-24 19:50:47 +00:00
Route::post('data-export/account', 'SettingsController@exportAccount')->middleware('dangerzone');
2019-04-25 03:08:35 +00:00
Route::post('data-export/statuses', 'SettingsController@exportStatuses')->middleware('dangerzone');
2019-02-11 05:04:09 +00:00
Route::get('developers', 'SettingsController@developers')->name('settings.developers')->middleware('dangerzone');
2019-04-28 23:02:49 +00:00
Route::get('labs', 'SettingsController@labs')->name('settings.labs');
Route::post('labs', 'SettingsController@labsStore');
2019-06-13 02:21:32 +00:00
Route::group(['prefix' => 'relationships'], function() {
Route::redirect('/', '/settings/relationships/home');
Route::get('home', 'SettingsController@relationshipsHome')->name('settings.relationships');
});
2018-08-10 05:20:27 +00:00
});
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'site'], function () {
Route::redirect('/', '/');
Route::get('about', 'SiteController@about')->name('site.about');
Route::view('help', 'site.help')->name('site.help');
Route::view('developer-api', 'site.developer')->name('site.developers');
Route::view('fediverse', 'site.fediverse')->name('site.fediverse');
Route::view('open-source', 'site.opensource')->name('site.opensource');
Route::view('banned-instances', 'site.bannedinstances')->name('site.bannedinstances');
Route::view('terms', 'site.terms')->name('site.terms');
Route::view('privacy', 'site.privacy')->name('site.privacy');
Route::view('platform', 'site.platform')->name('site.platform');
Route::view('language', 'site.language')->name('site.language');
2018-10-22 01:46:43 +00:00
Route::group(['prefix'=>'kb'], function() {
Route::view('getting-started', 'site.help.getting-started')->name('help.getting-started');
Route::view('sharing-media', 'site.help.sharing-media')->name('help.sharing-media');
Route::view('your-profile', 'site.help.your-profile')->name('help.your-profile');
Route::view('stories', 'site.help.stories')->name('help.stories');
Route::view('embed', 'site.help.embed')->name('help.embed');
Route::view('hashtags', 'site.help.hashtags')->name('help.hashtags');
Route::view('discover', 'site.help.discover')->name('help.discover');
Route::view('direct-messages', 'site.help.dm')->name('help.dm');
Route::view('timelines', 'site.help.timelines')->name('help.timelines');
Route::view('what-is-the-fediverse', 'site.help.what-is-fediverse')->name('help.what-is-fediverse');
Route::view('safety-tips', 'site.help.safety-tips')->name('help.safety-tips');
2019-02-11 05:04:09 +00:00
Route::get('community-guidelines', 'SiteController@communityGuidelines')->name('help.community-guidelines');
2018-10-22 01:46:43 +00:00
Route::view('controlling-visibility', 'site.help.controlling-visibility')->name('help.controlling-visibility');
Route::view('blocking-accounts', 'site.help.blocking-accounts')->name('help.blocking-accounts');
Route::view('report-something', 'site.help.report-something')->name('help.report-something');
Route::view('data-policy', 'site.help.data-policy')->name('help.data-policy');
});
2018-08-10 05:20:27 +00:00
});
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'timeline'], function () {
Route::redirect('/', '/');
Route::get('public', 'TimelineController@local')->name('timeline.public');
Route::post('public', 'StatusController@store');
2019-04-18 04:22:48 +00:00
// Route::get('network', 'TimelineController@network')->name('timeline.network');
2018-06-01 03:35:22 +00:00
});
2018-08-10 05:20:27 +00:00
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'users'], function () {
Route::redirect('/', '/');
Route::get('{user}.atom', 'ProfileController@showAtomFeed');
Route::get('{username}/outbox', 'FederationController@userOutbox');
Route::get('{username}', 'ProfileController@permalinkRedirect');
2018-11-09 01:32:08 +00:00
Route::get('{username}/followers', 'FederationController@userFollowers');
Route::get('{username}/following', 'FederationController@userFollowing');
2018-08-28 03:07:36 +00:00
});
Route::get('p/{username}/{id}/c/{cid}', 'CommentController@show');
Route::get('p/{username}/{id}/c', 'CommentController@showAll');
Route::get('p/{username}/{id}/edit', 'StatusController@edit');
Route::post('p/{username}/{id}/edit', 'StatusController@editStore');
Route::get('p/{username}/{id}', 'StatusController@show');
Route::get('{username}/saved', 'ProfileController@savedBookmarks');
2018-10-21 03:22:15 +00:00
Route::get('{username}/followers', 'ProfileController@followers')->middleware('auth');
Route::get('{username}/following', 'ProfileController@following')->middleware('auth');
2018-08-28 03:07:36 +00:00
Route::get('{username}', 'ProfileController@show');
});