Commit Graph

7833 Commits

Author SHA1 Message Date
kirrg001
ac2578b419 Moved errors,logging,i18n and events to lib/common
refs #9178
2017-12-12 10:28:13 +01:00
kirrg001
4265afe580 Moved utils/url.js to UrlService
refs #9178

- we have to take care that we don't end up in circular dependencies
  - e.g. API requires UrlService and UrlService needs to require the API (for requesting data)
- update the references
- we would like to get rid of the utils folder, this is/was the most complicated change
2017-12-11 20:05:33 +01:00
kirrg001
7d99ee8466 Small UrlService optimisations
no issue

- rename the config option to disable preloading the urls
- always expose the urlservice as singleton
- do the initialisation of the service inside the constructor
2017-12-11 20:05:33 +01:00
kirrg001
6d87703c2e Decrease chance of random test failure in core/test/unit/utils/request_spec.js
no issue
2017-12-11 12:53:13 +01:00
kirrg001
bac71db996 Updated comment in core/test/unit/migration_spec.js
no issue
2017-12-11 12:35:27 +01:00
Aileen Nowak
b70729b09d Version bump to 1.18.4 2017-12-07 19:30:00 +07:00
Aileen Nowak
3611744a08 Updated Ghost-Admin to 1.18.4 2017-12-07 19:30:00 +07:00
kirrg001
7139e8c794 Updated Ghost-Admin: asset delivery
refs #9178
2017-12-06 17:38:23 +01:00
Katharina Irrgang
7bcccc71dc
Moved apps into web folder (#9308)
refs #9178

- move express apps to one place (called `web`)
- requires https://github.com/TryGhost/Ghost-Admin/pull/923
- any further improvements are not part of this PR
- this PR just moves the files and ensures the paths are up-to-date
2017-12-06 17:37:54 +01:00
kirrg001
b8da46ddfd Tests: Simplify test/functional/module/module_spec.js
refs #9178

- these checks can happen within one test
2017-12-06 13:03:21 +01:00
kirrg001
511c26745b Decrease chance of random test failure in core/test/unit/server_utils_spec.js
no issue
2017-12-05 12:32:04 +01:00
kirrg001
4a6b5d2d4e Speed up routing tests
refs #9178

- the first test will start the ghost server
- all following test will reuse the server and only truncate the database tables
- you can use `forceStart` if you need
- we have to ensure that reusing the server requires us to
  - e.g. reload the settings
  - e.g. reload active theme
- remove fork functionality (you can use `forceStart: true`)
- no test has changed, just the way we start the server
2017-12-05 12:32:04 +01:00
kirrg001
cd27d5e1ab Version bump to 1.18.3 2017-12-05 10:07:05 +01:00
kirrg001
3bf2353a38 Updated Ghost-Admin to 1.18.3 2017-12-05 10:07:05 +01:00
kirrg001
1ac7c00d4a Bump knex-migrator to version 3.1.2
no issue

- patch update
2017-12-05 10:04:23 +01:00
Austin Burdine
ac64bc1c81 Added Ghost-CLI version range to package.json (#9253)
no issue

- compatibility check for Ghost and the Ghost-CLI
2017-12-05 09:17:06 +01:00
Katharina Irrgang
0bb81bb3c4
Bump knex-migrator to version 3.1.1 (#9199)
no issue

- adapt major changes of knex-migrator v3
- adapt migration scripts, simplify and add `down` (rollback) hook if possible
- clear Ghost cache after init hook (because of `knex-migrator migrate --init`)
- ensure db migrations work with the CLI
- updated troubleshooting guide (https://docs.ghost.org/v1/docs/troubleshooting#section-task-execute-is-not-a-function)

**For development only: Please ensure you run `npm i -g knex-migrator@latest` to update your global installation to v3. We always prefer the local installation, but v3 has modified and added binaries.**
2017-12-05 09:14:55 +01:00
kirrg001
533ae22c2b Added protection for incorrect i18n variable names
closes #9305

- add a try/catch when formatting messages
- fallback to the general error message if error ocurred
- log the error
2017-12-04 17:13:12 +01:00
kirrg001
0be734a05c Fixed incorrect i18n variable names
no issue
2017-12-04 16:58:02 +01:00
kirrg001
e895b2c23b Fixed channels/webhooks tests
no issue

- i saw that the channels routing tests were sometimes not running in Travis

e.g. https://travis-ci.org/TryGhost/Ghost/jobs/311303939
> Channel Routes
> Unhandled rejection Error: select "webhooks".* from "webhooks" where "event" = 'subscriber.added' - SQLITE_ERROR: no such table: webhooks
2017-12-04 15:18:12 +01:00
kirrg001
3e482254a3 Ensure test coverage exit in Travis
refs 611e8b5634

- looks like only grunt coverage won't tell Travis that the tests are finished
- second attempt
2017-12-04 15:18:12 +01:00
Aileen Nowak
3f823951ba Version bump to 1.18.2 2017-11-30 20:16:26 +07:00
Aileen Nowak
b709036ed0 Updated Ghost-Admin to 1.18.2 2017-11-30 20:16:26 +07:00
Kevin Ansfield
0712761752 Version bump to 1.18.1 2017-11-29 15:50:50 +00:00
Kevin Ansfield
e0757a80a3 Updated Ghost-Admin to 1.18.1 2017-11-29 15:50:50 +00:00
Katharina Irrgang
611e8b5634 Ensure tests exit in Travis (#9288)
refs https://github.com/mochajs/mocha/issues/3044

- there was a breaking change in mocha, which i have mentioned [here](ee7710ba68), but i thought it's not required, but it is
- it can happen that with mocha 4.x, travis does not complete a test run, because the process does not exit (maybe the test env does not shutdown everything completely)
- but it's hard to figure out why that happens, so we simply add `--exit` (this reflects the mocha 3.x behaviour)
- i've tested that failed tests are still counted and the build results in a red state
2017-11-29 15:22:21 +00:00
kirrg001
d58f7ae22b Bump grunt-mocha-cli to version 3.0.0
no issue

- https://github.com/Rowno/grunt-mocha-cli/blob/master/CHANGELOG.md#300--2016-11-07
- no major changes to adapt
2017-11-29 10:34:36 +01:00
kirrg001
53e7789d6d Bump grunt-shell to version 2.1.0
no issue

- no major changes to adapt
- 3b379e718a
2017-11-29 10:34:36 +01:00
kirrg001
5e370bc5ce Bump matchdep to version 2.0.0
no issue

- no major changes to adapt
2017-11-29 10:34:36 +01:00
kirrg001
71f6068aa6 Bump grunt-contrib-uglify to version 3.2.1
no issue

- we only use the `sourceMap` option, which is still supported
2017-11-29 10:34:36 +01:00
kirrg001
9ce20fb043 Removed run-sequence dev dependency
no issue

- not used
2017-11-29 10:34:36 +01:00
kirrg001
ee7710ba68 Bump mocha to version 4.0.1
no issue

- https://github.com/mochajs/mocha/blob/master/CHANGELOG.md#400--2017-10-02
- the new `--exit` flag might be interesting at some point

> In Mocha v3.0.0 and newer, returning a Promise and calling done() will result in an exception.

- adapt teardown/setup test utility
- adapt other mixed usages of callback && Promise usage
2017-11-29 10:34:36 +01:00
kirrg001
404d045461 Bump rewire to version 3.0.2
no issue

- nothing to adapt for the major jump
2017-11-29 10:34:36 +01:00
kirrg001
c6e64fc7a8 Speed up SchedulingDefault_spec.js unit test
refs #9178

- the test used lots of bigger and unneeded timeouts
- reduce them to ensure unit tests run faster
- they now run with 845ms on my mac
2017-11-28 21:42:14 +01:00
Katharina Irrgang
b9a44bacf6
Bump should to version 13.1.3 (#9284)
refs https://github.com/TryGhost/Ghost/issues/9178

- adapt major changes
- see https://github.com/shouldjs/should.js/blob/master/History.md
- should.have.enumerable was removed
2017-11-28 19:41:16 +01:00
Katharina Irrgang
b4b5da2a75
Bump sinon to version 4.1.2 (#9283)
refs #9178

- adapt major changes
2017-11-28 18:19:23 +01:00
Katharina Irrgang
9e388aee4d 🎨 Improved error handling for images on file storage which don't exist (#9282)
refs https://github.com/TryGhost/Team/issues/41

- differentiate error codes
- return 404 if image was not found
- else return a 500
- use i18n keys
- use errors.utils.isIgnitionError (!)
2017-11-28 14:27:18 +00:00
kirrg001
be9ce107bd Re-attach error to request object if error occurs when rendering error template
no issue

- otherwise we won't see the error in the logs
2017-11-28 13:44:14 +00:00
kirrg001
e8075262eb 🎨 Improved pagination misusage error
refs https://github.com/TryGhost/Team/issues/41, refs https://github.com/TryGhost/gscan/issues/85

- if you are using the pagination helper not inside a resource context, you will receive an error
- improve error message, because it was not clear what happened
- downgrade error level to normal, because it's not a critical error from Ghost's perspective, from user perspective it is
- added help docs link and added a callout to our docs
2017-11-28 13:44:14 +00:00
kirrg001
2f23cd32bb Bump dependencies
no issue

- gscan@1.2.3
- sanitize-html@1.16.1
- eslint@4.12.0
- nock@9.1.3
- sqlite3@3.1.13
2017-11-28 14:02:47 +01:00
Katharina Irrgang
d87fbeca49 🐛 Fixed error handling for html response (#9280)
refs https://github.com/TryGhost/Team/issues/41

- if you add invalid handlebars logic e.g. {{if condition condition}}, handlebars throws an error
- in case of having invalid hbs in an amp page, the amp component throwed another syntax error (which is fixed in this PR)
- furthermore the `setTemplate` helper function had a logic bug, which did not handle errors correctly
  - if there is an error and a template is set (e.g. amp), we have to still render the error page and not the amp page
- this fix only ensures that the error handling is correct, we still see the error of the "ugly" handlebars message
  - e.g. [amp.hbs] Cannot read property 'includeZero' of undefined
  - but no longer -> Cannot read property 'html' of undefined (which was a syntax error in Ghost)
2017-11-28 12:00:43 +00:00
Katharina Irrgang
3004e03bc6 🐛 Fixed throwing 500 for invalid encoded urls (#9279)
refs https://github.com/TryGhost/Team/issues/41

- if you send invalid encoded url components in the path, the server tried to decode the url
- if it contains invalid characters like /AF%, it throwed a 500
- we return a page not found error instead
2017-11-28 11:39:38 +00:00
Guillem Andreu
860b38a1a7 🐛 Fixed Sitemap when permalink contains Primary Tag (#9273)
closes #9272

- included tags in sitemap post-generator
2017-11-27 12:38:56 +01:00
Kevin Ansfield
94360c8a32
🐛 Fixed import and redirect uploads for Win10/Edge (#9267)
closes https://github.com/TryGhost/Ghost/issues/9236
- added `text/plain` to the allowed mime types for db and redirect uploads
2017-11-22 17:30:53 +00:00
Aileen Nowak
9190857e71 Version bump to 1.18.0 2017-11-21 23:48:02 +08:00
Aileen Nowak
f64e395eb3 Updated Ghost-Admin to 1.18.0 2017-11-21 23:48:02 +08:00
Kevin Ansfield
bffb3dbd90
Webhooks support for subscriber events (#9230)
no issue

Support for http://resthooks.org style webhooks that can be used with Zapier triggers. This can currently be used in two ways:

a) adding a webhook record to the DB manually
b) using the API with password auth and POSTing to /webhooks/ (this is private API so not documented)

⚠️ only _https_ URLs are supported in the webhook `target_url` field 🚨

- add `webhooks` table to store event names and target urls
- add `POST` and `DELETE` endpoints for `/webhooks/`
- configure `subscribers.added` and `subscribers.deleted` events to trigger registered webhooks
2017-11-21 15:43:14 +00:00
Aileen Nowak
9e60ac639b Upgrading Casper to 2.1.7 2017-11-21 22:09:35 +08:00
Aileen Nowak
a4cf29dc7d Bump amperize to version 0.3.6 (#9264)
no issue

New version contains
- dependency updates
- Node v8 support
- Eslint refactoring
2017-11-21 15:00:04 +01:00
Katharina Irrgang
dfd4afea19 Add bookshelf-relations (#9252)
no issue

- added https://github.com/TryGhost/bookshelf-relations as dependency
- remove existing tag handling

--- 

* Important: Ensure we trigger parent initialize function

- otherwise the plugin is unable to listen on model events
- important: event order for listeners is Ghost -> Plugin
- Ghost should be able to listen on the events as first instance
- e.g. be able to modify/validate relationships

* Fix tag validation

- we detect lower/update case slugs for tags manually
- this can't be taken over from the plugin obviously
- ensure we update the target model e.g. this.set('tags', ...)

* override base fn: `permittedAttributes`

- ensure we call the base
- put relations on top
- each relation is allowed to be passed
- the plugin will auto-unset any relations to it does not reach the database

* Ensure we run add/edit/delete within a transaction

- updating nested relationships requires sql queries
- all sql statements have to run in a single transaction to ensure we rollback everything if an error occurs
- use es6
2017-11-21 13:28:05 +00:00