├── README.md ├── nginx.conf ├── docker-compose.yml └── LICENSE /README.md: -------------------------------------------------------------------------------- 1 | # Local Media Center 2 | 3 | A self-hosted, Docker-powered media center for users who want full control over their media libraries. This setup leverages various applications to manage, organize, and access movies, TV shows, and other media, with automated download, subtitle management, and a sleek frontend interface. 4 | 5 | ![Screenshot from 2024-11-15 02-53-15](https://github.com/user-attachments/assets/abe65b97-89f3-4a13-aaed-1f2381413e27) 6 | ![Screenshot from 2024-11-15 02-53-43](https://github.com/user-attachments/assets/dda2553f-f9e2-4387-b5ce-1ec5c16b4a89) 7 | 8 | ## Table of Contents 9 | - [Overview](#overview) 10 | - [Features](#features) 11 | - [Installation](#installation) 12 | - [Configuration](#configuration) 13 | - [Available Services](#available-services) 14 | - [Accessing the Applications](#accessing-the-applications) 15 | - [License](#license) 16 | 17 | ## Overview 18 | 19 | This media center environment includes popular applications such as Jellyfin, Radarr, Sonarr, and others for managing and accessing media collections. Nginx is configured as a reverse proxy to simplify access to each service via easy-to-remember routes. 20 | 21 | ## Features 22 | 23 | - **Media Streaming**: Stream movies, TV shows, and other media with Jellyfin. 24 | - **Automated Media Management**: Use Radarr, Sonarr, and other tools to automatically download, organize, and tag media files. 25 | - **Subtitle Management**: Bazarr is configured for automatic subtitle downloads. 26 | - **Torrent and Usenet Support**: qBittorrent and Sabnzbd offer flexible download options. 27 | - **Single Access Point**: Access all services via a single IP address with customizable endpoints. 28 | 29 | ## Installation 30 | 31 | ### Prerequisites 32 | - Docker and Docker Compose installed 33 | - NVIDIA GPU (optional for hardware acceleration with Jellyfin) 34 | - Environment variables set up (place these in a `.env` file in the root of this project): 35 | ```plaintext 36 | PUID=1000 37 | PGID=1000 38 | TZ=Europe/London 39 | MEDIA_CENTER_PATH=/path/to/your/media_center 40 | ``` 41 | 42 | ### Steps 43 | 1. **Clone this repository**: 44 | ```bash 45 | git clone https://github.com/your-username/local-media-center.git 46 | cd local-media-center 47 | ``` 48 | 49 | 2. **Update Environment Variables**: 50 | Modify the `.env` file to match your system's configuration. 51 | 52 | 3. **Run Docker Compose**: 53 | Start the containers using Docker Compose: 54 | ```bash 55 | docker-compose up -d 56 | ``` 57 | 58 | 4. **Access the Services**: 59 | Open your browser and navigate to `http://your-server-ip` (or use Nginx-configured paths to access each service). 60 | 61 | ## Configuration 62 | 63 | ### Reverse Proxy (Nginx) 64 | Nginx is configured to serve each application at a specific path (e.g., `/jellyfin`, `/radarr`). The `nginx.conf` file in this repository defines these paths and ensures smooth navigation across all services. 65 | 66 | ### Volumes and Paths 67 | The following paths should be configured to match your media and configuration locations: 68 | - **Media Storage**: `${MEDIA_CENTER_PATH}/media/movies`, `${MEDIA_CENTER_PATH}/media/tv` 69 | - **Configuration Files**: `${MEDIA_CENTER_PATH}/config/{service_name}` 70 | - **Download Directory**: `${MEDIA_CENTER_PATH}/downloads` 71 | 72 | ## Available Services 73 | 74 | Each service runs in its own container and can be accessed through the Nginx reverse proxy: 75 | 76 | | Service | Path | Port | Description | 77 | |---------------|--------------|------|--------------------------------------------| 78 | | Jellyfin | `/jellyfin` | 8096 | Media server for streaming media | 79 | | Jellyseerr | `/jellyseerr`| 5055 | Request management for Jellyfin | 80 | | Radarr | `/radarr` | 7878 | Manages movie downloads and organization | 81 | | Sonarr | `/sonarr` | 8989 | Manages TV show downloads and organization | 82 | | Prowlarr | `/prowlarr` | 9696 | Integrates with indexers for Radarr/Sonarr | 83 | | Bazarr | `/bazarr` | 6767 | Automated subtitle management | 84 | | Homarr | `/` | 7575 | Customizable homepage for all services | 85 | | qBittorrent | `/qbittorrent`| 5080| Torrent client for managing downloads | 86 | | Sabnzbd | `/sabnzbd` | 8080 | Usenet client for managing downloads | 87 | 88 | ### Optional Services 89 | Commented-out services in `docker-compose.yml` include: 90 | - **Tdarr**: For video transcoding and optimization (requires an NVIDIA GPU). 91 | - **Ngrok**: Expose the server securely via the web for remote access. 92 | 93 | ## Accessing the Applications 94 | 95 | Each service is accessible via Nginx using predefined routes. Access each application by appending its path to the server’s IP address or hostname: 96 | 97 | - **Example**: `http://your-server-ip/jellyfin` for Jellyfin 98 | - **Homarr Homepage**: A landing page for all services, accessible at `http://your-server-ip/` 99 | 100 | ## License 101 | 102 | This project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more information. 103 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | # Global HTTP configuration 2 | events {} 3 | 4 | http { 5 | include /etc/nginx/mime.types; 6 | default_type application/octet-stream; 7 | 8 | # Logging format 9 | log_format main '$remote_addr - $host $remote_user [$time_local] "$request" ' 10 | '$status $body_bytes_sent "$http_referer" ' 11 | '"$http_user_agent" "$http_x_forwarded_for"'; 12 | 13 | access_log /var/log/nginx/access.log main; 14 | error_log /var/log/nginx/error.log warn; 15 | 16 | sendfile on; 17 | keepalive_timeout 65; 18 | 19 | # Default server block to catch undefined domains 20 | server { 21 | listen 80 default_server; 22 | server_name _; 23 | return 404; 24 | } 25 | 26 | # Jellyfin Server 27 | server { 28 | listen 80; 29 | server_name jellyfin.*; 30 | 31 | location / { 32 | proxy_pass http://jellyfin:8096/; 33 | proxy_set_header Host $host; 34 | proxy_set_header X-Real-IP $remote_addr; 35 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 36 | proxy_set_header X-Forwarded-Proto $scheme; 37 | proxy_http_version 1.1; 38 | proxy_set_header Upgrade $http_upgrade; 39 | proxy_set_header Connection "upgrade"; 40 | proxy_redirect off; 41 | } 42 | } 43 | 44 | # Jellyseerr 45 | server { 46 | listen 80; 47 | server_name jellyseerr.*; 48 | 49 | location / { 50 | proxy_pass http://jellyseerr:5055/; 51 | proxy_set_header Host $host; 52 | proxy_set_header X-Real-IP $remote_addr; 53 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 54 | proxy_set_header X-Forwarded-Proto $scheme; 55 | proxy_http_version 1.1; 56 | proxy_set_header Upgrade $http_upgrade; 57 | proxy_set_header Connection "upgrade"; 58 | proxy_redirect off; 59 | } 60 | } 61 | 62 | # qBittorrent 63 | server { 64 | listen 80; 65 | server_name qbittorrent.*; 66 | 67 | location / { 68 | proxy_pass http://qbittorrent:5080/; 69 | proxy_set_header Host $host; 70 | proxy_set_header X-Real-IP $remote_addr; 71 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 72 | proxy_set_header X-Forwarded-Proto $scheme; 73 | proxy_http_version 1.1; 74 | proxy_set_header Upgrade $http_upgrade; 75 | proxy_set_header Connection "upgrade"; 76 | proxy_redirect off; 77 | } 78 | } 79 | 80 | # Radarr 81 | server { 82 | listen 80; 83 | server_name radarr.*; 84 | 85 | location / { 86 | proxy_pass http://radarr:7878/; 87 | proxy_set_header Host $host; 88 | proxy_set_header X-Real-IP $remote_addr; 89 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 90 | proxy_set_header X-Forwarded-Proto $scheme; 91 | proxy_http_version 1.1; 92 | proxy_set_header Upgrade $http_upgrade; 93 | proxy_set_header Connection "upgrade"; 94 | proxy_redirect off; 95 | } 96 | } 97 | 98 | # Sonarr 99 | server { 100 | listen 80; 101 | server_name sonarr.*; 102 | 103 | location / { 104 | proxy_pass http://sonarr:8989/; 105 | proxy_set_header Host $host; 106 | proxy_set_header X-Real-IP $remote_addr; 107 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 108 | proxy_set_header X-Forwarded-Proto $scheme; 109 | proxy_http_version 1.1; 110 | proxy_set_header Upgrade $http_upgrade; 111 | proxy_set_header Connection "upgrade"; 112 | proxy_redirect off; 113 | } 114 | } 115 | 116 | # Bazarr 117 | server { 118 | listen 80; 119 | server_name bazarr.*; 120 | 121 | location / { 122 | proxy_pass http://bazarr:6767/; 123 | proxy_set_header Host $host; 124 | proxy_set_header X-Real-IP $remote_addr; 125 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 126 | proxy_set_header X-Forwarded-Proto $scheme; 127 | proxy_http_version 1.1; 128 | proxy_set_header Upgrade $http_upgrade; 129 | proxy_set_header Connection "upgrade"; 130 | proxy_redirect off; 131 | } 132 | } 133 | 134 | # Prowlarr 135 | server { 136 | listen 80; 137 | server_name prowlarr.*; 138 | 139 | location / { 140 | proxy_pass http://prowlarr:9696/; 141 | proxy_set_header Host $host; 142 | proxy_set_header X-Real-IP $remote_addr; 143 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 144 | proxy_set_header X-Forwarded-Proto $scheme; 145 | proxy_http_version 1.1; 146 | proxy_set_header Upgrade $http_upgrade; 147 | proxy_set_header Connection "upgrade"; 148 | proxy_redirect off; 149 | } 150 | } 151 | 152 | # Wizarr 153 | server { 154 | listen 80; 155 | server_name wizarr.*; 156 | 157 | location / { 158 | proxy_pass http://wizarr:5690/; 159 | proxy_set_header Host $host; 160 | proxy_set_header X-Real-IP $remote_addr; 161 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 162 | proxy_set_header X-Forwarded-Proto $scheme; 163 | proxy_http_version 1.1; 164 | proxy_set_header Upgrade $http_upgrade; 165 | proxy_set_header Connection "upgrade"; 166 | proxy_redirect off; 167 | } 168 | } 169 | 170 | # Homarr 171 | server { 172 | listen 80; 173 | server_name homarr.local; 174 | 175 | location / { 176 | proxy_pass http://homarr:7575/; 177 | proxy_set_header Host $host; 178 | proxy_set_header X-Real-IP $remote_addr; 179 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 180 | proxy_set_header X-Forwarded-Proto $scheme; 181 | proxy_http_version 1.1; 182 | proxy_set_header Upgrade $http_upgrade; 183 | proxy_set_header Connection "upgrade"; 184 | proxy_redirect off; 185 | } 186 | } 187 | 188 | # SuggestArr 189 | server { 190 | listen 80; 191 | server_name suggestarr.*; 192 | 193 | location / { 194 | proxy_pass http://suggestarr:5000/; 195 | proxy_set_header Host $host; 196 | proxy_set_header X-Real-IP $remote_addr; 197 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 198 | proxy_set_header X-Forwarded-Proto $scheme; 199 | proxy_http_version 1.1; 200 | proxy_set_header Upgrade $http_upgrade; 201 | proxy_set_header Connection "upgrade"; 202 | proxy_redirect off; 203 | } 204 | } 205 | } 206 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | # Jellyfin Server 4 | jellyfin: 5 | image: jellyfin/jellyfin:latest 6 | container_name: jellyfin-server 7 | user: "${PUID}:${PGID}" 8 | networks: 9 | - media_network 10 | ports: 11 | - 8096:8096/tcp 12 | - 8920:8920/tcp 13 | volumes: 14 | - "${MEDIA_CENTER_PATH}/config/jellyfin:/config" 15 | - "${MEDIA_CENTER_PATH}/cache/jellyfin:/cache" 16 | - "${MEDIA_CENTER_PATH}/media/movies:/media/movies" 17 | - "${MEDIA_CENTER_PATH}/media/tv:/media/tv" 18 | environment: 19 | - NVIDIA_VISIBLE_DEVICES=all 20 | restart: 'unless-stopped' 21 | devices: 22 | - "/dev/dri:/dev/dri" 23 | runtime: nvidia 24 | 25 | # Jellyseerr 26 | jellyseerr: 27 | image: fallenbagel/jellyseerr 28 | container_name: jellyseerr 29 | environment: 30 | - PUID=${PUID} 31 | - PGID=${PGID} 32 | - TZ=${TZ} 33 | - LOG_LEVEL=info 34 | expose: 35 | - 5055 36 | volumes: 37 | - "${MEDIA_CENTER_PATH}/config/jellyseerr:/app/config" 38 | networks: 39 | - media_network 40 | restart: unless-stopped 41 | 42 | # Radarr 43 | radarr: 44 | image: linuxserver/radarr:latest 45 | container_name: radarr 46 | environment: 47 | - PUID=${PUID} 48 | - PGID=${PGID} 49 | - TZ=${TZ} 50 | volumes: 51 | - "${MEDIA_CENTER_PATH}/config/radarr:/config" 52 | - "${MEDIA_CENTER_PATH}/media/movies:/movies" 53 | - "${MEDIA_CENTER_PATH}/downloads:/downloads" 54 | networks: 55 | - media_network 56 | expose: 57 | - 7878 58 | restart: unless-stopped 59 | depends_on: 60 | - qbittorrent 61 | 62 | # Sonarr 63 | sonarr: 64 | image: linuxserver/sonarr:latest 65 | container_name: sonarr 66 | environment: 67 | - PUID=${PUID} 68 | - PGID=${PGID} 69 | - TZ=${TZ} 70 | volumes: 71 | - "${MEDIA_CENTER_PATH}/config/sonarr:/config" 72 | - "${MEDIA_CENTER_PATH}/media/tv:/tv" 73 | - "${MEDIA_CENTER_PATH}/downloads:/downloads" 74 | networks: 75 | - media_network 76 | expose: 77 | - 8989 78 | restart: unless-stopped 79 | depends_on: 80 | - qbittorrent 81 | 82 | # Prowlarr 83 | prowlarr: 84 | image: linuxserver/prowlarr:latest 85 | container_name: prowlarr 86 | environment: 87 | - PUID=${PUID} 88 | - PGID=${PGID} 89 | - TZ=${TZ} 90 | volumes: 91 | - "${MEDIA_CENTER_PATH}/config/prowlarr:/config" 92 | networks: 93 | - media_network 94 | expose: 95 | - 9696 96 | restart: unless-stopped 97 | depends_on: 98 | - radarr 99 | - sonarr 100 | 101 | # Bazarr (Subtitles) 102 | bazarr: 103 | image: linuxserver/bazarr:latest 104 | container_name: bazarr 105 | environment: 106 | - PUID=${PUID} 107 | - PGID=${PGID} 108 | - TZ=${TZ} 109 | volumes: 110 | - "${MEDIA_CENTER_PATH}/config/bazarr:/config" 111 | - "${MEDIA_CENTER_PATH}/media/movies:/movies" 112 | - "${MEDIA_CENTER_PATH}/media/tv:/tv" 113 | networks: 114 | - media_network 115 | expose: 116 | - 6767 117 | restart: unless-stopped 118 | 119 | # # Tdarr 120 | # tdarr: 121 | # image: haveagitgat/tdarr:latest 122 | # container_name: tdarr 123 | # environment: 124 | # - PUID=${PUID} 125 | # - PGID=${PGID} 126 | # - TZ=${TZ} 127 | # - UMASK_SET=002 128 | # - serverIP=tdarr 129 | # - serverPort=8266 130 | # - webUIPort=8265 131 | # - internalNode=true 132 | # - inContainer=true 133 | # - ffmpegVersion=6 134 | # - nodeName=MyInternalNode 135 | # - NVIDIA_DRIVER_CAPABILITIES=all 136 | # - NVIDIA_VISIBLE_DEVICES=all 137 | # volumes: 138 | # - "${MEDIA_CENTER_PATH}/config/tdarr:/app/config" 139 | # - "${MEDIA_CENTER_PATH}/media:/media" 140 | # networks: 141 | # - media_network 142 | # expose: 143 | # - 8265 # webUI port 144 | # - 8266 # server port 145 | # restart: unless-stopped 146 | # devices: 147 | # - /dev/dri:/dev/dri 148 | # deploy: 149 | # resources: 150 | # reservations: 151 | # devices: 152 | # - driver: nvidia 153 | # count: all 154 | # capabilities: [gpu] 155 | 156 | # Homarr 157 | homarr: 158 | container_name: homarr 159 | image: ghcr.io/ajnart/homarr:latest 160 | restart: unless-stopped 161 | environment: 162 | - TZ=${TZ} 163 | - PUID=${PUID} 164 | - PGID=${PGID} 165 | volumes: 166 | - /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration 167 | - ${MEDIA_CENTER_PATH}/config/homarr:/app/data/configs 168 | - ${MEDIA_CENTER_PATH}/config/homarr/icons:/app/public/icons 169 | - ${MEDIA_CENTER_PATH}/config/homarr/data:/data 170 | expose: 171 | - 7575 172 | networks: 173 | - media_network 174 | 175 | # qBittorrent 176 | qbittorrent: 177 | image: linuxserver/qbittorrent:latest 178 | container_name: qbittorrent 179 | environment: 180 | - PUID=${PUID} 181 | - PGID=${PGID} 182 | - TZ=${TZ} 183 | - WEBUI_PORT=5080 184 | volumes: 185 | - "${MEDIA_CENTER_PATH}/config/qbittorrent:/config" 186 | - "${MEDIA_CENTER_PATH}/downloads:/downloads" 187 | networks: 188 | - media_network 189 | ports: 190 | - 6881:6881 191 | - 6881:6881/udp 192 | - 6882:6882 193 | - 6882:6882/udp 194 | expose: 195 | - 5080 196 | restart: unless-stopped 197 | 198 | # Wizarr 199 | wizarr: 200 | image: ghcr.io/wizarrrr/wizarr:latest 201 | container_name: wizarr 202 | environment: 203 | - PUID=${PUID} 204 | - PGID=${PGID} 205 | - TZ=${TZ} 206 | volumes: 207 | - "${MEDIA_CENTER_PATH}/config/wizarr:/data/database" 208 | networks: 209 | - media_network 210 | expose: 211 | - 5690 212 | restart: unless-stopped 213 | 214 | # SuggestArr 215 | suggestarr: 216 | image: ciuse99/suggestarr:latest 217 | container_name: suggestarr 218 | restart: unless-stopped 219 | environment: 220 | - PUID=${PUID} 221 | - PGID=${PGID} 222 | - TZ=${TZ} 223 | - LOG_LEVEL=${LOG_LEVEL:-info} 224 | - SUGGESTARR_PORT=${SUGGESTARR_PORT:-5000} 225 | volumes: 226 | - "${MEDIA_CENTER_PATH}/config/suggestarr:/app/config/config_files" 227 | networks: 228 | - media_network 229 | expose: 230 | - 5000 231 | depends_on: 232 | - radarr 233 | - sonarr 234 | - jellyseerr 235 | 236 | # Nginx 237 | nginx: 238 | image: nginx:latest 239 | container_name: nginx 240 | ports: 241 | - 80:80 242 | volumes: 243 | - ./nginx.conf:/etc/nginx/nginx.conf 244 | depends_on: 245 | - jellyfin 246 | - jellyseerr 247 | - radarr 248 | - sonarr 249 | - prowlarr 250 | - bazarr 251 | - qbittorrent 252 | # - sabnzbd 253 | - homarr 254 | - wizarr 255 | - suggestarr 256 | - flaresolverr 257 | restart: unless-stopped 258 | networks: 259 | - media_network 260 | 261 | # # Ngrok 262 | # ngrok: 263 | # image: ngrok/ngrok:latest 264 | # container_name: ngrok 265 | # ports: 266 | # - 4040:4040 267 | # depends_on: 268 | # - nginx 269 | # restart: unless-stopped 270 | # networks: 271 | # - media_network 272 | # environment: 273 | # - NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN} 274 | # env_file: 275 | # - .env 276 | # command: http --domain=bulldog-perfect-violently.ngrok-free.app nginx:80 277 | 278 | networks: 279 | media_network: 280 | driver: bridge -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------