diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52d75f3..ec7d1d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: "1.22.1" - name: Build run: go build . diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4666511..1d28917 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -15,15 +15,15 @@ on: pull_request: branches: ["main"] +permissions: + packages: write + jobs: build_and_push: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: "main" - fetch-depth: 0 - name: Docker meta id: meta @@ -45,18 +45,12 @@ jobs: id: buildx uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ github.repository_owner }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} - password: ${{ secrets.GH_TOKEN }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v5 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d0d85a1..5a7ba14 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version: "1.22.1" - name: Install dependencies run: go get . diff --git a/Dockerfile b/Dockerfile index 857032f..6c42f4a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.22-alpine3.19 AS builder +FROM golang:1.22.1-alpine3.19 AS builder ARG BUILD_VERSION diff --git a/src/go.mod b/src/go.mod index 16ee68f..05e7af4 100644 --- a/src/go.mod +++ b/src/go.mod @@ -1,18 +1,18 @@ module immich-exp -go 1.22 +go 1.22.1 require ( github.com/joho/godotenv v1.5.1 - github.com/prometheus/client_golang v1.18.0 + github.com/prometheus/client_golang v1.19.0 ) require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect - github.com/prometheus/client_model v0.5.0 // indirect - github.com/prometheus/common v0.46.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect - golang.org/x/sys v0.17.0 // indirect - google.golang.org/protobuf v1.32.0 // indirect + github.com/prometheus/client_model v0.6.0 // indirect + github.com/prometheus/common v0.50.0 // indirect + github.com/prometheus/procfs v0.13.0 // indirect + golang.org/x/sys v0.18.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect ) diff --git a/src/go.sum b/src/go.sum index b6024d3..b219d92 100644 --- a/src/go.sum +++ b/src/go.sum @@ -4,19 +4,19 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= -github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= -github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= -github.com/prometheus/common v0.46.0 h1:doXzt5ybi1HBKpsZOL0sSkaNHJJqkyfEWZGGqqScV0Y= -github.com/prometheus/common v0.46.0/go.mod h1:Tp0qkxpb9Jsg54QMe+EAmqXkSV7Evdy1BTn+g2pa/hQ= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= +github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= +github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/src/immich/data.go b/src/immich/data.go index 318c7c7..4ca0995 100644 --- a/src/immich/data.go +++ b/src/immich/data.go @@ -45,7 +45,7 @@ var httpGetJobs = Data{ HTTPMethod: http.MethodGet, } -var unmarshalError = "Can not unmarshal JSON" +var unmarshalError = "Can not unmarshal JSON " func Allrequests(r *prometheus.Registry) { @@ -95,8 +95,9 @@ func GetAllUsers(c chan func() (*API.StructAllUsers, error)) { } else { result := new(API.StructAllUsers) + unmarshalErr := unmarshalError + "for all users" if err := json.Unmarshal(body, &result); err != nil { - logger.Log.Error(unmarshalError) + logger.Log.Error(unmarshalErr) } c <- (func() (*API.StructAllUsers, error) { return result, nil }) @@ -117,8 +118,9 @@ func ServerVersion(r *prometheus.Registry) { } else { var result API.StructServerVersion + unmarshalErr := unmarshalError + "for all server version" if err := json.Unmarshal(body, &result); err != nil { - logger.Log.Error(unmarshalError) + logger.Log.Error(unmarshalErr) } prom.SendBackMessageserverVersion(&result, r) @@ -137,8 +139,9 @@ func ServerInfo(c chan func() (*API.StructServerInfo, error)) { } else { result := new(API.StructServerInfo) + unmarshalErr := unmarshalError + "for all server info" if err := json.Unmarshal(body, &result); err != nil { - logger.Log.Error(unmarshalError) + logger.Log.Error(unmarshalErr) } c <- (func() (*API.StructServerInfo, error) { return result, nil }) return @@ -158,8 +161,9 @@ func GetAllJobsStatus(c chan func() (*API.StructAllJobsStatus, error)) { } else { result := new(API.StructAllJobsStatus) + unmarshalErr := unmarshalError + "for jobs status" if err := json.Unmarshal(body, &result); err != nil { - logger.Log.Error(unmarshalError) + logger.Log.Error(unmarshalErr) } c <- (func() (*API.StructAllJobsStatus, error) { return result, nil }) return @@ -179,7 +183,7 @@ func Apirequest(uri string, method string) (*http.Response, error) { client := &http.Client{} resp, err := client.Do(req) if err != nil { - err := fmt.Errorf("Can't connect to server") + err := fmt.Errorf("can't connect to server") mutex.Lock() if !models.GetPromptError() { logger.Log.Error(err.Error())