Commit Graph

9491 Commits

Author SHA1 Message Date
Fabien O'Carroll
15585971e2 🐛 Fixed async helpers nested in template helpers
closes #10643

The async resolver in express-hbs relies on storing the state of the
promises on the `this` value inside of a helper, which is always set to
the `context`. This patch updates our helpers which render templates, to
use `this` as the context when rendering their templates.
2019-06-25 16:19:33 +07:00
Fabien O'Carroll
0e2ce29468 Moved members static mount point to /ghost/members
no-issue

This alleviates the CORS requests failing for members when the admin is
hosted on a different domain than the site
2019-06-25 15:13:52 +07:00
Fabien O'Carroll
bb1ee3c265 Updated members-theme-bindings & public/members.js
no-issue

This updates Ghost to inject the exact urls we want to use for both the
static members pages and the ssr endpoints we've configured for the
frontend. This allows us to changes these without having to update the
members repository, and gives a cleaner split between the two.
2019-06-25 15:13:52 +07:00
Nazar Gargol
e5391519eb Bumped js-yaml version to 3.13.1
no issue

- The 3.13.1 version contains security fixes described in b2f9e88239
2019-06-24 15:47:37 +02:00
Nazar Gargol
e056c770da Fixed a crash when theme is changed
refs #10790

- The error was happening due to wrong reference to the site app from themes service
- The issue was introduced in df7e64fafa
2019-06-24 13:59:41 +02:00
Nazar Gargol
22f56c95a8 Fixed redirects.json file validation
refs #10790

