Commit Graph

9299 Commits

Author SHA1 Message Date
Kevin Ansfield
ea37b78456
Added logging of slow {{#get}} helper uses (#10779)
no issue

- `{{#get}}` can slow down requests a lot if not used carefully, typically by using `limit="all"` or similar which can force a lot of data to be fetched and processed
- adds a warning log if we detect any `{{#get}}` helper call which takes longer than a certain threshold (default 200ms)
- allow log level and threshold to be configured via config to allow for different environments behaviours and requirements

New config options:
```
{
    "logging": {
        "slowHelper": {
            "level": "warn",
            "threshold": 200
        }
    }
}
```

Example output for `{{#get "tags" limit="all" order="name asc"}}` with a lot of tags:

```
[2019-06-07 10:35:52] WARN {{#get}} helper took 453ms to complete

{{#get}} helper took 453ms to complete

Error ID:
    062daed0-8910-11e9-8185-3b615ad8677d

Error Code:
    SLOW_GET_HELPER

Details:
    api:          v2.tagsPublic.browse
    apiOptions:
      order: name asc
      limit: all
    returnedRows: 1698
```
2019-06-07 14:54:55 +01:00
Nazar Gargol
f5544e7831 Migrated to use @tryghost/social-urls package
refs #10618

- /lib/social/urls was extracted into SDK to move more modules out of the core and reduce coupling of the theme layer
2019-06-06 17:10:13 +02:00
Kevin Ansfield
bdf1383b30 Version bump to 2.23.3 2019-06-06 11:15:47 +01:00
Kevin Ansfield
12308672d2 Updated Ghost-Admin to 2.23.3 2019-06-06 11:15:46 +01:00
Kevin Ansfield
07e9490621
🐛 Fixed server crash when AMP posts contain images with unescaped chars (#10775)
no issue

- bump `amperize` to v0.4.0 which contains an updated version of `got` which does not crash on invalid image urls
2019-06-05 17:31:23 +01:00
Naz Gargol
cb199b17b8
Decoupled asset hash calculation from package.json (#10774)
refs https://github.com/TryGhost/Ghost/issues/9414
refs c9b95b4bbd

- Removed package version from asset hash calculation
- Package version doesn't introduce any value when calculating a hash because Date.now() provides enough randomization on its own
2019-06-05 10:06:25 +02:00
Nazar Gargol
74d5bf3822 Version bump to 2.23.2 2019-06-04 13:01:40 +02:00
Nazar Gargol
dd30d7a9c3 Updated Ghost-Admin to 2.23.2 2019-06-04 13:01:40 +02:00
Nazar Gargol
c101f51fcc Updated Casper to 2.10.2 2019-06-04 13:01:40 +02:00
Naz Gargol
acdcadc396
🔥 Dropped Node v6 support (#10771)
no issue
    
- Node v6 has come to EOL as of 2019-04-30 (ref. https://github.com/nodejs/Release#end-of-life-releases)
- Removed Node v6 specific tests and code
2019-06-03 14:20:23 +02:00
Kevin Ansfield
525c2753ec Update dependency @tryghost/html-to-mobiledoc to v0.4.1
no issue

- includes a fix for text content potentially being lost when converting html to mobiledoc via the API
2019-06-03 12:34:35 +01:00
Kevin Ansfield
81ebe3e8a3 Version bump to 2.23.1 2019-05-28 18:36:10 +01:00
Kevin Ansfield
901da3fe05 Updated Ghost-Admin to 2.23.1 2019-05-28 18:36:10 +01:00
Kevin Ansfield
f88adb9180
Added x-frame-options header to /ghost/ route (#10760)
no issue
- by default the `/ghost/` route will add an `x-frame-options: sameorigin` header to the response to help protect the admin area against clickjacking
- the header can be disabled by adding `"adminFrameProtection": false` to the `config.{env}.json` configuration file

Credits: Muhammad Fawwad Obaida
2019-05-28 09:04:48 +01:00
Kevin Ansfield
5ee76a3f85 Version bump to 2.23.0 2019-05-27 10:57:22 +01:00
Kevin Ansfield
7f186f067d Updated Ghost-Admin to 2.23.0 2019-05-27 10:57:22 +01:00
Kevin Ansfield
7ea161ae04 Version bump to 2.22.3 2019-05-23 13:49:24 +01:00
Kevin Ansfield
2c16c58439 Updated Ghost-Admin to 2.22.3 2019-05-23 13:49:24 +01:00
John O'Nolan
69dd931aa2
Update FUNDING.yml 2019-05-23 10:51:11 +02:00
Aileen Nowak
d086841f36
Updated link to Marketplace (#10754)
no issue

- Marketplace moved to https://ghost.org/marketplace
2019-05-22 16:55:28 +08:00
Fabien O'Carroll
0918844e75 Version bump to 2.22.2 2019-05-21 12:09:14 +02:00
Fabien O'Carroll
77d24787e0 Updated Ghost-Admin to 2.22.2 2019-05-21 12:09:14 +02:00
Fabien O'Carroll
53b884ec2b
Refactored json-schema to use one instance of ajv (#10746)
refs https://github.com/TryGhost/Team/issues/211

Previous code was creating a new ajv instance for each call, as well as
loading the schemas, which are cached. This was causing a memory leak as
ajv caches all schemas.

We've replaced it with one instance of ajv, and conditionally
loading/compiling the schemas if they haven't been seen before.
2019-05-15 13:28:10 +02:00
Fabien O'Carroll
5b0b7e4d8d Version bump to 2.22.1 2019-05-14 11:16:04 +02:00
Fabien O'Carroll
f0c9742fc3 Updated Ghost-Admin to 2.22.1 2019-05-14 11:16:04 +02:00
Fabien O'Carroll
39df4096b4 Updated Casper to 2.10.1 2019-05-14 11:16:04 +02:00
Fabien O'Carroll
e82f625a15 Removed members references in Gruntfile
refs #10739

These leftover references were causing issues when running grunt
commands, now that the files are no longer there.
2019-05-13 10:15:29 +02:00
Nazar Gargol
bb7bb55cf3 Bumped gscan version to 2.6.0
no issue

- Updated valid theme fixture to be inline with warning that was added when using {{each}} helper instead of {{foreach}}
2019-05-08 16:56:22 +02:00
Fabien O'Carroll
c101fd90d7
Removed lib/members in favour of packages (#10739)
* Installed `@tryghost/members-{api,auth-pages}`

no-issue

* Used @tryghost/members-auth-pages in member service

no-issue

* Used @tryghost/members-api in members service

no-issue

* Deleted core/server/lib/members

no-issue

* Fixed parent app tests

no-issue

Requiring the members api (via the `gateway` getter) was throwing an
error, so we stub out the members service getters
2019-05-08 14:08:25 +02:00
Nazar Gargol
53b300d7bf Version bump to 2.22.0 2019-05-07 12:37:29 +02:00
Nazar Gargol
41aa811075 Updated Ghost-Admin to 2.22.0 2019-05-07 12:37:29 +02:00
Nazar Gargol
04e12edc56 Updated Casper to 2.10.0 2019-05-07 12:37:29 +02:00
Rish
a4f4a00cc4 Updated to use slugify method from SDK for safe string
refs #10618

- Updated lib safe string security method
2019-05-07 15:33:07 +05:30
Rish
65ee0f95c4 Updated reading time helper to use SDK
refs #10618

- Removed duplicate calculation for reading time by using SDK method
2019-05-07 15:33:07 +05:30
Aileen Nowak
b2ed906773 🎨 Allowed protocol overwrite for canonical URLs (#10729)
closes #10709

- Only transform a canonical URL that is identical with the Blog URL to a relative URL when the protocol matches as well
- Leave the canonical URL absolute for all other cases
- Use case for this is e. g. when users want to port over their Facebook comments/shares/likes after a move from `http` to `https`
2019-05-06 15:27:54 +02:00
kirrg001
a31ed7c71d Added comments for Ghost API
no issue

- jsdoc
- added more information & context
2019-05-06 14:49:25 +02:00
Aileen Nowak
79345f9030 🐛 Fixed Twittercard having wrong property when no feature image provided
closes #10706

- Fixed a bug where we weren't assigning `summary_large_image` as Twitter card property when no feature image is provided, but a dedicated Twitter image
- Updated test to reflect this case to be tested better
2019-05-06 12:51:43 +02:00
Fabien O'Carroll
4563999352 🐛 Fixed password submission for private blogging
no-issue

This bump to members-ssr includes an update which no longer consumes the
request stream when calling getMemberDataFromSession. Previously, this
method was called on every request to the theme layer, and the
private-blogging middleware was unable to parse the body as the request
stream had already been consumed.
2019-05-06 12:38:38 +02:00
Nazar Gargol
b69f1e9e21 Added comment about future scheduler migration
refs #10060
2019-05-06 12:26:08 +02:00
Katharina Irrgang
2447335ab1 🐛 Fixed post scheduling on restart (#10726)
no issue

- case: restart Ghost and while having a scheduled post 
- caused by 4acc375fb6 (diff-4726ce3c4d18d41afad4b46cb0aa7dd3)
  - the bug exists since 2.12
  - Bookshelf added support (or better said fixed a bug) for accessing previous attributes
  - `object.updated('published_at')` always returned "undefined", because the self-implementation < 2.12 only remembered previous attributes after update (see https://github.com/TryGhost/Ghost/blob/2.11.0/core/server/models/base/index.js#L234)
  - but `object.previous('published_at')` returns the current value (object.get('published_at') === object.previous('published_at') -> and that's why rescheduling on bootstrap never worked
- might fix https://forum.ghost.org/t/scheduled-posts-never-publish/6873/10
- reduced timeouts on scheduling unit tests
2019-05-06 11:11:43 +02:00
Kevin Ansfield
90db78b369 Properly fix escaping in test comparison 2019-05-04 11:46:13 +01:00
Kevin Ansfield
5db9651a60 Fixed tests due to escaped chars in comparison string 2019-05-04 11:39:06 +01:00
Kevin Ansfield
75ae3f8736 Added parsing of html cards when using ?source=html with the v2 Admin API
no issue

- when sending `html` with `?source=html` to the v2 Admin API it's now possible to include blocks of HTML that will be extracted to html cards rather than going through the normal lossy html-to-mobiledoc conversion

Example usage would be sending HTML in the following format:

```html
<p>Some standard content...</p>

<!--kg-card-begin: html-->
<div class="my-custom-html">...</div>
<!--kg-card-end: html-->

<p>Some more content...</p>
```

In this case an html card will be created in the mobiledoc with the content `<div class="my-custom-html">...</div>`.
2019-05-04 11:30:59 +01:00
Kevin Ansfield
9f9dde3107 Added caption and language extraction for code blocks when converting HTML via API
no issue
- update @tryghost/html-to-mobiledoc to v0.3.0
- uses updated @tryghost/kg-parser-plugins that is now shared with Ghost-Admin
2019-05-03 11:55:38 +01:00
Nazar Gargol
cd703a6dc3 Fixed regression test
no issue

- The test was broken due to removed `lts` flag in d0970ad30
2019-05-02 21:04:16 +02:00
Nazar Gargol
f21e713a83 Added temp file cleanup for invalid themes
refs #10174

- When theme check fails with validation error there was no cleanup of files left from zip extraction
2019-05-02 17:59:29 +02:00
Fabien O'Carroll
a77190a312 Removed 2.16 member permission migration
no-issue

It turned out that due to the mismatch between `"members"` and
`"member"`, that not a single row was added to the database via this
migration. Clearing the file for simplicity.
2019-05-02 17:31:38 +02:00
Fabien O'Carroll
c70f5a0567 Copied member permission migration from 2.16->2.22
no-issue

The original migration read data from the fixtures, and ensured the
relations were made. Now the fixtures have been corrected, we can use
the same migration for 2.22
2019-05-02 17:31:38 +02:00
Fabien O'Carroll
0a67a25dbc Fixed member permission/role relations in fixtures
no-issue

The previous relations were setup to match against "members", which is
plural, but the object_type on the permission is "member". This was
causing the permissions to not be added as a relation to the role.
2019-05-02 17:31:38 +02:00
Fabien O'Carroll
66f96d0a37 Updated yarn.lock
no-issue

There was a mismatch between exact version and caret version between
package.json and yarn.lock
2019-05-01 22:13:33 +02:00