├── FROM ├── VERSION ├── VERSION-PI ├── FROM-PI ├── .gitignore ├── .gitmodules ├── run.sh ├── homebridge.sh ├── homebridge-pi.sh ├── Dockerfile.specific-PI ├── Dockerfile.specific ├── homebridge-common.sh ├── README.md ├── Dockerfile.common ├── config-sample.json └── LICENSE /FROM: -------------------------------------------------------------------------------- 1 | FROM debian:jessie -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 0.1-SNAPSHOT -------------------------------------------------------------------------------- /VERSION-PI: -------------------------------------------------------------------------------- 1 | 0.1-SNAPSHOT -------------------------------------------------------------------------------- /FROM-PI: -------------------------------------------------------------------------------- 1 | FROM resin/rpi-raspbian:jessie -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /config.json 2 | /config.json.bak 3 | /Dockerfile 4 | /Dockerfile.bak 5 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "homebridge-src"] 2 | path = homebridge-src 3 | url = https://patrickbusch@github.com/nfarina/homebridge.git 4 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sed -i "s/rlimit-nproc=3/#rlimit-nproc=3/" /etc/avahi/avahi-daemon.conf 4 | 5 | dbus-daemon --system 6 | avahi-daemon -D 7 | 8 | homebridge 9 | -------------------------------------------------------------------------------- /homebridge.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASEDIR=$(dirname $0) 4 | cd $BASEDIR 5 | 6 | VERSION=$(> /etc/apt/sources.list 7 | RUN wget --no-check-certificate -O - -q https://apt.adafruit.com/apt.adafruit.com.gpg.key | apt-key add - 8 | RUN apt-get update 9 | RUN apt-get install -y node 10 | -------------------------------------------------------------------------------- /Dockerfile.specific: -------------------------------------------------------------------------------- 1 | ################################################## 2 | # Install node # 3 | ################################################## 4 | 5 | RUN curl -sLf -o /dev/null 'https://deb.nodesource.com/node_0.12/dists/vivid/Release' 6 | RUN curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - 7 | RUN echo 'deb https://deb.nodesource.com/node_0.12 vivid main' > /etc/apt/sources.list.d/nodesource.list 8 | RUN echo 'deb-src https://deb.nodesource.com/node_0.12 vivid main' >> /etc/apt/sources.list.d/nodesource.list 9 | 10 | RUN apt-get update 11 | RUN apt-get install -y nodejs 12 | #RUN ln -s /usr/bin/nodejs /usr/bin/node -------------------------------------------------------------------------------- /homebridge-common.sh: -------------------------------------------------------------------------------- 1 | ACTION=$1 2 | 3 | if [ -z "$ACTION" ]; 4 | then 5 | echo "usage: $0 "; 6 | exit 1; 7 | fi 8 | 9 | _build() { 10 | # Generate Dockerfile 11 | echo $FROM > Dockerfile 12 | cat Dockerfile.common >> Dockerfile 13 | eval $SED_COMMAND 14 | 15 | # Build 16 | docker build --tag="patrickbusch/homebridge:$VERSION" . 17 | } 18 | 19 | _run() { 20 | # Run (first time) 21 | docker run -d -p 0.0.0.0:51826:51826 -v /etc/homebridge:/root/.homebridge --net=host --name $IMAGE_NAME patrickbusch/homebridge:$VERSION 22 | } 23 | 24 | _stop() { 25 | # Stop 26 | docker stop $IMAGE_NAME 27 | } 28 | 29 | _start() { 30 | # Start (after stopping) 31 | docker start $IMAGE_NAME 32 | } 33 | 34 | _remove() { 35 | # Remove 36 | docker rm $IMAGE_NAME 37 | } 38 | 39 | _rerun() { 40 | _stop 41 | _remove 42 | _run 43 | } 44 | 45 | _attach() { 46 | docker exec -ti $IMAGE_NAME bash 47 | } 48 | 49 | _logs() { 50 | docker logs $IMAGE_NAME 51 | } 52 | 53 | eval _$ACTION 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Homebridge-Docker 2 | 3 | Docker image for Homebrigde by nfarina 4 | 5 | For details see https://github.com/nfarina/homebridge 6 | 7 | This is simply wrapping the source in a runnable Docker image for everyone that cannot install the dev environment on his machine or everyone that wants a simple containerized solution. 8 | 9 | ## Configuration 10 | 11 | Copy `config-sample.json` to `config.json` and adapt to your likings. 12 | 13 | ## Raspberry PI 14 | 15 | When building and running on a Raspberry PI, use `homebridge-pi.sh` instead of `homebridge.sh` 16 | 17 | ## Build 18 | 19 | `./homebridge.sh build` 20 | 21 | ## Run 22 | 23 | ### run first time 24 | 25 | `./homebridge.sh run` 26 | 27 | ### stop 28 | 29 | `./homebridge.sh stop` 30 | 31 | ### start 32 | 33 | (after stopping) 34 | 35 | `./homebridge.sh start` 36 | 37 | ### remove 38 | 39 | (needed before run is possible again) 40 | 41 | `./homebridge.sh remove` 42 | 43 | ### rerun 44 | 45 | Stops and removes the containers, then performs run again 46 | 47 | `./homebridge.sh rerun` 48 | 49 | ### attach 50 | 51 | Attaches to the running container 52 | 53 | `./homebridge.sh attach` 54 | 55 | ### logs 56 | 57 | Diplays stdout log of the running container 58 | 59 | `./homebridge.sh logs` -------------------------------------------------------------------------------- /Dockerfile.common: -------------------------------------------------------------------------------- 1 | #FROM debian:jessie 2 | #FROM resin/rpi-raspbian:jessie 3 | MAINTAINER Patrick Busch 4 | 5 | RUN apt-get update 6 | 7 | ################################################## 8 | # Set environment variables # 9 | ################################################## 10 | 11 | # Ensure UTF-8 12 | ENV LANG en_US.UTF-8 13 | ENV LC_ALL en_US.UTF-8 14 | 15 | ENV DEBIAN_FRONTEND noninteractive 16 | ENV TERM xterm 17 | 18 | 19 | ################################################## 20 | # Add app user # 21 | ################################################## 22 | 23 | #RUN useradd --create-home --home-dir /home/app --shell /bin/bash app 24 | 25 | 26 | ################################################## 27 | # Install tools # 28 | ################################################## 29 | 30 | RUN apt-get install -y curl wget git apt-transport-https python build-essential make g++ libavahi-compat-libdnssd-dev libkrb5-dev vim net-tools 31 | RUN alias ll='ls -alG' 32 | 33 | #####SPECIFIC##### 34 | 35 | 36 | ################################################## 37 | # Install homebridge # 38 | ################################################## 39 | 40 | #ADD homebridge-src /home/app/homebridge 41 | #ADD config.json /home/app/homebridge/config.json 42 | #RUN chown -R app:app /home/app/homebridge 43 | 44 | #WORKDIR /home/app/homebridge 45 | #USER app 46 | #RUN npm install 47 | 48 | RUN npm install -g homebridge 49 | RUN npm install -g homebridge-openhab 50 | 51 | ################################################## 52 | # Start # 53 | ################################################## 54 | 55 | USER root 56 | #WORKDIR /home/app/homebridge 57 | 58 | RUN mkdir -p /var/run/dbus 59 | #VOLUME /var/run/dbus 60 | 61 | EXPOSE 5353 51826 62 | 63 | #CMD ["npm", "run", "start"] 64 | ADD run.sh /root/run.sh 65 | 66 | RUN mkdir /root/.homebridge 67 | ADD config.json /root/.homebridge/config.json 68 | 69 | CMD ["/root/run.sh"] 70 | 71 | -------------------------------------------------------------------------------- /config-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "bridge": { 3 | "name": "Homebridge", 4 | "username": "CC:22:3D:E3:CE:30", 5 | "port": 51826, 6 | "pin": "031-45-154" 7 | }, 8 | 9 | "description": "This is an example configuration file with all supported devices. You can use this as a template for creating your own configuration file containing devices you actually own.", 10 | 11 | "platforms": [ 12 | { 13 | "platform" : "Nest", 14 | "name" : "Nest", 15 | "username" : "username", 16 | "password" : "password" 17 | }, 18 | { 19 | "platform" : "TelldusLive", 20 | "name" : "Telldus Live!", 21 | "public_key" : "telldus public key", 22 | "private_key" : "telldus private key", 23 | "token" : "telldus token", 24 | "token_secret" : "telldus token secret" 25 | }, 26 | { 27 | "platform" : "Telldus", 28 | "name" : "Telldus" 29 | }, 30 | { 31 | "platform": "Wink", 32 | "name": "Wink", 33 | "client_id": "YOUR_WINK_API_CLIENT_ID", 34 | "client_secret": "YOUR_WINK_API_CLIENT_SECRET", 35 | "username": "your@email.com", 36 | "password": "WINK_PASSWORD" 37 | }, 38 | { 39 | "platform": "SmartThings", 40 | "name": "SmartThings", 41 | "app_id": "JSON SmartApp Id", 42 | "access_token": "JSON SmartApp AccessToken" 43 | }, 44 | { 45 | "platform": "Domoticz", 46 | "name": "Domoticz", 47 | "server": "127.0.0.1", 48 | "port": "8080", 49 | "roomid": 0, 50 | "loadscenes": 1 51 | }, 52 | { 53 | "platform": "PhilipsHue", 54 | "name": "Phillips Hue", 55 | "username": "" 56 | }, 57 | { 58 | "platform": "ISY", 59 | "name": "ISY", 60 | "host": "192.168.1.20", 61 | "port": "8000", 62 | "username": "username", 63 | "password": "password" 64 | }, 65 | { 66 | "platform": "LogitechHarmony", 67 | "name": "Living Room Harmony Hub" 68 | }, 69 | { 70 | "platform": "Sonos", 71 | "name": "Sonos", 72 | "play_volume": 25 73 | }, 74 | { 75 | "platform": "YamahaAVR", 76 | "play_volume": -35, 77 | "setMainInputTo": "AirPlay" 78 | }, 79 | { 80 | "platform": "ZWayServer", 81 | "url": "http://192.168.1.10:8083/", 82 | "login": "zwayusername", 83 | "password": "zwayuserpassword", 84 | "poll_interval": 2, 85 | "split_services": false 86 | }, 87 | { 88 | "platform": "MiLight", 89 | "name": "MiLight", 90 | "ip_address": "255.255.255.255", 91 | "port": 8899, 92 | "type": "rgbw", 93 | "delay": 30, 94 | "repeat": 3, 95 | "zones":["Kitchen Lamp","Bedroom Lamp","Living Room Lamp","Hallway Lamp"] 96 | }, 97 | { 98 | "platform": "HomeAssistant", 99 | "name": "HomeAssistant", 100 | "host": "http://192.168.1.10:8123", 101 | "password": "XXXXX", 102 | "supported_types": ["light", "switch", "media_player", "scene"] 103 | }, 104 | { 105 | "platform": "LIFx", 106 | "name": "LIFx", 107 | "access_token": "XXXXXXXX generate at https://cloud.lifx.com/settings" 108 | } 109 | ], 110 | 111 | "accessories": [ 112 | { 113 | "accessory": "WeMo", 114 | "name": "Coffee Maker", 115 | "description": "This shim supports Belkin WeMo devices on the same network as this server. You can create duplicate entries for this device and change the 'name' attribute to reflect what device is plugged into the WeMo, for instance 'Air Conditioner' or 'Coffee Maker'. This name will be used by Siri. Make sure to update the 'wemo_name' attribute with the EXACT name of the device in the WeMo app itself. This can be the same value as 'name' but it doesn't have to be.", 116 | "wemo_name": "CoffeeMaker" 117 | }, 118 | { 119 | "accessory": "LiftMaster", 120 | "name": "Garage Door", 121 | "description": "This shim supports LiftMaster garage door openers that are already internet-connected to the 'MyQ' service.", 122 | // "requiredDeviceId", "", 123 | "username": "your-liftmaster-username", 124 | "password" : "your-liftmaster-password" 125 | }, 126 | { 127 | "accessory": "Lockitron", 128 | "name": "Front Door", 129 | "description": "This shim supports Lockitron locks. It uses the Lockitron cloud API, so the Lockitron must be 'awake' for locking and unlocking to actually happen. You can wake up Lockitron after issuing an lock/unlock command by knocking on the door.", 130 | "lock_id": "your-lock-id", 131 | "api_token" : "your-lockitron-api-access-token" 132 | }, 133 | { 134 | "accessory": "Carwings", 135 | "name": "Leaf", 136 | "description": "This shim supports controlling climate control on Nissan cars with Carwings. Note that Carwings is super slow and it may take up to 5 minutes for your command to be processed by the Carwings system.", 137 | "username": "your-carwings-username", 138 | "password" : "your-carwings-password" 139 | }, 140 | { 141 | "accessory": "iControl", 142 | "name": "Xfinity Home", 143 | "description": "This shim supports iControl-based security systems like Xfinity Home.", 144 | "system": "XFINITY_HOME", 145 | "email": "your-comcast-email", 146 | "password": "your-comcast-password", 147 | "pin": "your-security-system-pin-code" 148 | }, 149 | { 150 | "accessory": "HomeMatic", 151 | "name": "Light", 152 | "description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)", 153 | "ccu_id": "The XMP-API id of your HomeMatic device", 154 | "ccu_ip": "The IP-Adress of your HomeMatic CCU device" 155 | }, 156 | { 157 | "accessory": "HomeMaticWindow", 158 | "name": "Contact", 159 | "description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)", 160 | "ccu_id": "The XMP-API id of your HomeMatic device (type HM-Sec-RHS)", 161 | "ccu_ip": "The IP-Adress of your HomeMatic CCU device" 162 | }, 163 | { 164 | "accessory": "HomeMaticThermo", 165 | "name": "Contact", 166 | "description": "Control HomeMatic devices (The XMP-API addon for the CCU is required)", 167 | "ccu_id_TargetTemp": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )", 168 | "ccu_id_CurrentTemp": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )", 169 | "ccu_id_ControlMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )", 170 | "ccu_id_ManuMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )", 171 | "ccu_id_AutoMode": "The XMP-API id of your HomeMatic device (type HM-CC-RT-DN )", 172 | "ccu_ip": "The IP-Adress of your HomeMatic CCU device" 173 | }, 174 | { 175 | "accessory": "X10", 176 | "name": "Lamp", 177 | "ip_address": "localhost:3000", 178 | "device_id": "E1", 179 | "protocol": "pl", 180 | "can_dim": true 181 | }, 182 | { 183 | "accessory": "Http", 184 | "name": "Kitchen Lamp", 185 | "on_url": "https://192.168.1.22:3030/devices/23222/on", 186 | "off_url": "https://192.168.1.22:3030/devices/23222/off", 187 | "brightness_url": "https://192.168.1.22:3030/devices/23222/brightness/%b", 188 | "http_method": "POST" 189 | }, 190 | { 191 | "accessory": "HttpHygrometer", 192 | "name": "Kitchen", 193 | "url": "http://host/URL", 194 | "http_method": "GET" 195 | }, 196 | { 197 | "accessory": "HttpThermometer", 198 | "name": "Garage", 199 | "url": "http://home/URL", 200 | "http_method": "GET" 201 | }, 202 | { 203 | "accessory": "ELKM1", 204 | "name": "Security System", 205 | "description": "Allows basic control of Elk M1 security system. You can use 1 of 3 arm modes: Away, Stay, Night. If you need to access all 3, create 3 accessories with different names.", 206 | "zone": "1", 207 | "host": "192.168.1.10", 208 | "port": "2101", 209 | "pin": "1234", 210 | "arm": "Away" 211 | }, 212 | { 213 | "accessory": "AD2USB", 214 | "name": "Alarm", 215 | "description": "Arm, disarm, and status monitoring of the default partition for Honeywell/Ademco alarm systems. Requires network configured AD2USB interface", 216 | "host": "192.168.1.200", // IP address of the SER2SOCK service 217 | "port" : 4999, // Port the SER2SOCK process is running on 218 | "pin": "1234" // PIN used for arming / disarming 219 | }, 220 | { 221 | "accessory": "Tesla", 222 | "name": "Tesla", 223 | "description": "This shim supports controlling climate control on the Tesla Model S.", 224 | "username": "tesla_email", 225 | "password" : "tesla_password" 226 | }, 227 | { 228 | "accessory": "Hyperion", 229 | "name": "TV Backlight", 230 | "description": "Control the Hyperion TV backlight server. https://github.com/tvdzwan/hyperion", 231 | "host": "localhost", 232 | "port": "19444" 233 | }, 234 | { 235 | "accessory": "mpdclient", 236 | "name" : "mpd", 237 | "host" : "localhost", 238 | "port" : 6600, 239 | "description": "Allows some control of an MPD server" 240 | }, 241 | { 242 | "accessory": "FileSensor", 243 | "name": "File Time Motion Sensor", 244 | "path": "/tmp/CameraDump/", 245 | "window_seconds": 5, 246 | "sensor_type": "m", 247 | "inverse": false 248 | }, 249 | { 250 | "accessory": "GenericRS232Device", 251 | "name": "Projector", 252 | "description": "Make sure you set a 'Siri-Name' for your iOS-Device (example: 'Home Cinema') otherwise it might not work.", 253 | "id": "TYDYMU044UVNP", 254 | "baudrate": 9600, 255 | "device": "/dev/tty.usbserial", 256 | "manufacturer": "Acer", 257 | "model_name": "H6510BD", 258 | "on_command": "* 0 IR 001\r", 259 | "off_command": "* 0 IR 002\r" 260 | } 261 | ] 262 | } 263 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | 203 | --------------------------------------------------------------------------------