diff options
Diffstat (limited to '')
| -rw-r--r-- | backend/.env.example | 1 | ||||
| -rw-r--r-- | backend/go.mod | 4 | ||||
| -rw-r--r-- | backend/go.sum | 9 | ||||
| -rw-r--r-- | backend/main.go | 11 |
4 files changed, 25 insertions, 0 deletions
diff --git a/backend/.env.example b/backend/.env.example index b0a7101..0318aa1 100644 --- a/backend/.env.example +++ b/backend/.env.example | |||
| @@ -12,3 +12,4 @@ B2_KEY_ID=123456789ABCDEF | |||
| 12 | B2_API_KEY=123456789ABCDEF | 12 | B2_API_KEY=123456789ABCDEF |
| 13 | B2_DOWNLOAD_URL=https://lphub.s3.eu-central-001.backblazeb2.com/ | 13 | B2_DOWNLOAD_URL=https://lphub.s3.eu-central-001.backblazeb2.com/ |
| 14 | LOCAL_DEMOS_PATH=/path/to/demos/ | 14 | LOCAL_DEMOS_PATH=/path/to/demos/ |
| 15 | NEWRELIC_LICENSE_KEY=abcdef123456789 | ||
diff --git a/backend/go.mod b/backend/go.mod index e6f87c4..f9fe0db 100644 --- a/backend/go.mod +++ b/backend/go.mod | |||
| @@ -32,9 +32,13 @@ require ( | |||
| 32 | github.com/josharian/intern v1.0.0 // indirect | 32 | github.com/josharian/intern v1.0.0 // indirect |
| 33 | github.com/klauspost/cpuid/v2 v2.2.8 // indirect | 33 | github.com/klauspost/cpuid/v2 v2.2.8 // indirect |
| 34 | github.com/mailru/easyjson v0.7.7 // indirect | 34 | github.com/mailru/easyjson v0.7.7 // indirect |
| 35 | github.com/newrelic/go-agent/v3 v3.40.1 // indirect | ||
| 36 | github.com/newrelic/go-agent/v3/integrations/nrgin v1.4.1 // indirect | ||
| 35 | github.com/twitchyliquid64/golang-asm v0.15.1 // indirect | 37 | github.com/twitchyliquid64/golang-asm v0.15.1 // indirect |
| 36 | golang.org/x/arch v0.10.0 // indirect | 38 | golang.org/x/arch v0.10.0 // indirect |
| 37 | golang.org/x/tools v0.25.0 // indirect | 39 | golang.org/x/tools v0.25.0 // indirect |
| 40 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect | ||
| 41 | google.golang.org/grpc v1.65.0 // indirect | ||
| 38 | gopkg.in/yaml.v3 v3.0.1 // indirect | 42 | gopkg.in/yaml.v3 v3.0.1 // indirect |
| 39 | ) | 43 | ) |
| 40 | 44 | ||
diff --git a/backend/go.sum b/backend/go.sum index 59301ae..f655023 100644 --- a/backend/go.sum +++ b/backend/go.sum | |||
| @@ -74,6 +74,10 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w | |||
| 74 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= | 74 | github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= |
| 75 | github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= | 75 | github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= |
| 76 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= | 76 | github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= |
| 77 | github.com/newrelic/go-agent/v3 v3.40.1 h1:8nb4R252Fpuc3oySvlHpDwqySqaPWL5nf7ZVEhqtUeA= | ||
| 78 | github.com/newrelic/go-agent/v3 v3.40.1/go.mod h1:X0TLXDo+ttefTIue1V96Y5seb8H6wqf6uUq4UpPsYj8= | ||
| 79 | github.com/newrelic/go-agent/v3/integrations/nrgin v1.4.1 h1:a1waTQToxDTKd31LpwpaFHKWPj8Dav/BrzZayBiiAq8= | ||
| 80 | github.com/newrelic/go-agent/v3/integrations/nrgin v1.4.1/go.mod h1:mEbfsZIxBYIPT7FzboYvE+ed2ft4SCFXoCvleI2v5JQ= | ||
| 77 | github.com/pektezol/bitreader v1.4.3 h1:+WjsD6qOAaI6Q1jOOlEJcnaEso8vPMKRZnnaDnZhTSg= | 81 | github.com/pektezol/bitreader v1.4.3 h1:+WjsD6qOAaI6Q1jOOlEJcnaEso8vPMKRZnnaDnZhTSg= |
| 78 | github.com/pektezol/bitreader v1.4.3/go.mod h1:xBQEsQpOf8B5yPrnOTkirZGyVUV6Bqp0ups2RIlTskk= | 82 | github.com/pektezol/bitreader v1.4.3/go.mod h1:xBQEsQpOf8B5yPrnOTkirZGyVUV6Bqp0ups2RIlTskk= |
| 79 | github.com/pektezol/steam_go v1.1.2 h1:fta6SW+La8NfmCtR/Kn73bAmTBvCgUkkLCplsJGzx7g= | 83 | github.com/pektezol/steam_go v1.1.2 h1:fta6SW+La8NfmCtR/Kn73bAmTBvCgUkkLCplsJGzx7g= |
| @@ -150,6 +154,11 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc | |||
| 150 | golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= | 154 | golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE= |
| 151 | golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= | 155 | golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg= |
| 152 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= | 156 | golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= |
| 157 | google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= | ||
| 158 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 h1:Zy9XzmMEflZ/MAaA7vNcoebnRAld7FsPW1EeBB7V0m8= | ||
| 159 | google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157/go.mod h1:EfXuqaE1J41VCDicxHzUDm+8rk+7ZdXzHV0IhO/I6s0= | ||
| 160 | google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= | ||
| 161 | google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= | ||
| 153 | google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= | 162 | google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= |
| 154 | google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= | 163 | google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= |
| 155 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= | 164 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= |
diff --git a/backend/main.go b/backend/main.go index a1a4a20..e422359 100644 --- a/backend/main.go +++ b/backend/main.go | |||
| @@ -11,6 +11,8 @@ import ( | |||
| 11 | 11 | ||
| 12 | "github.com/gin-gonic/gin" | 12 | "github.com/gin-gonic/gin" |
| 13 | "github.com/joho/godotenv" | 13 | "github.com/joho/godotenv" |
| 14 | nrgin "github.com/newrelic/go-agent/v3/integrations/nrgin" | ||
| 15 | "github.com/newrelic/go-agent/v3/newrelic" | ||
| 14 | ) | 16 | ) |
| 15 | 17 | ||
| 16 | // @title Least Portals Hub | 18 | // @title Least Portals Hub |
| @@ -30,7 +32,16 @@ func main() { | |||
| 30 | if os.Getenv("ENV") == "PROD" { | 32 | if os.Getenv("ENV") == "PROD" { |
| 31 | gin.SetMode(gin.ReleaseMode) | 33 | gin.SetMode(gin.ReleaseMode) |
| 32 | } | 34 | } |
| 35 | app, err := newrelic.NewApplication( | ||
| 36 | newrelic.ConfigAppName("lphub"), | ||
| 37 | newrelic.ConfigLicense(os.Getenv("NEWRELIC_LICENSE_KEY")), | ||
| 38 | newrelic.ConfigAppLogForwardingEnabled(true), | ||
| 39 | ) | ||
| 40 | if err != nil { | ||
| 41 | log.Fatal("Error instrumenting newrelic") | ||
| 42 | } | ||
| 33 | router := gin.Default() | 43 | router := gin.Default() |
| 44 | router.Use(nrgin.Middleware(app)) | ||
| 34 | database.ConnectDB() | 45 | database.ConnectDB() |
| 35 | api.InitRoutes(router) | 46 | api.InitRoutes(router) |
| 36 | // for debugging | 47 | // for debugging |