Commit Graph

11949 Commits

Author SHA1 Message Date
Kevin Ansfield
d41c2f8446
Added migration for emails.track_opens column (#12331)
no issue

- tracking of bulk email opens can be enabled/disabled over time, if we're calculating analytics for emails we don't want emails which didn't have tracking enabled skewing the results so we need a record of whether tracking was enabled for each email
2020-11-05 11:39:53 +00:00
Renovate Bot
3da083a36d Update dependency @tryghost/adapter-manager to v0.2.0 2020-11-05 10:50:47 +00:00
Renovate Bot
55081d7d5a Update dependency @tryghost/bootstrap-socket to v0.2.3 2020-11-05 10:50:25 +00:00
Renovate Bot
571b6a621d Update dependency @tryghost/errors to v0.2.5 2020-11-05 10:50:10 +00:00
Renovate Bot
ebd55028cd Update dependency @tryghost/security to v0.2.1 2020-11-05 10:49:49 +00:00
Renovate Bot
8666ff3713 Update dependency @tryghost/promise to v0.1.2 2020-11-05 08:07:45 +00:00
Renovate Bot
2319f085e9
Update dependency @tryghost/zip to v1.1.5 2020-11-05 07:41:43 +00:00
Renovate Bot
7cac75b1bc Update dependency @tryghost/session-service to v0.1.10 2020-11-05 07:38:49 +00:00
Renovate Bot
9daba4e679
Update dependency @tryghost/vhost-middleware to v1.0.10 2020-11-05 04:50:29 +00:00
Naz
c7541a1fe0 Added scheduled job support in testmode
no issue

- We need an ability to early test scheduled jobs to refine the new feature and it's API. Should be used with caution
- To schedule an example scheduled job every 30 seconds run following request: `curl http://localhost:2368/ghost/api/schedule/every%2030%20seconds`
2020-11-05 17:46:57 +13:00
Naz
fae05558f3 Added JSDoc comments to redirects service
refs #11085
2020-11-05 12:45:34 +13:00
Naz
f69526c140 Fixed error logged for absent redirects config
refs #11085

- Incorrect usage error was logged to the output when there was no recirecst configuration file present in the system. Previously an empty string was returned in such situation, resulting in "ENOENT" error, which was ignored through special handling.
- The fix resembles logic in redirects async getter function where empty array is returned when the config file does not exits.
- Attempting to read unexistent config should not ever happen and will be handled on the config service layer, this is why special "ENOENT" handling has been removed
2020-11-05 12:45:02 +13:00
Renovate Bot
142f5d389d Update dependency supertest to v6.0.1 2020-11-04 20:04:18 +00:00
Renovate Bot
73d9639780
Update dependency @sentry/node to v5.27.3 2020-11-04 18:04:40 +00:00
Renovate Bot
9856d7c777
Update dependency sanitize-html to v2.1.2 2020-11-04 17:11:37 +00:00
Fabien O'Carroll
601b6ce174 Added migration to populate recipient_filter
no-issue

This populates the recipient_filter column for existing emails
based on the visibility of the related post at the time of the
migration.
2020-11-04 16:29:54 +00:00
Fabien O'Carroll
918c721bd1 Added recipient_filter column to emails table
no-issue

This column will allow us to store the canonical recipient filter on the
email resource giving us a detailed log of which members an email was
intended for
2020-11-04 16:29:54 +00:00
Fabien O'Carroll
dd0f80c9fa Added migration to populate email_recipient_filter
no-issue

This populates the email_recipient_filter column for existing posts
based on 1. if they were sent as an email and 2. their visibility.
2020-11-04 16:29:54 +00:00
Fabien O'Carroll
3b0a84b33b Added email_recipient_filter column to posts table
no-issue

This column will allow us to decouple the recipients of newsletter from
the `visibility` of a post, allowing us to send emails to specifically
free members, or to send paid posts as newsletters to all members.
2020-11-04 16:29:54 +00:00
Daniel Lockyer
9b45ea6f7d Added original error to logged error message
- without this, the original error stacktrace is hidden which makes
  issues harder to track down
2020-11-04 14:00:59 +00:00
Renovate Bot
9f93a0895e
Update dependency ghost-ignition to v4.2.4 2020-11-04 11:06:57 +00:00
Kukhyeon Heo
504509bb67
Removed global.Promise override (#12182)
closed #11943 

* Remove global.Promise
* Fix brute-knex bluebird error.
* Fix api-acceptance tests.
* Fix unit tests
2020-11-04 10:55:47 +00:00
Naz
e3e15646eb Updated redirect error message
refs #11085

- The logic which uses this error deals with an input yaml file thus the change.
- Related discussion here - https://github.com/TryGhost/Ghost/pull/12187#discussion_r508144220
2020-11-04 12:26:22 +13:00
Kukhyeon Heo
5715aa2155
Added .yaml format support in redirects configuration (#12187)
closes #11085

- Ghost has been using YAML format for other configurations (e.g. routes). The plan is to move to this format for all user-edited settings files. By default JSON format is still used in Ghost Admin API v2/v3, but will be changed to YAML in API v4. Check referenced issue for more context.
- New format supports all the features available before. The main noticeable change is the structure of config file. It is now grouped by redirect HTTP code instead of specifying `"permanent": true | false` attribute for each config property. Example format for YAML config:
```
302:
  /from-url/: /to-url/

301:
  /category/([a-z0-9\-]+)/i: /tag/$1/
  /v([0-9\.]+)/docs/([a-z0-9\-]+)/i: /docs/$2/
```
- Added 2 new endpoints: `POST redirects/upload` and `GET redirects/download`. These serve as an alias to current GET/POST `/redirects/json. "upload/download" naming pattern is introduced to match the convention with other resources that can be uploaded and downloaded (images, themes etc.). `/redirects/json`  endpoints will be removed in Admin API v4
- The parsing code from `custom-redirects.js` has been moved to `frontend/services/redirects/settings.js`. This location is more appropriate for this logic and eventually `custom-redirects.js` middlewear might be moved into "frontend" as this middlewear plays a role mostly effecting that area.
2020-11-04 12:08:32 +13:00
Renovate Bot
7d78895b4b Update dependency @tryghost/kg-markdown-html-renderer to v2.0.4 2020-11-03 20:08:55 +00:00
Renovate Bot
b166ec816f
Update dependency @tryghost/kg-card-factory to v2.1.4 2020-11-03 16:50:32 +00:00
Kevin Ansfield
bcf409ee8a 🐛 Fixed bookmark card caption formatting showing as visible html
no issue

- updated `@tryghost/kg-default-cards` which fixed the escaping of bookmark card caption output
2020-11-03 16:49:07 +00:00
Daniel Lockyer
1ecaac99b7 Removed grunt-contrib-uglify dependency
- the only bit of code that needed this, the minification of `members.js`, was
  removed in 3.37.0 so we no longer need this plugin
2020-11-03 14:13:00 +00:00
Daniel Lockyer
7904b8eb50 v3.37.1 2020-11-03 14:00:30 +00:00
Daniel Lockyer
300145798e Updated Ghost-Admin to v3.37.1 2020-11-03 14:00:30 +00:00
Daniel Lockyer
a824ba8d70 v3.37.0 2020-11-03 13:11:42 +00:00
Daniel Lockyer
4a270632db Updated Ghost-Admin to v3.37.0 2020-11-03 13:11:42 +00:00
Rishabh Garg
8ad11fe082
Enabled Portal (#12317)
no refs

[Portal](https://github.com/TryGhost/Portal) is a new drop-in script to make the bulk of Ghost membership features work on any theme out of the box, which was under a developer flag so far. This release removes the flag for Portal and makes it included as default for any members-enabled Ghost site. The Portal script is backward compatible with old public members script and existing Members-enabled themes should notice no change.

- Removes Portal config flag as Portal is now enabled by default
- Removes old members script as Portal is backward compatible with it
- Changes `{{content}}` helper to show default CTA in case of restricted content access
- `accent_color` setting is no more behind the dev experiment flag and included by default
- Adds migration to switch off Portal button setting for all existing sites which don't have Portal enabled in beta
2020-11-03 14:36:21 +05:30
Naz
4ebebd12d3 Removed unneeded parameter
no issue

- There is no second parameter in Promise constructor. Didn't serve any purpose as per comment - bbbd011074 (r41413465)
2020-11-03 13:38:08 +13:00
Renovate Bot
fd1e2f924b
Update dependency mocha to v8.2.1 2020-11-02 23:06:05 +00:00
Renovate Bot
be441c204f
Update dependency brute-knex to v4.0.1 2020-11-02 17:07:12 +00:00
Renovate Bot
ebaeb053c1
Update dependency @tryghost/helpers to v1.1.34 2020-11-02 15:54:33 +00:00
Renovate Bot
d86dca244f Update dependency @tryghost/string to v0.1.14 2020-11-02 15:53:37 +00:00
Renovate Bot
00bfb13a4d Update dependency @tryghost/html-to-mobiledoc to v0.7.6 2020-11-02 15:02:45 +00:00
Renovate Bot
614e1f6641 Update dependency knex to v0.21.12 2020-11-02 15:02:32 +00:00
Renovate Bot
dc51d997f8 Update dependency @tryghost/social-urls to v0.1.15 2020-11-02 15:02:08 +00:00
Renovate Bot
80738dcba0 Update dependency @tryghost/url-utils to v0.6.23 2020-11-02 15:01:52 +00:00
Renovate Bot
1c470f3d66
Update dependency @tryghost/admin-api-schema to v1.3.0 2020-11-02 13:19:45 +00:00
Naz
7326241718 🐛 Fixed server error for repeated order query parameter
closes #12263

- Express parses repeated query parameters as an array (req.query properties). Because there is no clear reason on why not to support this behavior extended order parameter parsing logic to handle arrays. This follows the rule of "liberal inputs, conservative outputs"
- Example supported query string for ordering can now look like: `?order=featured&order=published_at asc`, the priority of the order stays the same with the most significant appearing first and least significant last
2020-11-03 00:15:24 +13:00
Renovate Bot
14ac6168ac Update dependency @tryghost/members-api to v0.34.2 2020-11-02 10:34:21 +00:00
Renovate Bot
0958e6af82 Update dependency knex to v0.21.11 2020-11-02 10:10:38 +00:00
Daniel Lockyer
489add6e5e Pinned Node version in CI
- The default Node version on GitHub Actions is moving to Node 14 and we
  want to keep building it on 12 for now, so this commit pins the
  version to 12.18.0
2020-11-02 08:48:05 +00:00
naz
a2bfef53de
🐛 Fixed post resource filtering by posts_meta table fields (#12307)
refs #11572

- Filtering by fields coming from posts_meta table did not work for post resources. This was due to lack of support for these types of operations on NQL layer. The approach taken here is using same way filtering was done for many:many relations and generates a `WHERE IN` filtering clause. In the future we could look into adding preloading of 1:1 relations which should allow getting rid of `WHERE IN` in favor of `JOIN` and filtering directly by field names. 
- Changed structure of `EXPANSIONS` filter configuration. Current approach was based on "bag of all the things". Such structure will become problematic as more fields are added. For example, adding all the fields from 1:1 relation posts:posts_meta might collide with any other relations that would have similar naming like meta_description from tags table (if it were was added).
- Bumped nql version to 0.5.0. This adds filtering support to 1:1 relations
- Added filter expansions which can be unique per model Previous approach with single global expansions lookup wasn't working in case different models would need to declare expansion for same field names. Having a `filterExpansion` method per model works in a similar convention other filter related model methods do (e.g. enforcedFilters, defaultFilters)
2020-11-02 12:53:57 +13:00
Kevin Ansfield
7a74b78940 Included email-id as user variable when sending bulk emails via mailgun
no issue

- adding user variables via the mailgun API when sending emails means that events related to email have those variables attached to them
- adding the `email.id` value to user variables means we can easily associate mailgun events to emails, otherwise we'd have look up the batch via `email_batches.provider_id` then use a join to get back to the associated email
2020-10-29 16:37:42 +00:00
Renovate Bot
aaeba56134
Update dependency ghost-ignition to v4.2.3 2020-10-29 15:18:58 +00:00