Skip to content

Commit 37e360b

Browse files
authored
[chore] Dependency updates (#20)
* update dependencies * update changelog
1 parent c0ff32f commit 37e360b

File tree

9 files changed

+1297
-972
lines changed

9 files changed

+1297
-972
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Go
2-
FROM golang:1.19-alpine AS go-builder
2+
FROM golang:1.20-alpine AS go-builder
33
RUN apk add --no-cache upx
44

55
WORKDIR /app

api/go.mod

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,67 @@
11
module group-challenge
22

3-
go 1.18
3+
go 1.20
44

55
require (
66
github.com/gin-contrib/cors v1.4.0
77
github.com/gin-gonic/contrib v0.0.0-20201101042839-6a891bf89f19
8-
github.com/gin-gonic/gin v1.8.1
8+
github.com/gin-gonic/gin v1.9.0
99
github.com/go-pg/pg/v10 v10.10.6
1010
github.com/gofrs/uuid v4.2.0+incompatible
1111
github.com/gorilla/websocket v1.5.0
12-
github.com/jellydator/ttlcache/v3 v3.0.0
13-
github.com/spf13/viper v1.12.0
14-
github.com/zsais/go-gin-prometheus v0.1.1-0.20200217150448-2199a42d96c1
15-
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa
12+
github.com/jellydator/ttlcache/v3 v3.0.1
13+
github.com/prometheus/client_golang v1.12.1
14+
github.com/spf13/viper v1.15.0
15+
golang.org/x/crypto v0.8.0
1616
)
1717

1818
require (
1919
github.com/beorn7/perks v1.0.1 // indirect
20+
github.com/bytedance/sonic v1.8.0 // indirect
2021
github.com/cespare/xxhash/v2 v2.1.2 // indirect
21-
github.com/fsnotify/fsnotify v1.5.4 // indirect
22+
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
23+
github.com/fsnotify/fsnotify v1.6.0 // indirect
2224
github.com/gin-contrib/sse v0.1.0 // indirect
2325
github.com/go-pg/zerochecker v0.2.0 // indirect
24-
github.com/go-playground/locales v0.14.0 // indirect
25-
github.com/go-playground/universal-translator v0.18.0 // indirect
26-
github.com/go-playground/validator/v10 v10.10.1 // indirect
27-
github.com/goccy/go-json v0.9.7 // indirect
26+
github.com/go-playground/locales v0.14.1 // indirect
27+
github.com/go-playground/universal-translator v0.18.1 // indirect
28+
github.com/go-playground/validator/v10 v10.11.2 // indirect
29+
github.com/goccy/go-json v0.10.0 // indirect
2830
github.com/golang/protobuf v1.5.2 // indirect
2931
github.com/hashicorp/hcl v1.0.0 // indirect
3032
github.com/jinzhu/inflection v1.0.0 // indirect
3133
github.com/json-iterator/go v1.1.12 // indirect
34+
github.com/klauspost/cpuid/v2 v2.0.9 // indirect
3235
github.com/leodido/go-urn v1.2.1 // indirect
33-
github.com/magiconair/properties v1.8.6 // indirect
34-
github.com/mattn/go-isatty v0.0.14 // indirect
36+
github.com/magiconair/properties v1.8.7 // indirect
37+
github.com/mattn/go-isatty v0.0.17 // indirect
3538
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
3639
github.com/mitchellh/mapstructure v1.5.0 // indirect
3740
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
3841
github.com/modern-go/reflect2 v1.0.2 // indirect
39-
github.com/pelletier/go-toml v1.9.5 // indirect
40-
github.com/pelletier/go-toml/v2 v2.0.1 // indirect
41-
github.com/prometheus/client_golang v1.12.1 // indirect
42+
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
4243
github.com/prometheus/client_model v0.2.0 // indirect
4344
github.com/prometheus/common v0.33.0 // indirect
4445
github.com/prometheus/procfs v0.7.3 // indirect
45-
github.com/sirupsen/logrus v1.8.1 // indirect
46-
github.com/spf13/afero v1.8.2 // indirect
46+
github.com/spf13/afero v1.9.3 // indirect
4747
github.com/spf13/cast v1.5.0 // indirect
4848
github.com/spf13/jwalterweatherman v1.1.0 // indirect
4949
github.com/spf13/pflag v1.0.5 // indirect
50-
github.com/subosito/gotenv v1.3.0 // indirect
50+
github.com/subosito/gotenv v1.4.2 // indirect
5151
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
52-
github.com/ugorji/go/codec v1.2.7 // indirect
52+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
53+
github.com/ugorji/go/codec v1.2.9 // indirect
5354
github.com/vmihailenco/bufpool v0.1.11 // indirect
5455
github.com/vmihailenco/msgpack/v5 v5.3.4 // indirect
5556
github.com/vmihailenco/tagparser v0.1.2 // indirect
5657
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
57-
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect
58-
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
59-
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
60-
golang.org/x/text v0.3.7 // indirect
61-
google.golang.org/protobuf v1.28.0 // indirect
62-
gopkg.in/ini.v1 v1.66.4 // indirect
63-
gopkg.in/yaml.v2 v2.4.0 // indirect
58+
golang.org/x/arch v0.0.0-20210923205945-b76863e36670 // indirect
59+
golang.org/x/net v0.9.0 // indirect
60+
golang.org/x/sync v0.1.0 // indirect
61+
golang.org/x/sys v0.7.0 // indirect
62+
golang.org/x/text v0.9.0 // indirect
63+
google.golang.org/protobuf v1.28.1 // indirect
64+
gopkg.in/ini.v1 v1.67.0 // indirect
6465
gopkg.in/yaml.v3 v3.0.1 // indirect
6566
mellium.im/sasl v0.2.1 // indirect
6667
)

api/go.sum

Lines changed: 64 additions & 48 deletions
Large diffs are not rendered by default.

api/pkg/group-challenge/api/api.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"group-challenge/pkg/group-challenge/models"
99
"group-challenge/pkg/group-challenge/ws"
1010
"path"
11-
"strings"
1211
"time"
1312

1413
"github.com/gin-contrib/cors"
@@ -17,8 +16,7 @@ import (
1716
"github.com/go-pg/pg/v10"
1817
"github.com/gofrs/uuid"
1918
"github.com/jellydator/ttlcache/v3"
20-
21-
ginprometheus "github.com/zsais/go-gin-prometheus"
19+
"github.com/prometheus/client_golang/prometheus/promhttp"
2220
)
2321

2422
var (
@@ -93,6 +91,14 @@ func createWsHandler() gin.HandlerFunc {
9391
}
9492
}
9593

94+
func prometheusHandler() gin.HandlerFunc {
95+
h := promhttp.Handler()
96+
97+
return func(c *gin.Context) {
98+
h.ServeHTTP(c.Writer, c.Request)
99+
}
100+
}
101+
96102
/*
97103
RunServer starts the server
98104
*/
@@ -132,15 +138,7 @@ func RunServer(serverConfig config.ServerConfig, challengesConfig config.Challen
132138
router.Use(sessionStore.RequireSessionMiddleware([]string{"/_api/v1/parties"}))
133139

134140
// metrics
135-
prometheusMiddleware := ginprometheus.NewPrometheus("gin")
136-
prometheusMiddleware.ReqCntURLLabelMappingFn = func(c *gin.Context) string {
137-
url := c.Request.URL.Path
138-
for _, p := range c.Params {
139-
url = strings.Replace(url, p.Value, p.Key, 1)
140-
}
141-
return url
142-
}
143-
prometheusMiddleware.Use(router)
141+
router.GET("/metrics", prometheusHandler())
144142

145143
// static files
146144
router.Use(static.Serve("/", static.LocalFile(serverConfig.StaticFilesDir, true)))

docker-compose.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ version: "3.9"
22

33
services:
44
postgres:
5-
image: "postgres:14"
5+
image: "postgres:15"
66
restart: always
77
ports:
88
- 5432:5432
99
environment:
1010
POSTGRES_PASSWORD: postgres
1111
POSTGRES_DB: group_challenge
1212
imgProxy:
13-
image: "darthsim/imgproxy:v3.7.1"
14-
ports:
13+
image: "darthsim/imgproxy:v3.16.0"
14+
ports:
1515
- 8081:8081
1616
- 8082:8082
1717
environment:

0 commit comments

Comments
 (0)