Generate SRI integrity hashes into html

to prevent loading of scripts which were modified on the network
transport

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-05-05 19:08:02 +02:00
parent a7c4c584cc
commit 7aaf7a7f53
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
5 changed files with 163 additions and 139 deletions

252
assets.go
View file

@ -163,9 +163,9 @@ func bindataFrontendApplicationcoffee() (*asset, error) {
info := bindataFileInfo{
name: "frontend/application.coffee",
size: 2264,
md5checksum: "",
md5checksum: "cc7e1ff80de04958450e072085bd2951",
mode: os.FileMode(436),
modTime: time.Unix(1525534186, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -227,9 +227,9 @@ func bindataFrontendApplicationjs() (*asset, error) {
info := bindataFileInfo{
name: "frontend/application.js",
size: 3101,
md5checksum: "",
md5checksum: "acd3e0e8dd884df23ecfef6e90f0c719",
mode: os.FileMode(436),
modTime: time.Unix(1525536071, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -991,9 +991,9 @@ func bindataFrontendCssBootstrapmincss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/bootstrap.min.css",
size: 144877,
md5checksum: "",
md5checksum: "450fc463b8b1a349df717056fbb3e078",
mode: os.FileMode(420),
modTime: time.Unix(1525536068, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -1821,9 +1821,9 @@ func bindataFrontendCssBootswatchmincss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/bootswatch.min.css",
size: 160728,
md5checksum: "",
md5checksum: "016ca9cee5cc314843add8fceb2c0dab",
mode: os.FileMode(420),
modTime: time.Unix(1525536069, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -1863,9 +1863,9 @@ func bindataFrontendCssFabrandscss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fa-brands.css",
size: 687,
md5checksum: "",
md5checksum: "25a3b90967aac0d439349f17aa40e2dd",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -1904,9 +1904,9 @@ func bindataFrontendCssFabrandsmincss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fa-brands.min.css",
size: 633,
md5checksum: "",
md5checksum: "9778756ed1a68a0d6770fd08ddf0f65e",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -1946,9 +1946,9 @@ func bindataFrontendCssFaregularcss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fa-regular.css",
size: 706,
md5checksum: "",
md5checksum: "77ad0a58eb12326ba08e3f21e83d12d8",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -1987,9 +1987,9 @@ func bindataFrontendCssFaregularmincss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fa-regular.min.css",
size: 651,
md5checksum: "",
md5checksum: "40e5b573ff8576123e2a8328da4c0438",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -2029,9 +2029,9 @@ func bindataFrontendCssFasolidcss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fa-solid.css",
size: 699,
md5checksum: "",
md5checksum: "43176baae7b487484782f61b29e1c539",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -2070,9 +2070,9 @@ func bindataFrontendCssFasolidmincss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fa-solid.min.css",
size: 643,
md5checksum: "",
md5checksum: "026b52c2d594907536b79fdc316f592e",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -2416,9 +2416,9 @@ func bindataFrontendCssFontawesomeallcss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fontawesome-all.css",
size: 48548,
md5checksum: "",
md5checksum: "421f6abfb4fa6943b8d03b471cee24a8",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -2748,9 +2748,9 @@ func bindataFrontendCssFontawesomeallmincss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fontawesome-all.min.css",
size: 38598,
md5checksum: "",
md5checksum: "27f7478eaa0288ed151f740f1a266de1",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -3085,9 +3085,9 @@ func bindataFrontendCssFontawesomecss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fontawesome.css",
size: 46999,
md5checksum: "",
md5checksum: "d63a2485a8deb28a826f6adfcef1f7e0",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -3407,9 +3407,9 @@ func bindataFrontendCssFontawesomemincss() (*asset, error) {
info := bindataFileInfo{
name: "frontend/css/fontawesome.min.css",
size: 37233,
md5checksum: "",
md5checksum: "4d7a81d91d7999bbe7513fc757c24e26",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -3418,54 +3418,56 @@ func bindataFrontendCssFontawesomemincss() (*asset, error) {
}
var _bindataFrontendIndexhtml = []byte(
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x58\x5f\x6f\xdb\x36\x10\x7f\x4e\x3e\xc5\x95\x79\x0d\xa3\xb5\x58\x81" +
"\x2d\x95\x0c\x0c\xc5\x1e\x06\x14\xeb\xd0\xa4\xc0\x5e\x29\xf1\x2c\x31\xa5\x48\x95\x3c\xd9\x75\x83\x7c\xf7\x81\xa2" +
"\xa4\x48\x96\x9d\x78\x5d\xfb\x30\x14\x68\x2c\xea\xfe\xfe\xee\x77\xa7\x93\xd2\x17\xd2\x16\xb4\x6b\x10\x2a\xaa\xf5" +
"\xea\x3c\x0d\x7f\x40\x0b\x53\x66\x0c\x0d\x5b\x9d\x03\xa4\x15\x0a\x19\x7e\x00\xa4\x2f\x38\x87\x0f\xf8\xb9\x55\x0e" +
"\x25\xd4\x48\x02\x48\x94\x1e\x38\xef\xef\x77\x47\x45\x25\x9c\x47\xca\x58\x4b\x6b\xfe\x0b\x9b\xde\xaa\x88\x1a\x1e" +
"\xf4\x37\x19\xfb\x9b\x7f\xfc\x8d\xbf\xb5\x75\x23\x48\xe5\x1a\x19\x14\xd6\x10\x1a\xca\xd8\x1f\xbf\x67\x28\x4b\x9c" +
"\x69\x1a\x51\x63\xc6\x36\x0a\xb7\x8d\x75\x34\x11\xde\x2a\x49\x55\x26\x71\xa3\x0a\xe4\xdd\xc5\x25\x28\xa3\x48\x09" +
"\xcd\x7d\x21\x34\x66\x2f\x2f\xc1\x57\x4e\x99\x4f\x9c\x2c\x5f\x2b\xca\x8c\x65\xab\xf3\x68\x5b\x2b\xf3\x09\x1c\xea" +
"\x8c\x79\xda\x69\xf4\x15\x22\x31\xa8\x1c\xae\x33\x96\x14\xde\x27\xb9\xb5\xe4\xc9\x89\xe6\xaa\x56\xe6\xaa\xf0\x9e" +
"\x41\xb2\xfa\x37\xba\x5b\x41\x45\x35\x53\x3e\x3b\x7b\x5e\x75\x6d\x0d\x89\x2d\x7a\x5b\x23\x17\x5a\xcf\xf4\xa3\x77" +
"\x52\xa4\x71\xf5\xfe\xf6\x06\x38\xbc\x37\x08\xb7\xaa\x46\xb8\xc1\xc2\x21\xf9\x34\x89\x77\x7b\xd1\xce\x47\x0c\x1a" +
"\xe0\x22\xd8\xa4\x4a\x99\x72\xeb\xac\x29\x2f\xe1\xc2\x58\x5a\xdb\xd6\xc8\x4b\xb8\x28\x84\x93\x1f\x50\xc8\x68\xa7" +
"\x3f\x88\x17\x1f\x3f\xbc\x5b\x08\xfc\xe5\x10\xee\x41\x2a\xdf\x68\xb1\xbb\x06\x63\x0d\xbe\x81\x87\xde\xd1\xd5\xda" +
"\x5a\x42\x07\xf7\x50\x58\x6d\xdd\x35\x5c\xbc\x5a\x87\x7f\x6f\x20\x24\xc7\xbd\xfa\x8a\xd7\xf0\xd3\xd5\xaf\x58\xbf" +
"\x01\xc2\x2f\xc4\x85\x56\xa5\xb9\x86\x02\x0d\xa1\x1b\xec\xa4\xc9\x18\x7d\x9a\x0c\x4c\x4c\x73\x2b\x77\x43\x76\x46" +
"\x6c\xa0\xd0\xc2\xfb\x8c\x19\xb1\xc9\x85\x83\xf8\x87\xe3\x97\x46\x18\xc9\x75\x39\x1c\x48\xe1\x3e\x41\x5e\xf2\xc6" +
"\xa9\x5a\xb8\x1d\x1b\x20\x49\xc5\xdc\x00\xcf\x9d\x30\x72\xa8\xc7\x05\x5b\xa5\x6a\x10\x58\x0b\x0f\x6b\xc1\x5b\x8f" +
"\x8e\xfb\x0e\x03\xb6\x4a\x13\xb5\x82\x63\x85\x10\xa3\x93\xbc\x25\xb2\x66\xcf\x13\xd9\xb2\xd4\xe8\x18\x84\x1e\xcc" +
"\x58\x94\x61\x20\x05\x89\xfe\x5e\xc6\x0a\xab\xb5\x68\x3c\x0e\xc7\xc2\x95\xa1\xbb\x2e\xa2\x89\x9b\xb6\x09\x1d\x81" +
"\xf2\x6d\xec\x08\x06\xc2\x29\xc1\x43\x7f\x38\xab\x47\x4f\x47\xc4\x22\x46\x28\x43\x66\x3a\xb8\xe8\x4e\xb5\xc8\x03" +
"\x37\x6f\xbb\x00\x02\x7a\xaa\x14\xa4\xac\x19\x11\x0b\xa4\x6a\xc4\x91\x64\xb8\x2a\x82\x68\x9a\x04\x91\x31\xfd\x24" +
"\xe6\xd6\x57\x0d\x20\x95\x6a\xac\xdb\x90\xe1\x50\xa8\xc7\x8c\x95\x3c\x9a\xc0\x24\x96\x56\xef\x45\x12\x38\x51\x6b" +
"\x2e\x5a\xb2\x13\xb9\xae\x67\x27\x92\x5c\x11\xd6\x21\x50\xad\x9e\x17\x12\x23\x1d\x62\x50\xb8\xbd\x19\xea\xbf\xcf" +
"\x8e\x46\xb7\xbe\xa7\xc5\xfd\xfd\x2d\xb0\x9c\x0c\x37\xb8\x1d\x08\xf3\xf0\x10\x68\x31\xf7\x9a\x26\xad\x7e\x84\x4a" +
"\xaa\x4d\x3f\x63\x12\x23\x36\x03\xd1\x67\x80\x19\x12\xca\xa0\x83\x9a\xf8\xcf\x8f\x44\x9e\x88\x38\xbb\x85\xbb\xd6" +
"\x93\x5a\xef\x78\x3f\x2c\x79\x6c\xad\x29\x72\xf3\x22\xf0\x5a\x8e\x03\x7b\x29\x20\x34\x3a\x82\xee\x7f\x2e\x85\x29" +
"\x03\x6d\x9d\x0d\x0c\xed\xce\x7a\x5c\xfa\x61\x32\xb3\x02\xb0\xc0\xe8\x73\x8b\x3e\x50\x8a\x17\xca\x15\x7a\x20\x5e" +
"\xa5\xa4\x44\x93\x31\x72\x2d\x46\x04\x67\x56\x3a\x34\x63\x00\x11\x4b\x6e\x2c\xf1\xe8\xef\xe1\x61\x1a\xf6\x23\x84" +
"\xdf\x98\xc7\x7c\x4a\xfe\xf0\x6c\x06\x6f\x7c\x1b\xea\x14\x7d\x3e\x95\xd1\xec\xb2\xbf\x38\x4c\x82\xa7\xab\xfd\xf2" +
"\x15\x1b\x15\x17\x22\xc2\x49\xc8\xad\x93\xe8\xc6\x91\xd9\x61\x13\x6e\xfc\xf9\xc8\xff\x39\x34\x7b\x06\x78\x98\xd9" +
"\xe8\x26\x63\x37\x0e\xfb\x6d\xa5\x08\xf7\x74\x7b\x48\xba\x67\xd7\xbc\x61\xe6\x2e\xf6\x8b\x7b\xc0\x6b\x78\x40\x2c" +
"\xac\xa7\x6b\xeb\xea\x2e\x83\xf0\xe3\xad\x43\x41\x78\x30\x89\x7d\x93\x41\x9c\x97\xce\xb6\xcd\x01\xc1\x30\x30\xc2" +
"\xbc\x84\xb5\x75\x19\x1b\x1e\x0a\x5d\x26\xdd\xf9\x40\xd5\x30\xbc\xbb\xde\xef\x4e\x0f\xda\x09\xc8\x08\x87\x62\xe6" +
"\xb7\x9f\xe4\x81\xa3\x5b\x9f\xb1\xd7\x3d\x3f\xc7\x87\xcf\xa0\x74\x20\x85\x25\x50\xdd\xb1\x32\x4d\x4b\x83\x8f\x9c" +
"\x0c\x84\x01\xe5\xdb\xa2\xc0\xb0\x61\xc4\x27\x91\x6f\xf3\x5a\x11\x83\x8d\xd0\x2d\x66\x6c\x9c\x63\x45\x87\xda\x63" +
"\x65\x96\x20\x27\x21\xea\xd5\xd3\x15\x9b\x33\xf6\x50\x05\x07\xe2\x8d\x61\x0d\xc4\x1b\xb7\x91\xd3\x89\xd7\xdb\x38" +
"\x91\x78\x7d\xb9\x62\xa2\xf2\xfb\x91\xaf\x59\x56\x22\x7a\x0d\x51\x35\x0e\x79\xeb\xf4\xbe\xb7\xe0\x6f\xa1\x77\x32" +
"\x33\xfb\x42\xc7\x82\x06\x37\xec\x08\xb1\x50\x48\x6b\xf4\x6e\x59\xca\x03\xfc\x79\x3a\x8f\xbc\x75\x86\x57\xca\x2c" +
"\x9a\xf6\x40\x26\xff\x81\x15\x8b\x71\x34\xdb\x49\x7f\xd4\x48\x0a\x38\x85\x19\xfd\xbd\xc7\xd2\xb3\xcc\x70\xb8\x41" +
"\xa1\x9f\xc2\xf5\x04\x93\x7b\x0b\xe8\xa2\xef\x03\x94\xd1\xd1\xcd\x74\x86\x05\x99\xde\xff\x64\x7f\x19\x96\xb9\x03" +
"\xa1\x3c\x89\xc9\x77\x29\xf1\xff\xad\xbe\x27\xf7\xeb\x89\xf3\x7f\xec\xd7\xe3\xc3\x7f\x89\x33\x3c\xcb\xb4\x40\xaf" +
"\xae\x81\x97\x53\xef\x5b\x4a\x1b\xaf\xe3\x37\x83\xe4\x6a\xdc\x37\xc6\x8f\x05\xfb\x12\x61\x61\x0d\xf7\x8e\xec\xb2" +
"\x35\xf1\xd7\xcf\xed\x32\x10\x5f\x39\x67\xd0\x4e\x3a\xc9\x6e\xd1\xa1\xe4\xf9\x8e\x3d\x3c\xc0\xb8\xd0\x57\x44\x8d" +
"\xbf\x4e\x92\x52\x51\xd5\xe6\x57\x85\xad\x93\x77\xed\x57\xb5\x46\x97\x58\xf2\xf3\xf5\x3e\x0f\xcb\x5e\x14\xec\x17" +
"\xfc\x41\xf4\xfd\xed\x4d\xd8\xea\xe1\xfe\xfe\x6a\x83\xce\x2b\x6b\x26\x10\x1e\xda\xd6\xa6\x90\x9d\x9d\xa5\xbe\x70" +
"\xaa\x21\xf0\xae\xc8\x58\x72\xe7\x93\xbb\xcf\x2d\xba\x5d\xf7\xde\x7f\xd7\xbd\x4c\x44\x81\x5e\x6f\x5f\x3a\x69\x6c" +
"\xd3\xa0\x3b\x55\x7c\xfe\x51\xe3\x04\x85\x52\xe5\x39\x3a\xe5\x2b\x2e\xd0\x9f\xa2\x24\x9a\x46\xab\xa2\x7b\x69\x5c" +
"\x88\xa6\x49\x7c\x7d\x4f\x93\xf8\xcd\xe9\xfc\x9f\x00\x00\x00\xff\xff\x28\xba\xef\xc9\x85\x12\x00\x00")
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xd4\x58\xd1\x6f\xdb\xbe\x11\x7e\xcf\x5f\x71\x3f\xe6\x35\x8c\xd6\x62\x05" +
"\xb6\x54\x32\x30\x14\x03\x56\xa0\x58\x87\x24\x05\xf6\x58\x4a\x3c\x4b\x4c\x29\x52\x25\x4f\x76\x5d\xc3\xff\xfb\x40" +
"\x51\x52\x2c\xcb\x76\xdc\xae\x7d\xf8\x21\x40\x6c\x51\xa7\xfb\x78\xdf\x7d\x77\x3c\x2b\xfd\x43\xda\x82\x36\x0d\x42" +
"\x45\xb5\x5e\x5c\xa5\xe1\x03\xb4\x30\x65\xc6\xd0\xb0\xc5\x15\x40\x5a\xa1\x90\xe1\x0b\x40\xfa\x07\xe7\x70\x8f\x5f" +
"\x5b\xe5\x50\x42\x8d\x24\x80\x44\xe9\x81\xf3\xfe\x7e\xb7\x54\x54\xc2\x79\xa4\x8c\xb5\xb4\xe4\x7f\x63\xfb\xb7\x2a" +
"\xa2\x86\x87\xe7\x57\x19\xfb\x2f\xff\xf4\x0f\xfe\xce\xd6\x8d\x20\x95\x6b\x64\x50\x58\x43\x68\x28\x63\xef\xff\x99" +
"\xa1\x2c\x71\xf2\xa4\x11\x35\x66\x6c\xa5\x70\xdd\x58\x47\x7b\xc6\x6b\x25\xa9\xca\x24\xae\x54\x81\xbc\xbb\xb8\x01" +
"\x65\x14\x29\xa1\xb9\x2f\x84\xc6\xec\xd5\x0d\xf8\xca\x29\xf3\x85\x93\xe5\x4b\x45\x99\xb1\x6c\x71\x15\x7d\x6b\x65" +
"\xbe\x80\x43\x9d\x31\x4f\x1b\x8d\xbe\x42\x24\x06\x95\xc3\x65\xc6\x92\xc2\xfb\x24\xb7\x96\x3c\x39\xd1\xdc\xd6\xca" +
"\xdc\x16\xde\x33\x50\x86\xb0\x74\x8a\x36\x19\xdb\x6e\x1f\xee\xdf\xff\x4b\xf8\x0a\x3e\x1f\xb7\xfe\xbc\xdb\x31\x48" +
"\x16\x3f\x02\xb6\x16\x54\x54\x97\xa3\x4d\xcc\x7f\x0c\x6e\x69\x0d\x89\x35\x7a\x5b\x23\x17\x5a\x5f\x84\x79\xe2\x99" +
"\x01\x38\x22\x93\x22\x8d\x8b\x8f\x8f\x0f\xc0\xe1\xa3\x41\x78\x54\x35\xc2\x03\x16\x0e\xc9\xa7\x49\xbc\xdb\x9b\x76" +
"\x5b\x8b\x1b\x06\xb8\x0e\x6e\xa9\x52\xa6\x5c\x3b\x6b\xca\x1b\xb8\x36\x96\x96\xb6\x35\xf2\x06\xae\x0b\xe1\xe4\x3d" +
"\x0a\x19\xfd\xf4\x0b\xf1\xe2\xd3\xfd\x87\x99\xc1\x7f\x1c\xc2\x16\xa4\xf2\x8d\x16\x9b\x3b\x30\xd6\xe0\x5b\xd8\xf5" +
"\x40\xb7\x4b\x6b\x09\x1d\x6c\xa1\xb0\xda\xba\x3b\xb8\x7e\xbd\x0c\x7f\x6f\x21\xc4\xc7\xbd\xfa\x8e\x77\xf0\x97\xdb" +
"\xbf\x63\xfd\x16\x08\xbf\x11\x17\x5a\x95\xe6\x0e\x0a\x34\x84\x6e\xf0\x93\x26\xe3\xee\xd3\x64\xa8\x92\x34\xb7\x72" +
"\x33\x44\x67\xc4\x0a\x0a\x2d\xbc\xcf\x98\x11\xab\x5c\x38\x88\x1f\x1c\xbf\x35\xc2\x48\xae\xcb\x61\x41\x0a\xf7\x05" +
"\xf2\x92\x37\x4e\xd5\xc2\x6d\xd8\x40\x49\x2a\xa6\x0e\x78\xee\x84\x91\x43\x1a\xaf\xd9\x22\x55\x83\xc1\x52\x78\x58" +
"\x0a\xde\x7a\x74\xdc\x77\x1c\xb0\x45\x9a\xa8\x05\x9c\x4a\x84\x18\x41\xf2\x96\xc8\x9a\x03\x24\xb2\x65\xa9\xd1\x31" +
"\x08\xfd\x21\x63\xd1\x86\x81\x14\x24\xfa\x7b\x19\x2b\xac\xd6\xa2\xf1\x38\x2c\x0b\x57\x86\xca\xbf\x8e\x2e\x1e\xda" +
"\x26\x54\x2b\xca\x77\xb1\x5a\x19\x08\xa7\x04\x0f\xb5\xeb\xac\x1e\x91\x4e\x98\x45\x8e\x50\x86\xc8\x74\x80\xe8\x56" +
"\xb5\xc8\x83\xa4\x1f\xbb\x0d\x04\xf6\x54\x29\x48\x59\x33\x32\x16\x44\xd5\x88\x13\xc1\x70\x55\x04\xd3\x34\x09\x26" +
"\x63\xf8\x49\x8c\xad\xcf\x1a\x40\x2a\xd5\x98\xb7\x21\xc2\x21\x51\xcf\x11\x2b\x79\x32\x80\xbd\xbd\xb4\xfa\x60\x27" +
"\x41\x13\xb5\xe6\xa2\x25\xbb\x67\xd7\xd5\xeb\x9e\x25\x57\x84\x75\xd8\xa8\x56\x2f\x1b\x89\x51\x0e\x71\x53\xb8\x7e" +
"\x18\xf2\x7f\xa8\x8e\x46\xb7\xbe\x97\xc5\x76\xfb\x08\x2c\x27\xc3\x0d\xae\x07\xc1\xec\x76\x41\x16\x53\xd4\x34\x69" +
"\xf5\x33\x55\x52\xad\xfa\xfe\x92\x18\xb1\x1a\x84\x3e\x21\xcc\x90\x50\x06\x1d\xd4\xc4\xff\xfa\x2c\xe4\x3d\x13\x67" +
"\xd7\xf0\xd4\x7a\x52\xcb\x0d\xef\x1b\x39\x8f\xa5\xb5\xcf\xdc\x34\x09\xbc\x96\xe3\x61\x32\x37\x10\x1a\x1d\x41\xf7" +
"\x9f\x4b\x61\xca\x20\x5b\x67\x83\x42\xbb\xb5\x9e\x97\xbe\x99\x4c\xbc\x00\xcc\x38\xfa\xda\xa2\x0f\x92\xe2\x85\x72" +
"\x85\x1e\x84\x57\x29\x29\xd1\x64\x8c\x5c\x8b\x91\xc1\x89\x97\x8e\xcd\xb8\x81\xc8\x25\x37\x96\x78\xc4\xdb\xed\xf6" +
"\xb7\xfd\x4c\xe1\x4f\xc6\x31\xed\x92\xbf\x3d\x9a\x01\x8d\xaf\x43\x9e\x22\xe6\xb9\x88\x26\x97\xfd\xc5\x71\x11\x9c" +
"\xcf\xf6\xab\xd7\x6c\x7c\x70\x66\x22\x9c\x84\xdc\x3a\x89\x6e\x6c\x99\x1d\x37\xe1\xc6\xbf\x9f\xf5\x3f\xa5\xe6\xc0" +
"\x01\x0f\x3d\x1b\xdd\x5e\xdb\x8d\xcd\x7e\x5d\x29\xc2\x83\x67\x7b\x4a\xba\xb3\x6b\x5a\x30\x53\x88\xc3\xe4\x1e\x41" +
"\x0d\x07\xc4\xcc\x7b\xba\xb4\xae\xee\x22\x08\x5f\xde\x39\x14\x84\x47\x83\x38\x74\x19\xcc\x79\xe9\x6c\xdb\x1c\x31" +
"\x0c\x0d\x23\xf4\x4b\x58\x5a\x97\xb1\xe1\x50\xe8\x22\xe9\xd6\x07\xa9\x86\xe6\xdd\xd5\x7e\xb7\x7a\xd4\x4f\x60\x46" +
"\x38\x14\x13\xdc\xbe\x93\x07\x8d\xae\x7d\xc6\xde\xf4\xfa\x1c\x0f\x9f\xe1\xa1\x23\x21\xcc\x89\xea\x96\x95\x69\x5a" +
"\x1a\x30\x72\x32\x10\x1a\x94\x6f\x8b\x02\xc3\x60\x12\x4f\x22\xdf\xe6\xb5\x22\x06\x2b\xa1\x5b\x0c\x23\x4a\xdf\xc7" +
"\x8a\x8e\xb5\xe7\xcc\xcc\x49\x4e\xc2\xae\x17\xe7\x33\x36\x55\xec\xb1\x0c\x0e\xc2\x1b\xb7\x35\x08\x6f\x9c\x46\x2e" +
"\x17\x5e\xef\xe3\x42\xe1\xf5\xe9\x8a\x81\xca\x5f\x27\xbe\x66\x9e\x89\x88\x1a\x76\xd5\x38\xe4\xad\xd3\x87\x68\x01" +
"\x6f\xf6\xdc\xc5\xca\xec\x13\x1d\x13\x1a\x60\xd8\x09\x61\xa1\x90\xd6\xe8\xcd\x3c\x95\x47\xf4\x73\x3e\x8e\xbc\x75" +
"\x86\x57\xca\xcc\x8a\xf6\x48\x24\xff\x87\x2a\x66\xed\x68\x32\x93\xfe\xae\x96\x14\x78\x0a\x3d\xfa\x57\xb7\xa5\x17" +
"\x95\xe1\x70\x85\x42\x9f\xe3\xf5\x02\x97\x07\x03\xe8\xac\xee\x03\x95\x11\xe8\x61\xbf\x87\x05\x9b\x1e\x7f\x6f\x7e" +
"\x19\x86\xb9\x23\x5b\x39\xcb\xc9\x2f\x49\xf1\x9f\x2d\xbf\x17\xd7\xeb\x85\xfd\x7f\xac\xd7\xd3\xcd\x7f\xce\x33\xbc" +
"\xa8\xb4\x20\xaf\xae\x80\xe7\x5d\xef\x67\x52\x1b\xaf\xe3\xfb\x8c\xe4\x76\x9c\x37\xc6\x17\x19\x87\x16\x61\x60\x0d" +
"\xf7\x4e\xcc\xb2\x35\xf1\x37\x2f\xcd\x32\x10\x7f\x72\x4e\xa8\xdd\xab\x24\xbb\x46\x87\x92\xe7\x1b\xb6\xdb\xc1\x38" +
"\xd0\x57\x44\x8d\xbf\x4b\x92\x52\x51\xd5\xe6\xb7\x85\xad\x93\x0f\xed\x77\xb5\x44\x97\x58\xf2\xd3\xf1\x3e\x0f\xc3" +
"\x5e\x34\xec\x07\xfc\xc1\xf4\xe3\xe3\x43\x98\xea\x61\xbb\xbd\x5d\xa1\xf3\xca\x9a\x3d\x0a\x8f\x4d\x6b\x87\x94\xa5" +
"\xbe\x70\xaa\x21\xf0\xae\xc8\x58\xf2\xe4\x93\xa7\xaf\x2d\xba\x4d\xf7\xe3\xff\xe9\xf4\xfb\x82\x43\xc3\xcf\xe1\x48" +
"\x4e\x93\xe8\x6c\x71\xdc\x73\x63\x9b\x06\xdd\x05\x9e\x27\x86\x97\x78\x9e\xbe\x9b\x39\xef\xfc\xd0\xf6\x12\xff\xa5" +
"\xca\x73\x74\xca\x57\x5c\xa0\xbf\x00\xe3\x98\xfd\x4b\x38\xa2\x69\xb4\x2a\xba\xdf\xbb\x67\xbc\x4f\xad\x66\x3e\xd3" +
"\x24\xbe\xa2\x48\x93\xf8\xce\xef\xea\x7f\x01\x00\x00\xff\xff\xf3\xdd\x17\x43\x05\x14\x00\x00")
func bindataFrontendIndexhtmlBytes() ([]byte, error) {
return bindataRead(
@ -3484,10 +3486,10 @@ func bindataFrontendIndexhtml() (*asset, error) {
info := bindataFileInfo{
name: "frontend/index.html",
size: 4741,
md5checksum: "",
size: 5125,
md5checksum: "5f5253fb6b2c1bf2b27961bf03062bee",
mode: os.FileMode(436),
modTime: time.Unix(1525536010, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -3983,9 +3985,9 @@ func bindataFrontendJsBootstrapminjs() (*asset, error) {
info := bindataFileInfo{
name: "frontend/js/bootstrap.min.js",
size: 48944,
md5checksum: "",
md5checksum: "14d449eb8876fa55e1ef3c2cc52b0c17",
mode: os.FileMode(420),
modTime: time.Unix(1525536068, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -4173,9 +4175,9 @@ func bindataFrontendJsGibberishaesminjs() (*asset, error) {
info := bindataFileInfo{
name: "frontend/js/gibberish-aes.min.js",
size: 10160,
md5checksum: "",
md5checksum: "905f00492dbc3031761c003432c6d0a5",
mode: os.FileMode(420),
modTime: time.Unix(1525536068, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -5291,9 +5293,9 @@ func bindataFrontendJsJqueryminjs() (*asset, error) {
info := bindataFileInfo{
name: "frontend/js/jquery.min.js",
size: 86927,
md5checksum: "",
md5checksum: "a09e13ee94d51c524b7e2a728c7d4039",
mode: os.FileMode(420),
modTime: time.Unix(1525536068, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -5571,9 +5573,9 @@ func bindataFrontendJsPopperminjs() (*asset, error) {
info := bindataFileInfo{
name: "frontend/js/popper.min.js",
size: 19097,
md5checksum: "",
md5checksum: "a45a1ccca29f7d4a35171e666b908870",
mode: os.FileMode(420),
modTime: time.Unix(1525536068, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -5623,9 +5625,9 @@ func bindataFrontendLocaleDedealljson() (*asset, error) {
info := bindataFileInfo{
name: "frontend/locale/de-de.all.json",
size: 1394,
md5checksum: "",
md5checksum: "817137ec37bc1afe77f18285f34d4126",
mode: os.FileMode(436),
modTime: time.Unix(1525536066, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -5654,9 +5656,9 @@ func bindataFrontendLocaleDedeuntranslatedjson() (*asset, error) {
info := bindataFileInfo{
name: "frontend/locale/de-de.untranslated.json",
size: 2,
md5checksum: "",
md5checksum: "99914b932bd37a50b983c5e7c90ae93b",
mode: os.FileMode(436),
modTime: time.Unix(1525536066, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -5704,9 +5706,9 @@ func bindataFrontendLocaleEnusalljson() (*asset, error) {
info := bindataFileInfo{
name: "frontend/locale/en-us.all.json",
size: 1342,
md5checksum: "",
md5checksum: "410ae72527369393afbddd00af4820ab",
mode: os.FileMode(436),
modTime: time.Unix(1525536066, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -5735,9 +5737,9 @@ func bindataFrontendLocaleEnusuntranslatedjson() (*asset, error) {
info := bindataFileInfo{
name: "frontend/locale/en-us.untranslated.json",
size: 2,
md5checksum: "",
md5checksum: "99914b932bd37a50b983c5e7c90ae93b",
mode: os.FileMode(436),
modTime: time.Unix(1525536066, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -8358,9 +8360,9 @@ func bindataFrontendWebfontsFabrands400eot() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-brands-400.eot",
size: 111620,
md5checksum: "",
md5checksum: "9ba26fdd3ac06a9b8f04051488ab9244",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -15212,9 +15214,9 @@ func bindataFrontendWebfontsFabrands400svg() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-brands-400.svg",
size: 599834,
md5checksum: "",
md5checksum: "3619e4601d77994662036eb903b64eee",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -17831,9 +17833,9 @@ func bindataFrontendWebfontsFabrands400ttf() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-brands-400.ttf",
size: 111384,
md5checksum: "",
md5checksum: "f36867cea60d1aee624de459f08cfec3",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -20419,9 +20421,9 @@ func bindataFrontendWebfontsFabrands400woff() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-brands-400.woff",
size: 71560,
md5checksum: "",
md5checksum: "01d529f9d53ade05ea6299ee7b5bedb7",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -22642,9 +22644,9 @@ func bindataFrontendWebfontsFabrands400woff2() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-brands-400.woff2",
size: 61344,
md5checksum: "",
md5checksum: "2cc6ef0b89269cc0a611f791f232bdd9",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -23214,9 +23216,9 @@ func bindataFrontendWebfontsFaregular400eot() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-regular-400.eot",
size: 31260,
md5checksum: "",
md5checksum: "2ba4e5d20c9405250a68c6dfff29eb5e",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -24508,9 +24510,9 @@ func bindataFrontendWebfontsFaregular400svg() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-regular-400.svg",
size: 104914,
md5checksum: "",
md5checksum: "7e62ee01f6e4e617ddfa13b70d925a5a",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -25077,9 +25079,9 @@ func bindataFrontendWebfontsFaregular400ttf() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-regular-400.ttf",
size: 31032,
md5checksum: "",
md5checksum: "4dca4f345e378bf11cba42bda78c41e0",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -25634,9 +25636,9 @@ func bindataFrontendWebfontsFaregular400woff() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-regular-400.woff",
size: 14724,
md5checksum: "",
md5checksum: "a3e0cb30717a51c4aa7e66f77017609c",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -26101,9 +26103,9 @@ func bindataFrontendWebfontsFaregular400woff2() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-regular-400.woff2",
size: 12192,
md5checksum: "",
md5checksum: "c54c2a910d541458abac5807ed605a26",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -28210,9 +28212,9 @@ func bindataFrontendWebfontsFasolid900eot() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-solid-900.eot",
size: 119084,
md5checksum: "",
md5checksum: "b6a6ab31b83ed057dee15ac5e9210790",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -33440,9 +33442,9 @@ func bindataFrontendWebfontsFasolid900svg() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-solid-900.svg",
size: 434854,
md5checksum: "",
md5checksum: "7bc0b08bd858d78a561191a308e0bcd4",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -35545,9 +35547,9 @@ func bindataFrontendWebfontsFasolid900ttf() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-solid-900.ttf",
size: 118864,
md5checksum: "",
md5checksum: "204f540f75f16934eabee56f8e69d1a1",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -37618,9 +37620,9 @@ func bindataFrontendWebfontsFasolid900woff() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-solid-900.woff",
size: 57148,
md5checksum: "",
md5checksum: "b622a71689bd68c262c71be8e9f6080c",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}
@ -39261,9 +39263,9 @@ func bindataFrontendWebfontsFasolid900woff2() (*asset, error) {
info := bindataFileInfo{
name: "frontend/webfonts/fa-solid-900.woff2",
size: 45120,
md5checksum: "",
md5checksum: "88ef9540f6d276fa810d51130502d4fe",
mode: os.FileMode(420),
modTime: time.Unix(1525376330, 0),
modTime: time.Unix(1, 0),
}
a := &asset{bytes: bytes, info: info}

View file

@ -6,9 +6,9 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="/css/bootstrap.min.css" />
<link rel="stylesheet" href="/css/bootswatch.min.css" />
<link rel="stylesheet" href="/css/fontawesome-all.min.css" />
<link rel="stylesheet" href="/css/bootstrap.min.css" integrity="{{SRIHash `/css/bootstrap.min.css`}}" />
<link rel="stylesheet" href="/css/bootswatch.min.css" integrity="{{SRIHash `/css/bootswatch.min.css`}}" />
<link rel="stylesheet" href="/css/fontawesome-all.min.css" integrity="{{SRIHash `/css/fontawesome-all.min.css`}}" />
<title>OTS - One Time Secrets</title>
@ -122,11 +122,11 @@
</div>
</div>
<script src="/js/jquery.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/gibberish-aes.min.js"></script>
<script src="application.js"></script>
<script src="/js/jquery.min.js" integrity="{{SRIHash `/js/jquery.min.js`}}"></script>
<script src="/js/popper.min.js" integrity="{{SRIHash `/js/popper.min.js`}}"></script>
<script src="/js/bootstrap.min.js" integrity="{{SRIHash `/js/bootstrap.min.js`}}"></script>
<script src="/js/gibberish-aes.min.js" integrity="{{SRIHash `/js/gibberish-aes.min.js`}}"></script>
<script src="application.js" integrity="{{SRIHash `application.js`}}"></script>
</body>
</html>

View file

@ -1,6 +1,6 @@
package main
//go:generate go-bindata -pkg $GOPACKAGE -o assets.go ./frontend/...
//go:generate go-bindata -pkg $GOPACKAGE -o assets.go -modtime 1 -md5checksum ./frontend/...
import (
"fmt"
@ -81,7 +81,7 @@ func assetDelivery(res http.ResponseWriter, r *http.Request) {
return
}
tpl, err := template.New(assetName).Funcs(getTFuncMap(r)).Parse(string(assetData))
tpl, err := template.New(assetName).Funcs(addTranslateFunc(tplFuncs, r)).Parse(string(assetData))
if err != nil {
log.Errorf("Template for asset %q has an error: %s", assetName, err)

22
tplFuncs.go Normal file
View file

@ -0,0 +1,22 @@
package main
import (
"crypto/sha512"
"encoding/base64"
"path"
"text/template"
)
var tplFuncs = template.FuncMap{
"SRIHash": assetSRIHash,
}
func assetSRIHash(assetName string) string {
data := MustAsset(path.Join("frontend", assetName))
h := sha512.New384()
h.Write(data)
sum := h.Sum(nil)
return "sha384-" + base64.StdEncoding.EncodeToString(sum)
}

View file

@ -22,7 +22,7 @@ func init() {
}
}
func getTFuncMap(r *http.Request) template.FuncMap {
func addTranslateFunc(t template.FuncMap, r *http.Request) template.FuncMap {
cookie, _ := r.Cookie("lang")
cookieLang := ""
@ -34,7 +34,7 @@ func getTFuncMap(r *http.Request) template.FuncMap {
defaultLang := "en-US" // known valid language
T, _ := i18n.Tfunc(cookieLang, qpLang, acceptLang, defaultLang)
return template.FuncMap{
"T": T,
}
t["T"] = T
return t
}