3 * @copyright Copyright (C) 2020, Friendica
5 * @license GNU AGPL version 3 or any later version
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as
9 * published by the Free Software Foundation, either version 3 of the
10 * License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 * Configuration for the default routes in Friendica
22 * The syntax is either
23 * - 'route' => [ Module::class , [ HTTPMethod(s) ] ]
24 * - 'group' => [ 'route' => [ Module::class, [ HTTPMethod(s) ] ]
26 * It's possible to create recursive groups
30 use Friendica\App\Router as R;
34 '/' => [Module\Home::class, [R::GET]],
37 '/host-meta' => [Module\WellKnown\HostMeta::class, [R::GET]],
38 '/nodeinfo' => [Module\WellKnown\NodeInfo::class, [R::GET]],
39 '/webfinger' => [Module\Xrd::class, [R::GET]],
40 '/x-nodeinfo2' => [Module\NodeInfo210::class, [R::GET]],
41 '/x-social-relay' => [Module\WellKnown\XSocialRelay::class, [R::GET]],
45 '[/]' => [Module\Security\TwoFactor\Verify::class, [R::GET, R::POST]],
46 '/recovery' => [Module\Security\TwoFactor\Recovery::class, [R::GET, R::POST]],
51 '/custom_emojis' => [Module\Api\Mastodon\CustomEmojis::class, [R::GET ]],
52 '/follow_requests' => [Module\Api\Mastodon\FollowRequests::class, [R::GET ]],
53 '/follow_requests/{id:\d+}/{action}' => [Module\Api\Mastodon\FollowRequests::class, [ R::POST]],
54 '/instance' => [Module\Api\Mastodon\Instance::class, [R::GET ]],
55 '/instance/peers' => [Module\Api\Mastodon\Instance\Peers::class, [R::GET ]],
58 '/profile/show' => [Module\Api\Friendica\Profile\Show::class , [R::GET ]],
59 '/events' => [Module\Api\Friendica\Events\Index::class , [R::GET ]],
61 '/followers/ids' => [Module\Api\Twitter\FollowersIds::class , [R::GET ]],
62 '/followers/list' => [Module\Api\Twitter\FollowersList::class , [R::GET ]],
63 '/friends/ids' => [Module\Api\Twitter\FriendsIds::class , [R::GET ]],
64 '/friends/list' => [Module\Api\Twitter\FriendsList::class , [R::GET ]],
68 '[/]' => [Module\Admin\Summary::class, [R::GET]],
70 '/addons' => [Module\Admin\Addons\Index::class, [R::GET, R::POST]],
71 '/addons/{addon}' => [Module\Admin\Addons\Details::class, [R::GET, R::POST]],
74 '/blocklist/contact' => [Module\Admin\Blocklist\Contact::class, [R::GET, R::POST]],
75 '/blocklist/server' => [Module\Admin\Blocklist\Server::class, [R::GET, R::POST]],
77 '/dbsync[/check]' => [Module\Admin\DBSync::class, [R::GET]],
78 '/dbsync/{update:\d+}' => [Module\Admin\DBSync::class, [R::GET]],
79 '/dbsync/mark/{update:\d+}' => [Module\Admin\DBSync::class, [R::GET]],
81 '/features' => [Module\Admin\Features::class, [R::GET, R::POST]],
82 '/federation' => [Module\Admin\Federation::class, [R::GET]],
84 '/item/delete' => [Module\Admin\Item\Delete::class, [R::GET, R::POST]],
85 '/item/source[/{guid}]' => [Module\Admin\Item\Source::class, [R::GET, R::POST]],
87 '/logs/view' => [Module\Admin\Logs\View::class, [R::GET]],
88 '/logs' => [Module\Admin\Logs\Settings::class, [R::GET, R::POST]],
90 '/phpinfo' => [Module\Admin\PhpInfo::class, [R::GET]],
92 '/queue[/deferred]' => [Module\Admin\Queue::class, [R::GET]],
94 '/site' => [Module\Admin\Site::class, [R::GET, R::POST]],
96 '/themes' => [Module\Admin\Themes\Index::class, [R::GET, R::POST]],
97 '/themes/{theme}' => [Module\Admin\Themes\Details::class, [R::GET, R::POST]],
98 '/themes/{theme}/embed' => [Module\Admin\Themes\Embed::class, [R::GET, R::POST]],
100 '/tos' => [Module\Admin\Tos::class, [R::GET, R::POST]],
102 '/users[/{action}/{uid}]' => [Module\Admin\Users::class, [R::GET, R::POST]],
104 '/amcd' => [Module\AccountManagementControlDocument::class, [R::GET]],
105 '/acctlink' => [Module\Acctlink::class, [R::GET]],
106 '/apps' => [Module\Apps::class, [R::GET]],
107 '/attach/{item:\d+}' => [Module\Attach::class, [R::GET]],
108 '/babel' => [Module\Debug\Babel::class, [R::GET, R::POST]],
109 '/debug/ap' => [Module\Debug\ActivityPubConversion::class, [R::GET, R::POST]],
110 '/bookmarklet' => [Module\Bookmarklet::class, [R::GET]],
112 '/community[/{content}[/{accounttype}]]' => [Module\Conversation\Community::class, [R::GET]],
114 '/compose[/{type}]' => [Module\Item\Compose::class, [R::GET, R::POST]],
117 '[/]' => [Module\Contact::class, [R::GET]],
118 '/{id:\d+}[/]' => [Module\Contact::class, [R::GET, R::POST]],
119 '/{id:\d+}/archive' => [Module\Contact::class, [R::GET]],
120 '/{id:\d+}/advanced' => [Module\Contact\Advanced::class, [R::GET, R::POST]],
121 '/{id:\d+}/block' => [Module\Contact::class, [R::GET]],
122 '/{id:\d+}/conversations' => [Module\Contact::class, [R::GET]],
123 '/{id:\d+}/contacts[/{type}]' => [Module\Contact\Contacts::class, [R::GET]],
124 '/{id:\d+}/drop' => [Module\Contact::class, [R::GET]],
125 '/{id:\d+}/ignore' => [Module\Contact::class, [R::GET]],
126 '/{id:\d+}/poke' => [Module\Contact\Poke::class, [R::GET, R::POST]],
127 '/{id:\d+}/posts' => [Module\Contact::class, [R::GET]],
128 '/{id:\d+}/update' => [Module\Contact::class, [R::GET]],
129 '/{id:\d+}/updateprofile' => [Module\Contact::class, [R::GET]],
130 '/archived' => [Module\Contact::class, [R::GET]],
131 '/batch' => [Module\Contact::class, [R::GET, R::POST]],
132 '/pending' => [Module\Contact::class, [R::GET]],
133 '/blocked' => [Module\Contact::class, [R::GET]],
134 '/hidden' => [Module\Contact::class, [R::GET]],
135 '/ignored' => [Module\Contact::class, [R::GET]],
136 '/hovercard' => [Module\Contact\Hovercard::class, [R::GET]],
139 '/credits' => [Module\Credits::class, [R::GET]],
141 '/delegation'=> [Module\Delegation::class, [R::GET, R::POST]],
142 '/dirfind' => [Module\Search\Directory::class, [R::GET]],
143 '/directory' => [Module\Directory::class, [R::GET]],
146 '/{nickname}' => [Module\Feed::class, [R::GET]],
147 '/{nickname}/posts' => [Module\Feed::class, [R::GET]],
148 '/{nickname}/comments' => [Module\Feed::class, [R::GET]],
149 '/{nickname}/replies' => [Module\Feed::class, [R::GET]],
150 '/{nickname}/activity' => [Module\Feed::class, [R::GET]],
152 '/feedtest' => [Module\Debug\Feed::class, [R::GET]],
155 '/post/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]],
156 '/status_message/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]],
157 '/reshare/{guid}' => [Module\Diaspora\Fetch::class, [R::GET]],
159 '/filer[/{id:\d+}]' => [Module\Filer\SaveTag::class, [R::GET]],
160 '/filerm/{id:\d+}' => [Module\Filer\RemoveTag::class, [R::GET]],
161 '/follow_confirm' => [Module\FollowConfirm::class, [R::GET, R::POST]],
162 '/followers/{owner}' => [Module\Followers::class, [R::GET]],
163 '/following/{owner}' => [Module\Following::class, [R::GET]],
164 '/friendica[/json]' => [Module\Friendica::class, [R::GET]],
166 '/fsuggest/{contact:\d+}' => [Module\FriendSuggest::class, [R::GET, R::POST]],
169 '[/]' => [Module\Group::class, [R::GET, R::POST]],
170 '/{group:\d+}' => [Module\Group::class, [R::GET, R::POST]],
171 '/none' => [Module\Group::class, [R::GET, R::POST]],
172 '/new' => [Module\Group::class, [R::GET, R::POST]],
173 '/drop/{group:\d+}' => [Module\Group::class, [R::GET, R::POST]],
174 '/{group:\d+}/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]],
176 '/{group:\d+}/add/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]],
177 '/{group:\d+}/remove/{contact:\d+}' => [Module\Group::class, [R::GET, R::POST]],
179 '/hashtag' => [Module\Hashtag::class, [R::GET]],
180 '/help[/{doc:.+}]' => [Module\Help::class, [R::GET]],
181 '/home' => [Module\Home::class, [R::GET]],
182 '/hcard/{profile}[/{action}]' => [Module\HoverCard::class, [R::GET]],
183 '/inbox[/{nickname}]' => [Module\Inbox::class, [R::GET, R::POST]],
184 '/invite' => [Module\Invite::class, [R::GET, R::POST]],
187 '[/]' => [Module\Install::class, [R::GET, R::POST]],
188 '/testrewrite' => [Module\Install::class, [R::GET]],
192 '/ignore/{id}' => [Module\Item\Ignore::class, [R::GET]],
195 '/like/{item:\d+}' => [Module\Like::class, [R::GET]],
196 '/localtime' => [Module\Debug\Localtime::class, [R::GET, R::POST]],
197 '/login' => [Module\Security\Login::class, [R::GET, R::POST]],
198 '/logout' => [Module\Security\Logout::class, [R::GET, R::POST]],
199 '/magic' => [Module\Magic::class, [R::GET]],
200 '/maintenance' => [Module\Maintenance::class, [R::GET]],
201 '/manifest' => [Module\Manifest::class, [R::GET]],
202 '/modexp/{nick}' => [Module\PublicRSAKey::class, [R::GET]],
203 '/newmember' => [Module\Welcome::class, [R::GET]],
204 '/nodeinfo/1.0' => [Module\NodeInfo110::class, [R::GET]],
205 '/nodeinfo/2.0' => [Module\NodeInfo120::class, [R::GET]],
206 '/nogroup' => [Module\Group::class, [R::GET]],
209 '/{nick}' => [Module\NoScrape::class, [R::GET]],
210 '/{profile}/view' => [Module\NoScrape::class, [R::GET]],
213 '/notifications' => [
214 '/network[/json]' => [Module\Notifications\Notifications::class, [R::GET, R::POST]],
215 '/system[/json]' => [Module\Notifications\Notifications::class, [R::GET, R::POST]],
216 '/personal[/json]' => [Module\Notifications\Notifications::class, [R::GET, R::POST]],
217 '/home[/json]' => [Module\Notifications\Notifications::class, [R::GET, R::POST]],
218 '/intros[/json]' => [Module\Notifications\Introductions::class, [R::GET, R::POST]],
219 '/intros/all[/json]' => [Module\Notifications\Introductions::class, [R::GET, R::POST]],
220 '/intros/{contact:\d+}[/json]' => [Module\Notifications\Introductions::class, [R::GET, R::POST]],
224 '[/]' => [Module\Notifications\Notification::class, [R::GET]],
225 '/mark/all' => [Module\Notifications\Notification::class, [R::GET]],
226 '/{id:\d+}' => [Module\Notifications\Notification::class, [R::GET, R::POST]],
228 '/objects/{guid}[/{activity}]' => [Module\Objects::class, [R::GET]],
231 '/b2h' => [Module\Oembed::class, [R::GET]],
232 '/h2b' => [Module\Oembed::class, [R::GET]],
233 '/{hash}' => [Module\Oembed::class, [R::GET]],
235 '/outbox/{owner}' => [Module\Outbox::class, [R::GET]],
236 '/owa' => [Module\Owa::class, [R::GET]],
237 '/openid' => [Module\Security\OpenID::class, [R::GET]],
238 '/opensearch' => [Module\OpenSearch::class, [R::GET]],
240 '/permission/tooltip/{type}/{id:\d+}' => [Module\PermissionTooltip::class, [R::GET]],
243 '/{name}' => [Module\Photo::class, [R::GET]],
244 '/{type}/{name}' => [Module\Photo::class, [R::GET]],
245 '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]],
248 '/pinned/{item:\d+}' => [Module\Pinned::class, [R::GET]],
249 '/pretheme' => [Module\ThemeDetails::class, [R::GET]],
250 '/probe' => [Module\Debug\Probe::class, [R::GET]],
253 '/{nickname}' => [Module\Profile\Index::class, [R::GET]],
254 '/{nickname}/profile' => [Module\Profile\Profile::class, [R::GET]],
255 '/{nickname}/contacts/common' => [Module\Profile\Common::class, [R::GET]],
256 '/{nickname}/contacts[/{type}]' => [Module\Profile\Contacts::class, [R::GET]],
257 '/{nickname}/status[/{category}[/{date1}[/{date2}]]]' => [Module\Profile\Status::class, [R::GET]],
261 '[/]' => [Module\Proxy::class, [R::GET]],
262 '/{url}' => [Module\Proxy::class, [R::GET]],
263 '/{sub1}/{url}' => [Module\Proxy::class, [R::GET]],
264 '/{sub1}/{sub2}/{url}' => [Module\Proxy::class, [R::GET]],
268 '[/]' => [Module\Search\Index::class, [R::GET]],
269 '/acl' => [Module\Search\Acl::class, [R::GET, R::POST]],
270 '/saved/add' => [Module\Search\Saved::class, [R::GET]],
271 '/saved/remove' => [Module\Search\Saved::class, [R::GET]],
275 '/public' => [Module\Diaspora\Receive::class, [R::POST]],
276 '/users/{guid}' => [Module\Diaspora\Receive::class, [R::POST]],
281 '[/]' => [Module\Settings\TwoFactor\Index::class, [R::GET, R::POST]],
282 '/recovery' => [Module\Settings\TwoFactor\Recovery::class, [R::GET, R::POST]],
283 '/app_specific' => [Module\Settings\TwoFactor\AppSpecific::class, [R::GET, R::POST]],
284 '/verify' => [Module\Settings\TwoFactor\Verify::class, [R::GET, R::POST]],
286 '/delegation[/{action}/{user_id}]' => [Module\Settings\Delegation::class, [R::GET, R::POST]],
287 '/display' => [Module\Settings\Display::class, [R::GET, R::POST]],
289 '[/]' => [Module\Settings\Profile\Index::class, [R::GET, R::POST]],
290 '/photo[/new]' => [Module\Settings\Profile\Photo\Index::class, [R::GET, R::POST]],
291 '/photo/crop/{guid}' => [Module\Settings\Profile\Photo\Crop::class, [R::GET, R::POST]],
293 '/userexport[/{action}]' => [Module\Settings\UserExport::class, [R::GET, R::POST]],
296 '/randprof' => [Module\RandomProfile::class, [R::GET]],
297 '/register' => [Module\Register::class, [R::GET, R::POST]],
298 '/remote_follow/{profile}' => [Module\RemoteFollow::class, [R::GET, R::POST]],
299 '/robots.txt' => [Module\RobotsTxt::class, [R::GET]],
300 '/rsd.xml' => [Module\ReallySimpleDiscovery::class, [R::GET]],
301 '/smilies[/json]' => [Module\Smilies::class, [R::GET]],
302 '/statistics.json' => [Module\Statistics::class, [R::GET]],
303 '/starred/{item:\d+}' => [Module\Starred::class, [R::GET]],
304 '/toggle_mobile' => [Module\ToggleMobile::class, [R::GET]],
305 '/tos' => [Module\Tos::class, [R::GET]],
307 '/update_community[/{content}[/{accounttype}]]' => [Module\Update\Community::class, [R::GET]],
308 '/update_profile' => [Module\Update\Profile::class, [R::GET]],
310 '/view/theme/{theme}/style.pcss' => [Module\Theme::class, [R::GET]],
311 '/viewsrc/{item:\d+}' => [Module\Debug\ItemBody::class, [R::GET]],
312 '/webfinger' => [Module\Debug\WebFinger::class, [R::GET]],
313 '/xrd' => [Module\Xrd::class, [R::GET]],
314 '/worker' => [Module\Worker::class, [R::GET]],