diff --git a/README.md b/README.md index dd04b096f..72207c1f3 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,6 @@ The current recommended release version is v4.5.0. ^4.5 (and all future even-num - [Talk Product Roadmap](https://www.pivotaltracker.com/n/projects/1863625) - [Our Blog](https://blog.coralproject.net/) -- [Community Forums](https://community.coralproject.net/) - [Community Guides for Journalism](https://guides.coralproject.net/) - [More About Us](https://coralproject.net/) diff --git a/docs/source/01-04-planning-architecture.md b/docs/source/01-04-planning-architecture.md index d11ca4ac2..de1cfe803 100644 --- a/docs/source/01-04-planning-architecture.md +++ b/docs/source/01-04-planning-architecture.md @@ -19,3 +19,38 @@ Application servers: c4.xlarge (16 VM nginx + Talk VM machine pairs) Mongo nodes: 3x c3.medium (large db cluster, 1 master, 2 read replicas) If you need help with Talk performance or want custom scaling help or recommendations, let us know by logging a ticket and one of our engineers will get in touch with you: https://support.coralproject.net + +## How to Scale Talk Components +### Scaling the Talk Application + +In addition to scaling by adding additional app servers, Talk as a server component can flex to various roles. Depending on the desired configuration the roles can be split up to ensure high availability, and best matching to underlying host resources. + +There are three components to the Talk application that can be served independently or in combination on a single thread: API Server, WebSockets, and Jobs + +![ServerArchitectureDiagram](/talk/images/ServerArch.png) + +In the diagram we see the difference between a Typical configuration (which just adds additional Talk application instances) vs the Split configuration where different Talk components could be spread across different machine resources to optimize infrastructure utilization. +See [Serving the Application](/talk/configuration-cli-tools/#serving-the-application) + +### Scaling Redis + +Redis serves as a general cache and pub/sub broker. We treat all the data stored in Redis as ephemeral, so using as a cache serves us well for Talk to synchronize expensive query caches. It also serves as our pub/sub broker for use with live updates as propagated through the GraphQL subscription system. For this reason it is not recommended to implement multiple instances of Redis. + +### Scaling MongoDB + +MongoDB is treated as our general store for persisted data. Talk supports the most common strategies for scaling MongoDB instances including replicas and/or sharding. Depending on your specific data use cases, refer to MongoDBs documentation for more information about scaling https://www.mongodb.com/mongodb-scale. + +### Load Balancer +While this subject lives outside the Talk ecosystem, it is critical for application delivery. For websockets to work correctly, a load balancer must be selected that can support long lived connections that are required for websockets to work. + +## Running Talk in Production + +When you are ready to launch your production instance of Talk update your NODE_ENV environment variable from `development` to `production` mode. + +Then launch talk with `yarn start` or with the command `NODE_ENV=production ./bin/cli-serve -j -w` + + + + + + diff --git a/docs/source/01-05-pre-launch-checklist.md b/docs/source/01-05-pre-launch-checklist.md index 01e42b9bd..f07953eb6 100644 --- a/docs/source/01-05-pre-launch-checklist.md +++ b/docs/source/01-05-pre-launch-checklist.md @@ -58,9 +58,10 @@ permalink: /pre-launch-checklist/ - Install [talk-plugin-rich-text](/talk/plugin/talk-plugin-rich-text) -- [ ] Do you want to display comment counts? - - Use the GraphQL [CommentCountQuery](https://docs.coralproject.net/talk/api/graphql/#CommentCountQuery) - - Install [talk-plugin-deep-reply-count](/talk/plugin/talk-plugin-deep-reply-count) if necessary. +- [ ] Do you want to display comment counts on your embed stream or on a homepage with dozens of articles? + - Install [talk-plugin-comment-count](https://github.com/coralproject/talk-plugin-comment-count) for summary counts on multiple articles + - Install [talk-plugin-deep-reply-count](/talk/plugin/talk-plugin-deep-reply-count) to add counts to the embed stream + - Or use the GraphQL [CommentCountQuery](https://docs.coralproject.net/talk/api/graphql/#CommentCountQuery) - [ ] Do you want to translate Talk to a different language? diff --git a/docs/source/07-01-faq.md b/docs/source/07-01-faq.md index 8f34adbf1..f3bf92396 100644 --- a/docs/source/07-01-faq.md +++ b/docs/source/07-01-faq.md @@ -11,8 +11,6 @@ To log a bug or request a feature, submit a Support ticket ([support@coralprojec You can also request help on Github by [submitting an issue](https://github.com/coralproject/talk/issues). This also increases your chances of having someone from the community respond to help. -And you can also search our [Coral Community](https://community.coralproject.net) to see if your issue has been solved, or to get tips from the community. - ## How can our dev team contribute to Talk? We are lucky to work with newsroom dev teams and individual contributors who span the world, and come from newsrooms of all sizes. You can read our [Contribution Guide](https://github.com/coralproject/talk/blob/master/CONTRIBUTING.md) to get started, but feel free to reach out to us via Github too. diff --git a/docs/source/07-02-troubleshooting-tips.md b/docs/source/07-02-troubleshooting-tips.md index 6d7304a83..0b4a7a682 100644 --- a/docs/source/07-02-troubleshooting-tips.md +++ b/docs/source/07-02-troubleshooting-tips.md @@ -38,3 +38,6 @@ If you're using `talk-plugin-auth`: * See if you can isolate if it's a particular group of users that are experiencing this issue, e.g. mods, admins, subscribers? Confirm they have the appropriate permissions to comment. * Note if this is a new issue that happened after an upgrade - did you read the [migration docs](/talk/migration/3/) and the [release notes](https://github.com/coralproject/talk/releases)? This might help you resolve the issue. * If you're still experiencing issues, log a [support ticket](mailto:support@coralproject.net) so we can help diagnose the issue + +If a user has been locked out due to too many failed login attempts: +* How long does the user have to wait before they will be allowed to login? 10 mins \ No newline at end of file diff --git a/docs/source/_data/plugins.yml b/docs/source/_data/plugins.yml index 0e09de210..3c08715fe 100644 --- a/docs/source/_data/plugins.yml +++ b/docs/source/_data/plugins.yml @@ -146,3 +146,8 @@ tags: - default - sorting +- name: talk-plugin-comment-count + description: This plugin enables adding comment counts to Talk’s embed or in other locations on your site. + link: https://github.com/coralproject/talk-plugin-comment-count + tags: + - counts diff --git a/docs/source/images/ServerArch.png b/docs/source/images/ServerArch.png new file mode 100644 index 000000000..aed5ffcca Binary files /dev/null and b/docs/source/images/ServerArch.png differ diff --git a/docs/source/integrating/authentication.md b/docs/source/integrating/authentication.md index f834f3e53..05f88449e 100644 --- a/docs/source/integrating/authentication.md +++ b/docs/source/integrating/authentication.md @@ -26,6 +26,9 @@ Plugins are available for the following 3rd party authentication providers: * [Facebook](/talk/plugin/talk-plugin-facebook-auth/) * [Google](/talk/plugin/talk-plugin-google-auth/) +_FAQ: Can I create a Twitter auth plugin?_ +This is currently not possible because Talk uses passport.js which does not support Twitter's oAuth2 requirements. + ## Custom Token Integration You can integrate Talk with any authentication service to enable single sign-on @@ -61,6 +64,9 @@ The generated JWT must contain the following claims: - [`iss`](https://tools.ietf.org/html/rfc7519#section-4.1.1): the issuer for the token must match the value of `TALK_JWT_ISSUER` - [`aud`](https://tools.ietf.org/html/rfc7519#section-4.1.3): the audience for the token must match the value of `TALK_JWT_AUDIENCE` +### Generate a key to sign the JWT +Optionally you can use https://github.com/coralproject/coralcert to generate a key with which to sign the JWTs and specify the secret as an environment variable. + ### Push token into embed We're assuming that your CMS is capable of authenticating a user account, or diff --git a/docs/source/integrating/notifications.md b/docs/source/integrating/notifications.md index a5f625083..04fe8f59f 100644 --- a/docs/source/integrating/notifications.md +++ b/docs/source/integrating/notifications.md @@ -3,22 +3,13 @@ title: Notifications permalink: /integrating/notifications/ --- -Talk currently supports 3 types of email notifications. +There are several plugins included with Talk that once enabled will control how and when Talk sends emails to users based on user activity. Only basic user profile notifications are enabled by default. - -1. When someone replies to my comment -2. When a staff member replies to my comment -3. When my comment gets featured - -Talk support 3 options for notification frequency: immediately, hourly or daily. Commenters can also opt-out of email notifications. Notifications are set to OFF by default. - -Commenters cannot enable notifications until they have verified their email. - -Note: Notifications are not currently supported for users that sign-up via Facebook or Google auth, or don't have an email attached to their account for any other reason. +_NOTE: Notifications are only supported for users that have an email address in Talk! If you are using authenticate via Facebook, Google, or SSO and you want to persist the user’s email, you will also need to enable `talk-plugin-local-auth` ([See Authentication](/talk/integrating/authentication/))_ ### Configuring SMTP -You must setup SMTP to use notifications. The following ENV variables must be set: +You must setup SMTP to send email notifications. The following ENV variables must be set: ``` TALK_SMTP_FROM_ADDRESS=email@email.com @@ -28,28 +19,74 @@ TALK_SMTP_HOST=smtp.domain.net TALK_SMTP_PORT=2525 ``` -### Enabling Notifications +See our documentation on [setting env variables](/talk/advanced-configuration/#talk-smtp-from-address) for reference. -Enabling the `talk-plugin-notifications` creates a NotificationManager that creates and manages events send from the event emitter that is linked to the Graph API PubSub system. +When running Talk in production we recommend using a 3rd party mail service provider like SendGrid or MailGun. -Adding the `talk-plugin-notifications` plugin will also enable the `notifications` plugin hook. Any plugin that registers before the `talk-plugin-notifications` plugin will get picked up by. +If you are having difficulty with your SMTP settings you can add `DEBUG=talk:jobs:mailer` to your .env to see additional logs from the mailer service. -See https://github.com/coralproject/talk/blob/8b669a31c551a042f0f079d8cfc16825673eb8f0/plugins/talk-plugin-notifications-reply/index.js for an example. +All notifications require SMTP settings to be correctly configured first, then enable the corresponding plugin, and configure any settings in the Talk Admin. If SMTP is not enabled, it will log to the server console that some variables were not provided. -### Notification Categories +### Notification Types & Plugins -Talk currently supports the following Notifications options out of the box: +In addition to the core notifications included with Talk, some plugins add features that are supported by and will add additional types of email notifications. Commenters can opt-out of most email notifications, and comment activity notifications are set to OFF by default. Commenters cannot enable notifications until they have verified their email. -`talk-plugin-notifications-category-reply` -`talk-plugin-notifications-category-staff-reply` -`talk-plugin-notifications-category-featured` +You can see a list of all the plugins related to notifications by visiting: +https://docs.coralproject.net/talk/plugins-directory/?q=notifications + +#### Type: User Profile Notifications (Included by Talk core) + +* When user registers, sends email confirmation and verification +* When user requests password reset +* When user changes username, sends confirmation +* When a user is banned or suspended + +_NOTE: Users can not opt-out of User Profile Notifications_ + +#### Type: GDPR Notifications (optional) +`talk-plugin-profile-data:` +* When my comment history is ready for download (only one link can be generated every 7 days, and the link is valid for 24 hours) + +`talk-plugin-local-auth:` +* When user changes their email address +* When a user adds a new email address + +#### Type: Comment Activity Notifications (optional) +Talk support 3 options for notification frequency for this type of notification: +* immediately +* hourly +* daily + +`talk-plugin-notifications:` +* Enables notifications configuration (required for all comment activity notifications below) + +`talk-plugin-notifications-category-reply:` +* When someone replies to my comment + +`talk-plugin-notifications-category-staff-reply:` +* When a staff member replies to my comment + +`talk-plugin-notifications-category-featured:` +* When my comment gets featured ### Notification Digests +Notification digests are enabled by enabling the corresponding plugin, otherwise comment activity notifications are sent immediately. +* `talk-plugin-notifications-digest-daily` +* `talk-plugin-notifications-digest-hourly` + Talk supports hourly and daily digests out the box, if you would like to create your own, refer to the below: https://github.com/coralproject/talk/blob/9cc9969320dca47bb0f8f81e8d944ae4d19e548b/plugins/talk-plugin-notifications/server/connect.js#L69-L102 + +### Customizing Notifications + +Enabling the `talk-plugin-notifications` creates a NotificationManager that creates and manages events send from the event emitter that is linked to the Graph API PubSub system. This allows the instance that received the mutation to also fire off a notification job that can be handled. It also enabels the `notifications` plugin hook. Any plugin that registers after the `talk-plugin-notifications` can export the notifications plugin to reference it. + +See https://github.com/coralproject/talk/blob/8b669a31c551a042f0f079d8cfc16825673eb8f0/plugins/talk-plugin-notifications-reply/index.js for an example. + + ### Connect API This exposes the `graph/connectors.js` via the `connect` hook. @@ -67,3 +104,12 @@ See https://github.com/coralproject/talk/blob/90290cfa2de88e62f687e1ed0235ba6dfe ### Email Templates Email templates are text based and support translations. If you would like to create a new email template, you can register it via the Connect API, see https://github.com/coralproject/talk/blob/8b669a31c551a042f0f079d8cfc16825673eb8f0/plugins/talk-plugin-notifications/server/connect.js#L12-L28### + +Any email template registered with the same name as another template will replace the existing template for that type of email. _NOTE: that also means that the template data sent to each email template will __not__ change, so bear that in mind when designing templates that you may not have rich access to data._ + +An example of this is with the `talk-plugin-notifications-category-featured` plugin: + +Notification translation is located: https://github.com/coralproject/talk/blob/dd0601a80132d2849c53ef7eaf12ff382f3920b9/plugins/talk-plugin-notifications-category-featured/translations.yml#L13 + +Where the template content is provided: https://github.com/coralproject/talk/blob/dd0601a80132d2849c53ef7eaf12ff382f3920b9/plugins/talk-plugin-notifications-category-featured/index.js#L79 + diff --git a/docs/source/plugins/overview.md b/docs/source/plugins/overview.md index 1f734edeb..b4e1f41d5 100644 --- a/docs/source/plugins/overview.md +++ b/docs/source/plugins/overview.md @@ -67,9 +67,9 @@ External plugins can be resolved by running: This achieves two things: 1. It will traverse into local plugin folders and install their dependencies. - _Note that if the plugin is already installed and available in the + __Note that if the plugin is already installed and available in the node_modules folder, it will not be fetched again unless there is a version - mismatch._ This will result in the project `package.json` and `yarn.lock` + mismatch.__ This will result in the project `package.json` and `yarn.lock` files to be modified, this is normal as this ensures that repeated deployments (with the same config) will have the same config, these changes should not be committed to source control. diff --git a/plugins/talk-plugin-facebook-auth/README.md b/plugins/talk-plugin-facebook-auth/README.md index 08780adda..839265b04 100644 --- a/plugins/talk-plugin-facebook-auth/README.md +++ b/plugins/talk-plugin-facebook-auth/README.md @@ -29,6 +29,8 @@ Configuration: guide. This is only required while the `talk-plugin-facebook-auth` plugin is enabled. +_NOTE: FabceBook auth requires your site to use `https` (SSL) not `http`. If your site is not `https` you can not use this plugin!_ + ## GDPR Compliance In order to facilitate compliance with the