Adding image hashing and verification to 'make all'

This commit is contained in:
Ben Yanke
2018-05-11 22:58:18 -05:00
parent dc90cd6819
commit f0cf6488e4
3 changed files with 48 additions and 41 deletions
+3
View File
@@ -4,4 +4,7 @@ glauth.cfg
# Ignore the built binary during testing
glauth
# Built binaries
bin
.*.swp
+6 -4
View File
@@ -4,7 +4,7 @@ VERSION=$(shell bin/glauth64 --version)
run:
go run glauth.go bindata.go ldapbackend.go webapi.go configbackend.go -c glauth.cfg
all: bindata binaries
all: bindata binaries verify
binaries: bindata linux32 linux64 darwin64
@@ -12,11 +12,13 @@ bindata:
go-bindata -pkg=main assets
linux32: bindata
GOOS=linux GOARCH=386 go build -o bin/glauth32 glauth.go bindata.go ldapbackend.go webapi.go configbackend.go
GOOS=linux GOARCH=386 go build -o bin/glauth32 glauth.go bindata.go ldapbackend.go webapi.go configbackend.go && cd bin && sha256sum glauth32 > glauth32.sha256
linux64: bindata
GOOS=linux GOARCH=amd64 go build -o bin/glauth64 glauth.go bindata.go ldapbackend.go webapi.go configbackend.go
GOOS=linux GOARCH=amd64 go build -o bin/glauth64 glauth.go bindata.go ldapbackend.go webapi.go configbackend.go && cd bin && sha256sum glauth64 > glauth64.sha256
darwin64: bindata
GOOS=darwin GOARCH=amd64 go build -o bin/glauthOSX glauth.go bindata.go ldapbackend.go webapi.go configbackend.go
GOOS=darwin GOARCH=amd64 go build -o bin/glauthOSX glauth.go bindata.go ldapbackend.go webapi.go configbackend.go && cd bin && sha256sum glauthOSX > glauthOSX.sha256
verify:
cd bin && sha256sum *.sha256 -c && cd ../;
+39 -37
View File
@@ -1,10 +1,10 @@
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io"
"bytes"
"compress/gzip"
"fmt"
"io"
)
func bindata_read(data []byte, name string) ([]byte, error) {
@@ -24,34 +24,6 @@ func bindata_read(data []byte, name string) ([]byte, error) {
return buf.Bytes(), nil
}
func assets_glauth_css() ([]byte, error) {
return bindata_read([]byte{
0x1f, 0x8b, 0x08, 0x00, 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x4c, 0x22, 0x88,
0x73, 0x65, 0x1e, 0xad, 0x0f, 0xb2, 0xc3, 0x98, 0x3a, 0x40, 0x3f, 0x65,
0xe6, 0x5b, 0xad, 0x44, 0xeb, 0x4c, 0xd6, 0xad, 0x4f, 0xaa, 0x12, 0xed,
0x33, 0x16, 0x49, 0x05, 0x9d, 0x5f, 0x52, 0x2b, 0xd4, 0x52, 0xaf, 0xff,
0xf8, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x91, 0x33, 0xcc, 0x6e, 0xee, 0x01,
0x00, 0x00,
},
"assets/glauth.css",
)
}
func assets_glauth_js() ([]byte, error) {
return bindata_read([]byte{
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0xa4, 0x54,
@@ -94,7 +66,7 @@ func assets_glauth_js() ([]byte, error) {
0x43, 0xdd, 0xe0, 0xd3, 0x14, 0x3d, 0xc0, 0xfa, 0xc3, 0xe1, 0xd5, 0xf8,
0x2f, 0x00, 0x00, 0xff, 0xff, 0x1d, 0x12, 0x43, 0xad, 0x6a, 0x05, 0x00,
0x00,
},
},
"assets/glauth.js",
)
}
@@ -198,11 +170,40 @@ func assets_index_html() ([]byte, error) {
0x90, 0xb4, 0xee, 0x77, 0xcb, 0x26, 0x38, 0x89, 0x7d, 0x68, 0x93, 0xd8,
0x7f, 0x06, 0xff, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x08, 0x9c, 0x44, 0x70,
0x17, 0x0f, 0x00, 0x00,
},
},
"assets/index.html",
)
}
func assets_glauth_css() ([]byte, error) {
return bindata_read([]byte{
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x00, 0xff, 0x8c, 0x8f,
0xc1, 0x72, 0x83, 0x20, 0x14, 0x45, 0xf7, 0x7c, 0xc5, 0x9b, 0x71, 0x1d,
0x47, 0x0d, 0xa6, 0x60, 0xbe, 0x86, 0x07, 0x4f, 0xa5, 0x35, 0xe0, 0x00,
0x69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, 0x52, 0x2b, 0xd4, 0x52, 0xaf, 0xff,
0xf8, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x91, 0x33, 0xcc, 0x6e, 0xee, 0x01,
0x00, 0x00,
},
"assets/glauth.css",
)
}
// Asset loads and returns the asset for the given name.
// It returns an error if the asset could not be found or
// could not be loaded.
@@ -214,8 +215,9 @@ func Asset(name string) ([]byte, error) {
}
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() ([]byte, error){
"assets/glauth.css": assets_glauth_css,
"assets/glauth.js": assets_glauth_js,
var _bindata = map[string] func() ([]byte, error) {
"assets/glauth.js": assets_glauth_js,
"assets/index.html": assets_index_html,
"assets/glauth.css": assets_glauth_css,
}