2020-06-10 15:00:12 +00:00
|
|
|
<?php
|
|
|
|
|
2021-06-08 09:52:11 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2020-06-10 15:00:12 +00:00
|
|
|
namespace Config;
|
2020-05-27 18:46:16 +02:00
|
|
|
|
|
|
|
// Create a new instance of our RouteCollection class.
|
|
|
|
$routes = Services::routes();
|
|
|
|
|
|
|
|
// Load the system's routing file first, so that the app and ENVIRONMENT
|
|
|
|
// can override as needed.
|
2020-06-01 21:23:14 +00:00
|
|
|
if (file_exists(SYSTEMPATH . 'Config/Routes.php')) {
|
|
|
|
require SYSTEMPATH . 'Config/Routes.php';
|
2020-05-27 18:46:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
* Router Setup
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
$routes->setDefaultNamespace('App\Controllers');
|
|
|
|
$routes->setDefaultController('Home');
|
|
|
|
$routes->setDefaultMethod('index');
|
|
|
|
$routes->setTranslateURIDashes(false);
|
|
|
|
$routes->set404Override();
|
2020-06-01 21:23:14 +00:00
|
|
|
$routes->setAutoRoute(false);
|
2020-07-31 16:05:10 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
* Placeholder definitions
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
$routes->addPlaceholder('podcastName', '[a-zA-Z0-9\_]{1,32}');
|
2020-08-18 16:31:28 +00:00
|
|
|
$routes->addPlaceholder('slug', '[a-zA-Z0-9\-]{1,191}');
|
2020-10-29 17:27:16 +01:00
|
|
|
$routes->addPlaceholder('base64', '[A-Za-z0-9\.\_]+\-{0,2}');
|
2020-11-18 17:17:56 +00:00
|
|
|
$routes->addPlaceholder('platformType', '\bpodcasting|\bsocial|\bfunding');
|
2021-06-21 10:04:18 +00:00
|
|
|
$routes->addPlaceholder('statusAction', '\bfavourite|\breblog|\breply');
|
2021-06-08 09:52:11 +00:00
|
|
|
$routes->addPlaceholder('embeddablePlayerTheme', '\blight|\bdark|\blight-transparent|\bdark-transparent');
|
2021-04-02 17:20:02 +00:00
|
|
|
$routes->addPlaceholder(
|
|
|
|
'uuid',
|
|
|
|
'[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-4[0-9A-Fa-f]{3}-[89ABab][0-9A-Fa-f]{3}-[0-9A-Fa-f]{12}',
|
|
|
|
);
|
2020-05-27 18:46:16 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
* Route Definitions
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
// We get a performance increase by specifying the default
|
|
|
|
// route since we don't have to scan directories.
|
2021-05-19 16:35:13 +00:00
|
|
|
$routes->get('/', 'HomeController::index', [
|
|
|
|
'as' => 'home',
|
|
|
|
]);
|
2020-06-10 15:00:12 +00:00
|
|
|
|
2020-08-12 20:03:45 +00:00
|
|
|
// Install Wizard route
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group(config('App')->installGateway, function ($routes): void {
|
2021-05-19 16:35:13 +00:00
|
|
|
$routes->get('/', 'InstallController', [
|
|
|
|
'as' => 'install',
|
|
|
|
]);
|
|
|
|
$routes->post('instance-config', 'InstallController::attemptInstanceConfig', [
|
|
|
|
'as' => 'instance-config',
|
2021-06-08 09:52:11 +00:00
|
|
|
]);
|
2021-05-19 16:35:13 +00:00
|
|
|
$routes->post('database-config', 'InstallController::attemptDatabaseConfig', [
|
|
|
|
'as' => 'database-config',
|
2021-06-08 09:52:11 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('cache-config', 'InstallController::attemptCacheConfig', [
|
2020-10-08 16:38:30 +00:00
|
|
|
'as' => 'cache-config',
|
2020-08-12 20:03:45 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post(
|
|
|
|
'create-superadmin',
|
|
|
|
'InstallController::attemptCreateSuperAdmin',
|
|
|
|
[
|
|
|
|
'as' => 'create-superadmin',
|
|
|
|
],
|
|
|
|
);
|
2020-08-12 20:03:45 +00:00
|
|
|
});
|
|
|
|
|
2020-11-18 17:17:56 +00:00
|
|
|
$routes->get('.well-known/platforms', 'Platform');
|
|
|
|
|
2020-07-10 12:20:25 +00:00
|
|
|
// Admin area
|
|
|
|
$routes->group(
|
2021-05-19 16:35:13 +00:00
|
|
|
config('App')
|
|
|
|
->adminGateway,
|
|
|
|
[
|
|
|
|
'namespace' => 'App\Controllers\Admin',
|
|
|
|
],
|
2021-05-06 14:00:48 +00:00
|
|
|
function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'HomeController', [
|
2020-08-12 20:03:45 +00:00
|
|
|
'as' => 'admin',
|
2020-07-10 12:20:25 +00:00
|
|
|
]);
|
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('persons', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PersonController', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'as' => 'person-list',
|
|
|
|
'filter' => 'permission:person-list',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('new', 'PersonController::create', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'as' => 'person-create',
|
|
|
|
'filter' => 'permission:person-create',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('new', 'PersonController::attemptCreate', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'filter' => 'permission:person-create',
|
|
|
|
]);
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('(:num)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PersonController::view/$1', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'as' => 'person-view',
|
|
|
|
'filter' => 'permission:person-view',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('edit', 'PersonController::edit/$1', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'as' => 'person-edit',
|
|
|
|
'filter' => 'permission:person-edit',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('edit', 'PersonController::attemptEdit/$1', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'filter' => 'permission:person-edit',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->add('delete', 'PersonController::delete/$1', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'as' => 'person-delete',
|
|
|
|
'filter' => 'permission:person-delete',
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// Podcasts
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('podcasts', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PodcastController::list', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'podcast-list',
|
2020-07-31 16:05:10 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('new', 'PodcastController::create', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'podcast-create',
|
|
|
|
'filter' => 'permission:podcasts-create',
|
2020-07-10 12:20:25 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('new', 'PodcastController::attemptCreate', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'filter' => 'permission:podcasts-create',
|
2020-07-10 12:20:25 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('import', 'PodcastImportController', [
|
2020-08-21 08:41:09 +00:00
|
|
|
'as' => 'podcast-import',
|
|
|
|
'filter' => 'permission:podcasts-import',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('import', 'PodcastImportController::attemptImport', [
|
2020-08-21 08:41:09 +00:00
|
|
|
'filter' => 'permission:podcasts-import',
|
|
|
|
]);
|
2020-07-10 12:20:25 +00:00
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// Podcast
|
|
|
|
// Use ids in admin area to help permission and group lookups
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('(:num)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PodcastController::view/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'podcast-view',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('edit', 'PodcastController::edit/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'podcast-edit',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:podcast-edit',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('edit', 'PodcastController::attemptEdit/$1', [
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:podcast-edit',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('delete', 'PodcastController::delete/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'podcast-delete',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:podcasts-delete',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2020-10-14 10:38:48 +00:00
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('persons', function ($routes): void {
|
2021-05-17 17:11:23 +00:00
|
|
|
$routes->get('/', 'PodcastPersonController/$1', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'as' => 'podcast-person-manage',
|
|
|
|
'filter' => 'permission:podcast-edit',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post(
|
|
|
|
'/',
|
2021-05-17 17:11:23 +00:00
|
|
|
'PodcastPersonController::attemptAdd/$1',
|
2021-05-12 14:00:25 +00:00
|
|
|
[
|
|
|
|
'filter' => 'permission:podcast-edit',
|
|
|
|
],
|
|
|
|
);
|
2021-02-10 16:20:01 +00:00
|
|
|
|
|
|
|
$routes->get(
|
|
|
|
'(:num)/remove',
|
2021-05-17 17:11:23 +00:00
|
|
|
'PodcastPersonController::remove/$1/$2',
|
2021-02-10 16:20:01 +00:00
|
|
|
[
|
|
|
|
'as' => 'podcast-person-remove',
|
|
|
|
'filter' => 'permission:podcast-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2021-02-10 16:20:01 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('analytics', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PodcastController::viewAnalytics/$1', [
|
2020-10-14 10:38:48 +00:00
|
|
|
'as' => 'podcast-analytics',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
|
|
|
]);
|
|
|
|
$routes->get(
|
|
|
|
'webpages',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastController::viewAnalyticsWebpages/$1',
|
2020-10-14 10:38:48 +00:00
|
|
|
[
|
|
|
|
'as' => 'podcast-analytics-webpages',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-10-14 10:38:48 +00:00
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'locations',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastController::viewAnalyticsLocations/$1',
|
2020-10-14 10:38:48 +00:00
|
|
|
[
|
|
|
|
'as' => 'podcast-analytics-locations',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-10-14 10:38:48 +00:00
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'unique-listeners',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastController::viewAnalyticsUniqueListeners/$1',
|
2020-10-14 10:38:48 +00:00
|
|
|
[
|
|
|
|
'as' => 'podcast-analytics-unique-listeners',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-10-14 10:38:48 +00:00
|
|
|
);
|
2020-10-19 10:33:23 +00:00
|
|
|
$routes->get(
|
|
|
|
'listening-time',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastController::viewAnalyticsListeningTime/$1',
|
2020-10-19 10:33:23 +00:00
|
|
|
[
|
|
|
|
'as' => 'podcast-analytics-listening-time',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-10-19 10:33:23 +00:00
|
|
|
);
|
2020-11-02 18:15:19 +00:00
|
|
|
$routes->get(
|
|
|
|
'time-periods',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastController::viewAnalyticsTimePeriods/$1',
|
2020-11-02 18:15:19 +00:00
|
|
|
[
|
|
|
|
'as' => 'podcast-analytics-time-periods',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-11-02 18:15:19 +00:00
|
|
|
);
|
2020-10-14 10:38:48 +00:00
|
|
|
$routes->get(
|
|
|
|
'players',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastController::viewAnalyticsPlayers/$1',
|
2020-10-14 10:38:48 +00:00
|
|
|
[
|
|
|
|
'as' => 'podcast-analytics-players',
|
|
|
|
'filter' => 'permission:podcasts-view,podcast-view',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-10-14 10:38:48 +00:00
|
|
|
);
|
|
|
|
});
|
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// Podcast episodes
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('episodes', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'EpisodeController::list/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'episode-list',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' =>
|
|
|
|
'permission:episodes-list,podcast_episodes-list',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('new', 'EpisodeController::create/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'episode-create',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:podcast_episodes-create',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post(
|
|
|
|
'new',
|
|
|
|
'EpisodeController::attemptCreate/$1',
|
|
|
|
[
|
|
|
|
'filter' => 'permission:podcast_episodes-create',
|
|
|
|
],
|
|
|
|
);
|
2020-07-10 12:20:25 +00:00
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// Episode
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('(:num)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'EpisodeController::view/$1/$2', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'episode-view',
|
|
|
|
'filter' =>
|
|
|
|
'permission:episodes-view,podcast_episodes-view',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('edit', 'EpisodeController::edit/$1/$2', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'episode-edit',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post(
|
|
|
|
'edit',
|
|
|
|
'EpisodeController::attemptEdit/$1/$2',
|
|
|
|
[
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
|
|
|
],
|
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'publish',
|
|
|
|
'EpisodeController::publish/$1/$2',
|
|
|
|
[
|
|
|
|
'as' => 'episode-publish',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_publications',
|
|
|
|
],
|
|
|
|
);
|
2021-04-02 17:20:02 +00:00
|
|
|
$routes->post(
|
|
|
|
'publish',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::attemptPublish/$1/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
[
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_publications',
|
|
|
|
],
|
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'publish-edit',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::publishEdit/$1/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
[
|
|
|
|
'as' => 'episode-publish_edit',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_publications',
|
|
|
|
],
|
|
|
|
);
|
|
|
|
$routes->post(
|
|
|
|
'publish-edit',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::attemptPublishEdit/$1/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
[
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_publications',
|
|
|
|
],
|
|
|
|
);
|
2021-06-22 17:59:33 +00:00
|
|
|
$routes->get(
|
|
|
|
'publish-cancel',
|
|
|
|
'EpisodeController::publishCancel/$1/$2',
|
|
|
|
[
|
|
|
|
'as' => 'episode-publish-cancel',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_publications',
|
|
|
|
],
|
|
|
|
);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'unpublish',
|
|
|
|
'EpisodeController::unpublish/$1/$2',
|
|
|
|
[
|
|
|
|
'as' => 'episode-unpublish',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_publications',
|
|
|
|
],
|
|
|
|
);
|
2021-04-02 17:20:02 +00:00
|
|
|
$routes->post(
|
|
|
|
'unpublish',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::attemptUnpublish/$1/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
[
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_publications',
|
|
|
|
],
|
|
|
|
);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'delete',
|
|
|
|
'EpisodeController::delete/$1/$2',
|
|
|
|
[
|
|
|
|
'as' => 'episode-delete',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast_episodes-delete',
|
|
|
|
],
|
|
|
|
);
|
2020-11-24 20:18:08 +00:00
|
|
|
$routes->get(
|
|
|
|
'transcript-delete',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::transcriptDelete/$1/$2',
|
2020-11-24 20:18:08 +00:00
|
|
|
[
|
|
|
|
'as' => 'transcript-delete',
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-11-24 20:18:08 +00:00
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'chapters-delete',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::chaptersDelete/$1/$2',
|
2020-11-24 20:18:08 +00:00
|
|
|
[
|
|
|
|
'as' => 'chapters-delete',
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-11-24 20:18:08 +00:00
|
|
|
);
|
2020-12-07 20:13:46 +00:00
|
|
|
$routes->get(
|
|
|
|
'soundbites',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::soundbitesEdit/$1/$2',
|
2020-12-07 20:13:46 +00:00
|
|
|
[
|
|
|
|
'as' => 'soundbites-edit',
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-12-07 20:13:46 +00:00
|
|
|
);
|
|
|
|
$routes->post(
|
|
|
|
'soundbites',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::soundbitesAttemptEdit/$1/$2',
|
2020-12-07 20:13:46 +00:00
|
|
|
[
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-12-07 20:13:46 +00:00
|
|
|
);
|
2021-04-02 17:20:02 +00:00
|
|
|
$routes->get(
|
2020-12-07 20:13:46 +00:00
|
|
|
'soundbites/(:num)/delete',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::soundbiteDelete/$1/$2/$3',
|
2020-12-07 20:13:46 +00:00
|
|
|
[
|
|
|
|
'as' => 'soundbite-delete',
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-12-07 20:13:46 +00:00
|
|
|
);
|
2021-02-27 21:21:26 +00:00
|
|
|
$routes->get(
|
|
|
|
'embeddable-player',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::embeddablePlayer/$1/$2',
|
2021-02-27 21:21:26 +00:00
|
|
|
[
|
|
|
|
'as' => 'embeddable-player-add',
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2021-02-27 21:21:26 +00:00
|
|
|
);
|
2021-02-10 16:20:01 +00:00
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('persons', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'EpisodePersonController/$1/$2', [
|
2021-02-10 16:20:01 +00:00
|
|
|
'as' => 'episode-person-manage',
|
|
|
|
'filter' => 'permission:podcast_episodes-edit',
|
|
|
|
]);
|
|
|
|
$routes->post(
|
|
|
|
'/',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodePersonController::attemptAdd/$1/$2',
|
2021-02-10 16:20:01 +00:00
|
|
|
[
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2021-02-10 16:20:01 +00:00
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'(:num)/remove',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodePersonController::remove/$1/$2/$3',
|
2021-02-10 16:20:01 +00:00
|
|
|
[
|
|
|
|
'as' => 'episode-person-remove',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast_episodes-edit',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2021-02-10 16:20:01 +00:00
|
|
|
);
|
|
|
|
});
|
2020-08-14 18:27:57 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
// Podcast contributors
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('contributors', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'ContributorController::list/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'contributor-list',
|
|
|
|
'filter' =>
|
2020-08-27 14:17:56 +00:00
|
|
|
'permission:podcasts-view,podcast-manage_contributors',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('add', 'ContributorController::add/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'contributor-add',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:podcast-manage_contributors',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post(
|
|
|
|
'add',
|
|
|
|
'ContributorController::attemptAdd/$1',
|
|
|
|
[
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_contributors',
|
|
|
|
],
|
|
|
|
);
|
2020-08-14 18:27:57 +00:00
|
|
|
|
|
|
|
// Contributor
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('(:num)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'ContributorController::view/$1/$2', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'contributor-view',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_contributors',
|
2020-08-14 18:27:57 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'edit',
|
|
|
|
'ContributorController::edit/$1/$2',
|
|
|
|
[
|
|
|
|
'as' => 'contributor-edit',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_contributors',
|
|
|
|
],
|
|
|
|
);
|
2020-08-14 18:27:57 +00:00
|
|
|
$routes->post(
|
|
|
|
'edit',
|
2021-05-12 14:00:25 +00:00
|
|
|
'ContributorController::attemptEdit/$1/$2',
|
2020-08-14 18:27:57 +00:00
|
|
|
[
|
|
|
|
'filter' =>
|
2020-08-27 14:17:56 +00:00
|
|
|
'permission:podcast-manage_contributors',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-08-14 18:27:57 +00:00
|
|
|
);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'remove',
|
|
|
|
'ContributorController::remove/$1/$2',
|
|
|
|
[
|
|
|
|
'as' => 'contributor-remove',
|
|
|
|
'filter' =>
|
|
|
|
'permission:podcast-manage_contributors',
|
|
|
|
],
|
|
|
|
);
|
2020-08-14 18:27:57 +00:00
|
|
|
});
|
|
|
|
});
|
2020-08-27 10:05:44 +00:00
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('platforms', function ($routes): void {
|
2020-11-18 17:17:56 +00:00
|
|
|
$routes->get(
|
|
|
|
'/',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastPlatformController::platforms/$1/podcasting',
|
2020-11-18 17:17:56 +00:00
|
|
|
[
|
|
|
|
'as' => 'platforms-podcasting',
|
|
|
|
'filter' => 'permission:podcast-manage_platforms',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-11-18 17:17:56 +00:00
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'social',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastPlatformController::platforms/$1/social',
|
2020-11-18 17:17:56 +00:00
|
|
|
[
|
|
|
|
'as' => 'platforms-social',
|
|
|
|
'filter' => 'permission:podcast-manage_platforms',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-11-18 17:17:56 +00:00
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'funding',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastPlatformController::platforms/$1/funding',
|
2020-11-18 17:17:56 +00:00
|
|
|
[
|
|
|
|
'as' => 'platforms-funding',
|
|
|
|
'filter' => 'permission:podcast-manage_platforms',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-11-18 17:17:56 +00:00
|
|
|
);
|
2020-08-27 10:05:44 +00:00
|
|
|
$routes->post(
|
2020-11-18 17:17:56 +00:00
|
|
|
'save/(:platformType)',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastPlatformController::attemptPlatformsUpdate/$1/$2',
|
2020-11-18 17:17:56 +00:00
|
|
|
[
|
|
|
|
'as' => 'platforms-save',
|
|
|
|
'filter' => 'permission:podcast-manage_platforms',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-08-27 10:05:44 +00:00
|
|
|
);
|
2021-04-02 17:20:02 +00:00
|
|
|
$routes->get(
|
2020-11-18 17:17:56 +00:00
|
|
|
'(:slug)/podcast-platform-remove',
|
2021-05-12 14:00:25 +00:00
|
|
|
'PodcastPlatformController::removePodcastPlatform/$1/$2',
|
2020-08-27 10:05:44 +00:00
|
|
|
[
|
2020-11-18 17:17:56 +00:00
|
|
|
'as' => 'podcast-platform-remove',
|
2020-08-27 10:05:44 +00:00
|
|
|
'filter' => 'permission:podcast-manage_platforms',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
2020-08-27 10:05:44 +00:00
|
|
|
);
|
|
|
|
});
|
2020-08-14 18:27:57 +00:00
|
|
|
});
|
2020-07-10 12:20:25 +00:00
|
|
|
});
|
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
// Instance wide Fediverse config
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('fediverse', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'FediverseController::dashboard', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'fediverse-dashboard',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'blocked-actors',
|
|
|
|
'FediverseController::blockedActors',
|
|
|
|
[
|
|
|
|
'as' => 'fediverse-blocked-actors',
|
|
|
|
'filter' => 'permission:fediverse-block_actors',
|
|
|
|
],
|
|
|
|
);
|
|
|
|
$routes->get(
|
|
|
|
'blocked-domains',
|
|
|
|
'FediverseController::blockedDomains',
|
|
|
|
[
|
|
|
|
'as' => 'fediverse-blocked-domains',
|
|
|
|
'filter' => 'permission:fediverse-block_domains',
|
|
|
|
],
|
|
|
|
);
|
2021-04-02 17:20:02 +00:00
|
|
|
});
|
|
|
|
|
2020-08-18 16:31:28 +00:00
|
|
|
// Pages
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('pages', function ($routes): void {
|
2021-05-19 16:35:13 +00:00
|
|
|
$routes->get('/', 'PageController::list', [
|
|
|
|
'as' => 'page-list',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('new', 'PageController::create', [
|
2020-08-18 16:31:28 +00:00
|
|
|
'as' => 'page-create',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:pages-manage',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('new', 'PageController::attemptCreate', [
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:pages-manage',
|
2020-08-18 16:31:28 +00:00
|
|
|
]);
|
|
|
|
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('(:num)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PageController::view/$1', [
|
|
|
|
'as' => 'page-view',
|
|
|
|
]);
|
|
|
|
$routes->get('edit', 'PageController::edit/$1', [
|
2020-08-18 16:31:28 +00:00
|
|
|
'as' => 'page-edit',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:pages-manage',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('edit', 'PageController::attemptEdit/$1', [
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:pages-manage',
|
2020-08-18 16:31:28 +00:00
|
|
|
]);
|
|
|
|
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('delete', 'PageController::delete/$1', [
|
2020-08-18 16:31:28 +00:00
|
|
|
'as' => 'page-delete',
|
2020-08-27 14:17:56 +00:00
|
|
|
'filter' => 'permission:pages-manage',
|
2020-08-18 16:31:28 +00:00
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2020-07-10 12:20:25 +00:00
|
|
|
// Users
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('users', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'UserController::list', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'user-list',
|
|
|
|
'filter' => 'permission:users-list',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('new', 'UserController::create', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'user-create',
|
|
|
|
'filter' => 'permission:users-create',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('new', 'UserController::attemptCreate', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'filter' => 'permission:users-create',
|
|
|
|
]);
|
2020-07-10 12:20:25 +00:00
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// User
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('(:num)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'UserController::view/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'user-view',
|
|
|
|
'filter' => 'permission:users-view',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('edit', 'UserController::edit/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'user-edit',
|
|
|
|
'filter' => 'permission:users-manage_authorizations',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('edit', 'UserController::attemptEdit/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'filter' => 'permission:users-manage_authorizations',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('ban', 'UserController::ban/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'user-ban',
|
|
|
|
'filter' => 'permission:users-manage_bans',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('unban', 'UserController::unBan/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'user-unban',
|
|
|
|
'filter' => 'permission:users-manage_bans',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'force-pass-reset',
|
|
|
|
'UserController::forcePassReset/$1',
|
|
|
|
[
|
|
|
|
'as' => 'user-force_pass_reset',
|
|
|
|
'filter' => 'permission:users-force_pass_reset',
|
|
|
|
],
|
|
|
|
);
|
|
|
|
$routes->get('delete', 'UserController::delete/$1', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'user-delete',
|
|
|
|
'filter' => 'permission:users-delete',
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
2020-07-10 12:20:25 +00:00
|
|
|
|
|
|
|
// My account
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('my-account', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'MyAccountController', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'my-account',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'change-password',
|
|
|
|
'MyAccountController::changePassword/$1',
|
|
|
|
[
|
|
|
|
'as' => 'change-password',
|
|
|
|
],
|
|
|
|
);
|
2021-06-08 09:52:11 +00:00
|
|
|
$routes->post('change-password', 'MyAccountController::attemptChange/$1');
|
2020-08-14 18:27:57 +00:00
|
|
|
});
|
2021-04-02 17:20:02 +00:00
|
|
|
},
|
2020-07-10 12:20:25 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Overwriting Myth:auth routes file
|
|
|
|
*/
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group(config('App')->authGateway, function ($routes): void {
|
2020-08-14 18:27:57 +00:00
|
|
|
// Login/out
|
2021-05-19 16:35:13 +00:00
|
|
|
$routes->get('login', 'AuthController::login', [
|
|
|
|
'as' => 'login',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('login', 'AuthController::attemptLogin');
|
|
|
|
$routes->get('logout', 'AuthController::logout', [
|
|
|
|
'as' => 'logout',
|
|
|
|
]);
|
2020-07-10 12:20:25 +00:00
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// Registration
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('register', 'AuthController::register', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'register',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('register', 'AuthController::attemptRegister');
|
2020-07-10 12:20:25 +00:00
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// Activation
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('activate-account', 'AuthController::activateAccount', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'activate-account',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
|
|
|
'resend-activate-account',
|
|
|
|
'AuthController::resendActivateAccount',
|
|
|
|
[
|
|
|
|
'as' => 'resend-activate-account',
|
|
|
|
],
|
|
|
|
);
|
2020-07-31 16:05:10 +00:00
|
|
|
|
2020-08-14 18:27:57 +00:00
|
|
|
// Forgot/Resets
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('forgot', 'AuthController::forgotPassword', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'forgot',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('forgot', 'AuthController::attemptForgot');
|
|
|
|
$routes->get('reset-password', 'AuthController::resetPassword', [
|
2020-08-14 18:27:57 +00:00
|
|
|
'as' => 'reset-password',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('reset-password', 'AuthController::attemptReset');
|
2020-08-14 18:27:57 +00:00
|
|
|
});
|
2020-07-10 12:20:25 +00:00
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
// Podcast's Public routes
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('@(:podcastName)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PodcastController::activity/$1', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'podcast-activity',
|
|
|
|
]);
|
|
|
|
// override default ActivityPub Library's actor route
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'PodcastController::activity/$1', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'actor',
|
|
|
|
'alternate-content' => [
|
|
|
|
'application/activity+json' => [
|
|
|
|
'namespace' => 'ActivityPub\Controllers',
|
|
|
|
'controller-method' => 'ActorController/$1',
|
|
|
|
],
|
2021-07-12 18:40:22 +00:00
|
|
|
'application/podcast-activity+json' => [
|
|
|
|
'namespace' => 'App\Controllers',
|
|
|
|
'controller-method' => 'PodcastController::podcastActor/$1',
|
|
|
|
],
|
2021-04-02 17:20:02 +00:00
|
|
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
|
|
|
'namespace' => 'ActivityPub\Controllers',
|
|
|
|
'controller-method' => 'ActorController/$1',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('episodes', 'PodcastController::episodes/$1', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'podcast-episodes',
|
2021-07-12 18:40:22 +00:00
|
|
|
'alternate-content' => [
|
|
|
|
'application/activity+json' => [
|
|
|
|
'controller-method' => 'PodcastController::episodeCollection/$1',
|
|
|
|
],
|
|
|
|
'application/podcast-activity+json' => [
|
|
|
|
'controller-method' => 'PodcastController::episodeCollection/$1',
|
|
|
|
],
|
|
|
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
|
|
|
'controller-method' => 'PodcastController::episodeCollection/$1',
|
|
|
|
],
|
|
|
|
],
|
2021-04-02 17:20:02 +00:00
|
|
|
]);
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('episodes/(:slug)', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'EpisodeController/$1/$2', [
|
2021-02-27 21:21:26 +00:00
|
|
|
'as' => 'episode',
|
2021-07-12 18:40:22 +00:00
|
|
|
'alternate-content' => [
|
|
|
|
'application/activity+json' => [
|
|
|
|
'controller-method' => 'EpisodeController::episodeObject/$1/$2',
|
|
|
|
],
|
|
|
|
'application/podcast-activity+json' => [
|
|
|
|
'controller-method' => 'EpisodeController::episodeObject/$1/$2',
|
|
|
|
],
|
|
|
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
|
|
|
'controller-method' => 'EpisodeController::episodeObject/$1/$2',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
2021-07-24 15:33:34 +00:00
|
|
|
$routes->options('comments', 'EpisodeController::commentsPreflight/$1/$2');
|
2021-07-12 18:40:22 +00:00
|
|
|
$routes->get('comments', 'EpisodeController::comments/$1/$2', [
|
|
|
|
'as' => 'episode-comments',
|
|
|
|
'application/activity+json' => [
|
|
|
|
'controller-method' => 'EpisodeController::comments/$1/$2',
|
|
|
|
],
|
|
|
|
'application/podcast-activity+json' => [
|
|
|
|
'controller-method' => 'EpisodeController::comments/$1/$2',
|
|
|
|
],
|
|
|
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
|
|
|
'controller-method' => 'EpisodeController::comments/$1/$2',
|
|
|
|
],
|
2021-02-27 21:21:26 +00:00
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('oembed.json', 'EpisodeController::oembedJSON/$1/$2', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'episode-oembed-json',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('oembed.xml', 'EpisodeController::oembedXML/$1/$2', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'episode-oembed-xml',
|
|
|
|
]);
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('embeddable-player', function ($routes): void {
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('/', 'EpisodeController::embeddablePlayer/$1/$2', [
|
2021-02-27 21:21:26 +00:00
|
|
|
'as' => 'embeddable-player',
|
|
|
|
]);
|
2021-04-02 17:20:02 +00:00
|
|
|
$routes->get(
|
|
|
|
'(:embeddablePlayerTheme)',
|
2021-05-12 14:00:25 +00:00
|
|
|
'EpisodeController::embeddablePlayer/$1/$2/$3',
|
2021-04-02 17:20:02 +00:00
|
|
|
[
|
|
|
|
'as' => 'embeddable-player-theme',
|
|
|
|
],
|
|
|
|
);
|
2021-02-27 21:21:26 +00:00
|
|
|
});
|
|
|
|
});
|
2021-04-02 17:20:02 +00:00
|
|
|
|
2021-05-19 16:35:13 +00:00
|
|
|
$routes->head('feed.xml', 'FeedController/$1', [
|
|
|
|
'as' => 'podcast_feed',
|
|
|
|
]);
|
|
|
|
$routes->get('feed.xml', 'FeedController/$1', [
|
|
|
|
'as' => 'podcast_feed',
|
|
|
|
]);
|
2020-08-18 16:31:28 +00:00
|
|
|
});
|
2021-04-02 17:20:02 +00:00
|
|
|
|
|
|
|
// Other pages
|
2021-05-19 16:35:13 +00:00
|
|
|
$routes->get('/credits', 'CreditsController', [
|
|
|
|
'as' => 'credits',
|
|
|
|
]);
|
|
|
|
$routes->get('/pages/(:slug)', 'PageController/$1', [
|
|
|
|
'as' => 'page',
|
|
|
|
]);
|
2020-08-18 16:31:28 +00:00
|
|
|
|
2021-04-02 17:20:02 +00:00
|
|
|
// interacting as an actor
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post('interact-as-actor', 'AuthController::attemptInteractAsActor', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'interact-as-actor',
|
|
|
|
]);
|
|
|
|
|
2020-05-27 18:46:16 +02:00
|
|
|
/**
|
2021-04-02 17:20:02 +00:00
|
|
|
* Overwriting ActivityPub routes file
|
|
|
|
*/
|
2021-05-06 14:00:48 +00:00
|
|
|
$routes->group('@(:podcastName)', function ($routes): void {
|
2021-06-21 10:04:18 +00:00
|
|
|
$routes->post('statuses/new', 'StatusController::attemptCreate/$1', [
|
|
|
|
'as' => 'status-attempt-create',
|
2021-04-02 17:20:02 +00:00
|
|
|
'filter' => 'permission:podcast-manage_publications',
|
|
|
|
]);
|
2021-06-21 10:04:18 +00:00
|
|
|
// Status
|
|
|
|
$routes->group('statuses/(:uuid)', function ($routes): void {
|
|
|
|
$routes->get('/', 'StatusController::view/$1/$2', [
|
|
|
|
'as' => 'status',
|
2021-04-02 17:20:02 +00:00
|
|
|
'alternate-content' => [
|
|
|
|
'application/activity+json' => [
|
|
|
|
'namespace' => 'ActivityPub\Controllers',
|
2021-06-21 10:04:18 +00:00
|
|
|
'controller-method' => 'StatusController/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
|
|
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
|
|
|
'namespace' => 'ActivityPub\Controllers',
|
2021-06-21 10:04:18 +00:00
|
|
|
'controller-method' => 'StatusController/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
2021-06-21 10:04:18 +00:00
|
|
|
$routes->get('replies', 'StatusController/$1/$2', [
|
|
|
|
'as' => 'status-replies',
|
2021-04-02 17:20:02 +00:00
|
|
|
'alternate-content' => [
|
|
|
|
'application/activity+json' => [
|
|
|
|
'namespace' => 'ActivityPub\Controllers',
|
2021-06-21 10:04:18 +00:00
|
|
|
'controller-method' => 'StatusController::replies/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
|
|
|
'application/ld+json; profile="https://www.w3.org/ns/activitystreams' => [
|
|
|
|
'namespace' => 'ActivityPub\Controllers',
|
2021-06-21 10:04:18 +00:00
|
|
|
'controller-method' => 'StatusController::replies/$2',
|
2021-04-02 17:20:02 +00:00
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Actions
|
2021-06-21 10:04:18 +00:00
|
|
|
$routes->post('action', 'StatusController::attemptAction/$1/$2', [
|
|
|
|
'as' => 'status-attempt-action',
|
2021-04-02 17:20:02 +00:00
|
|
|
'filter' => 'permission:podcast-interact_as',
|
|
|
|
]);
|
|
|
|
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->post(
|
|
|
|
'block-actor',
|
2021-06-21 10:04:18 +00:00
|
|
|
'StatusController::attemptBlockActor/$1/$2',
|
2021-05-12 14:00:25 +00:00
|
|
|
[
|
2021-06-21 10:04:18 +00:00
|
|
|
'as' => 'status-attempt-block-actor',
|
2021-05-12 14:00:25 +00:00
|
|
|
'filter' => 'permission:fediverse-block_actors',
|
|
|
|
],
|
|
|
|
);
|
|
|
|
$routes->post(
|
|
|
|
'block-domain',
|
2021-06-21 10:04:18 +00:00
|
|
|
'StatusController::attemptBlockDomain/$1/$2',
|
2021-05-12 14:00:25 +00:00
|
|
|
[
|
2021-06-21 10:04:18 +00:00
|
|
|
'as' => 'status-attempt-block-domain',
|
2021-05-12 14:00:25 +00:00
|
|
|
'filter' => 'permission:fediverse-block_domains',
|
|
|
|
],
|
|
|
|
);
|
2021-06-21 10:04:18 +00:00
|
|
|
$routes->post('delete', 'StatusController::attemptDelete/$1/$2', [
|
|
|
|
'as' => 'status-attempt-delete',
|
2021-04-02 17:20:02 +00:00
|
|
|
'filter' => 'permission:podcast-manage_publications',
|
|
|
|
]);
|
|
|
|
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get(
|
2021-06-21 10:04:18 +00:00
|
|
|
'remote/(:statusAction)',
|
|
|
|
'StatusController::remoteAction/$1/$2/$3',
|
2021-05-12 14:00:25 +00:00
|
|
|
[
|
2021-06-21 10:04:18 +00:00
|
|
|
'as' => 'status-remote-action',
|
2021-05-12 14:00:25 +00:00
|
|
|
],
|
|
|
|
);
|
2021-04-02 17:20:02 +00:00
|
|
|
});
|
|
|
|
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('follow', 'ActorController::follow/$1', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'follow',
|
|
|
|
]);
|
2021-05-12 14:00:25 +00:00
|
|
|
$routes->get('outbox', 'ActorController::outbox/$1', [
|
2021-04-02 17:20:02 +00:00
|
|
|
'as' => 'outbox',
|
|
|
|
'filter' => 'activity-pub:verify-activitystream',
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
|
|
|
|
/*
|
2020-05-27 18:46:16 +02:00
|
|
|
* --------------------------------------------------------------------
|
|
|
|
* Additional Routing
|
|
|
|
* --------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* There will often be times that you need additional routing and you
|
2021-04-02 17:20:02 +00:00
|
|
|
* need it to be able to override any defaults in this file. Environment
|
2020-05-27 18:46:16 +02:00
|
|
|
* based routes is one such time. require() additional route files here
|
|
|
|
* to make that happen.
|
|
|
|
*
|
|
|
|
* You will have access to the $routes object within that file without
|
|
|
|
* needing to reload it.
|
|
|
|
*/
|
2020-06-01 21:23:14 +00:00
|
|
|
if (file_exists(APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php')) {
|
|
|
|
require APPPATH . 'Config/' . ENVIRONMENT . '/Routes.php';
|
2020-05-27 18:46:16 +02:00
|
|
|
}
|