Remove references to short domain
This commit is contained in:
parent
328c9badb4
commit
7a58287b34
27 changed files with 215 additions and 404 deletions
|
@ -60,7 +60,7 @@ class PasskeysController extends Controller
|
||||||
// RP Entity i.e. the application
|
// RP Entity i.e. the application
|
||||||
$rpEntity = PublicKeyCredentialRpEntity::create(
|
$rpEntity = PublicKeyCredentialRpEntity::create(
|
||||||
config('app.name'),
|
config('app.name'),
|
||||||
config('url.longurl'),
|
config('app.url'),
|
||||||
);
|
);
|
||||||
|
|
||||||
// User Entity
|
// User Entity
|
||||||
|
@ -148,7 +148,7 @@ class PasskeysController extends Controller
|
||||||
);
|
);
|
||||||
$securedRelyingPartyId = [];
|
$securedRelyingPartyId = [];
|
||||||
if (App::environment('local', 'development')) {
|
if (App::environment('local', 'development')) {
|
||||||
$securedRelyingPartyId = [config('url.longurl')];
|
$securedRelyingPartyId = [config('app.url')];
|
||||||
}
|
}
|
||||||
$ceremonyStepManagerFactory->setSecuredRelyingPartyId($securedRelyingPartyId);
|
$ceremonyStepManagerFactory->setSecuredRelyingPartyId($securedRelyingPartyId);
|
||||||
|
|
||||||
|
@ -165,7 +165,7 @@ class PasskeysController extends Controller
|
||||||
$publicKeyCredentialSource = $authenticatorAttestationResponseValidator->check(
|
$publicKeyCredentialSource = $authenticatorAttestationResponseValidator->check(
|
||||||
authenticatorAttestationResponse: $publicKeyCredential->response,
|
authenticatorAttestationResponse: $publicKeyCredential->response,
|
||||||
publicKeyCredentialCreationOptions: $publicKeyCredentialCreationOptions,
|
publicKeyCredentialCreationOptions: $publicKeyCredentialCreationOptions,
|
||||||
request: config('url.longurl'),
|
request: config('app.url'),
|
||||||
securedRelyingPartyId: $securedRelyingPartyId,
|
securedRelyingPartyId: $securedRelyingPartyId,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ class PasskeysController extends Controller
|
||||||
);
|
);
|
||||||
$securedRelyingPartyId = [];
|
$securedRelyingPartyId = [];
|
||||||
if (App::environment('local', 'development')) {
|
if (App::environment('local', 'development')) {
|
||||||
$securedRelyingPartyId = [config('url.longurl')];
|
$securedRelyingPartyId = [config('app.url')];
|
||||||
}
|
}
|
||||||
$ceremonyStepManagerFactory->setSecuredRelyingPartyId($securedRelyingPartyId);
|
$ceremonyStepManagerFactory->setSecuredRelyingPartyId($securedRelyingPartyId);
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ class PasskeysController extends Controller
|
||||||
credentialId: $publicKeyCredentialSource,
|
credentialId: $publicKeyCredentialSource,
|
||||||
authenticatorAssertionResponse: $publicKeyCredential->response,
|
authenticatorAssertionResponse: $publicKeyCredential->response,
|
||||||
publicKeyCredentialRequestOptions: $publicKeyCredentialRequestOptions,
|
publicKeyCredentialRequestOptions: $publicKeyCredentialRequestOptions,
|
||||||
request: config('url.longurl'),
|
request: config('app.url'),
|
||||||
userHandle: null,
|
userHandle: null,
|
||||||
securedRelyingPartyId: $securedRelyingPartyId,
|
securedRelyingPartyId: $securedRelyingPartyId,
|
||||||
);
|
);
|
||||||
|
|
|
@ -122,8 +122,8 @@ class FeedsController extends Controller
|
||||||
|
|
||||||
foreach ($notes as $key => $note) {
|
foreach ($notes as $key => $note) {
|
||||||
$data['items'][$key] = [
|
$data['items'][$key] = [
|
||||||
'id' => $note->longurl,
|
'id' => $note->uri,
|
||||||
'url' => $note->longurl,
|
'url' => $note->uri,
|
||||||
'content_text' => $note->content,
|
'content_text' => $note->content,
|
||||||
'date_published' => $note->created_at->tz('UTC')->toRfc3339String(),
|
'date_published' => $note->created_at->tz('UTC')->toRfc3339String(),
|
||||||
'date_modified' => $note->updated_at->tz('UTC')->toRfc3339String(),
|
'date_modified' => $note->updated_at->tz('UTC')->toRfc3339String(),
|
||||||
|
@ -164,7 +164,7 @@ class FeedsController extends Controller
|
||||||
'author' => [
|
'author' => [
|
||||||
'type' => 'card',
|
'type' => 'card',
|
||||||
'name' => config('user.display_name'),
|
'name' => config('user.display_name'),
|
||||||
'url' => config('url.longurl'),
|
'url' => config('app.url'),
|
||||||
],
|
],
|
||||||
'children' => $items,
|
'children' => $items,
|
||||||
], 200, [
|
], 200, [
|
||||||
|
@ -183,8 +183,8 @@ class FeedsController extends Controller
|
||||||
$items[] = [
|
$items[] = [
|
||||||
'type' => 'entry',
|
'type' => 'entry',
|
||||||
'published' => $note->created_at,
|
'published' => $note->created_at,
|
||||||
'uid' => $note->longurl,
|
'uid' => $note->uri,
|
||||||
'url' => $note->longurl,
|
'url' => $note->uri,
|
||||||
'content' => [
|
'content' => [
|
||||||
'text' => $note->getRawOriginal('note'),
|
'text' => $note->getRawOriginal('note'),
|
||||||
'html' => $note->note,
|
'html' => $note->note,
|
||||||
|
@ -200,7 +200,7 @@ class FeedsController extends Controller
|
||||||
'author' => [
|
'author' => [
|
||||||
'type' => 'card',
|
'type' => 'card',
|
||||||
'name' => config('user.display_name'),
|
'name' => config('user.display_name'),
|
||||||
'url' => config('url.longurl'),
|
'url' => config('app.url'),
|
||||||
],
|
],
|
||||||
'children' => $items,
|
'children' => $items,
|
||||||
], 200, [
|
], 200, [
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\RedirectResponse;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @psalm-suppress UnusedClass
|
|
||||||
*/
|
|
||||||
class ShortURLsController extends Controller
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Short URL Controller
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| This redirects the short urls to long ones
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Redirect from '/' to the long url.
|
|
||||||
*/
|
|
||||||
public function baseURL(): RedirectResponse
|
|
||||||
{
|
|
||||||
return redirect(config('app.url'));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Redirect from '/@' to a twitter profile.
|
|
||||||
*/
|
|
||||||
public function twitter(): RedirectResponse
|
|
||||||
{
|
|
||||||
return redirect('https://twitter.com/jonnybarnes');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Redirect a short url of this site out to a long one based on post type.
|
|
||||||
*
|
|
||||||
* Further redirects may happen.
|
|
||||||
*/
|
|
||||||
public function expandType(string $type, string $postId): RedirectResponse
|
|
||||||
{
|
|
||||||
if ($type === 't') {
|
|
||||||
$type = 'notes';
|
|
||||||
}
|
|
||||||
if ($type === 'b') {
|
|
||||||
$type = 'blog/s';
|
|
||||||
}
|
|
||||||
|
|
||||||
return redirect(config('app.url') . '/' . $type . '/' . $postId);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -53,7 +53,7 @@ class ProcessWebMention implements ShouldQueue
|
||||||
// check webmention still references target
|
// check webmention still references target
|
||||||
// we try each type of mention (reply/like/repost)
|
// we try each type of mention (reply/like/repost)
|
||||||
if ($webmention->type === 'in-reply-to') {
|
if ($webmention->type === 'in-reply-to') {
|
||||||
if ($parser->checkInReplyTo($microformats, $this->note->longurl) === false) {
|
if ($parser->checkInReplyTo($microformats, $this->note->uri) === false) {
|
||||||
// it doesn’t so delete
|
// it doesn’t so delete
|
||||||
$webmention->delete();
|
$webmention->delete();
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class ProcessWebMention implements ShouldQueue
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ($webmention->type === 'like-of') {
|
if ($webmention->type === 'like-of') {
|
||||||
if ($parser->checkLikeOf($microformats, $this->note->longurl) === false) {
|
if ($parser->checkLikeOf($microformats, $this->note->uri) === false) {
|
||||||
// it doesn’t so delete
|
// it doesn’t so delete
|
||||||
$webmention->delete();
|
$webmention->delete();
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ class ProcessWebMention implements ShouldQueue
|
||||||
} // note we don’t need to do anything if it still is a like
|
} // note we don’t need to do anything if it still is a like
|
||||||
}
|
}
|
||||||
if ($webmention->type === 'repost-of') {
|
if ($webmention->type === 'repost-of') {
|
||||||
if ($parser->checkRepostOf($microformats, $this->note->longurl) === false) {
|
if ($parser->checkRepostOf($microformats, $this->note->uri) === false) {
|
||||||
// it doesn’t so delete
|
// it doesn’t so delete
|
||||||
$webmention->delete();
|
$webmention->delete();
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ class ProcessWebMention implements ShouldQueue
|
||||||
$type = $parser->getMentionType($microformats); // throw error here?
|
$type = $parser->getMentionType($microformats); // throw error here?
|
||||||
dispatch(new SaveProfileImage($microformats));
|
dispatch(new SaveProfileImage($microformats));
|
||||||
$webmention->source = $this->source;
|
$webmention->source = $this->source;
|
||||||
$webmention->target = $this->note->longurl;
|
$webmention->target = $this->note->uri;
|
||||||
$webmention->commentable_id = $this->note->id;
|
$webmention->commentable_id = $this->note->id;
|
||||||
$webmention->commentable_type = Note::class;
|
$webmention->commentable_type = Note::class;
|
||||||
$webmention->type = $type;
|
$webmention->type = $type;
|
||||||
|
|
|
@ -45,7 +45,7 @@ class SendWebMentions implements ShouldQueue
|
||||||
$guzzle = resolve(Client::class);
|
$guzzle = resolve(Client::class);
|
||||||
$guzzle->post($endpoint, [
|
$guzzle->post($endpoint, [
|
||||||
'form_params' => [
|
'form_params' => [
|
||||||
'source' => $this->note->longurl,
|
'source' => $this->note->uri,
|
||||||
'target' => $url,
|
'target' => $url,
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
@ -61,7 +61,7 @@ class SendWebMentions implements ShouldQueue
|
||||||
public function discoverWebmentionEndpoint(string $url): ?string
|
public function discoverWebmentionEndpoint(string $url): ?string
|
||||||
{
|
{
|
||||||
// let’s not send webmentions to myself
|
// let’s not send webmentions to myself
|
||||||
if (parse_url($url, PHP_URL_HOST) === config('url.longurl')) {
|
if (parse_url($url, PHP_URL_HOST) === parse_url(config('app.url'), PHP_URL_HOST)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (Str::startsWith($url, '/notes/tagged/')) {
|
if (Str::startsWith($url, '/notes/tagged/')) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ class Bookmark extends Model
|
||||||
return $this->belongsToMany('App\Models\Tag');
|
return $this->belongsToMany('App\Models\Tag');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function longurl(): Attribute
|
protected function local_uri(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::get(
|
return Attribute::get(
|
||||||
get: fn () => config('app.url') . '/bookmarks/' . $this->id,
|
get: fn () => config('app.url') . '/bookmarks/' . $this->id,
|
||||||
|
|
|
@ -124,7 +124,7 @@ class Note extends Model
|
||||||
public function getNoteAttribute(?string $value): ?string
|
public function getNoteAttribute(?string $value): ?string
|
||||||
{
|
{
|
||||||
if ($value === null && $this->place !== null) {
|
if ($value === null && $this->place !== null) {
|
||||||
$value = '📍: <a href="' . $this->place->longurl . '">' . $this->place->name . '</a>';
|
$value = '📍: <a href="' . $this->place->uri . '">' . $this->place->name . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// if $value is still null, just return null
|
// if $value is still null, just return null
|
||||||
|
@ -172,16 +172,11 @@ class Note extends Model
|
||||||
return (string) resolve(Numbers::class)->numto60($this->id);
|
return (string) resolve(Numbers::class)->numto60($this->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLongurlAttribute(): string
|
public function getUriAttribute(): string
|
||||||
{
|
{
|
||||||
return config('app.url') . '/notes/' . $this->nb60id;
|
return config('app.url') . '/notes/' . $this->nb60id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getShorturlAttribute(): string
|
|
||||||
{
|
|
||||||
return config('url.shorturl') . '/notes/' . $this->nb60id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getIso8601Attribute(): string
|
public function getIso8601Attribute(): string
|
||||||
{
|
{
|
||||||
return $this->updated_at->toISO8601String();
|
return $this->updated_at->toISO8601String();
|
||||||
|
|
|
@ -74,24 +74,10 @@ class Place extends Model
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function longurl(): Attribute
|
|
||||||
{
|
|
||||||
return Attribute::get(
|
|
||||||
get: fn ($value, $attributes) => config('app.url') . '/places/' . $attributes['slug'],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function shorturl(): Attribute
|
|
||||||
{
|
|
||||||
return Attribute::get(
|
|
||||||
get: fn ($value, $attributes) => config('url.shorturl') . '/places/' . $attributes['slug'],
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function uri(): Attribute
|
protected function uri(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::get(
|
return Attribute::get(
|
||||||
get: fn () => $this->longurl,
|
get: static fn ($value, $attributes) => config('app.url') . '/places/' . $attributes['slug'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,6 @@ class HCardService
|
||||||
$data['longitude'] = Arr::get($request, 'longitude');
|
$data['longitude'] = Arr::get($request, 'longitude');
|
||||||
}
|
}
|
||||||
|
|
||||||
return resolve(PlaceService::class)->createPlace($data)->longurl;
|
return resolve(PlaceService::class)->createPlace($data)->uri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,17 +18,17 @@ class HEntryService
|
||||||
public function process(array $request, ?string $client = null): ?string
|
public function process(array $request, ?string $client = null): ?string
|
||||||
{
|
{
|
||||||
if (Arr::get($request, 'properties.like-of') || Arr::get($request, 'like-of')) {
|
if (Arr::get($request, 'properties.like-of') || Arr::get($request, 'like-of')) {
|
||||||
return resolve(LikeService::class)->create($request)->longurl;
|
return resolve(LikeService::class)->create($request)->url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Arr::get($request, 'properties.bookmark-of') || Arr::get($request, 'bookmark-of')) {
|
if (Arr::get($request, 'properties.bookmark-of') || Arr::get($request, 'bookmark-of')) {
|
||||||
return resolve(BookmarkService::class)->create($request)->longurl;
|
return resolve(BookmarkService::class)->create($request)->uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Arr::get($request, 'properties.name') || Arr::get($request, 'name')) {
|
if (Arr::get($request, 'properties.name') || Arr::get($request, 'name')) {
|
||||||
return resolve(ArticleService::class)->create($request)->longurl;
|
return resolve(ArticleService::class)->create($request)->link;
|
||||||
}
|
}
|
||||||
|
|
||||||
return resolve(NoteService::class)->create($request, $client)->longurl;
|
return resolve(NoteService::class)->create($request, $client)->uri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Here we set the long and short URLs our app shall use
|
|
||||||
* You can override these settings in the .env file
|
|
||||||
*/
|
|
||||||
|
|
||||||
return [
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Application Long URL
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| The long URL for the application
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'longurl' => env('APP_LONGURL', 'longurl.local'),
|
|
||||||
|
|
||||||
/*
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
| Application Short URL
|
|
||||||
|--------------------------------------------------------------------------
|
|
||||||
|
|
|
||||||
| The short URL for the application
|
|
||||||
|
|
|
||||||
*/
|
|
||||||
|
|
||||||
'shorturl' => env('APP_SHORTURL', 'shorturl.local'),
|
|
||||||
|
|
||||||
];
|
|
|
@ -3,7 +3,7 @@
|
||||||
<channel>
|
<channel>
|
||||||
<title>{{ config('user.display_name') }}</title>
|
<title>{{ config('user.display_name') }}</title>
|
||||||
<atom:link href="{{ config('app.url') }}/blog/feed.rss" rel="self" type="application/rss+xml" />
|
<atom:link href="{{ config('app.url') }}/blog/feed.rss" rel="self" type="application/rss+xml" />
|
||||||
<description>An RSS feed of the blog posts found on {{ config('url.longurl') }}</description>
|
<description>An RSS feed of the blog posts found on {{ config('app.url') }}</description>
|
||||||
<link>{{ config('app.url') }}/blog</link>
|
<link>{{ config('app.url') }}/blog</link>
|
||||||
<lastBuildDate>{{ $buildDate }}</lastBuildDate>
|
<lastBuildDate>{{ $buildDate }}</lastBuildDate>
|
||||||
<ttl>1800</ttl>
|
<ttl>1800</ttl>
|
||||||
|
|
|
@ -7,15 +7,15 @@
|
||||||
@foreach($bookmarks as $bookmark)
|
@foreach($bookmarks as $bookmark)
|
||||||
<div class="h-entry">
|
<div class="h-entry">
|
||||||
<div class="bookmark-link">
|
<div class="bookmark-link">
|
||||||
<a class="u-bookmark-of<?php if ($bookmark->name !== null) { echo ' h-cite'; } ?>" href="{{ $bookmark->url }}">
|
<a class="u-bookmark-of<?php if ($bookmark->name !== null) { echo ' h-cite'; } ?>" href="{{ $bookmark->uri }}">
|
||||||
@isset($bookmark->name)
|
@isset($bookmark->name)
|
||||||
{{ $bookmark->name }}
|
{{ $bookmark->name }}
|
||||||
@endisset
|
@endisset
|
||||||
|
|
||||||
@empty($bookmark->name)
|
@empty($bookmark->name)
|
||||||
{{ $bookmark->url }}
|
{{ $bookmark->uri }}
|
||||||
@endempty
|
@endempty
|
||||||
</a> <a href="{{ $bookmark->longurl }}">🔗</a>
|
</a> <a href="{{ $bookmark->uri }}">🔗</a>
|
||||||
</div>
|
</div>
|
||||||
@isset($bookmark->content)
|
@isset($bookmark->content)
|
||||||
<p>{{ $bookmark->content }}</p>
|
<p>{{ $bookmark->content }}</p>
|
||||||
|
|
|
@ -8,15 +8,15 @@
|
||||||
@foreach($bookmarks as $bookmark)
|
@foreach($bookmarks as $bookmark)
|
||||||
<div class="h-entry">
|
<div class="h-entry">
|
||||||
<div class="bookmark-link">
|
<div class="bookmark-link">
|
||||||
<a class="u-bookmark-of<?php if ($bookmark->name !== null) { echo ' h-cite'; } ?>" href="{{ $bookmark->url }}">
|
<a class="u-bookmark-of<?php if ($bookmark->name !== null) { echo ' h-cite'; } ?>" href="{{ $bookmark->uri }}">
|
||||||
@isset($bookmark->name)
|
@isset($bookmark->name)
|
||||||
{{ $bookmark->name }}
|
{{ $bookmark->name }}
|
||||||
@endisset
|
@endisset
|
||||||
|
|
||||||
@empty($bookmark->name)
|
@empty($bookmark->name)
|
||||||
{{ $bookmark->url }}
|
{{ $bookmark->uri }}
|
||||||
@endempty
|
@endempty
|
||||||
</a> <a href="{{ $bookmark->longurl }}">🔗</a>
|
</a> <a href="{{ $bookmark->uri }}">🔗</a>
|
||||||
</div>
|
</div>
|
||||||
@isset($bookmark->content)
|
@isset($bookmark->content)
|
||||||
<p>{{ $bookmark->content }}</p>
|
<p>{{ $bookmark->content }}</p>
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
@foreach($notes as $note)
|
@foreach($notes as $note)
|
||||||
<entry>
|
<entry>
|
||||||
<title>{{ strip_tags($note->note) }}</title>
|
<title>{{ strip_tags($note->note) }}</title>
|
||||||
<link href="{{ $note->longurl }}" />
|
<link href="{{ $note->uri }}" />
|
||||||
<id>{{ $note->longurl }}</id>
|
<id>{{ $note->uri }}</id>
|
||||||
<updated>{{ $note->updated_at->toAtomString() }}</updated>
|
<updated>{{ $note->updated_at->toAtomString() }}</updated>
|
||||||
<content type="html">{{ $note->note }}</content>
|
<content type="html">{{ $note->note }}</content>
|
||||||
<author>
|
<author>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<channel>
|
<channel>
|
||||||
<title>{{ config('user.display_name') }}</title>
|
<title>{{ config('user.display_name') }}</title>
|
||||||
<atom:link href="{{ config('app.url') }}/notes/feed.rss" rel="self" type="application/rss+xml" />
|
<atom:link href="{{ config('app.url') }}/notes/feed.rss" rel="self" type="application/rss+xml" />
|
||||||
<description>An RSS feed of the notes found on {{ config('url.longurl') }}</description>
|
<description>An RSS feed of the notes found on {{ config('app.url') }}</description>
|
||||||
<link>{{ config('app.url') }}/notes</link>
|
<link>{{ config('app.url') }}/notes</link>
|
||||||
<lastBuildDate>{{ $buildDate }}</lastBuildDate>
|
<lastBuildDate>{{ $buildDate }}</lastBuildDate>
|
||||||
<ttl>1800</ttl>
|
<ttl>1800</ttl>
|
||||||
|
@ -16,8 +16,8 @@
|
||||||
{!! $note->note !!}
|
{!! $note->note !!}
|
||||||
]]>
|
]]>
|
||||||
</description>
|
</description>
|
||||||
<link>{{ $note->longurl }}</link>
|
<link>{{ $note->uri }}</link>
|
||||||
<guid>{{ $note->longurl}}</guid>
|
<guid>{{ $note->uri}}</guid>
|
||||||
<pubDate>{{ $note->pubdate }}</pubDate>
|
<pubDate>{{ $note->pubdate }}</pubDate>
|
||||||
</item>
|
</item>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
@if($note->client) via <a class="client" href="{{ $note->client->client_url }}">{{ $note->client->client_name }}</a>@endif
|
@if($note->client) via <a class="client" href="{{ $note->client->client_url }}">{{ $note->client->client_name }}</a>@endif
|
||||||
@if($note->place)
|
@if($note->place)
|
||||||
@if($note->getOriginal('note'))
|
@if($note->getOriginal('note'))
|
||||||
in <span class="p-location h-card"><a class="p-name u-url" href="{{ $note->place->longurl }}">{{ $note->address }}</a><data class="p-latitude" value="{{ $note->place->latitude }}"></data><data class="p-longitude" value="{{ $note->place->longitude }}"></data></span>
|
in <span class="p-location h-card"><a class="p-name u-url" href="{{ $note->place->uri }}">{{ $note->address }}</a><data class="p-latitude" value="{{ $note->place->latitude }}"></data><data class="p-longitude" value="{{ $note->place->longitude }}"></data></span>
|
||||||
@endif
|
@endif
|
||||||
@elseif($note->address)
|
@elseif($note->address)
|
||||||
in <span class="p-location h-adr">{!! $note->address !!}<data class="p-latitude" value="{{ $note->latitude }}"></data><data class="p-longitude" value="{{ $note->longitude }}"></data></span>
|
in <span class="p-location h-adr">{!! $note->address !!}<data class="p-latitude" value="{{ $note->latitude }}"></data><data class="p-longitude" value="{{ $note->longitude }}"></data></span>
|
||||||
|
|
126
routes/web.php
126
routes/web.php
|
@ -23,7 +23,6 @@ use App\Http\Controllers\MicropubMediaController;
|
||||||
use App\Http\Controllers\NotesController;
|
use App\Http\Controllers\NotesController;
|
||||||
use App\Http\Controllers\PlacesController;
|
use App\Http\Controllers\PlacesController;
|
||||||
use App\Http\Controllers\SearchController;
|
use App\Http\Controllers\SearchController;
|
||||||
use App\Http\Controllers\ShortURLsController;
|
|
||||||
use App\Http\Controllers\WebMentionsController;
|
use App\Http\Controllers\WebMentionsController;
|
||||||
use App\Http\Middleware\CorsHeaders;
|
use App\Http\Middleware\CorsHeaders;
|
||||||
use App\Http\Middleware\MyAuthMiddleware;
|
use App\Http\Middleware\MyAuthMiddleware;
|
||||||
|
@ -41,27 +40,26 @@ use Illuminate\Support\Facades\Route;
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Route::domain(config('url.longurl'))->group(function () {
|
Route::get('/', [FrontPageController::class, 'index']);
|
||||||
Route::get('/', [FrontPageController::class, 'index']);
|
|
||||||
|
|
||||||
// Static project page
|
// Static project page
|
||||||
Route::view('projects', 'projects');
|
Route::view('projects', 'projects');
|
||||||
|
|
||||||
// Static colophon page
|
// Static colophon page
|
||||||
Route::view('colophon', 'colophon');
|
Route::view('colophon', 'colophon');
|
||||||
|
|
||||||
// The login routes to get auth’d for admin
|
// The login routes to get auth’d for admin
|
||||||
Route::get('login', [AuthController::class, 'showLogin'])->name('login');
|
Route::get('login', [AuthController::class, 'showLogin'])->name('login');
|
||||||
Route::post('login', [AuthController::class, 'login']);
|
Route::post('login', [AuthController::class, 'login']);
|
||||||
Route::get('login/passkey', [PasskeysController::class, 'getRequestOptions']);
|
Route::get('login/passkey', [PasskeysController::class, 'getRequestOptions']);
|
||||||
Route::post('login/passkey', [PasskeysController::class, 'login']);
|
Route::post('login/passkey', [PasskeysController::class, 'login']);
|
||||||
|
|
||||||
// And the logout routes
|
// And the logout routes
|
||||||
Route::get('logout', [AuthController::class, 'showLogout'])->name('logout');
|
Route::get('logout', [AuthController::class, 'showLogout'])->name('logout');
|
||||||
Route::post('logout', [AuthController::class, 'logout']);
|
Route::post('logout', [AuthController::class, 'logout']);
|
||||||
|
|
||||||
// Admin pages grouped for filter
|
// Admin pages grouped for filter
|
||||||
Route::middleware(MyAuthMiddleware::class)->prefix('admin')->group(function () {
|
Route::middleware(MyAuthMiddleware::class)->prefix('admin')->group(function () {
|
||||||
Route::get('/', [HomeController::class, 'welcome']);
|
Route::get('/', [HomeController::class, 'welcome']);
|
||||||
|
|
||||||
// Articles
|
// Articles
|
||||||
|
@ -150,10 +148,10 @@ Route::domain(config('url.longurl'))->group(function () {
|
||||||
Route::get('register', [PasskeysController::class, 'getCreateOptions']);
|
Route::get('register', [PasskeysController::class, 'getCreateOptions']);
|
||||||
Route::post('register', [PasskeysController::class, 'create']);
|
Route::post('register', [PasskeysController::class, 'create']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Blog pages using ArticlesController
|
// Blog pages using ArticlesController
|
||||||
Route::prefix('blog')->group(function () {
|
Route::prefix('blog')->group(function () {
|
||||||
Route::get('/feed.rss', [FeedsController::class, 'blogRss']);
|
Route::get('/feed.rss', [FeedsController::class, 'blogRss']);
|
||||||
Route::get('/feed.atom', [FeedsController::class, 'blogAtom']);
|
Route::get('/feed.atom', [FeedsController::class, 'blogAtom']);
|
||||||
Route::get('/feed.json', [FeedsController::class, 'blogJson']);
|
Route::get('/feed.json', [FeedsController::class, 'blogJson']);
|
||||||
|
@ -161,10 +159,10 @@ Route::domain(config('url.longurl'))->group(function () {
|
||||||
Route::get('/s/{id}', [ArticlesController::class, 'onlyIdInURL']);
|
Route::get('/s/{id}', [ArticlesController::class, 'onlyIdInURL']);
|
||||||
Route::get('/{year?}/{month?}', [ArticlesController::class, 'index'])->where(['year' => '[0-9]{4}', 'month' => '[0-9]{2}']);
|
Route::get('/{year?}/{month?}', [ArticlesController::class, 'index'])->where(['year' => '[0-9]{4}', 'month' => '[0-9]{2}']);
|
||||||
Route::get('/{year}/{month}/{slug}', [ArticlesController::class, 'show'])->where(['year' => '[0-9]{4}', 'month' => '[0-9]{2}']);
|
Route::get('/{year}/{month}/{slug}', [ArticlesController::class, 'show'])->where(['year' => '[0-9]{4}', 'month' => '[0-9]{2}']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Notes pages using NotesController
|
// Notes pages using NotesController
|
||||||
Route::prefix('notes')->group(function () {
|
Route::prefix('notes')->group(function () {
|
||||||
Route::get('/', [NotesController::class, 'index']);
|
Route::get('/', [NotesController::class, 'index']);
|
||||||
Route::get('/feed.rss', [FeedsController::class, 'notesRss']);
|
Route::get('/feed.rss', [FeedsController::class, 'notesRss']);
|
||||||
Route::get('/feed.atom', [FeedsController::class, 'notesAtom']);
|
Route::get('/feed.atom', [FeedsController::class, 'notesAtom']);
|
||||||
|
@ -173,69 +171,53 @@ Route::domain(config('url.longurl'))->group(function () {
|
||||||
Route::get('/new', [NotesController::class, 'create']);
|
Route::get('/new', [NotesController::class, 'create']);
|
||||||
Route::get('/{id}', [NotesController::class, 'show']);
|
Route::get('/{id}', [NotesController::class, 'show']);
|
||||||
Route::get('/tagged/{tag}', [NotesController::class, 'tagged']);
|
Route::get('/tagged/{tag}', [NotesController::class, 'tagged']);
|
||||||
});
|
});
|
||||||
Route::get('note/{id}', [NotesController::class, 'redirect']); // for legacy note URLs
|
Route::get('note/{id}', [NotesController::class, 'redirect']); // for legacy note URLs
|
||||||
|
|
||||||
// Likes
|
// Likes
|
||||||
Route::prefix('likes')->group(function () {
|
Route::prefix('likes')->group(function () {
|
||||||
Route::get('/', [LikesController::class, 'index']);
|
Route::get('/', [LikesController::class, 'index']);
|
||||||
Route::get('/{like}', [LikesController::class, 'show']);
|
Route::get('/{like}', [LikesController::class, 'show']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bookmarks
|
// Bookmarks
|
||||||
Route::prefix('bookmarks')->group(function () {
|
Route::prefix('bookmarks')->group(function () {
|
||||||
Route::get('/', [BookmarksController::class, 'index']);
|
Route::get('/', [BookmarksController::class, 'index']);
|
||||||
Route::redirect('/tagged', '/bookmarks');
|
Route::redirect('/tagged', '/bookmarks');
|
||||||
Route::get('/{bookmark}', [BookmarksController::class, 'show']);
|
Route::get('/{bookmark}', [BookmarksController::class, 'show']);
|
||||||
Route::get('/tagged/{tag}', [BookmarksController::class, 'tagged']);
|
Route::get('/tagged/{tag}', [BookmarksController::class, 'tagged']);
|
||||||
});
|
});
|
||||||
|
|
||||||
// IndieAuth
|
// IndieAuth
|
||||||
Route::get('.well-known/indieauth-server', [IndieAuthController::class, 'indieAuthMetadataEndpoint'])->name('indieauth.metadata');
|
Route::get('.well-known/indieauth-server', [IndieAuthController::class, 'indieAuthMetadataEndpoint'])->name('indieauth.metadata');
|
||||||
Route::get('auth', [IndieAuthController::class, 'start'])->middleware(MyAuthMiddleware::class)->name('indieauth.start');
|
Route::get('auth', [IndieAuthController::class, 'start'])->middleware(MyAuthMiddleware::class)->name('indieauth.start');
|
||||||
Route::post('auth/confirm', [IndieAuthController::class, 'confirm'])->middleware(MyAuthMiddleware::class);
|
Route::post('auth/confirm', [IndieAuthController::class, 'confirm'])->middleware(MyAuthMiddleware::class);
|
||||||
Route::post('auth', [IndieAuthController::class, 'processCodeExchange']);
|
Route::post('auth', [IndieAuthController::class, 'processCodeExchange']);
|
||||||
Route::post('token', [IndieAuthController::class, 'processTokenRequest'])->name('indieauth.token');
|
Route::post('token', [IndieAuthController::class, 'processTokenRequest'])->name('indieauth.token');
|
||||||
|
|
||||||
// Micropub Endpoints
|
// Micropub Endpoints
|
||||||
Route::get('api/post', [MicropubController::class, 'get'])->middleware(VerifyMicropubToken::class);
|
Route::get('api/post', [MicropubController::class, 'get'])->middleware(VerifyMicropubToken::class);
|
||||||
Route::post('api/post', [MicropubController::class, 'post'])->middleware(VerifyMicropubToken::class)->name('micropub-endpoint');
|
Route::post('api/post', [MicropubController::class, 'post'])->middleware(VerifyMicropubToken::class)->name('micropub-endpoint');
|
||||||
Route::get('api/media', [MicropubMediaController::class, 'getHandler'])->middleware(VerifyMicropubToken::class);
|
Route::get('api/media', [MicropubMediaController::class, 'getHandler'])->middleware(VerifyMicropubToken::class);
|
||||||
Route::post('api/media', [MicropubMediaController::class, 'media'])
|
Route::post('api/media', [MicropubMediaController::class, 'media'])
|
||||||
->middleware([VerifyMicropubToken::class, CorsHeaders::class])
|
->middleware([VerifyMicropubToken::class, CorsHeaders::class])
|
||||||
->name('media-endpoint');
|
->name('media-endpoint');
|
||||||
Route::options('/api/media', [MicropubMediaController::class, 'mediaOptionsResponse'])->middleware(CorsHeaders::class);
|
Route::options('/api/media', [MicropubMediaController::class, 'mediaOptionsResponse'])->middleware(CorsHeaders::class);
|
||||||
|
|
||||||
// Webmention
|
// Webmention
|
||||||
Route::get('webmention', [WebMentionsController::class, 'get'])->name('webmention-endpoint');
|
Route::get('webmention', [WebMentionsController::class, 'get'])->name('webmention-endpoint');
|
||||||
Route::post('webmention', [WebMentionsController::class, 'receive']);
|
Route::post('webmention', [WebMentionsController::class, 'receive']);
|
||||||
|
|
||||||
// Contacts
|
// Contacts
|
||||||
Route::get('contacts', [ContactsController::class, 'index']);
|
Route::get('contacts', [ContactsController::class, 'index']);
|
||||||
Route::get('contacts/{contact:nick}', [ContactsController::class, 'show']);
|
Route::get('contacts/{contact:nick}', [ContactsController::class, 'show']);
|
||||||
|
|
||||||
// Places
|
// Places
|
||||||
Route::get('places', [PlacesController::class, 'index']);
|
Route::get('places', [PlacesController::class, 'index']);
|
||||||
Route::get('places/{place}', [PlacesController::class, 'show']);
|
Route::get('places/{place}', [PlacesController::class, 'show']);
|
||||||
|
|
||||||
// Micropub
|
// Micropub
|
||||||
Route::redirect('/micropub/create', '/notes/new');
|
Route::redirect('/micropub/create', '/notes/new');
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
Route::get('search', [SearchController::class, 'search']);
|
Route::get('search', [SearchController::class, 'search']);
|
||||||
});
|
|
||||||
|
|
||||||
// Short URL
|
|
||||||
Route::domain(config('url.shorturl'))->group(function () {
|
|
||||||
Route::get('/', [ShortURLsController::class, 'baseURL']);
|
|
||||||
Route::get('@', [ShortURLsController::class, 'twitter']);
|
|
||||||
|
|
||||||
Route::get('{type}/{id}', [ShortURLsController::class, 'expandType'])->where(
|
|
||||||
[
|
|
||||||
'type' => '[bt]',
|
|
||||||
'id' => '[0-9A-HJ-NP-Z_a-km-z]+',
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
Route::get('h/{id}', [ShortURLsController::class, 'redirect']);
|
|
||||||
});
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ class FeedsTest extends TestCase
|
||||||
'author' => [
|
'author' => [
|
||||||
'type' => 'card',
|
'type' => 'card',
|
||||||
'name' => config('user.display_name'),
|
'name' => config('user.display_name'),
|
||||||
'url' => config('url.longurl'),
|
'url' => config('app.url'),
|
||||||
],
|
],
|
||||||
'children' => [[
|
'children' => [[
|
||||||
'type' => 'entry',
|
'type' => 'entry',
|
||||||
|
@ -122,7 +122,7 @@ class FeedsTest extends TestCase
|
||||||
'author' => [
|
'author' => [
|
||||||
'type' => 'card',
|
'type' => 'card',
|
||||||
'name' => config('user.display_name'),
|
'name' => config('user.display_name'),
|
||||||
'url' => config('url.longurl'),
|
'url' => config('app.url'),
|
||||||
],
|
],
|
||||||
'children' => [[
|
'children' => [[
|
||||||
'type' => 'entry',
|
'type' => 'entry',
|
||||||
|
|
|
@ -299,7 +299,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'type' => ['h-entry'],
|
'type' => ['h-entry'],
|
||||||
'properties' => [
|
'properties' => [
|
||||||
'content' => [$note],
|
'content' => [$note],
|
||||||
'location' => [$place->longurl],
|
'location' => [$place->uri],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
['HTTP_Authorization' => 'Bearer ' . $this->getToken()]
|
||||||
|
@ -499,7 +499,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'/api/post',
|
'/api/post',
|
||||||
[
|
[
|
||||||
'action' => 'update',
|
'action' => 'update',
|
||||||
'url' => $note->longurl,
|
'url' => $note->uri,
|
||||||
'replace' => [
|
'replace' => [
|
||||||
'content' => ['replaced content'],
|
'content' => ['replaced content'],
|
||||||
],
|
],
|
||||||
|
@ -519,7 +519,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'/api/post',
|
'/api/post',
|
||||||
[
|
[
|
||||||
'action' => 'update',
|
'action' => 'update',
|
||||||
'url' => $note->longurl,
|
'url' => $note->uri,
|
||||||
'add' => [
|
'add' => [
|
||||||
'syndication' => [
|
'syndication' => [
|
||||||
'https://www.swarmapp.com/checkin/123',
|
'https://www.swarmapp.com/checkin/123',
|
||||||
|
@ -546,7 +546,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'/api/post',
|
'/api/post',
|
||||||
[
|
[
|
||||||
'action' => 'update',
|
'action' => 'update',
|
||||||
'url' => $note->longurl,
|
'url' => $note->uri,
|
||||||
'add' => [
|
'add' => [
|
||||||
'photo' => ['https://example.org/photo.jpg'],
|
'photo' => ['https://example.org/photo.jpg'],
|
||||||
],
|
],
|
||||||
|
@ -607,7 +607,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'/api/post',
|
'/api/post',
|
||||||
[
|
[
|
||||||
'action' => 'update',
|
'action' => 'update',
|
||||||
'url' => $note->longurl,
|
'url' => $note->uri,
|
||||||
'morph' => [ // or any other unsupported update type
|
'morph' => [ // or any other unsupported update type
|
||||||
'syndication' => ['https://www.swarmapp.com/checkin/123'],
|
'syndication' => ['https://www.swarmapp.com/checkin/123'],
|
||||||
],
|
],
|
||||||
|
@ -646,7 +646,7 @@ class MicropubControllerTest extends TestCase
|
||||||
'/api/post',
|
'/api/post',
|
||||||
[
|
[
|
||||||
'action' => 'update',
|
'action' => 'update',
|
||||||
'url' => $note->longurl,
|
'url' => $note->uri,
|
||||||
'replace' => [
|
'replace' => [
|
||||||
'syndication' => [
|
'syndication' => [
|
||||||
'https://www.swarmapp.com/checkin/the-id',
|
'https://www.swarmapp.com/checkin/the-id',
|
||||||
|
|
|
@ -31,7 +31,7 @@ class NotesControllerTest extends TestCase
|
||||||
public function specificNotePageLoads(): void
|
public function specificNotePageLoads(): void
|
||||||
{
|
{
|
||||||
$note = Note::factory()->create();
|
$note = Note::factory()->create();
|
||||||
$response = $this->get($note->longurl);
|
$response = $this->get($note->uri);
|
||||||
$response->assertViewHas('note');
|
$response->assertViewHas('note');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ class NotesControllerTest extends TestCase
|
||||||
{
|
{
|
||||||
$note = Note::factory()->create();
|
$note = Note::factory()->create();
|
||||||
$response = $this->get('/note/' . $note->id);
|
$response = $this->get('/note/' . $note->id);
|
||||||
$response->assertRedirect($note->longurl);
|
$response->assertRedirect($note->uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -30,7 +30,7 @@ class PlacesTest extends TestCase
|
||||||
public function singlePlacePageLoads(): void
|
public function singlePlacePageLoads(): void
|
||||||
{
|
{
|
||||||
$place = Place::factory()->create();
|
$place = Place::factory()->create();
|
||||||
$response = $this->get($place->longurl);
|
$response = $this->get($place->uri);
|
||||||
$response->assertViewHas('place', $place);
|
$response->assertViewHas('place', $place);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Tests\Feature;
|
|
||||||
|
|
||||||
use PHPUnit\Framework\Attributes\Test;
|
|
||||||
use Tests\TestCase;
|
|
||||||
|
|
||||||
class ShortURLsControllerTest extends TestCase
|
|
||||||
{
|
|
||||||
#[Test]
|
|
||||||
public function shortDomainRedirectsToLongDomain(): void
|
|
||||||
{
|
|
||||||
$response = $this->get('https://' . config('url.shorturl'));
|
|
||||||
$response->assertRedirect(config('app.url'));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Test]
|
|
||||||
public function shortDomainSlashAtRedirectsToTwitter(): void
|
|
||||||
{
|
|
||||||
$response = $this->get('https://' . config('url.shorturl') . '/@');
|
|
||||||
$response->assertRedirect('https://twitter.com/jonnybarnes');
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Test]
|
|
||||||
public function shortDomainSlashTRedirectsToLongDomainSlashNotes(): void
|
|
||||||
{
|
|
||||||
$response = $this->get('https://' . config('url.shorturl') . '/t/E');
|
|
||||||
$response->assertRedirect(config('app.url') . '/notes/E');
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Test]
|
|
||||||
public function shortDomainSlashBRedirectsToLongDomainSlashBlog(): void
|
|
||||||
{
|
|
||||||
$response = $this->get('https://' . config('url.shorturl') . '/b/1');
|
|
||||||
$response->assertRedirect(config('app.url') . '/blog/s/1');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -82,7 +82,7 @@ class WebMentionsControllerTest extends TestCase
|
||||||
|
|
||||||
$response = $this->call('POST', '/webmention', [
|
$response = $this->call('POST', '/webmention', [
|
||||||
'source' => 'https://example.org/post/123',
|
'source' => 'https://example.org/post/123',
|
||||||
'target' => $note->longurl,
|
'target' => $note->uri,
|
||||||
]);
|
]);
|
||||||
$response->assertStatus(202);
|
$response->assertStatus(202);
|
||||||
|
|
||||||
|
|
|
@ -94,12 +94,12 @@ class ProcessWebMentionJobTest extends TestCase
|
||||||
$source = 'https://aaronpk.localhost/reply/1';
|
$source = 'https://aaronpk.localhost/reply/1';
|
||||||
WebMention::factory()->create([
|
WebMention::factory()->create([
|
||||||
'source' => $source,
|
'source' => $source,
|
||||||
'target' => $note->longurl,
|
'target' => $note->uri,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$html = <<<HTML
|
$html = <<<HTML
|
||||||
<div class="h-entry">
|
<div class="h-entry">
|
||||||
<p>In reply to <a class="u-in-reply-to" href="{$note->longurl}">a note</a></p>
|
<p>In reply to <a class="u-in-reply-to" href="{$note->uri}">a note</a></p>
|
||||||
<div class="e-content">Updated reply</div>
|
<div class="e-content">Updated reply</div>
|
||||||
</div>
|
</div>
|
||||||
HTML;
|
HTML;
|
||||||
|
@ -117,7 +117,7 @@ class ProcessWebMentionJobTest extends TestCase
|
||||||
'source' => $source,
|
'source' => $source,
|
||||||
'type' => 'in-reply-to',
|
'type' => 'in-reply-to',
|
||||||
// phpcs:ignore Generic.Files.LineLength.TooLong
|
// phpcs:ignore Generic.Files.LineLength.TooLong
|
||||||
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"content": [{"html": "Updated reply", "value": "Updated reply"}], "in-reply-to": ["' . $note->longurl . '"]}}], "rel-urls": []}',
|
'mf2' => '{"rels": [], "items": [{"type": ["h-entry"], "properties": {"content": [{"html": "Updated reply", "value": "Updated reply"}], "in-reply-to": ["' . $note->uri . '"]}}], "rel-urls": []}',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,14 +115,6 @@ class NotesTest extends TestCase
|
||||||
$this->assertEquals($expected, $note->note);
|
$this->assertEquals($expected, $note->note);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Test]
|
|
||||||
public function shorturlMethodReturnsExpectedValue(): void
|
|
||||||
{
|
|
||||||
$note = Note::factory()->make();
|
|
||||||
$note->id = 14;
|
|
||||||
$this->assertEquals(config('url.shorturl') . '/notes/E', $note->shorturl);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Test]
|
#[Test]
|
||||||
public function weGetLatitudeLongitudeValuesOfAssociatedPlaceOfNote(): void
|
public function weGetLatitudeLongitudeValuesOfAssociatedPlaceOfNote(): void
|
||||||
{
|
{
|
||||||
|
@ -382,11 +374,11 @@ class NotesTest extends TestCase
|
||||||
public function markdown_content_gets_converted(): void
|
public function markdown_content_gets_converted(): void
|
||||||
{
|
{
|
||||||
$note = Note::factory()->create([
|
$note = Note::factory()->create([
|
||||||
'note' => 'The best search engine? https://duckduckgo.com',
|
'note' => 'The best search engine? https://kagi.com',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertSame(
|
$this->assertSame(
|
||||||
'<p>The best search engine? <a href="https://duckduckgo.com">https://duckduckgo.com</a></p>' . PHP_EOL,
|
'<p>The best search engine? <a href="https://kagi.com">https://kagi.com</a></p>' . PHP_EOL,
|
||||||
$note->note
|
$note->note
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,24 +40,6 @@ class PlacesTest extends TestCase
|
||||||
$this->assertEquals('the-bridgewater-pub', $nearby[0]->slug);
|
$this->assertEquals('the-bridgewater-pub', $nearby[0]->slug);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[Test]
|
|
||||||
public function getLongurl(): void
|
|
||||||
{
|
|
||||||
$place = Place::factory()->create([
|
|
||||||
'name' => 'The Bridgewater Pub',
|
|
||||||
]);
|
|
||||||
$this->assertEquals(config('app.url') . '/places/the-bridgewater-pub', $place->longurl);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Test]
|
|
||||||
public function getShorturl()
|
|
||||||
{
|
|
||||||
$place = Place::factory()->create([
|
|
||||||
'name' => 'The Bridgewater Pub',
|
|
||||||
]);
|
|
||||||
$this->assertEquals(config('url.shorturl') . '/places/the-bridgewater-pub', $place->shorturl);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[Test]
|
#[Test]
|
||||||
public function getUri(): void
|
public function getUri(): void
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue