diff --git a/Dockerfile b/Dockerfile index bdbc8b746..72b4bba3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/docker/tmpl.Dockerfile b/docker/tmpl.Dockerfile index 08b10e4a5..753e07900 100644 --- a/docker/tmpl.Dockerfile +++ b/docker/tmpl.Dockerfile @@ -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 diff --git a/vehicle/audi.go b/vehicle/audi.go index 16586a450..054293741 100644 --- a/vehicle/audi.go +++ b/vehicle/audi.go @@ -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)