pixelfed/routes/web.php

152 lines
9.1 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');
Route::redirect('users', '/users/list');
Route::get('users/list', 'AdminController@users')->name('admin.users');
Route::redirect('media', '/media/list');
Route::get('media/list', 'AdminController@media')->name('admin.media');
2018-04-15 23:56:48 +00:00
});
2018-04-16 00:00:49 +00:00
2018-08-28 03:07:36 +00:00
Route::domain(config('pixelfed.domain.app'))->middleware('validemail')->group(function () {
Route::get('/', 'SiteController@home')->name('timeline.personal');
2018-08-31 06:21:05 +00:00
Route::post('/', 'StatusController@store')->middleware('throttle:500,1440');
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-08-28 03:07:36 +00:00
Route::get('.well-known/webfinger', 'FederationController@webfinger');
Route::get('.well-known/nodeinfo', 'FederationController@nodeinfoWellKnown');
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
2018-08-28 03:07:36 +00:00
Route::get('discover', 'DiscoverController@home')->name('discover');
2018-06-01 03:35:22 +00:00
2018-08-28 03:07:36 +00:00
Route::get('search/hashtag/{tag}', function ($tag) {
return redirect('/discover/tags/'.$tag);
});
2018-06-01 03:35:22 +00:00
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'api'], function () {
Route::get('search/{tag}', 'SearchController@searchAPI')
->where('tag', '[A-Za-z0-9]+');
Route::get('nodeinfo/2.0.json', 'FederationController@nodeinfo');
Route::group(['prefix' => 'v1'], function () {
Route::post('avatar/update', 'ApiController@avatarUpdate');
Route::get('likes', 'ApiController@hydrateLikes');
});
Route::group(['prefix' => 'local'], function () {
Route::get('i/follow-suggestions', 'ApiController@followSuggestions');
Route::post('i/more-comments', 'ApiController@loadMoreComments');
});
});
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');
2018-08-31 06:21:05 +00:00
Route::post('comment', 'CommentController@store')->middleware('throttle:1000,1440');
Route::post('delete', 'StatusController@delete')->middleware('throttle:1000,1440');
Route::post('mute', 'AccountController@mute')->middleware('throttle:100,1440');
Route::post('block', 'AccountController@block')->middleware('throttle:100,1440');
Route::post('like', 'LikeController@store')->middleware('throttle:1000,1440');
Route::post('share', 'StatusController@storeShare')->middleware('throttle:1000,1440');
Route::post('follow', 'FollowerController@store')->middleware('throttle:250,1440');
Route::post('bookmark', 'BookmarkController@store')->middleware('throttle:250,1440');
2018-08-28 03:07:36 +00:00
Route::get('lang/{locale}', 'SiteController@changeLocale');
Route::get('verify-email', 'AccountController@verifyEmail');
2018-08-31 06:21:05 +00:00
Route::post('verify-email', 'AccountController@sendVerifyEmail')->middleware('throttle:10,1440');
Route::get('confirm-email/{userToken}/{randomToken}', 'AccountController@confirmVerifyEmail')->middleware('throttle:10,1440');
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'report'], function () {
Route::get('/', 'ReportController@showForm')->name('report.form');
2018-08-31 06:21:05 +00:00
Route::post('/', 'ReportController@formStore')->middleware('throttle:100,1440');
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-08-10 05:20:27 +00:00
2018-08-28 03:07:36 +00:00
Route::group(['prefix' => 'settings'], function () {
Route::redirect('/', '/settings/home');
Route::get('home', 'SettingsController@home')->name('settings');
2018-08-31 06:21:05 +00:00
Route::post('home', 'SettingsController@homeUpdate')->middleware('throttle:25,1440');
2018-08-28 03:07:36 +00:00
Route::get('avatar', 'SettingsController@avatar')->name('settings.avatar');
2018-08-31 06:21:05 +00:00
Route::post('avatar', 'AvatarController@store')->middleware('throttle:5,1440');
2018-08-28 03:07:36 +00:00
Route::get('password', 'SettingsController@password')->name('settings.password');
2018-08-31 06:21:05 +00:00
Route::post('password', 'SettingsController@passwordUpdate')->middleware('throttle:2,1440');
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');
2018-08-31 06:21:05 +00:00
Route::post('privacy', 'SettingsController@privacyStore')->middleware('throttle:25,1440');
2018-08-31 04:28:09 +00:00
Route::get('privacy/muted-users', 'SettingsController@mutedUsers')->name('settings.privacy.muted-users');
2018-08-31 06:21:05 +00:00
Route::post('privacy/muted-users', 'SettingsController@mutedUsersUpdate')->middleware('throttle:100,1440');
2018-08-31 04:28:09 +00:00
Route::get('privacy/blocked-users', 'SettingsController@blockedUsers')->name('settings.privacy.blocked-users');
2018-08-31 06:21:05 +00:00
Route::post('privacy/blocked-users', 'SettingsController@blockedUsersUpdate')->middleware('throttle:100,1440');
2018-08-31 04:28:09 +00:00
Route::get('privacy/blocked-instances', 'SettingsController@blockedInstances')->name('settings.privacy.blocked-instances');
2018-08-28 03:07:36 +00:00
Route::get('security', 'SettingsController@security')->name('settings.security');
Route::get('applications', 'SettingsController@applications')->name('settings.applications');
Route::get('data-export', 'SettingsController@dataExport')->name('settings.dataexport');
Route::get('developers', 'SettingsController@developers')->name('settings.developers');
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-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');
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');
});
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');
Route::get('{username}/followers', 'ProfileController@followers');
Route::get('{username}/following', 'ProfileController@following');
Route::get('{username}', 'ProfileController@show');
});