Commit Graph

32 Commits

Author SHA1 Message Date
Princi Vershwal
84473dd094
Not storing icons and thumbnails in case of mention (#21424)
Ref
https://linear.app/ghost/issue/ENG-1662/incoming-recommendations-get-deleted-if-the-metadata-icon-fails-to

https://linear.app/ghost/issue/ENG-904/bookmark-card-hot-linking-favicons
2024-10-28 05:29:49 +00:00
Sag
a3b84e8cd1
Revert "Fixed fetching and storing bookmark card icons and thumbnails" (#21316)
ref https://linear.app/tryghost/issue/ONC-433
ref https://linear.app/tryghost/issue/ENG-904

- the reverted commit (871d21acaf) caused
a regression for recommendations: incoming recommendations were marked
as deleted and did not render in Admin Settings anymore
2024-10-16 08:42:35 +00:00
Princi Vershwal
871d21acaf
🐛 Fixed fetching and storing bookmark card icons and thumbnails (#21036)
Ref: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons
2024-09-19 15:52:08 +05:30
Sag
99d8a5777f
Fixed "Unsaved post" modal shown after publishing (#21028)
ref https://linear.app/tryghost/issue/ENG-661
ref INC-109

- this PR reverts two commits: 5903dd7 and 426b1d4
2024-09-17 18:55:03 +00:00
Princi Vershwal
5903dd7fb4
Checking unique names for icon and thumbnails before saving locally (#21012)
Ref: https://linear.app/tryghost/issue/ENG-1554/wrong-youtube-thumbnail
2024-09-16 19:19:35 +05:30
Princi Vershwal
426b1d4d93
🐛 Fixed bookmark card hot linking icons and thumbnails (#20923)
Ref:
https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons
2024-09-05 16:09:17 +05:30
Princi Vershwal
77cfa39eec
Revert Fetch and store icons and thumbnails ENG-904 (#20920)
Reverting this as there is an issue with the urls stored in db. Details
in the
[thread](https://ghost.slack.com/archives/C02G9E68C/p1725445854035799)
2024-09-04 11:10:23 +00:00
Princi Vershwal
b6407f2d45
🐛 Fixed bookmark card hot linking icons and thumbnails ENG-904 (#20906)
Ref: https://linear.app/tryghost/issue/ENG-904/bookmark-card-hot-linking-favicons

Bookmark cards' icons and thumbnails are not fetched and stored in our storage.
2024-09-04 12:33:14 +05:30
Kevin Ansfield
ad1a00f60d Fixed YT live embeds for non-www URLs
ref https://github.com/TryGhost/Ghost/pull/20706
ref https://linear.app/tryghost/issue/ONC-197

- previous check for YT live match was a little too specific and required the www which should have been optional
2024-08-01 17:22:02 +01:00
Kevin Ansfield
1eab73c76d 🐛 Fixed YouTube live embeds failing in some situations
ref https://linear.app/tryghost/issue/ONC-197

- YouTube has started responding to video page requests with localised content when requested from certain IPs, with that localised content not containing the required `<link rel="alternate" ...>` tag pointing to the oembed endpoint
- we were fetching video pages rather than the oembed endpoint for YouTube Live URLs because they are not recognised by the oembed extraction library we use
- by modifying the URL from a live URL to a watch URL before we perform oembed lookup/extraction we are able to bypass the (localised) page fetch and instead grab the oembed content directly
2024-08-01 16:59:52 +01:00
Daniel Lockyer
09c59a6569 Lazyloaded several required dependencies
- these dependencies can be pushed to be loaded later than upon boot,
  where boot time is critical
- this commit makes boot about 4% faster
2024-07-26 09:52:26 +02:00
Sag
d0d0783837
🐛 Fixed pasting product URLs into the editor (#20565)
fixes https://linear.app/tryghost/issue/ENG-1215

- when pasting URLs that return `type: link` from the oembed service, we
now fallback to using a Bookmark card
- previously, this would render a plain link in the editor
- example product URL with `type: link`:
https://indiebeer.co.uk/products/terra-tempo-vinicius-red-wine-ba-wild-ale-with-mango-pineapple-honeydew-melon-and-banana-750ml-7
2024-07-09 18:28:56 +02:00
Kevin Ansfield
1593fd87d2 🐛 Fixed YouTube bookmark creation
https://github.com/TryGhost/Ghost/issues/20445

- after switching to a browser-like user-agent, YouTube started responding with a "supported browsers" message rather than the actual video meaning bookmark creation failed
- when trying other user-agents it was discovered that nytimes.com (why the user-agent was originally changed) had a problem with the github.com address in the user-agent. By switching to using https://ghost.org instead the request was allowed through fixing both YouTube and NYTimes embeds
2024-06-23 21:09:25 +01:00
Kevin Ansfield
0b4e249037 🐛 Fixed bookmark creation for sites that block some user agents
closes https://linear.app/tryghost/issue/ENG-762

- nytimes.com and other sites return 403 responses when requests do not match typical browser user-agents
- our bookmark fetching requests were using `Ghost(https://github.com/TryGhost/Ghost)` meaning bookmark creation failed for these user-agent-blocking sites
- switched to using a standard browser user-agent string to avoid such blocks
2024-06-20 22:15:38 +01:00
Kevin Ansfield
3bc5eb8cf9
🐛 Fixed Bluesky URLs creating bookmarks rather than embeds (#20435)
closes https://github.com/TryGhost/Ghost/issues/20028

It's fairly common practice for oembed providers to skip some of the "required" fields from the oembed spec such as `height` when it doesn't make sense for the embeddable content, this was the case with Bluesky embeds which return `height: null`

- removed validation for `height` being present in the response for it to be recognised as an embed because we don't use it anywhere and the validation is blocking otherwise valid embeds
2024-06-20 20:41:24 +00:00
Daniel Lockyer
5fa4496d52 🐛 Fixed HTTP 500 responses when oembed endpoint receives error
fixes https://github.com/TryGhost/Product/issues/4237

- this fixes the fact that we return a HTTP 500 response when the oembed
  library receives an error, such as a 401 or 403
- includes special handling for cases where we want to return a slightly
  different error message
- also adds unit tests for @tryghost/oembed-service package
2024-03-12 12:31:44 +01:00
Peter Zimon
8f3617aaa8
Content card design improvements (#19737)
refs. https://linear.app/tryghost/issue/DES-122/bookmark-card-issues

This PR addresses the following content card related problems:

1. The design of the following cards are more self-contained so it makes
more sense to use `px` for their font-sizes and spacings so it looks the
same regardless of the theme. Of course themes still can override these
values.

Updated cards to use `px` for font sizing:
- audio
- bookmark
- file
- product

2. So far header and signup cards had been using `rem` for font-sizes
and some sizing. This commit updates these to use `em` instead so that
it's consistent with all other cards.

3. The favicon sometimes is not available for bookmark cards. This PR also
fixes that by providing a default favicon for these cases.
2024-02-29 17:09:34 +01:00
Kevin Ansfield
0c5cdbf4d2
🐛 Fixed embed service trying http before https for oembed providers (#19521)
no issue

- issue reported via the forum https://forum.ghost.org/t/video-embed-break-page-on-mobile/44172
- due to historical issues we check against http/https and non-www/www URLs to match an oembed provider in case our library's provider list is out of date. However we checked http first which could match and then update the original URL to be `http` in place of `https` leading to potentially broken oembed fetch requests as was the case with http://odysee.com URLs
2024-01-18 14:42:28 +00:00
Simon Backx
b51e12d90f
Added emails for recommendations (#18361)
fixes https://github.com/TryGhost/Product/issues/3938
2023-09-26 15:29:17 +00:00
Simon Backx
1e3232cf82
Improved webmention stability in case of slow external servers (#18242)
refs https://github.com/TryGhost/Product/issues/3850

- Added a recheck for recommendation related webmentions after boot (to
check missed webmentions during down time)
- Increased general timeouts to 15s for all webmention related HTTP
requests. Instead, increased retries to 3.
- Increased timeout for fetching webmention metadata from 2s to 15s
- Added more logging about verification and deletion status of
webmentions
2023-09-20 13:09:47 +02:00
Kevin Ansfield
309184f5da
🐛 Fixed bookmark card creation and pasted link unfurls (#17990)
no issue

- recently added code to grab apple touch icons or SVGs before falling back to the default metascraper behaviour wrongly assumed that every size would have a `rel` and `href` attribute which is not the case
2023-09-06 10:22:45 +00:00
Simon Backx
96fefaea69
Added well known recommendations service (#17895)
fixes https://github.com/TryGhost/Product/issues/3797 
fixes https://github.com/TryGhost/Product/issues/3776 
fixes https://github.com/TryGhost/Product/issues/3798

- Added support for storing json webmentions
- Improved handling deleted webmentions (set deleted to true instead of verified to false)
2023-08-31 14:57:18 +00:00
Simon Backx
875fe939a5
Wired up adding recommendations via admin-x (#17878)
refs https://github.com/TryGhost/Product/issues/3773
2023-08-31 11:26:12 +02:00
Daniel Lockyer
898b55265c Lazyloaded @extractus/oembed-extractor dependency
- this dependency seems a pretty heavy one to require upon boot and
  given most sites don't need it to function as normal, this saves
  several MB of RAM per instance
2023-05-12 12:18:40 +02:00
Fabien "egg" O'Carroll
104f84f252 Added eslint rule for file naming convention
As discussed with the product team we want to enforce kebab-case file names for
all files, with the exception of files which export a single class, in which
case they should be PascalCase and reflect the class which they export.

This will help find classes faster, and should push better naming for them too.

Some files and packages have been excluded from this linting, specifically when
a library or framework depends on the naming of a file for the functionality
e.g. Ember, knex-migrator, adapter-manager
2023-05-09 12:34:34 -04:00
Chris Raible
27e4523aec
🐛 Improved error message for unauthorized YouTube embeds (#16374)
refs TryGhost/Ghost#16048

- When attempting to embed a Youtube video that has had embedding
disabled by its owner/author, Ghost displayed a generic error message
that didn't indicate the reason for the failed emebed.
- This change updated the error message when Youtube (or any provider)
returns 401: Unauthorized to indicate that the owner of the resource has
explicitly disabled embedding.
2023-05-04 16:04:58 -07:00
Daniel Lockyer
045e1ee33d Disabled got retries in testing environment
- by default, got retries failed requests, which is causing issues in
  tests because we've disabled the network with `nock`
- this is causing huge idle time because got pauses before retrying
- this change disables the retries if we're running tests, so things are
  more stable
2023-03-24 11:55:57 +01:00
Steve Larson
9e58181398
combined fetch for metadata and verification (#16330)
refs TryGhost/Team#2582
-removed duplicative fetch request
-added mention as type in oembed service
2023-02-28 08:39:28 -06:00
Steve Larson
2d84b7d990
Upgraded got package from v9.6.0 to v11.8.6 (#16261)
Refs TryGhost/Team#2459
-upgraded got from v9.6.0 to v11.8.6 to support following redirects (and
other fixes)
-got v12+ requires ESM, so we do not want to upgrade further at this
time
-required changes to a few libraries that use externalRequests
-mention discovery service tests updated to test for follow redirects
2023-02-20 09:33:11 -06:00
Fabien 'egg' O'Carroll
33ebe971f8
Added BookshelfMentionRepository implementation (#16156)
fixes https://github.com/TryGhost/Team/issues/2418

This stores the received webmentions in the database.

Co-authored-by: Simon Backx <simon@ghost.org>
2023-01-20 14:32:50 +01:00
jbenezech
75811f35bc
🐛 Fixed embedded cards for non-utf8 content (#15578)
closes: https://github.com/TryGhost/Ghost/issues/14973

- When fetching content using a non-standard charset, characters were notproperly decoded to utf-8 resulting in mangled text in the editor -> Detect charset and use iconv to decode the page text

- When requesting a non bookmark card, if no oembed data could be foundand we fallback to bookmark, a second network request to fetch the content was issued. This seemed unnecessary -> refactored to avoid that
2022-10-13 12:19:47 +01:00
Daniel Lockyer
d2eda5cf51 Extracted oembed service to separate package
refs https://github.com/TryGhost/Toolbox/issues/363

- the oembed service is completely standalone and could do with some
  individual unit tests
- moving it out to a package allows us to draw the boundaries better and
  allows us to remove some dependencies from the core package.json
2022-08-15 10:07:06 +02:00