Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • alpha
  • beta
  • develop
  • docs/fix-readme
  • docs/update-vitepress
  • draft/rss-feed
  • feat/dashboard
  • feat/episodes-page-ux
  • feat/generator-user-agent
  • feat/headliner
  • feat/new-languages
  • feat/plugins
  • fix/federation
  • fix/forms-ux
  • i18n
  • main
  • next
  • refactor/transcripts
  • v1.0.0
  • v1.0.0-alpha.1
  • v1.0.0-alpha.10
  • v1.0.0-alpha.11
  • v1.0.0-alpha.12
  • v1.0.0-alpha.13
  • v1.0.0-alpha.14
  • v1.0.0-alpha.15
  • v1.0.0-alpha.16
  • v1.0.0-alpha.17
  • v1.0.0-alpha.18
  • v1.0.0-alpha.19
  • v1.0.0-alpha.2
  • v1.0.0-alpha.20
  • v1.0.0-alpha.21
  • v1.0.0-alpha.22
  • v1.0.0-alpha.23
  • v1.0.0-alpha.24
  • v1.0.0-alpha.25
  • v1.0.0-alpha.26
  • v1.0.0-alpha.27
  • v1.0.0-alpha.28
  • v1.0.0-alpha.29
  • v1.0.0-alpha.3
  • v1.0.0-alpha.30
  • v1.0.0-alpha.31
  • v1.0.0-alpha.32
  • v1.0.0-alpha.33
  • v1.0.0-alpha.34
  • v1.0.0-alpha.35
  • v1.0.0-alpha.36
  • v1.0.0-alpha.37
  • v1.0.0-alpha.38
  • v1.0.0-alpha.39
  • v1.0.0-alpha.4
  • v1.0.0-alpha.40
  • v1.0.0-alpha.41
  • v1.0.0-alpha.42
  • v1.0.0-alpha.43
  • v1.0.0-alpha.44
  • v1.0.0-alpha.45
  • v1.0.0-alpha.46
  • v1.0.0-alpha.47
  • v1.0.0-alpha.48
  • v1.0.0-alpha.49
  • v1.0.0-alpha.5
  • v1.0.0-alpha.50
  • v1.0.0-alpha.51
  • v1.0.0-alpha.52
  • v1.0.0-alpha.53
  • v1.0.0-alpha.54
  • v1.0.0-alpha.55
  • v1.0.0-alpha.56
  • v1.0.0-alpha.57
  • v1.0.0-alpha.58
  • v1.0.0-alpha.59
  • v1.0.0-alpha.6
  • v1.0.0-alpha.60
  • v1.0.0-alpha.61
  • v1.0.0-alpha.62
  • v1.0.0-alpha.63
  • v1.0.0-alpha.64
  • v1.0.0-alpha.65
  • v1.0.0-alpha.66
  • v1.0.0-alpha.67
  • v1.0.0-alpha.68
  • v1.0.0-alpha.69
  • v1.0.0-alpha.7
  • v1.0.0-alpha.70
  • v1.0.0-alpha.71
  • v1.0.0-alpha.72
  • v1.0.0-alpha.73
  • v1.0.0-alpha.74
  • v1.0.0-alpha.75
  • v1.0.0-alpha.76
  • v1.0.0-alpha.77
  • v1.0.0-alpha.78
  • v1.0.0-alpha.79
  • v1.0.0-alpha.8
  • v1.0.0-alpha.80
  • v1.0.0-alpha.9
  • v1.0.0-beta.1
  • v1.0.0-beta.10
  • v1.0.0-beta.11
  • v1.0.0-beta.12
  • v1.0.0-beta.13
  • v1.0.0-beta.14
  • v1.0.0-beta.15
  • v1.0.0-beta.16
  • v1.0.0-beta.17
  • v1.0.0-beta.18
  • v1.0.0-beta.19
  • v1.0.0-beta.2
  • v1.0.0-beta.20
  • v1.0.0-beta.21
  • v1.0.0-beta.22
  • v1.0.0-beta.23
  • v1.0.0-beta.24
  • v1.0.0-beta.3
  • v1.0.0-beta.4
118 results

Target

Select target project
  • adaures/castopod
  • mkljczk/castopod-host
  • spaetz/castopod-host
  • PatrykMis/castopod
  • jonas/castopod
  • ajeremias/castopod
  • misuzu/castopod
  • KrzysztofDomanczyk/castopod
  • Behel/castopod
  • nebulon/castopod
  • ewen/castopod
  • NeoluxConsulting/castopod
  • nateritter/castopod-og
  • prcutler/castopod
