1
0
Fork 0
mirror of https://github.com/Luzifer/sri.git synced 2024-11-08 14:50:12 +00:00

Add meta files

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-08-16 23:06:51 +02:00
parent 161abc96c8
commit ddc78b8547
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 52 additions and 0 deletions

25
LICENSE Normal file
View file

@ -0,0 +1,25 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <http://unlicense.org>

27
README.md Normal file
View file

@ -0,0 +1,27 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/Luzifer/sri)](https://goreportcard.com/report/github.com/Luzifer/sri)
![](https://badges.fyi/github/license/Luzifer/sri)
![](https://badges.fyi/github/downloads/Luzifer/sri)
![](https://badges.fyi/github/latest-release/Luzifer/sri)
![](https://knut.in/project-status/sri)
# Luzifer / sri
`sri` is a very small helper to calculate [SRI](https://www.w3.org/TR/SRI/) information for `<link>` or `<script>` tags.
Files are downloaded as they currently are and a checksum is calculated. This checksum then is printed inside the desired HTML tag for embedding into an HTML page.
Please be aware you should use this with non-changing URLs as the browser will no longer load the file as soon as the hash does no longer match.
## Usage
```console
# sri --help
Usage of sri:
--html Print HTML tags with SRI information (If disabled just prints the hashes) (default true)
--html-tag string Tag to use for HTML mode (supported: link, script) (default "link")
--log-level string Log level (debug, info, warn, error, fatal) (default "info")
--version Prints current version and exits
# sri --html-tag link https://use.fontawesome.com/releases/v5.10.1/css/all.css
<link href="https://use.fontawesome.com/releases/v5.10.1/css/all.css" integrity="sha512-9my9Mb2+0YO+I4PUCSwUYO7sEK21Y0STBAiFEYoWtd2VzLEZZ4QARDrZ30hdM1GlioHJ8o8cWQiy8IAb1hy/Hg==" crossorigin="anonymous">
```