├── .gitmodules ├── .gitignore ├── .github ├── workflows │ ├── release-drafter.yml │ ├── update-submodule-cron.yml │ └── upload-to-release.yml └── release-drafter.yml ├── docker-compose-dev.yml ├── docker-compose.yml ├── doc └── DEPLOY.md ├── README.md ├── server.go ├── Dockerfile ├── vue.config.js └── LICENSE /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "PasteMeFrontend"] 2 | path = PasteMeFrontend 3 | url = https://github.com/PasteUs/PasteMeFrontend.git 4 | [submodule "PasteMeGoBackend"] 5 | path = PasteMeGoBackend 6 | url = https://github.com/PasteUs/PasteMeGoBackend.git 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.exe~ 4 | *.dll 5 | *.so 6 | *.dylib 7 | 8 | # Test binary, build with `go test -c` 9 | *.test 10 | 11 | # Output of the go coverage tool, specifically when used with LiteIDE 12 | *.out 13 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | draft_release: 10 | if: github.repository == 'PasteUs/PasteMeLite' 11 | name: Draft release 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: toolmantim/release-drafter@v5.2.0 15 | name: Draft 16 | env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | -------------------------------------------------------------------------------- /docker-compose-dev.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | pasteme-lite: 5 | build: . 6 | container_name: pasteme-lite 7 | healthcheck: 8 | test: ["CMD", "wget", "localhost:8000/?method=beat", "--output=/dev/null"] 9 | interval: 45s 10 | timeout: 3s 11 | retries: 3 12 | restart: always 13 | volumes: 14 | - ./backend/data/:/data/ 15 | #- ./frontend/usr/:/pasteme_frontend/usr/ 16 | ports: 17 | - 80:8000 18 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | pasteme-lite: 5 | image: registry.cn-hangzhou.aliyuncs.com/pasteus/pasteme-lite:0.0.3 6 | container_name: pasteme-lite 7 | healthcheck: 8 | test: ["CMD", "wget", "localhost:8000/?method=beat", "--output=/dev/null"] 9 | interval: 45s 10 | timeout: 3s 11 | retries: 3 12 | restart: always 13 | volumes: 14 | - ./backend/data/:/data/ 15 | #- ./frontend/usr/:/pasteme_frontend/usr/ 16 | ports: 17 | - 80:8000 18 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: 'release-v$NEXT_PATCH_VERSION' 2 | tag-template: 'release-v$NEXT_PATCH_VERSION' 3 | categories: 4 | - title: 'Features' 5 | labels: 6 | - 'feature' 7 | - 'enhancement' 8 | - title: 'Bug Fixes' 9 | labels: 10 | - 'fix' 11 | - 'bugfix' 12 | - 'bug' 13 | - title: 'Maintenance' 14 | labels: 15 | - 'chore' 16 | - 'documentation' 17 | change-template: '- $TITLE (#$NUMBER) @$AUTHOR' 18 | template: | 19 | # Changes 20 | 21 | $CHANGES -------------------------------------------------------------------------------- /doc/DEPLOY.md: -------------------------------------------------------------------------------- 1 | # PasteMe Lite 部署文档 2 | 3 | > 默认监听 8000 端口 4 | 5 | ## 直接运行 6 | 7 | > 由于 sqlite 使用了 cgo,故目前只支持 linux-amd64 8 | 9 | 前往此项目的 [latest release](https://github.com/PasteUs/PasteMeLite/releases/latest) 页面下载 `pasteme_lite.tar.gz` ,解压后执行 `./pastemed` 即可。 10 | 11 | ## Docker 12 | 13 | ```bash 14 | docker run \ 15 | -d \ 16 | -p 80:8000 \ 17 | -v ${PWD}/backend/data/:/data/ \ 18 | registry.cn-hangzhou.aliyuncs.com/pasteus/pasteme-lite:0.0.3 19 | ``` 20 | 21 | ## docker-compose 22 | 23 | [docker-compose.yml](../docker-compose.yml) 24 | -------------------------------------------------------------------------------- /.github/workflows/update-submodule-cron.yml: -------------------------------------------------------------------------------- 1 | name: Update submodule 2 | 3 | on: 4 | schedule: 5 | - cron: "*/5 * * * *" 6 | 7 | jobs: 8 | update: 9 | if: github.repository == 'PasteUs/PasteMeLite' 10 | name: Update submodule 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Clone and update submodule 15 | run: | 16 | git clone https://github.com/${{ github.repository }}.git -b dev PasteMeDev --recursive 17 | cd PasteMeDev 18 | git submodule foreach git pull origin master 19 | git config user.name "Lucien Shui" 20 | git config user.email "lucien@lucien.ink" 21 | git add --all 22 | if ! git commit -m "Sync submodule at `TZ=UTC-8 date +'%Y-%m-%d %H:%M:%S'`"; then exit 0; fi 23 | git push https://"${{ secrets.GITHUB_PASSWORD }}"@"github.com/${{ github.repository }}.git" dev 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 |