14 results
Select Git revision
  • alpha
  • beta
  • develop
  • docs/fix-readme
  • docs/update-vitepress
  • draft/rss-feed
  • feat/dashboard
  • feat/episodes-page-ux
  • feat/generator-user-agent
  • feat/headliner
  • feat/new-languages
  • feat/plugins
  • fix/federation
  • fix/forms-ux
  • i18n
  • main
  • next
  • refactor/transcripts
  • v1.0.0
  • v1.0.0-alpha.1
  • v1.0.0-alpha.10
  • v1.0.0-alpha.11
  • v1.0.0-alpha.12
  • v1.0.0-alpha.13
  • v1.0.0-alpha.14
  • v1.0.0-alpha.15
  • v1.0.0-alpha.16
  • v1.0.0-alpha.17
  • v1.0.0-alpha.18
  • v1.0.0-alpha.19
  • v1.0.0-alpha.2
  • v1.0.0-alpha.20
  • v1.0.0-alpha.21
  • v1.0.0-alpha.22
  • v1.0.0-alpha.23
  • v1.0.0-alpha.24
  • v1.0.0-alpha.25
  • v1.0.0-alpha.26
  • v1.0.0-alpha.27
  • v1.0.0-alpha.28
  • v1.0.0-alpha.29
  • v1.0.0-alpha.3
  • v1.0.0-alpha.30
  • v1.0.0-alpha.31
  • v1.0.0-alpha.32
  • v1.0.0-alpha.33
  • v1.0.0-alpha.34
  • v1.0.0-alpha.35
  • v1.0.0-alpha.36
  • v1.0.0-alpha.37
  • v1.0.0-alpha.38
  • v1.0.0-alpha.39
  • v1.0.0-alpha.4
  • v1.0.0-alpha.40
  • v1.0.0-alpha.41
  • v1.0.0-alpha.42
  • v1.0.0-alpha.43
  • v1.0.0-alpha.44
  • v1.0.0-alpha.45
  • v1.0.0-alpha.46
  • v1.0.0-alpha.47
  • v1.0.0-alpha.48
  • v1.0.0-alpha.49
  • v1.0.0-alpha.5
  • v1.0.0-alpha.50
  • v1.0.0-alpha.51
  • v1.0.0-alpha.52
  • v1.0.0-alpha.53
  • v1.0.0-alpha.54
  • v1.0.0-alpha.55
  • v1.0.0-alpha.56
  • v1.0.0-alpha.57
  • v1.0.0-alpha.58
  • v1.0.0-alpha.59
  • v1.0.0-alpha.6
  • v1.0.0-alpha.60
  • v1.0.0-alpha.61
  • v1.0.0-alpha.62
  • v1.0.0-alpha.63
  • v1.0.0-alpha.64
  • v1.0.0-alpha.65
  • v1.0.0-alpha.66
  • v1.0.0-alpha.67
  • v1.0.0-alpha.68
  • v1.0.0-alpha.69
  • v1.0.0-alpha.7
  • v1.0.0-alpha.70
  • v1.0.0-alpha.71
  • v1.0.0-alpha.72
  • v1.0.0-alpha.73
  • v1.0.0-alpha.74
  • v1.0.0-alpha.75
  • v1.0.0-alpha.76
  • v1.0.0-alpha.77
  • v1.0.0-alpha.78
  • v1.0.0-alpha.79
  • v1.0.0-alpha.8
  • v1.0.0-alpha.80
  • v1.0.0-alpha.9
  • v1.0.0-beta.1
  • v1.0.0-beta.10
  • v1.0.0-beta.11
  • v1.0.0-beta.12
  • v1.0.0-beta.13
  • v1.0.0-beta.14
  • v1.0.0-beta.15
  • v1.0.0-beta.16
  • v1.0.0-beta.17
  • v1.0.0-beta.18
  • v1.0.0-beta.19
  • v1.0.0-beta.2
  • v1.0.0-beta.20
  • v1.0.0-beta.21
  • v1.0.0-beta.22
  • v1.0.0-beta.23
  • v1.0.0-beta.24
  • v1.0.0-beta.3
  • v1.0.0-beta.4
