]> git.mxchange.org Git - friendica.git/blob - static/routes.config.php
Partly revert coding for compatibility issues
[friendica.git] / static / routes.config.php
1 <?php
2 /**
3  * @copyright Copyright (C) 2020, Friendica
4  *
5  * @license GNU AGPL version 3 or any later version
6  *
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.
11  *
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.
16  *
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/>.
19  *
20  * Configuration for the default routes in Friendica
21  *
22  * The syntax is either
23  * - 'route' => [ Module::class , [ HTTPMethod(s) ] ]
24  * - 'group' => [ 'route' => [ Module::class, [ HTTPMethod(s) ] ]
25  *
26  * It's possible to create recursive groups
27  *
28  */
29
30 use Friendica\App\Router as R;
31 use Friendica\Module;
32
33 return [
34         '/' => [Module\Home::class, [R::GET]],
35
36         '/.well-known' => [
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]],
42         ],
43
44         '/2fa' => [
45                 '[/]'       => [Module\Security\TwoFactor\Verify::class,   [R::GET, R::POST]],
46                 '/recovery' => [Module\Security\TwoFactor\Recovery::class, [R::GET, R::POST]],
47         ],
48
49         '/api' => [
50                 '/v1' => [
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         ]],
56                 ],
57                 '/friendica' => [
58                         '/profile/show'                      => [Module\Api\Friendica\Profile\Show::class , [R::GET         ]],
59                         '/events'                            => [Module\Api\Friendica\Events\Index::class , [R::GET         ]],
60                 ],
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         ]],
65         ],
66
67         '/admin'               => [
68                 '[/]' => [Module\Admin\Summary::class, [R::GET]],
69
70                 '/addons'         => [Module\Admin\Addons\Index::class,   [R::GET, R::POST]],
71                 '/addons/{addon}' => [Module\Admin\Addons\Details::class, [R::GET, R::POST]],
72
73
74                 '/blocklist/contact' => [Module\Admin\Blocklist\Contact::class, [R::GET, R::POST]],
75                 '/blocklist/server'  => [Module\Admin\Blocklist\Server::class,  [R::GET, R::POST]],
76
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]],
80
81                 '/features'   => [Module\Admin\Features::class,   [R::GET, R::POST]],
82                 '/federation' => [Module\Admin\Federation::class, [R::GET]],
83
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]],
86
87                 '/logs/view' => [Module\Admin\Logs\View::class,     [R::GET]],
88                 '/logs'      => [Module\Admin\Logs\Settings::class, [R::GET, R::POST]],
89
90                 '/phpinfo' => [Module\Admin\PhpInfo::class, [R::GET]],
91
92                 '/queue[/deferred]' => [Module\Admin\Queue::class, [R::GET]],
93
94                 '/site' => [Module\Admin\Site::class, [R::GET, R::POST]],
95
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]],
99
100                 '/tos' => [Module\Admin\Tos::class, [R::GET, R::POST]],
101
102                 '/users[/{action}/{uid}]' => [Module\Admin\Users::class, [R::GET, R::POST]],
103         ],
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]],
111
112         '/community[/{content}[/{accounttype}]]' => [Module\Conversation\Community::class, [R::GET]],
113
114         '/compose[/{type}]'    => [Module\Item\Compose::class, [R::GET, R::POST]],
115
116         '/contact'   => [
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]],
137         ],
138
139         '/credits'               => [Module\Credits::class,        [R::GET]],
140
141         '/delegation'=> [Module\Delegation::class,       [R::GET, R::POST]],
142         '/dirfind'   => [Module\Search\Directory::class, [R::GET]],
143         '/directory' => [Module\Directory::class,        [R::GET]],
144
145         '/feed'     => [
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]],
151         ],
152         '/feedtest' => [Module\Debug\Feed::class, [R::GET]],
153
154         '/fetch'             => [
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]],
158         ],
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]],
165
166         '/fsuggest/{contact:\d+}' => [Module\FriendSuggest::class,  [R::GET, R::POST]],
167
168         '/group'              => [
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]],
175
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]],
178         ],
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]],
185
186         '/install'         => [
187                 '[/]'                    => [Module\Install::class, [R::GET, R::POST]],
188                 '/testrewrite'           => [Module\Install::class, [R::GET]],
189         ],
190
191         '/item'            => [
192                 '/ignore/{id}' => [Module\Item\Ignore::class, [R::GET]],
193         ],
194
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]],
207
208         '/noscrape' => [
209                 '/{nick}'         => [Module\NoScrape::class, [R::GET]],
210                 '/{profile}/view' => [Module\NoScrape::class, [R::GET]],
211         ],
212
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]],
221         ],
222
223         '/notification'         => [
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]],
227         ],
228         '/objects/{guid}[/{activity}]' => [Module\Objects::class, [R::GET]],
229
230         '/oembed'         => [
231                 '/b2h'    => [Module\Oembed::class, [R::GET]],
232                 '/h2b'    => [Module\Oembed::class, [R::GET]],
233                 '/{hash}' => [Module\Oembed::class, [R::GET]],
234         ],
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]],
239
240         '/permission/tooltip/{type}/{id:\d+}' => [Module\PermissionTooltip::class, [R::GET]],
241
242         '/photo' => [
243                 '/{name}'                    => [Module\Photo::class, [R::GET]],
244                 '/{type}/{name}'             => [Module\Photo::class, [R::GET]],
245                 '/{type}/{customize}/{name}' => [Module\Photo::class, [R::GET]],
246         ],
247
248         '/pinned/{item:\d+}' => [Module\Pinned::class,       [R::GET]],
249         '/pretheme'          => [Module\ThemeDetails::class, [R::GET]],
250         '/probe'             => [Module\Debug\Probe::class,  [R::GET]],
251
252         '/profile' => [
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]],
258         ],
259
260         '/proxy' => [
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]],
265         ],
266
267         '/search' => [
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]],
272         ],
273
274         '/receive' => [
275                 '/public'       => [Module\Diaspora\Receive::class, [R::POST]],
276                 '/users/{guid}' => [Module\Diaspora\Receive::class, [R::POST]],
277         ],
278
279         '/settings' => [
280                 '/2fa' => [
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]],
285                 ],
286                 '/delegation[/{action}/{user_id}]' => [Module\Settings\Delegation::class,       [R::GET, R::POST]],
287                 '/display'                 => [Module\Settings\Display::class,             [R::GET, R::POST]],
288                 '/profile' => [
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]],
292                 ],
293                 '/userexport[/{action}]' => [Module\Settings\UserExport::class,             [R::GET, R::POST]],
294         ],
295
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]],
306
307         '/update_community[/{content}[/{accounttype}]]' => [Module\Update\Community::class, [R::GET]],
308         '/update_profile'                => [Module\Update\Profile::class,        [R::GET]],
309
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]],
315 ];