2
1
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2023-12-13 21:00:40 +01:00
Commit graph

8356 commits

Author SHA1 Message Date
Fabien O'Carroll
b326cfaab7 Updated base model to remove extraAllowedProperties
refs #9881

This is because when extending these methods, you need to know the
contents of the extraAllowedProperties to replicate it in the subclass,
breaking the principle of open/closed.
2018-09-21 12:15:29 +02:00
Katharina Irrgang
b913618c03 Extended uncapitalise unit tests (#9891)
Extended uncapitalise unit tests

refs #9866

- Proved that the middleware works for many API versions
- Added test case to prove that the version identifier gets lowercased too
2018-09-20 22:27:38 +02:00
Katharina Irrgang
0d35733448 Removed res.isAdmin from admin express app (#9889)
refs #9866

- the admin express app serves the client
- it only uses admin redirects
- we can use the new middleware function to avoid `res.isAdmin`
2018-09-21 01:08:09 +05:30
Rishabh Garg
fcd275f6c0 Refactored web/middleware and web/utils to web/shared (#9892)
refs #9866

- Moved web/middleware to web/shared/middlewares
- Moved util file to web/shared/utils
2018-09-20 20:04:34 +02:00
kirrg001
07fee6d027 Replaced setPrototypeOf with Object.setPrototypeOf
no issue

- discovered here: https://github.com/TryGhost/Ghost/pull/9886#discussion_r219127231
- `setPrototypeOf` is a npm package and a dependency of e.g. express
- we can use `Object.setPrototypeOf` instead
2018-09-20 17:50:57 +02:00
Nazar Gargol
006c83fbe4 ES6 migration: server/web/ (#9886)
refs #9589
2018-09-20 15:03:33 +02:00
Nazar Gargol
7e17c56feb Removed res.isAdmin usages from v2 express app (#9884)
refs #9866

- Removed `res.isAdmin` flag in v2 express app
- Did not touch v0.1 express app
- Separated url redirect middleware for admin and content API
2018-09-20 13:58:45 +02:00
Rishabh Garg
0549c9f7d4 ES6 migration: server/api/ (#9876)
refs #9589
2018-09-18 15:59:56 +02:00
Nazar Gargol
57271127f4 Added v2 api endpoints (#9874)
refs #9866

- Registered Content API under /ghost/api/v2/content/
- Registered Admin API under /ghost/api/v2/admin/
- Moved API v0.1 implementation to web/api/v0.1
- Created web/api/v2 for the new api endpoints
- Started with reducing the implementation for the new Content API (the Content api does not serve admin api endpoints, that's why it was reducible)
- Covered parent-app module with basic test checking correct applications/routes are being mounted
- Added a readme file, which contains a warning using v2, because it's under active development!
- This PR does only make the new endpoints available, we have not:
  - optimised the web folder (e.g. res.isAdmin)
  - started with different API controllers
  - reason: we want to do more preparation tasks before we copy the api controllers
2018-09-18 15:59:06 +02:00
Rish
6ae5c13de7 Version bump to 2.1.3 2018-09-18 18:07:57 +05:30
Rish
e66edd403b Updated Ghost-Admin to 2.1.3 2018-09-18 18:07:57 +05:30
Kevin Ansfield
2eada22282 Bump forked oembed-parser dependency
no issue
- removes bellajs sub-dependency that wasn't pinned because it's latest version restricts the usable node version
2018-09-18 10:33:04 +01:00
Sumedh Nimkarde
ad2797c18d 🔧 Add the 'compress' and 'preloadHeaders' options to defaults.json config (#9863) 2018-09-17 21:36:52 +02:00
Sumedh Nimkarde
efd1587ee9 Switched to eslint-plugin-ghost (#9835)
refs #9834

- @TODO: the test env eslint needs to use the plugin, not part of this PR
2018-09-17 20:49:30 +02:00
Nazar Gargol
d0d3eed13c Refactored posts integration tests to return promises instead of using done() callback 2018-09-17 19:55:21 +02:00
Nazar Gargol
9241a77935 🐛 Fixed ordering of unpublished draft posts
closes #8495

- Fixes ordering of posts when one of the drafts was previously published
- Adds test coverage for ordering of unpublished drafts
2018-09-17 19:55:21 +02:00
Vikas Potluri
2aaf4d6054 🐛Disallowed indexing of preview pages (#9762)
closes #9749

- disallow indexing of /p/ in robots.txt
- add meta robots tag to preview pages
- robots.txt wont' be applied for blogs not mounted to the root (i.e. https://example.com/blog/)
2018-09-17 11:29:47 +02:00
Nazar Gargol
ecc89b5c0b Removed unused getApiURL method in api test utilities
no issue

- housekeeping in test utilities
2018-09-17 09:43:00 +02:00
kirrg001
242f7ef4c8 Removed usage of res.isAdmin from private blogging app
no issue

- private blogging was once part of a single big express app, see: c1a2601514
- therefor we needed to differentiate if the request is for /api/v0.1 or for the actual site
- nowadays, we register apps only for the site express app
2018-09-15 08:58:53 +02:00
Nazar Gargol
d2bc812983 Version bump to 2.1.2 2018-09-11 14:15:21 +02:00
Nazar Gargol
936b59efe5 Updated Ghost-Admin to 2.1.2 2018-09-11 14:15:21 +02:00
Nazar Gargol
aab9df1784 Upgrading Casper to 2.6.2 2018-09-11 13:53:19 +02:00
kirrg001
ec49a48a1e 🐛 Fixed routes.yaml upload on Ubuntu
no issue

- a specific content type was missing (e.g. Firefox on Ubuntu)
- they send a different content-type to the server: application/x-yaml
- was reported in the forum: https://forum.ghost.org/t/cant-upload-routes-yamls-for-dynamic-routing-error-please-select-a-valid-yaml-file-to-import/2986
2018-09-10 20:03:38 +02:00
Anonymous
8f568bc556 ES6 migration: server/lib/common (#9779)
refs #9589
2018-09-10 14:39:50 +02:00
Mandeep Singh Gulati
03af23cddf ES6 migration: server/api (#9761)
refs #9589

- not all of the api files were updated
2018-09-10 14:30:48 +02:00
Lars Nolden
5e963935f9 ES6 migration: server/web/middleware (#9737)
refs #9589
2018-09-10 14:07:57 +02:00
Bill Fienberg
b17e242fc6 ES6 migration: server/adapters/storage (#9700)
refs #9589

- Replace vars with const/lets
- Replace concatenated strings with ES6 Template Literals
- Use ES6 object shorthand
2018-09-10 13:40:32 +02:00
Bill Fienberg
d710baad0d ES6 migration: server/adapters/SchedulingDefault (#9696)
refs #9589
2018-09-10 11:47:43 +02:00
Denis Zhbankov
f12fd4b101 Fixed correct promise order in RSS feed generator (#9726)
no issue

- the 'rss.feed' filter used to get an empty feed as a parameter, because item generation is done via promises
- now it waits until all items have been added
2018-09-10 11:39:38 +02:00
Tien Do
839eb5bd43 ES6 migration: server/apps/subscribers (#9688)
refs #9589

- use const, let, arrow function, string template
2018-09-10 11:06:41 +02:00
Nazar Gargol
8ca444fd55 Version bump to 2.1.1 2018-09-06 12:59:24 +02:00
Nazar Gargol
cfd1a0a012 Updated Ghost-Admin to 2.1.1 2018-09-06 12:59:24 +02:00
Nazar Gargol
b36490b6e7 Bump gscan to version 2.2.1
closes #9851
2018-09-06 12:24:17 +02:00
Nazar Gargol
9613de7cc1 🐛 Fixed gif images are not converted to png (#9853)
refs #9848

- Disabled image optimization for .gif files as a temporary solution until sharp library starts supporting latest version of libvips
- Disabled image optimization for .svg/.svgz files as permanent solution as these file types are being converted to .png
2018-09-06 11:42:42 +02:00
kirrg001
c679a3527a Version bump to 2.1.0 2018-08-31 12:14:52 +01:00
kirrg001
336f4e7375 Updated Ghost-Admin to 2.1.0 2018-08-31 12:14:52 +01:00
Kevin Ansfield
8e4c5d0f34 Fixed mobiledoc-converter test
no issue
- 👻
2018-08-31 12:03:08 +01:00
kirrg001
6dfcbd251e Upgrading Casper to 2.6.1 2018-08-31 11:28:27 +01:00
Kevin Ansfield
bba3049106 Updated gallery renderer to cope with invalid images
no issue
- skip rendering images that do not have all required fields
- do not render anything if there are no valid images
2018-08-31 11:13:24 +01:00
Rish
d29e376367 Added kg-card class to mobiledoc cards
No issue
2018-08-31 11:05:47 +01:00
Fabien O'Carroll
c9b8ddde4b 🎨Added absolute_url flag to public api (#9833)
closes #9832

The API _should_ be returning absolute URLs for everything, 3rd party applications require absolute urls to read and display ghost data correctly. Currently they have to concat the blog url and the resource url, which is very uncomfortable.

Changing the public api like this would be considered a breaking change however so we've opted to put it behind a query parameter named `absolute_urls`.
2018-08-31 11:02:39 +01:00
kirrg001
a796d73ed0 Fixed tests
no issue

- Adapted tests because of gscan bump
2018-08-30 18:04:54 +01:00
Rish
5f49d9090a Update gscan version 2018-08-30 17:59:47 +01:00
Kevin Ansfield
402d26a23c Added mobiledoc renderer for gallery card
no issue
- basic renderer for working with Koenig's gallery card
2018-08-30 17:57:17 +01:00
kirrg001
4c0e2754ba Upgrading Casper to 2.6.0 2018-08-30 17:48:20 +01:00
Nazar Gargol
0faf89b5ab Added ability to resize and compress images on upload (#9837)
refs #4453

* On by default

* Added config to disable resizing

* Added basic image optimization processing

* Added dep: sharp (optional dep)

* Added resize middleware

* Take care of rotation based on EXIF information

* Removed all meta data from optimised image

* Added handling if sharp could not get installed

* Do not read ext twice - optimisation

* Do not call sharp if config is disabled

* Do not remove the original image which was uploaded (store 2 images)

* Support of `req.files` for internal logic

* Disabled cache to enable file removal on Windows
2018-08-30 17:30:36 +01:00
Nazar Gargol
154366f448 🎨 Added additional parameters to subscribe_form and input_email helpers (#9820)
closes #9134

- Added form_id, input_id, and button_id parameters to subscribe_form helper
- Added id parameter to input_email helper
- Added test coverage to input_email helper
- Added quotes to id attributes for consistency
- Added subscribe_form helper tests
- Updated express to v4 in helper tests
2018-08-30 17:17:27 +01:00
Nazar Gargol
a0e7160fc9 🐛Fixed count.posts respecting co authors (#9830)
closes #9822

- Fixed the post count issue for co authors
- Corrected and refactored tests related to users post count
- Consistency fix, because we return all posts where the author is primary or co author for the author page already
2018-08-30 17:05:29 +01:00
Fabien O'Carroll
647fb1db62 Move yarn installation into before_install scripts
refs #9838

For some reason Travis was pulling in a different key, and so the yarn
package could not be verified. The apt addon for travis displays that it
is in beta - so for now the installation of yarn has been moved into
before_install which should be more stable.
2018-08-30 16:58:43 +08:00
Fabien O'Carroll
8ccf27340b Oembed meta tag fallback for unknown providers (#9827)
closes #9786

- Make GET request when url has no provider match
  - The HEAD request was made in order to send less data over the wire when
checking for redirects for urls that do not have an oembed provider
match. We are now going to look for provider metatags withing the
response of the request - rather than making a HEAD followed by a GET if
no redirect is found, this condenses that to a single request.

- Try to get OEmbed data from tag if no provider
  - Here we parse the HTML response of the resource and look for a link tag
that will give us the oembed resource url which we can use to fetch the
embed html
2018-08-27 15:02:03 +01:00