- Reference to method previously used to validate wasn't updated during refactoring done in be27db46eb
2019-06-24 10:56:30 +02:00
Naz Gargol
8ae5db9922
Extracted frontend code from settings API controllers (#10797)
* Moved settings#upload method out of settings controller

* Moved out code from download to serve method

* Moved API v0.1 settings upload/downalod routes.yaml methods to use setting handler service

* Reverted unintended change

* Moved RoutesHandler into settings module

- To keep in convention with settings described in - https://github.com/TryGhost/Ghost/issues/9528 , extracted routes handler into separate settings folder

* Frontend settings for API v0.1

* Renamed 'routes' to 'dynamic-routing'

* Renamved activate/serve methods as suggested in discussions

* Moved settings dynamicRouting to routing.settings
2019-06-21 16:52:07 +02:00
Naz Gargol
be27db46eb
Extracted frontend code from redirects API controllers (#10798)
refs #10790

- The code was moved out of controllers to reduce the number of coupling points between the API controllers and "frontend" services
- A nice side effect of this move is a decreased amount of code that will need to be maintained and reusability between existing controllers
- Calling just a few methods from frontend services on API level makes it easier to abstract fronted away from API
2019-06-21 16:50:16 +02:00
Nazar Gargol
c7522f896b Moved settings dynamicRouting to routing.settings 2019-06-21 16:34:17 +02:00
Nazar Gargol
a84c15689e Renamved activate/serve methods as suggested in discussions 2019-06-21 13:58:26 +02:00
Nazar Gargol
f3b4e2e39a Renamed 'routes' to 'dynamic-routing' 2019-06-21 13:12:23 +02:00
Daniel Lockyer
64735693be Replaced keypair with rsa-keypair module (#10758)
refs #10789 

Speed up Ghost boot time by replacing the JS-only RSA key generator
library with a native alternative.
2019-06-21 16:51:44 +07:00
Nazar Gargol
ede267e823 Updated README in content/settings
no issue

- Updated TODO with a link to docs
2019-06-21 10:42:10 +02:00
Nazar Gargol
19d3c4bc5c Frontend settings for API v0.1 2019-06-20 17:20:44 +02:00
Nazar Gargol
61dc9e8c24 Moved RoutesHandler into settings module
- To keep in convention with settings described in - https://github.com/TryGhost/Ghost/issues/9528 , extracted routes handler into separate settings folder
2019-06-20 16:58:26 +02:00
Nazar Gargol
dc68f37b86 Reverted unintended change 2019-06-20 16:27:37 +02:00
Nazar Gargol
06a6dc835d Moved API v0.1 settings upload/downalod routes.yaml methods to use setting handler service 2019-06-20 13:34:22 +02:00
Nazar Gargol
8709f5cc55 Moved out code from download to serve method 2019-06-20 13:23:58 +02:00
Nazar Gargol
c3b14f82fd Moved settings#upload method out of settings controller 2019-06-20 13:19:22 +02:00
Nazar Gargol
58a077564f Fixed stray rename after frontend extraction
refs #10790

- The name should be themeService as everywhere else in the codebase
2019-06-19 17:58:07 +02:00
Naz Gargol
df7e64fafa
Extracted frontend folder (#10780)
refs #10790

- Moved /core/apps into core/frontend
- Moved /core/server/helpers to /core/frontend/helpers along with /core/server/services/themes
- Changed helper location in overrides
- Moved /core/server/services/routing to /core/frontend/services
- Moved /core/server/services/url to /core/frontend/services
- Moved /core/server/data/meta to /core/frontend/meta
- Moved /core/server/services/rss to /core/frontend/services
- Moved /core/server/data/xml to /core/frontend/services
2019-06-19 11:30:28 +02:00
Aileen Nowak
b90bd44bc6
Updated link to Ghost Blog (#10795)
no issue
2019-06-19 17:11:57 +08:00
Fabien O'Carroll
cbe8d1885c Version bump to 2.25.1 2019-06-19 13:58:12 +07:00
Fabien O'Carroll
815b1405be Updated Ghost-Admin to 2.25.1 2019-06-19 13:58:12 +07:00
Kevin Ansfield
3069f5f5a9 Mocked network access for {{amp_content}} img unit test (#10792)
no issue

- unit test was fetching images over the network which could cause random test failures on poor connections
2019-06-19 13:56:30 +07:00
Naz Gargol
abda6e6338
Migrated to use url-utils from Ghost-SDK (#10787)
closes #10773

- The refactoring is a substitute for `urlService.utils` used previously throughout the codebase and now extracted into the separate module in Ghost-SDK
- Added url-utils stubbing utility for test suites
- Some tests had to be refactored to avoid double mocks (when url's are being reset inside of rested 'describe' groups)
2019-06-18 15:13:55 +02:00
Fabien O'Carroll
a63d29f859 Version bump to 2.25.0 2019-06-18 19:38:29 +07:00
Fabien O'Carroll
1053ff5f8e Updated Ghost-Admin to 2.25.0 2019-06-18 19:38:29 +07:00
Fabien O'Carroll
262c27c8e8 Version bump to 2.24.0 2019-06-18 19:25:06 +07:00
Fabien O'Carroll
46c7162085 Updated Ghost-Admin to 2.24.0 2019-06-18 19:25:06 +07:00
Nazar Gargol
058a87d2a1 Fixed Node v12 failing build on Travis
no issue

- Node v12 goes into LTS on 2019-10-22 (https://github.com/nodejs/Release#release-schedule)
- It is not a recommended version but we want to start testing it early
- Added '--ignore-engines' option to `install` step to make it possible
to run v12 build without adding new entry in Ghost's package.json
2019-06-18 12:20:51 +02:00
Nazar Gargol
d06409701d Added Node v12 to allowed failures
no issue

- Node v12 goes into LTS on 2019-10-22 (https://github.com/nodejs/Release#release-schedule)
2019-06-17 23:44:23 +02:00
Hannah Wolfe
d1e3205569 Add url as context to oembed unknownProvider error
- This is so that we can use logs to see urls that turn up with this error
2019-06-13 12:57:02 +01:00
Kevin Ansfield
bbae006eb5
Speed up image-size utility functions (#10784)
no issue

- add `probe-image-size` dependency
- use `probe-image-size` to fetch partial image data over the network where possible
2019-06-11 16:25:15 +01:00
Rish
c5cb7a6155 Version bump to 2.23.4 2019-06-11 16:51:41 +05:30
Rish
f17e32b52d Updated Ghost-Admin to 2.23.4 2019-06-11 16:51:41 +05:30
Kevin Ansfield
6fd2db2ed4 Update amperize to v0.5.2
no issue
- includes a couple of bug fixes for fallback from probe-image-size to image-size
2019-06-11 12:17:28 +01:00
Nazar Gargol
a936362051 Removed logging for validation error in frontend routing
refs #10525

- The logging in this place only introduced confusion and provided no usefull information
2019-06-11 12:35:16 +02:00
Kevin Ansfield
f34a9d2e36 Update amperize to v0.5.1
no issue

- includes fix for http->https conversion that broke tests in 90b0c8d3bb
2019-06-10 11:14:00 +01:00
Kevin Ansfield
90b0c8d3bb 🚀 Speed up initial generation of /amp/ content with many images
no issue

- update `amperize` to v0.5.0 which includes partial image loading and parallel network requests for fetching image dimensions
2019-06-10 09:53:25 +01:00
Timothy Stapleton
f2e60806da 🐛 Fixed redirects to absolute URLs (#10777)
closes #10776

When the "to" property of the redirect includes a host (implying an external or fully qualified url) we skip replacing any paths and redirect straight to it, rather than modifying the URL with the sites sub-directory.
2019-06-10 12:48:37 +07:00
Rish
a4f119cb7f Moved visibility utility from static model fn to Ghost-SDK
refs #10618

- Visibility methods don't belong on model, but are generic utils
- Used directly from ghost helper's visibility methods, cleans up core
- Removes direct model dependency of theme helper
- Updated `foreach_spec` to correct test data as per schema - visibility property cannot be empty
2019-06-09 13:12:04 +05:30
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