|
1 | 1 | [](https://codecov.io/gh/opensearch-project/notifications)
|
| 2 | +[](https://discuss.opendistrocommunity.dev) |
| 3 | + |
2 | 4 |
|
| 5 | +<img src="https://opensearch.org/assets/brand/SVG/Logo/opensearch_logo_default.svg" height="64px"/> |
3 | 6 |
|
4 |
| -# Notifications plugin for OpenSearch |
| 7 | +- [OpenSearch Notifications](#opensearch-notifications) |
| 8 | +- [Highlights](#highlights) |
| 9 | +- [Documentation](#documentation) |
| 10 | +- [Contributing](#contributing) |
| 11 | +- [Code of Conduct](#code-of-conduct) |
| 12 | +- [Security](#security) |
| 13 | +- [License](#license) |
| 14 | +- [Copyright](#copyright) |
5 | 15 |
|
6 |
| -## Overview |
7 |
| -Notifications plugin for OpenSearch enables other plugins to send notifications via Email, Slack, Amazon Chime, Custom web-hook etc channels |
8 |
| - |
9 |
| -## Highlights |
10 |
| - |
11 |
| -1. Supports sending email with attachment (PDF, PNG, CSV, etc). |
12 |
| -1. Supports sending multipart email with Text and HTML body with full Embedded HTML support. |
13 |
| -1. Supports cross-plugin calls to send notifications (without re-implementing). |
14 |
| -1. Supports tracking the number of email sent from this plugin and throttling based on it. |
| 16 | +# OpenSearch Notifications |
15 | 17 |
|
16 | 18 | ## Documentation
|
17 | 19 |
|
18 |
| -Please see our [documentation](https://opendistro.github.io/for-elasticsearch-docs/). |
19 |
| - |
20 |
| -## Setup |
21 |
| - |
22 |
| -1. Check out this package from version control. |
23 |
| -1. Launch Intellij IDEA, choose **Import Project**, and select the `settings.gradle` file in the root of this package. |
24 |
| -1. To build from the command line, set `JAVA_HOME` to point to a JDK >= 14 before running `./gradlew`. |
25 |
| - |
26 |
| -### Setup email notification using localhost email relay/server |
27 |
| - |
28 |
| -1. Run local email server on the machine where OpenSearch is running. e.g. for Mac, run command `sudo postfix start` |
29 |
| -1. Verify that local email server does not require any authentication (Make sure server is listening on local port only) |
30 |
| -1. Update the `notification.yml` configuration file according to your setup |
31 |
| - |
32 |
| -### Setup Amazon SES and SDK |
33 |
| - |
34 |
| -While using Amazon SES as email channel for sending mail, use below procedure for SES setup and configure environment. |
35 |
| - |
36 |
| -1. [Setup Amazon SES account](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sign-up-for-aws.html) |
37 |
| -1. [Verify Email address](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify-email-addresses-procedure.html) |
38 |
| -1. [Create IAM role](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html#iam-term-service-role-ec2) with [Allowing Access to Email-Sending Actions Only](https://docs.aws.amazon.com/ses/latest/DeveloperGuide/control-user-access.html) `Action` required are `SendEmail` and `SendRawEmail`. |
39 |
| -1. While using command line [configure AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) [Refer Best practices](https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html) |
40 |
| -1. [Use Amazon EC2 IAM role to grant permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html) while using EC2 |
41 |
| - |
42 |
| -## Build |
43 |
| - |
44 |
| -This project uses following tools |
45 |
| - |
46 |
| -1. [Gradle](https://docs.gradle.org/current/userguide/userguide.html) build system. Gradle comes with an excellent documentation that should be your first stop when trying to figure out how to operate or modify the build. |
47 |
| -1. OpenSearch build tools for Gradle. These tools are idiosyncratic and don't always follow the conventions and instructions for building regular Java code using Gradle. If you encounter such a situation, the OpenSearch build tools is your best bet for figuring out what's going on. |
48 |
| - |
49 |
| -### Building from the command line |
50 |
| - |
51 |
| -1. `./gradlew build` builds and tests project. |
52 |
| -1. `./gradlew run` launches a single node cluster with the `notifications` plugin installed. |
53 |
| -1. `./gradlew run -PnumNodes=3` launches a multi-node cluster (3 nodes) with the `notifications` plugin installed. |
54 |
| -1. `./gradlew integTest` launches a single node cluster with the `notifications` plugin installed and runs all integ tests. |
55 |
| -1. `./gradlew integTest -PnumNodes=3` launches a multi-node cluster with the `notifications` plugin installed and runs all integ tests. |
56 |
| -1. `./gradlew integTest -Dtests.class="*RunnerIT"` runs a single integ test class |
57 |
| -1. `./gradlew integTest -Dtests.method="test execute * with dryrun"` runs a single integ test method |
58 |
| - (remember to quote the test method name if it contains spaces). |
59 |
| - |
60 |
| -When launching a cluster using above commands, logs are placed in `notifications/build/testclusters/integTest-0/logs/`. |
61 |
| - |
62 |
| -#### Run integration tests with Security enabled |
| 20 | +#### TODO: Create Documentation |
| 21 | +Please see our [documentation](https://opensearch.org/docs/latest/). |
63 | 22 |
|
64 |
| -1. Setup a local ODFE cluster with security plugin. |
65 |
| -- `./gradlew build` |
66 |
| -- `./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=opensearch-integrationtest -Dhttps=true -Duser=admin -Dpassword=admin` |
67 |
| -- `./gradlew integTestRunner -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=opensearch-integrationtest -Dhttps=true -Duser=admin -Dpassword=admin --tests "<test name>"` |
| 23 | +## Contributing |
68 | 24 |
|
69 |
| -### Debugging |
70 | 25 |
|
71 |
| -Sometimes it's useful to attach a debugger to either the OpenSearch cluster, or the integ tests to see what's going on. When running unit tests, hit **Debug** from the IDE's gutter to debug the tests. |
72 |
| -You must start your debugger to listen for remote JVM before running the below commands. |
73 |
| - |
74 |
| -To debug code running in an actual server, run: |
75 |
| - |
76 |
| -``` |
77 |
| -./gradlew integTest -Dopensearch.debug # to start a cluster and run integ tests |
78 |
| -``` |
79 |
| - |
80 |
| -OR |
81 |
| - |
82 |
| -``` |
83 |
| -./gradlew run --debug-jvm # to just start a cluster that can be debugged |
84 |
| -``` |
85 |
| - |
86 |
| -The OpenSearch server JVM will launch suspended and wait for a debugger to attach to `localhost:5005` before starting the OpenSearch server. |
87 |
| -The IDE needs to listen for the remote JVM. If using Intellij you must set your debug-configuration to "Listen to remote JVM" and make sure "Auto Restart" is checked. |
88 |
| -You must start your debugger to listen for remote JVM before running the commands. |
89 |
| - |
90 |
| -To debug code running in an integ test (which exercises the server from a separate JVM), run: |
91 |
| - |
92 |
| -``` |
93 |
| -./gradlew -Dtest.debug integTest |
94 |
| -``` |
95 |
| - |
96 |
| -The test runner JVM will start suspended and wait for a debugger to attach to `localhost:5005` before running the tests. |
97 |
| - |
98 |
| - |
99 |
| -### Advanced: Launching multi-node clusters locally |
100 |
| - |
101 |
| -Sometimes you need to launch a cluster with more than one OpenSearch server process. |
102 |
| - |
103 |
| -You can do this by running `./gradlew run -PnumNodes=<numberOfNodesYouWant>` |
104 |
| - |
105 |
| -You can also run the integration tests against a multi-node cluster by running `./gradlew integTest -PnumNodes=<numberOfNodesYouWant>` |
106 |
| - |
107 |
| -You can also debug a multi-node cluster, by using a combination of above multi-node and debug steps. |
108 |
| -You must set up debugger configurations to listen on each port starting from `5005` and increasing by 1 for each node. |
| 26 | +See [developer guide](DEVELOPER_GUIDE.md) and [how to contribute to this project](CONTRIBUTING.md). |
109 | 27 |
|
110 | 28 | ## Code of Conduct
|
111 | 29 |
|
112 |
| -See [CODE_OF_CONDUCT](CODE_OF_CONDUCT.md) for more information. |
| 30 | +This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. |
113 | 31 |
|
114 | 32 | ## Security
|
115 | 33 |
|
116 |
| -See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information. |
| 34 | +If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public GitHub issue. |
117 | 35 |
|
118 | 36 | ## License
|
119 | 37 |
|
120 |
| -This project is licensed under the Apache-2.0 License. See [LICENSE](LICENSE) for more information. |
| 38 | +This project is licensed under the [Apache v2.0 License](LICENSE.txt). |
121 | 39 |
|
122 |
| -## Notice |
| 40 | +## Copyright |
123 | 41 |
|
124 |
| -See [NOTICE](NOTICE) for more information. |
| 42 | +Copyright 2020-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
125 | 43 |
|
126 |
| -## Copyright |
127 | 44 |
|
128 |
| -Copyright OpenSearch Contributors. See [NOTICE](NOTICE) for details. |
0 commit comments