Subscribed to the topic AWS_IOT_THING_NAME/publish
153 |
154 |
155 |
156 |
157 |
Published to the topic AWS_IOT_THING_NAME/subscribe
158 |
159 |
160 |
161 |
162 | }
163 |
164 |
165 |
166 | );
167 | }
168 | }
169 |
170 | export default App;
171 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | # Created by https://www.toptal.com/developers/gitignore/api/pycharm,python
3 | # Edit at https://www.toptal.com/developers/gitignore?templates=pycharm,python
4 |
5 | ### PyCharm ###
6 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
7 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
8 |
9 | # User-specific stuff
10 | .idea/**/workspace.xml
11 | .idea/**/tasks.xml
12 | .idea/**/usage.statistics.xml
13 | .idea/**/dictionaries
14 | .idea/**/shelf
15 |
16 | # AWS User-specific
17 | .idea/**/aws.xml
18 |
19 | # Generated files
20 | .idea/**/contentModel.xml
21 |
22 | # Sensitive or high-churn files
23 | .idea/**/dataSources/
24 | .idea/**/dataSources.ids
25 | .idea/**/dataSources.local.xml
26 | .idea/**/sqlDataSources.xml
27 | .idea/**/dynamic.xml
28 | .idea/**/uiDesigner.xml
29 | .idea/**/dbnavigator.xml
30 |
31 | # Gradle
32 | .idea/**/gradle.xml
33 | .idea/**/libraries
34 |
35 | # Gradle and Maven with auto-import
36 | # When using Gradle or Maven with auto-import, you should exclude module files,
37 | # since they will be recreated, and may cause churn. Uncomment if using
38 | # auto-import.
39 | # .idea/artifacts
40 | # .idea/compiler.xml
41 | # .idea/jarRepositories.xml
42 | # .idea/modules.xml
43 | # .idea/*.iml
44 | # .idea/modules
45 | # *.iml
46 | # *.ipr
47 |
48 | # CMake
49 | cmake-build-*/
50 |
51 | # Mongo Explorer plugin
52 | .idea/**/mongoSettings.xml
53 |
54 | # File-based project format
55 | *.iws
56 |
57 | # IntelliJ
58 | out/
59 |
60 | # mpeltonen/sbt-idea plugin
61 | .idea_modules/
62 |
63 | # JIRA plugin
64 | atlassian-ide-plugin.xml
65 |
66 | # Cursive Clojure plugin
67 | .idea/replstate.xml
68 |
69 | # Crashlytics plugin (for Android Studio and IntelliJ)
70 | com_crashlytics_export_strings.xml
71 | crashlytics.properties
72 | crashlytics-build.properties
73 | fabric.properties
74 |
75 | # Editor-based Rest Client
76 | .idea/httpRequests
77 |
78 | # Android studio 3.1+ serialized cache file
79 | .idea/caches/build_file_checksums.ser
80 |
81 | ### PyCharm Patch ###
82 | # Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
83 |
84 | # *.iml
85 | # modules.xml
86 | # .idea/misc.xml
87 | # *.ipr
88 |
89 | # Sonarlint plugin
90 | # https://plugins.jetbrains.com/plugin/7973-sonarlint
91 | .idea/**/sonarlint/
92 |
93 | # SonarQube Plugin
94 | # https://plugins.jetbrains.com/plugin/7238-sonarqube-community-plugin
95 | .idea/**/sonarIssues.xml
96 |
97 | # Markdown Navigator plugin
98 | # https://plugins.jetbrains.com/plugin/7896-markdown-navigator-enhanced
99 | .idea/**/markdown-navigator.xml
100 | .idea/**/markdown-navigator-enh.xml
101 | .idea/**/markdown-navigator/
102 |
103 | # Cache file creation bug
104 | # See https://youtrack.jetbrains.com/issue/JBR-2257
105 | .idea/$CACHE_FILE$
106 |
107 | # CodeStream plugin
108 | # https://plugins.jetbrains.com/plugin/12206-codestream
109 | .idea/codestream.xml
110 |
111 | ### Python ###
112 | # Byte-compiled / optimized / DLL files
113 | __pycache__/
114 | *.py[cod]
115 | *$py.class
116 |
117 | # C extensions
118 | *.so
119 |
120 | # Distribution / packaging
121 | .Python
122 | build/
123 | custom-build/
124 | greengrass-build/
125 | develop-eggs/
126 | dist/
127 | downloads/
128 | eggs/
129 | .eggs/
130 | lib/
131 | lib64/
132 | parts/
133 | sdist/
134 | var/
135 | wheels/
136 | share/python-wheels/
137 | *.egg-info/
138 | .installed.cfg
139 | *.egg
140 | MANIFEST
141 |
142 | # PyInstaller
143 | # Usually these files are written by a python script from a template
144 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
145 | *.manifest
146 | *.spec
147 |
148 | # Installer logs
149 | pip-log.txt
150 | pip-delete-this-directory.txt
151 |
152 | # Unit test / coverage reports
153 | htmlcov/
154 | .tox/
155 | .nox/
156 | .coverage
157 | .coverage.*
158 | .cache
159 | nosetests.xml
160 | coverage.xml
161 | *.cover
162 | *.py,cover
163 | .hypothesis/
164 | .pytest_cache/
165 | cover/
166 |
167 | # Translations
168 | *.mo
169 | *.pot
170 |
171 | # Django stuff:
172 | *.log
173 | local_settings.py
174 | db.sqlite3
175 | db.sqlite3-journal
176 |
177 | # Flask stuff:
178 | instance/
179 | .webassets-cache
180 |
181 | # Scrapy stuff:
182 | .scrapy
183 |
184 | # Sphinx documentation
185 | docs/_build/
186 |
187 | # PyBuilder
188 | .pybuilder/
189 | target/
190 |
191 | # Jupyter Notebook
192 | .ipynb_checkpoints
193 |
194 | # IPython
195 | profile_default/
196 | ipython_config.py
197 |
198 | # pyenv
199 | # For a library or package, you might want to ignore these files since the code is
200 | # intended to run in multiple environments; otherwise, check them in:
201 | # .python-version
202 |
203 | # pipenv
204 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
205 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
206 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
207 | # install all needed dependencies.
208 | #Pipfile.lock
209 |
210 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
211 | __pypackages__/
212 |
213 | # Celery stuff
214 | celerybeat-schedule
215 | celerybeat.pid
216 |
217 | # SageMath parsed files
218 | *.sage.py
219 |
220 | # Environments
221 | .env
222 | .venv
223 | env/
224 | venv/
225 | ENV/
226 | env.bak/
227 | venv.bak/
228 |
229 | # Spyder project settings
230 | .spyderproject
231 | .spyproject
232 |
233 | # Rope project settings
234 | .ropeproject
235 |
236 | # mkdocs documentation
237 | /site
238 |
239 | # mypy
240 | .mypy_cache/
241 | .dmypy.json
242 | dmypy.json
243 |
244 | # Pyre type checker
245 | .pyre/
246 |
247 | # pytype static type analyzer
248 | .pytype/
249 |
250 | # Cython debug symbols
251 | cython_debug/
252 |
253 | # End of https://www.toptal.com/developers/gitignore/api/pycharm,python
254 |
255 | .idea/*
256 |
257 | ./custom-build
258 | ./greengrass-build
259 | .coverage
260 |
261 | *.crt
262 | *.key
263 | *.srl
264 | *.csr
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # aws.greengrass.labs.LocalWebServer
2 |
3 | This repository contains code artifacts deploying an interactive local web server hosted on a Linux-based Greengrass v2 device.
4 |
5 | This component demonstrates how to implement a local web server on Greengrass v2. Some industrial IoT solutions require customers to have a HMI (human machine interface) to visualize/interact with the state of the device(s). This implementation includes a Flask (Python) backend, and a React (JavaScript) frontend. The aws.greengrass.labs.LocalWebServer component shows how Flask + SocketIO can be integrated with the (Python) AWS IoT Device SDK for interprocess communication (IPC) on Greengrass v2. With a Flask + SocketIO application integrated with Greengrass IPC, a process using the SocketIO client can access the MQTT broker (via proxy) over SocketIO. A basic [create-react-app](https://github.com/facebook/create-react-app) application using the JavaScript SocketIO client can publish/subscribe messages to the Flask + SocketIO server, which acts as a bridge to the local MQTT broker on Greengrass.
6 |
7 | ## Architecture
8 |
9 | ### Component
10 |
11 | There are three artifacts included in this component: a docker-compose.yaml file, and two Docker images for each the React application and the Flask+SocketIO application. When docker-compose up is executed (as defined in the Greengrass component recipe), both containers are initialized and a local network is created - the Flask+SocketIO application is exposed over port 5000, while the React application is exposed over port 3000. In addition, a NGINX server is included in the React app Docker image, for serving the React application, and providing a reverse proxy for all API calls to the Flask+SocketIO container.
12 |
13 | 
14 |
15 | ## Requirements
16 | ### AWS IoT Greengrass v2
17 |
18 | If you haven't already installed the Greengrass v2 runtime on your device, you can follow the tutorial [here](https://docs.aws.amazon.com/greengrass/v2/developerguide/getting-started.html).
19 |
20 | ### Docker
21 |
22 | On the Greengrass v2 core device, the following must be installed:
23 |
24 | * [Docker](https://docs.docker.com/get-docker/)
25 | * [docker-compose](https://docs.docker.com/compose/install/)
26 |
27 |
28 | ### Create secret in AWS Secrets Manager
29 |
30 | First, we need to provide a username and password for authenticating into local web server on the device. Make sure to take note of the ARN for deployment!
31 |
32 | > NOTE: you will need the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) installed to run the following commands. You can optionally create this secret in the AWS Management Console instead
33 |
34 | > NOTE: make sure you close this terminal session after the tutorial to protect your password.
35 |
36 | > NOTE: in macOS, run `bash` before running the following commands.
37 |
38 | ```console
39 | read -s -p "Enter user:" LOCALWEBSERVER_USER
40 | read -s -p "Enter password:" LOCALWEBSERVER_PASSWORD
41 | aws secretsmanager create-secret --name localwebserver_credentials
42 | aws secretsmanager put-secret-value --secret-id localwebserver_credentials --secret-string "{\"username\":\"$LOCALWEBSERVER_USER\",\"password\":\"$LOCALWEBSERVER_PASSWORD\"}"
43 | ```
44 |
45 | ## Dependencies
46 |
47 | When you deploy a component, AWS IoT Greengrass also deploys compatible versions of its dependencies. This means that you must meet the requirements for the component and all of its dependencies to successfully deploy the component. This section lists the dependencies for the released versions of this component and the semantic version constraints that define the component versions for each dependency. You can also view the dependencies for each version of the component in the [AWS IoT Greengrass console](https://console.aws.amazon.com/greengrass). On the component details page, look for the Dependencies list.
48 |
49 | ### 1.0.0
50 |
51 | | Dependency | Compatible versions | Dependency type |
52 | |---|---|---|
53 | | aws.greengrass.Nucleus | >=2.4.0 | Soft |
54 | | aws.greengrass.SecretManager | >=2.0.9 | Soft |
55 |
56 | ## Build and publish Greengrass component
57 |
58 | ### Update the GDK configuration file
59 |
60 | Update the **bucket** and **region** values in **gdk-config.json** to values of your choosing.
61 |
62 | ### Add a SSL certificate/key
63 |
64 | The front-end Docker image in this Greengrass component uses SSL, and expects both a certificate and key at build-time.
65 |
66 | If you already have a valid SSL certificate and key for your web server, rename to **ssl.crt** and **ssl.key**, and copy both to **src/frontend**.
67 |
68 | If you need a temporary SSL certificate and key for development purposes only, follow the instructions below.
69 |
70 | First, we need to create a certificate authority that we will use to sign SSL certificates for localhost development/debugging. For a production environment, you should acquire/purchase a certificate verified by a trusted certificate authority.
71 |
72 | > NOTE: the following -subj arguments can be modified, and are example values only
73 |
74 | ```console
75 | openssl genrsa -out localhostRootCA.key 2048
76 | openssl req -x509 -new -nodes -key localhostRootCA.key -sha256 -days 3650 -out localhostRootCA.crt -subj "/C=US/ST=Washington/L=Seattle/O=Localhost Signing Authority/CN=Localhost Signing Authority"
77 | ```
78 |
79 | Next, we will create a SSL certificate and key using the previously created certificate authority and the parameters configured in **req.conf**.
80 |
81 | > NOTE: the values in req.conf can be modified, and are example values only
82 |
83 | ```console
84 | openssl req -new -sha256 -nodes -newkey rsa:2048 -keyout ssl.key -out ssl.csr -config req.conf
85 | openssl x509 -req -in ssl.csr -CA localhostRootCA.crt -CAkey localhostRootCA.key -CAcreateserial -out ssl.crt -sha256 -days 3650 -extfile req.conf -extensions v3_ca
86 | ```
87 |
88 | Lastly, copy both **ssl.crt** and **ssl.key** to **src/frontend**.
89 |
90 | If you needed to create a development certificate authority, you need trust this certificate authority (the localhostRootCA.crt file) in your device browser (i.e. in Chrome, go to **Settings > Privacy and security > Security > Manage Certificates** to import a new certificate authority. You will only need to import this certificate authority once per device.
91 |
92 | ### Run GDK commands
93 |
94 | ```console
95 | gdk component build
96 | ```
97 |
98 | ```console
99 | gdk component publish
100 | ```
101 |
102 | ## Configure and update Greengrass deployment
103 |
104 | ### Update IAM role for Greengrass role alias
105 |
106 | You will need to grant permissions for the IAM role to read from the S3 bucket with your component(s), and also read the secret created in AWS Secrets Manager.
107 |
108 | ### Navigate to AWS IoT Greengrass & Deployments
109 |
110 | In the AWS Management Console, navigate to AWS IoT Greengrass, and click **Deployments**
111 |
112 | Notice the different deployments that are listed - one for the specific Core device, and another for the Thing group that the Core device is associated to. Click **Deployment for YOUR_GROUP_NAME**.
113 |
114 | ### Revise an existing Deployment
115 |
116 | Notice the IoT Job featured at the top - this is responsible for continuously deploying this deployment configuration out to associated targets. Click Revise to update the deployment.
117 |
118 | If prompted, click **Revise Deployment**.
119 |
120 | In **Step 1 - Specify Target**, click **Next**.
121 |
122 | ### Add component
123 |
124 | Unselect **Show only selected components** under **My Components** and **Public Components**. Then make sure the following components are checked:
125 |
126 | * aws.greengrass.labs.LocalWebServer
127 | * aws.greengrass.SecretManager
128 |
129 | Then, click Next.
130 |
131 | ### Finish deployment
132 |
133 | In **Step 3 - Configure components**, select **aws.greengrass.SecretManager**, and click **Configure component**.
134 |
135 | In **Configuration to merge**, paste the following JSON with your secret ARN for the local web server (from previous instruction). Then click **Confirm**.
136 |
137 | ```json
138 | { "cloudSecrets": [{ "arn": "arn:aws:secretsmanager:REGION:ACCOUNT:secret:localwebserver_credentials-SUFFIX" }] }
139 | ```
140 |
141 | In **Step 4 - Configure advanced settings**, click **Next**.
142 |
143 | In **Step 5 - Review**, click **Deploy**.
144 |
145 | ## Using the component
146 |
147 | ### Navigate to AWS IoT MQTT test client
148 |
149 | * In the AWS Management Console, navigate to AWS IoT, and click **Test >> MQTT Test client**
150 | * Enter **#** in **Subscription topic** and click **Subscribe to topic**
151 | * You should see different state/actions information being published in console below when interacting with React application.
152 |
153 | ### Edge device interaction
154 |
155 | On the device, open the url **https://localhost:3000** in a browser (i.e. Chromium). You will be prompted to login with the credentials you stored in AWS Secrets Manager:
156 |
157 | 
158 |
159 | After logging in, you can see incoming messages that were published on the topic **/subscribe**, and you can also publish messages to **/publish**
160 |
161 | > NOTE: Login sessions are configured to last for 15 minutes by default. You will automatically be logged out after this duration has passed.
162 |
163 | 
164 |
165 | ## Testing
166 |
167 | ## PyTest + Coverage
168 |
169 | Make sure you have the following packages installed:
170 |
171 | ```console
172 | pip install pytest pytest-mock pytest-cov flask-socketio flask-login awsiotsdk
173 | ```
174 |
175 | Then run the following to get coverage tests on the backend application that will run on the device:
176 |
177 | ```console
178 | pytest --cov=src/ --cov-report=html
179 | ```
180 |
181 | ## Changelog
182 |
183 | The following table describes the changes in each version of the component.
184 |
185 | | Version | Changes |
186 | |---|---|
187 | | 1.0.0 | Initial version |
188 |
189 | ## Security
190 |
191 | See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
192 |
193 | ## License
194 |
195 | This project is licensed under the Apache-2.0 License.
196 |
197 |
198 |
199 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
--------------------------------------------------------------------------------