118 results
Show changes
Commits on Source (4)
# [1.0.0-alpha.77](https://code.podlibre.org/podlibre/castopod-host/compare/v1.0.0-alpha.76...v1.0.0-alpha.77) (2021-11-23)
### Bug Fixes
- **cors:** add preflight option routes for episode, podcast and status objects
([a281abf](https://code.podlibre.org/podlibre/castopod-host/commit/a281abfda475388a07943c169dab460cc2d4f944))
- **podcast-import:** move guid attribute declaration for Episode entity to
include slug data
([5d02ae3](https://code.podlibre.org/podlibre/castopod-host/commit/5d02ae39908a9d743627135b372bf981134c4328))
# [1.0.0-alpha.76](https://code.podlibre.org/podlibre/castopod-host/compare/v1.0.0-alpha.75...v1.0.0-alpha.76) (2021-10-26)
### Bug Fixes
......
......@@ -11,7 +11,7 @@ declare(strict_types=1);
|
| NOTE: this constant is updated upon release with Continuous Integration.
*/
defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.76');
defined('CP_VERSION') || define('CP_VERSION', '1.0.0-alpha.77');
/*
| --------------------------------------------------------------------
......
......@@ -690,6 +690,7 @@ $routes->group('@(:podcastName)', function ($routes): void {
'as' => 'podcast-activity',
]);
// override default ActivityPub Library's actor route
$routes->options('/', 'ActivityPubController::preflight');
$routes->get('/', 'PodcastController::activity/$1', [
'as' => 'actor',
'alternate-content' => [
......@@ -707,6 +708,7 @@ $routes->group('@(:podcastName)', function ($routes): void {
],
],
]);
$routes->options('episodes', 'ActivityPubController::preflight');
$routes->get('episodes', 'PodcastController::episodes/$1', [
'as' => 'podcast-episodes',
'alternate-content' => [
......@@ -722,6 +724,7 @@ $routes->group('@(:podcastName)', function ($routes): void {
],
]);
$routes->group('episodes/(:slug)', function ($routes): void {
$routes->options('/', 'ActivityPubController::preflight');
$routes->get('/', 'EpisodeController/$1/$2', [
'as' => 'episode',
'alternate-content' => [
......@@ -736,7 +739,7 @@ $routes->group('@(:podcastName)', function ($routes): void {
],
],
]);
$routes->options('comments', 'EpisodeController::commentsPreflight/$1/$2');
$routes->options('comments', 'ActivityPubController::preflight');
$routes->get('comments', 'EpisodeController::comments/$1/$2', [
'as' => 'episode-comments',
'application/activity+json' => [
......@@ -806,6 +809,7 @@ $routes->group('@(:podcastName)', function ($routes): void {
]);
// Status
$routes->group('statuses/(:uuid)', function ($routes): void {
$routes->options('/', 'ActivityPubController::preflight');
$routes->get('/', 'StatusController::view/$1/$2', [
'as' => 'status',
'alternate-content' => [
......@@ -819,6 +823,7 @@ $routes->group('@(:podcastName)', function ($routes): void {
],
],
]);
$routes->options('replies', 'ActivityPubController::preflight');
$routes->get('replies', 'StatusController/$1/$2', [
'as' => 'status-replies',
'alternate-content' => [
......
<?php
declare(strict_types=1);
/**
* @copyright 2021 Podlibre
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
* @link https://castopod.org/
*/
namespace App\Controllers;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\Response;
class ActivityPubController extends Controller
{
/**
* @noRector ReturnTypeDeclarationRector
*/
public function preflight(): Response
{
return $this->response->setHeader('Access-Control-Allow-Origin', '*') // for allowing any domain, insecure
->setHeader('Access-Control-Allow-Headers', '*') // for allowing any headers, insecure
->setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS') // allows GET and OPTIONS methods only
->setHeader('Access-Control-Max-Age', '86400')
->setHeader('Cache-Control', 'public, max-age=86400')
->setStatusCode(200);
}
}
......@@ -345,9 +345,9 @@ class PodcastImportController extends BaseController
$newEpisode = new Episode([
'podcast_id' => $newPodcastId,
'guid' => $item->guid ?? null,
'title' => $item->title,
'slug' => $slug,
'guid' => $item->guid ?? null,
'audio_file' => download_file((string) $item->enclosure->attributes()['url']),
'description_markdown' => $converter->convert($itemDescriptionHtml),
'description_html' => $itemDescriptionHtml,
......
......@@ -210,19 +210,6 @@ class EpisodeController extends BaseController
->setBody($podcastObject->toJSON());
}
/**
* @noRector ReturnTypeDeclarationRector
*/
public function commentsPreflight(): Response
{
return $this->response->setHeader('Access-Control-Allow-Origin', '*') // for allowing any domain, insecure
->setHeader('Access-Control-Allow-Headers', '*') // for allowing any headers, insecure
->setHeader('Access-Control-Allow-Methods', 'GET, OPTIONS') // allows GET and OPTIONS methods only
->setHeader('Access-Control-Max-Age', '86400')
->setHeader('Cache-Control', 'public, max-age=86400')
->setStatusCode(200);
}
/**
* @noRector ReturnTypeDeclarationRector
*/
......
......@@ -420,7 +420,7 @@ class Episode extends Entity
public function getLink(): string
{
return base_url(route_to('episode', $this->getPodcast() ->name, $this->attributes['slug']));
return url_to('episode', $this->getPodcast()->name, $this->attributes['slug']);
}
public function getEmbeddablePlayerUrl(string $theme = null): string
......
......@@ -125,7 +125,7 @@ class FavouriteModel extends UuidModel
$likeActivity = new LikeActivity();
$likeActivity
->set('id', base_url(route_to('activity', $actor->username, $activity->id)))
->set('id', url_to('activity', $actor->username, $activity->id))
->set('actor', $actor->uri)
->set('object', $status->uri);
......
......@@ -83,7 +83,7 @@ class FollowModel extends Model
'queued',
);
$followActivity->set('id', base_url(route_to('activity', $actor->username, $activityId)));
$followActivity->set('id', url_to('activity', $actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......
......@@ -278,7 +278,7 @@ class StatusModel extends UuidModel
if ($registerActivity) {
// set status id and uri to construct NoteObject
$status->id = $newStatusId;
$status->uri = base_url(route_to('status', $status->actor->username, $newStatusId));
$status->uri = url_to('status', $status->actor->username, $newStatusId);
$createActivity = new CreateActivity();
$noteObjectClass = config('ActivityPub')
......@@ -298,7 +298,7 @@ class StatusModel extends UuidModel
'queued',
);
$createActivity->set('id', base_url(route_to('activity', $status->actor->username, $activityId)));
$createActivity->set('id', url_to('activity', $status->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -411,7 +411,7 @@ class StatusModel extends UuidModel
'queued',
);
$deleteActivity->set('id', base_url(route_to('activity', $status->actor->username, $activityId)));
$deleteActivity->set('id', url_to('activity', $status->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -492,7 +492,7 @@ class StatusModel extends UuidModel
'queued',
);
$announceActivity->set('id', base_url(route_to('activity', $status->actor->username, $activityId)));
$announceActivity->set('id', url_to('activity', $status->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -535,10 +535,7 @@ class StatusModel extends UuidModel
->first();
$announceActivity = new AnnounceActivity($reblogStatus);
$announceActivity->set(
'id',
base_url(route_to('activity', $reblogStatus->actor->username, $activity->id)),
);
$announceActivity->set('id', url_to('activity', $reblogStatus->actor->username, $activity->id),);
$undoActivity
->set('actor', $reblogStatus->actor->uri)
......@@ -555,7 +552,7 @@ class StatusModel extends UuidModel
'queued',
);
$undoActivity->set('id', base_url(route_to('activity', $reblogStatus->actor->username, $activityId)));
$undoActivity->set('id', url_to('activity', $reblogStatus->actor->username, $activityId));
model('ActivityModel')
->update($activityId, [
......@@ -627,7 +624,7 @@ class StatusModel extends UuidModel
$actor = model('ActorModel')
->getActorById((int) $data['data']['actor_id']);
$data['data']['uri'] = base_url(route_to('status', $actor->username, $uuid4->toString()));
$data['data']['uri'] = url_to('status', $actor->username, $uuid4->toString());
}
return $data;
......
{
"name": "podlibre/castopod-host",
"version": "1.0.0-alpha76",
"version": "1.0.0-alpha77",
"type": "project",
"description": "Castopod Host is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"homepage": "https://castopod.org",
......
This diff is collapsed.
{
"name": "castopod-host",
"version": "1.0.0-alpha.76",
"version": "1.0.0-alpha.77",
"description": "Castopod Host is an open-source hosting platform made for podcasters who want engage and interact with their audience.",
"private": true,
"license": "AGPL-3.0-or-later",
......@@ -45,10 +45,10 @@
"devDependencies": {
"@commitlint/cli": "^12.0.1",
"@commitlint/config-conventional": "^12.0.1",
"@semantic-release/changelog": "^5.0.1",
"@semantic-release/exec": "^5.0.0",
"@semantic-release/git": "^9.0.0",
"@semantic-release/gitlab": "^6.0.9",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/gitlab": "^7.0.4",
"@tailwindcss/forms": "^0.2.1",
"@tailwindcss/line-clamp": "^0.2.0",
"@tailwindcss/typography": "^0.4.0",
......@@ -72,7 +72,7 @@
"prettier": "2.2.1",
"prettier-plugin-organize-imports": "^1.1.1",
"rollup-plugin-multi-input": "^1.2.0",
"semantic-release": "^17.4.2",
"semantic-release": "^18.0.0",
"stylelint": "^13.12.0",
"stylelint-config-standard": "^21.0.0",
"svgo": "^2.2.2",
......