5 | 6 | version 7 | 8 | 9 | version 10 | 11 |

12 |

13 | 14 | 15 | 16 | 17 | version 18 | 19 | 20 | version 21 | 22 | 23 | donate 24 | 25 |

26 |
27 |

PasteMe Lite

28 |
29 | 30 | [PasteMe](https://github.com/LucienShui/PasteMe) 的轻量版本,将前端集成至 Golang 服务中,不依赖于数据库服务。唯一一件需要做的事情,就是运行。 31 | 32 | ## Deploy 33 | 34 | [PasteMe Lite Deploy Documentation](./doc/DEPLOY.md) 35 | -------------------------------------------------------------------------------- /server.go: -------------------------------------------------------------------------------- 1 | /* 2 | @File: server.go 3 | @Contact: lucien@lucien.ink 4 | @Licence: (C)Copyright 2019 Lucien Shui 5 | 6 | @Modify Time @Author @Version @Description 7 | ------------ ------- -------- ----------- 8 | 2019-06-21 08:37 Lucien 1.0 Init 9 | */ 10 | package server 11 | 12 | import ( 13 | "fmt" 14 | "github.com/PasteUs/PasteMeGoBackend/flag" 15 | "github.com/gin-gonic/gin" 16 | "github.com/wonderivan/logger" 17 | ) 18 | 19 | var router *gin.Engine 20 | 21 | func init() { 22 | if !flag.Debug { 23 | gin.SetMode(gin.ReleaseMode) 24 | } 25 | router = gin.Default() 26 | 27 | api := router.Group("/api") 28 | { 29 | api.GET("/", beat) 30 | api.GET("/:token", query) 31 | api.POST("/", permanentCreator) 32 | api.POST("/once", readOnceCreator) 33 | api.PUT("/:key", temporaryCreator) 34 | // router.NoRoute(notFoundHandler) 35 | } 36 | 37 | router.Static("/pasteme_frontend/", "pasteme_frontend/") 38 | router.Static("/usr/", "pasteme_frontend/usr/") 39 | 40 | router.NoRoute(func(requests *gin.Context) { 41 | requests.File("pasteme_frontend/index.html") 42 | }) 43 | } 44 | 45 | func Run(address string, port uint16) { 46 | if err := router.Run(fmt.Sprintf("%s:%d", address, port)); err != nil { 47 | logger.Painc("Run server failed: " + err.Error()) 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:12 as frontend_builder 2 | COPY ./PasteMeFrontend /source 3 | COPY ./vue.config.js /source/vue.config.js 4 | WORKDIR /source 5 | RUN npm install 6 | RUN npm run build 7 | RUN mv pasteme_frontend/usr/config.example.json pasteme_frontend/usr/config.json 8 | RUN rm -rf pasteme_frontend/conf.d pasteme_frontend/report.html 9 | 10 | FROM golang:1.13-alpine as backend_builder 11 | RUN apk --no-cache add build-base 12 | COPY ./PasteMeGoBackend /go/src/github.com/PasteUs/PasteMeGoBackend 13 | COPY ./server.go /go/src/github.com/PasteUs/PasteMeGoBackend/server/server.go 14 | ENV GO111MODULE=on \ 15 | GOOS=linux 16 | WORKDIR /go/src/github.com/PasteUs/PasteMeGoBackend 17 | RUN go mod download 18 | RUN go build main.go 19 | 20 | FROM alpine:3 21 | LABEL maintainer="Lucien Shui" \ 22 | email="lucien@lucien.ink" 23 | COPY --from=backend_builder /go/src/github.com/PasteUs/PasteMeGoBackend/main /usr/bin/pastemed 24 | COPY --from=frontend_builder /source/pasteme_frontend /pasteme_frontend 25 | RUN chmod +x /usr/bin/pastemed && \ 26 | mkdir /data && \ 27 | mkdir /config && \ 28 | echo '{"address":"0.0.0.0","port":8000,"database":{"type":"sqlite","username":"username","password":"password","server":"pasteme-mysql","port":3306,"database":"pasteme"}}' > /config/config.json 29 | CMD ["pastemed", "-c", "/config/config.json", "-d", "/data"] 30 | -------------------------------------------------------------------------------- /.github/workflows/upload-to-release.yml: -------------------------------------------------------------------------------- 1 | name: PasteMe Lite Release 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | jobs: 8 | 9 | release: 10 | if: github.repository == 'PasteUs/PasteMeLite' 11 | name: Release on ${{ matrix.os }} and upload 12 | runs-on: ${{ matrix.os }} 13 | 14 | strategy: 15 | matrix: 16 | os: [ubuntu-latest] 17 | node_version: [12.x] 18 | go_version: [1.13] 19 | 20 | steps: 21 | - uses: actions/checkout@v1 22 | 23 | - name: Set up Node.js ${{ matrix.node_version }} 24 | uses: actions/setup-node@v1 25 | with: 26 | node_version: ${{ matrix.node_version }} 27 | 28 | - name: Set up Go ${{ matrix.go_version }} 29 | uses: actions/setup-go@v1 30 | with: 31 | go-version: ${{ matrix.go_version }} 32 | id: go 33 | 34 | - name: Update submodule 35 | run: | 36 | git submodule update --init --recursive 37 | 38 | - name: Build Frontend 39 | run: | 40 | cp vue.config.js PasteMeFrontend 41 | cd PasteMeFrontend 42 | npm install 43 | npm run build 44 | mv pasteme_frontend/usr/config.example.json pasteme_frontend/usr/config.json 45 | rm -rf pasteme_frontend/conf.d pasteme_frontend/report.html 46 | cd .. 47 | 48 | - name: Build Backend 49 | run: | 50 | cp server.go PasteMeGoBackend/server 51 | cd PasteMeGoBackend 52 | go mod download 53 | go build main.go 54 | cd .. 55 | env: 56 | GO111MODULE: on 57 | GOOS: linux 58 | 59 | - name: Gzip 60 | run: | 61 | mkdir pasteme_lite 62 | cp doc/DEPLOY.md pasteme_lite/README.md 63 | cp -r PasteMeFrontend/pasteme_frontend pasteme_lite 64 | cp PasteMeGoBackend/main pasteme_lite/pastemed 65 | echo '{"address":"0.0.0.0","port":80,"database":{"type":"sqlite","username":"username","password":"password","server":"pasteme-mysql","port":3306,"database":"pasteme"}}' > pasteme_lite/config.json 66 | tar -czvf pasteme_lite.tar.gz pasteme_lite 67 | 68 | - name: Upload to release 69 | uses: JasonEtco/upload-to-release@master 70 | with: 71 | args: pasteme_lite.tar.gz application/octet-stream 72 | env: 73 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 74 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; 2 | 3 | let webPath = '/pasteme_frontend/'; 4 | 5 | const cdn = { 6 | // 开发环境 7 | dev: { 8 | css: [ 9 | "https://shadow.elemecdn.com/npm/katex@0.11.0/dist/katex.min.css", 10 | "https://cdn.staticfile.org/github-markdown-css/3.0.1/github-markdown.min.css", 11 | "https://shadow.elemecdn.com/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css", 12 | "https://shadow.elemecdn.com/npm/bootstrap-vue@2.0.0-rc.28/dist/bootstrap-vue.min.css" 13 | ], 14 | js: [ 15 | "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.9/build/highlight.min.js" 16 | ] 17 | }, 18 | // 生产环境 19 | build: { 20 | css: [ 21 | "https://shadow.elemecdn.com/npm/katex@0.11.0/dist/katex.min.css", 22 | "https://cdn.staticfile.org/github-markdown-css/3.0.1/github-markdown.min.css", 23 | "https://shadow.elemecdn.com/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css", 24 | "https://shadow.elemecdn.com/npm/bootstrap-vue@2.0.0-rc.28/dist/bootstrap-vue.min.css" 25 | ], 26 | js: [ 27 | 'https://shadow.elemecdn.com/npm/vue@2.6.10/dist/vue.runtime.min.js', 28 | 'https://shadow.elemecdn.com/npm/vue-router@3.1.2/dist/vue-router.min.js', 29 | 'https://shadow.elemecdn.com/npm/vuex@3.1.1/dist/vuex.min.js', 30 | 'https://shadow.elemecdn.com/npm/axios@0.19.0/dist/axios.min.js', 31 | 'https://shadow.elemecdn.com/npm/katex@0.11.0/dist/katex.min.js', 32 | "https://shadow.elemecdn.com/npm/mermaid@8.2.3/dist/mermaid.min.js", 33 | "https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.15.9/build/highlight.min.js", 34 | "https://cdn.jsdelivr.net/npm/d3@5.9.7/dist/d3.min.js", 35 | "https://shadow.elemecdn.com/npm/bootstrap-vue@2.0.0-rc.28/dist/bootstrap-vue.min.js", 36 | "https://cdn.jsdelivr.net/npm/markdown-it@9.1.0/dist/markdown-it.min.js", 37 | "https://cdn.jsdelivr.net/npm/unorm@1.6.0/lib/unorm.min.js", 38 | "https://cdn.jsdelivr.net/npm/@chenfengyuan/vue-qrcode@1.0.1/dist/vue-qrcode.min.js", 39 | "https://cdn.jsdelivr.net/npm/vue-i18n@8.14.0/dist/vue-i18n.min.js" 40 | ] 41 | } 42 | }; 43 | 44 | module.exports = { 45 | devServer: { 46 | proxy: { 47 | "/usr": { 48 | secure: false, 49 | target: "http://dev.pasteme.lucien.ink", 50 | changeOrigin: true 51 | }, 52 | "/api": { 53 | secure: false, 54 | target: "http://dev.pasteme.lucien.ink", 55 | changeOrigin: true 56 | } 57 | } 58 | }, 59 | publicPath: process.env.NODE_ENV === 'production' ? webPath : '/', 60 | outputDir: 'pasteme_frontend', 61 | productionSourceMap: false, 62 | configureWebpack: config => { // eslint-disable-line 63 | if (process.env.NODE_ENV === 'production') { 64 | config.plugins.push(new BundleAnalyzerPlugin({ 65 | analyzerMode: "static" 66 | })); 67 | config.externals = { 68 | "vue": "Vue", 69 | "vuex": "Vuex", 70 | "vue-router": "VueRouter", 71 | "katex": "katex", 72 | "axios": "axios", 73 | "mermaid": "mermaid", 74 | "highlight.js": "hljs", 75 | "d3": "d3", 76 | "bootstrap-vue": "BootstrapVue", 77 | "markdown-it": "markdownit", 78 | "unorm": "unorm", 79 | "@chenfengyuan/vue-qrcode": "VueQrcode", 80 | "vue-i18n": "VueI18n" 81 | }; 82 | } 83 | return { 84 | output: { 85 | libraryExport: 'default', 86 | jsonpFunction: 'jsonpFunction' 87 | } 88 | } 89 | }, 90 | chainWebpack: config => { 91 | config.plugin('html').tap(args => { 92 | if (process.env.NODE_ENV === 'production') { 93 | args[0].cdn = cdn.build 94 | } 95 | if (process.env.NODE_ENV === 'development') { 96 | args[0].cdn = cdn.dev 97 | } 98 | return args 99 | }) 100 | } 101 | }; 102 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------