Use token secret for docker build

This commit is contained in:
andig 2020-10-25 16:06:22 +01:00
parent bbe065deae
commit d43f503474
3 changed files with 5 additions and 4 deletions

View file

@ -17,7 +17,8 @@ COPY go.sum .
RUN go mod download
COPY . .
RUN make clean install assets build
RUN make clean install assets
RUN AUDI_HASH_SECRET={{ env "AUDI_HASH_SECRET" }} make build
#
# STEP 2 build a small image including module support

View file

@ -17,7 +17,7 @@ RUN go mod download
COPY . .
RUN make clean install assets
RUN GOARCH={{ .GoARCH }} GOARM={{ .GoARM }} make build
RUN GOARCH={{ .GoARCH }} GOARM={{ .GoARM }} AUDI_HASH_SECRET={{ env "AUDI_HASH_SECRET" }} make build
#############################
## STEP 2 build a small image

View file

@ -133,8 +133,8 @@ func (v *Audi) authFlow() error {
})
var hash string
var secret []byte
if secret, err = hex.DecodeString(AudiHashSecret); err == nil {
secret, err := hex.DecodeString(AudiHashSecret)
if err == nil {
// timestamp rounded to 100s precision
ts := strconv.FormatInt(time.Now().Unix()/100, 10)