build(deps): bump Go to 1.24 (#2060)

* build(deps): bump Go to 1.24
This commit is contained in:
ze0s 2025-05-01 16:36:55 +02:00 committed by GitHub
parent b980b5530d
commit 1ae8624e05
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 15 additions and 24 deletions

View file

@ -21,7 +21,7 @@ on:
- cron: '20 13 * * 6' - cron: '20 13 * * 6'
env: env:
GO_VERSION: '1.23' GO_VERSION: '1.24'
NODE_VERSION: '20.17.0' NODE_VERSION: '20.17.0'
jobs: jobs:

View file

@ -9,7 +9,7 @@ on:
pull_request: pull_request:
env: env:
GO_VERSION: '1.23' GO_VERSION: '1.24'
NODE_VERSION: '20.17.0' NODE_VERSION: '20.17.0'
jobs: jobs:

View file

@ -26,7 +26,7 @@ on:
env: env:
REGISTRY: ghcr.io REGISTRY: ghcr.io
REGISTRY_IMAGE: ghcr.io/${{ github.repository }} REGISTRY_IMAGE: ghcr.io/${{ github.repository }}
GO_VERSION: '1.23' GO_VERSION: '1.24'
NODE_VERSION: '20.17.0' NODE_VERSION: '20.17.0'
permissions: permissions:

View file

@ -11,7 +11,7 @@ COPY web ./
RUN pnpm run build RUN pnpm run build
# build app # build app
FROM golang:1.23-alpine3.20 AS app-builder FROM golang:1.24-alpine3.21 AS app-builder
ARG VERSION=dev ARG VERSION=dev
ARG REVISION=dev ARG REVISION=dev

View file

@ -1,5 +1,5 @@
# build app # build app
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS app-builder FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.21 AS app-builder
RUN apk add --no-cache git tzdata RUN apk add --no-cache git tzdata
ENV SERVICE=autobrr ENV SERVICE=autobrr

View file

@ -1,5 +1,5 @@
# build app # build app
FROM --platform=$BUILDPLATFORM golang:1.23-alpine3.20 AS app-builder FROM --platform=$BUILDPLATFORM golang:1.24-alpine3.20 AS app-builder
RUN apk add --no-cache git tzdata RUN apk add --no-cache git tzdata
ENV SERVICE=autobrr ENV SERVICE=autobrr

2
go.mod
View file

@ -1,6 +1,6 @@
module github.com/autobrr/autobrr module github.com/autobrr/autobrr
go 1.23.2 go 1.24
replace github.com/r3labs/sse/v2 => github.com/autobrr/sse/v2 v2.0.0-20230520125637-530e06346d7d replace github.com/r3labs/sse/v2 => github.com/autobrr/sse/v2 v2.0.0-20230520125637-530e06346d7d

View file

@ -6,7 +6,6 @@ package list
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"fmt"
"net/http" "net/http"
"strings" "strings"
@ -19,17 +18,14 @@ func (s *service) trakt(ctx context.Context, list *domain.List) error {
l := s.log.With().Str("type", "trakt").Str("list", list.Name).Logger() l := s.log.With().Str("type", "trakt").Str("list", list.Name).Logger()
if list.URL == "" { if list.URL == "" {
errMsg := "no URL provided for steam" return errors.Errorf("no URL provided for trakt: %s", list.Name)
l.Error().Msg(errMsg)
return fmt.Errorf(errMsg)
} }
l.Debug().Msgf("fetching titles from %s", list.URL) l.Debug().Msgf("fetching titles from %s", list.URL)
req, err := http.NewRequestWithContext(ctx, http.MethodGet, list.URL, nil) req, err := http.NewRequestWithContext(ctx, http.MethodGet, list.URL, nil)
if err != nil { if err != nil {
l.Error().Err(err).Msg("could not make new request") return errors.Wrapf(err, "could not make new request for URL: %s", list.URL)
return err
} }
req.Header.Set("trakt-api-version", "2") req.Header.Set("trakt-api-version", "2")
@ -44,20 +40,17 @@ func (s *service) trakt(ctx context.Context, list *domain.List) error {
resp, err := s.httpClient.Do(req) resp, err := s.httpClient.Do(req)
if err != nil { if err != nil {
l.Error().Err(err).Msgf("failed to fetch titles from URL: %s", list.URL) return errors.Wrapf(err, "failed to fetch titles from URL: %s", list.URL)
return err
} }
defer resp.Body.Close() defer resp.Body.Close()
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
l.Error().Msgf("failed to fetch titles from URL: %s", list.URL) return errors.Errorf("failed to fetch titles from URL: %s", list.URL)
return fmt.Errorf("failed to fetch titles from URL: %s", list.URL)
} }
contentType := resp.Header.Get("Content-Type") contentType := resp.Header.Get("Content-Type")
if !strings.HasPrefix(contentType, "application/json") { if !strings.HasPrefix(contentType, "application/json") {
errMsg := fmt.Sprintf("invalid content type for URL: %s, content type should be application/json", list.URL) return errors.Errorf("invalid content type for URL: %s, content type should be application/json", list.URL)
return fmt.Errorf(errMsg)
} }
var data []struct { var data []struct {
@ -71,8 +64,7 @@ func (s *service) trakt(ctx context.Context, list *domain.List) error {
} }
if err := json.NewDecoder(resp.Body).Decode(&data); err != nil { if err := json.NewDecoder(resp.Body).Decode(&data); err != nil {
l.Error().Err(err).Msgf("failed to decode JSON data from URL: %s", list.URL) return errors.Wrapf(err, "failed to decode JSON data from URL: %s", list.URL)
return err
} }
var titles []string var titles []string

View file

@ -141,7 +141,7 @@ func (s *service) Test(ctx context.Context, proxy *domain.Proxy) error {
} }
if resp.StatusCode != http.StatusOK { if resp.StatusCode != http.StatusOK {
return errors.New(resp.Status) return errors.New("got unexpected status code: %d", resp.StatusCode)
} }
s.log.Debug().Msgf("proxy %s test OK!", proxy.Addr) s.log.Debug().Msgf("proxy %s test OK!", proxy.Addr)

View file

@ -7,7 +7,6 @@ import (
"bytes" "bytes"
"context" "context"
"encoding/json" "encoding/json"
"fmt"
"net/http" "net/http"
"reflect" "reflect"
"strconv" "strconv"
@ -186,7 +185,7 @@ func (c *rpcClient) doCall(ctx context.Context, request RPCRequest) (*RPCRespons
if err != nil { if err != nil {
if httpResponse.StatusCode >= 400 { if httpResponse.StatusCode >= 400 {
return nil, errors.Wrap(err, fmt.Sprintf("rpc call %v() on %v status code: %v. Could not decode body to rpc response", request.Method, httpRequest.URL.String(), httpResponse.StatusCode)) return nil, errors.Wrap(err, "rpc call %v() on %v status code: %v. Could not decode body to rpc response", request.Method, httpRequest.URL.String(), httpResponse.StatusCode)
} }
// if res.StatusCode == http.StatusUnauthorized { // if res.StatusCode == http.StatusUnauthorized {
// return nil, errors.New("unauthorized: bad credentials") // return nil, errors.New("unauthorized: bad credentials")