diff --git a/cmd/api/config.go b/cmd/api/config.go index 008ff92..545351a 100644 --- a/cmd/api/config.go +++ b/cmd/api/config.go @@ -57,6 +57,7 @@ func NewConfig() *config.Config { config.Server.Host = util.GetEnv("SERVICE_API_HOST", "localhost") config.Server.Port = util.GetEnv("SERVICE_API_PORT", 1111) + config.Server.BaseURL = util.GetEnv("SERVICE_API_BASE_URL", "http://localhost:1111") config.Server.Origins = util.GetEnv("SERVICE_API_ORIGINS", []string{"http://localhost:1111"}) config.Server.RequestHeaderMaxSize = 1 << 10 // 1 KB config.Server.RequestBodyMaxSize = 4 << 10 // 4 KB diff --git a/envs/ci/.env b/envs/ci/.env index 187a867..525c77e 100644 --- a/envs/ci/.env +++ b/envs/ci/.env @@ -30,6 +30,7 @@ SERVICE_EXAMPLE_SERVICE_BASE_URL=https://api.nationalize.io # SERVICE_API SERVICE_API_HOST=localhost SERVICE_API_PORT=1111 +SERVICE_API_BASE_URL=http://localhost:1111 SERVICE_API_ORIGINS=http://localhost:1111 # SERVICE_WORKER diff --git a/envs/ci/api.Dockerfile b/envs/ci/api.Dockerfile index 8dff874..e335cfb 100644 --- a/envs/ci/api.Dockerfile +++ b/envs/ci/api.Dockerfile @@ -23,7 +23,7 @@ FROM alpine AS app # Setup TLS RUN apk update && \ - apk add --no-cache ca-certificates && \ + apk add --no-cache ca-certificates tzdata && \ rm -rf /var/cache/apk/* # Running directory has to have the same path as the build one for stacktrace mapping diff --git a/envs/ci/cli.Dockerfile b/envs/ci/cli.Dockerfile index ab19ca5..7501fd5 100644 --- a/envs/ci/cli.Dockerfile +++ b/envs/ci/cli.Dockerfile @@ -23,7 +23,7 @@ FROM alpine AS app # Setup TLS RUN apk update && \ - apk add --no-cache ca-certificates && \ + apk add --no-cache ca-certificates tzdata && \ rm -rf /var/cache/apk/* # Running directory has to have the same path as the build one for stacktrace mapping diff --git a/envs/ci/worker.Dockerfile b/envs/ci/worker.Dockerfile index f1fb3eb..c0f8993 100644 --- a/envs/ci/worker.Dockerfile +++ b/envs/ci/worker.Dockerfile @@ -23,7 +23,7 @@ FROM alpine AS app # Setup TLS RUN apk update && \ - apk add --no-cache ca-certificates && \ + apk add --no-cache ca-certificates tzdata && \ rm -rf /var/cache/apk/* # Running directory has to have the same path as the build one for stacktrace mapping diff --git a/envs/dev/.env.example b/envs/dev/.env.example index debae72..cd3f86e 100644 --- a/envs/dev/.env.example +++ b/envs/dev/.env.example @@ -30,6 +30,7 @@ SERVICE_EXAMPLE_SERVICE_BASE_URL=https://api.nationalize.io # SERVICE_API SERVICE_API_HOST=localhost SERVICE_API_PORT=1111 +SERVICE_API_BASE_URL=http://localhost:1111 SERVICE_API_ORIGINS=http://localhost:1111 SERVICE_API_GILK_PORT=1113 diff --git a/envs/prod/.env.example b/envs/prod/.env.example index 86b4654..3c7926b 100644 --- a/envs/prod/.env.example +++ b/envs/prod/.env.example @@ -34,6 +34,7 @@ SERVICE_EXAMPLE_SERVICE_BASE_URL=https://api.nationalize.io # SERVICE_API SERVICE_API_HOST= SERVICE_API_PORT=1111 +SERVICE_API_BASE_URL= SERVICE_API_ORIGINS= SERVICE_API_RELEASE= diff --git a/envs/prod/api.Dockerfile b/envs/prod/api.Dockerfile index 8dff874..e335cfb 100644 --- a/envs/prod/api.Dockerfile +++ b/envs/prod/api.Dockerfile @@ -23,7 +23,7 @@ FROM alpine AS app # Setup TLS RUN apk update && \ - apk add --no-cache ca-certificates && \ + apk add --no-cache ca-certificates tzdata && \ rm -rf /var/cache/apk/* # Running directory has to have the same path as the build one for stacktrace mapping diff --git a/envs/prod/cli.Dockerfile b/envs/prod/cli.Dockerfile index ab19ca5..7501fd5 100644 --- a/envs/prod/cli.Dockerfile +++ b/envs/prod/cli.Dockerfile @@ -23,7 +23,7 @@ FROM alpine AS app # Setup TLS RUN apk update && \ - apk add --no-cache ca-certificates && \ + apk add --no-cache ca-certificates tzdata && \ rm -rf /var/cache/apk/* # Running directory has to have the same path as the build one for stacktrace mapping diff --git a/envs/prod/worker.Dockerfile b/envs/prod/worker.Dockerfile index f1fb3eb..c0f8993 100644 --- a/envs/prod/worker.Dockerfile +++ b/envs/prod/worker.Dockerfile @@ -23,7 +23,7 @@ FROM alpine AS app # Setup TLS RUN apk update && \ - apk add --no-cache ca-certificates && \ + apk add --no-cache ca-certificates tzdata && \ rm -rf /var/cache/apk/* # Running directory has to have the same path as the build one for stacktrace mapping diff --git a/go.mod b/go.mod index 5396941..f3ba25d 100644 --- a/go.mod +++ b/go.mod @@ -7,10 +7,10 @@ require ( github.com/labstack/echo/v4 v4.11.4 github.com/leporo/sqlf v1.4.0 github.com/mkideal/cli v0.2.7 - github.com/neoxelox/errors v0.2.0 - github.com/neoxelox/kit v0.37.0 + github.com/neoxelox/errors v0.3.0 + github.com/neoxelox/kit v0.39.0 github.com/rs/xid v1.5.0 - golang.org/x/text v0.14.0 + golang.org/x/text v0.16.0 ) require ( @@ -19,7 +19,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/eapache/go-resiliency v1.6.0 // indirect - github.com/getsentry/sentry-go v0.27.0 // indirect + github.com/getsentry/sentry-go v0.28.0 // indirect github.com/go-redis/cache/v8 v8.4.4 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect @@ -62,8 +62,8 @@ require ( go.uber.org/atomic v1.11.0 // indirect golang.org/x/crypto v0.22.0 // indirect golang.org/x/net v0.24.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.19.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.21.0 // indirect golang.org/x/term v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect google.golang.org/protobuf v1.33.0 // indirect diff --git a/go.sum b/go.sum index 43ec165..4e9aa53 100644 --- a/go.sum +++ b/go.sum @@ -49,8 +49,8 @@ github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7z github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/getsentry/sentry-go v0.27.0 h1:Pv98CIbtB3LkMWmXi4Joa5OOcwbmnX88sF5qbK3r3Ps= -github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.28.0 h1:7Rqx9M3ythTKy2J6uZLHmc8Sz9OGgIlseuO1iBX/s0M= +github.com/getsentry/sentry-go v0.28.0/go.mod h1:1fQZ+7l7eeJ3wYi82q5Hg8GqAPgefRq+FP/QhafYVgg= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -217,15 +217,16 @@ github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/neoxelox/errors v0.2.0 h1:AhvCMJAjUBFCP3PgZHbY6SS8Sc9fxx/DiawU5Cd5RxE= -github.com/neoxelox/errors v0.2.0/go.mod h1:gCPnC7z8Qwswwz5Usv3WORxvan9Q6WSrDTvzaQyl7oM= +github.com/neoxelox/errors v0.3.0 h1:m4XLsUxw4lfis70l3IyWy+wU1O7XCGr1iG8QizVdcW4= +github.com/neoxelox/errors v0.3.0/go.mod h1:419HQZjLsxlgk/bP+jmZSYTBIXGxYOrnJ3TtRYuQfIo= github.com/neoxelox/gilk v0.5.0 h1:Knw/TgSUnwPDIRJbqoTmG98gYsmKojNCJ5WAjALoWFc= github.com/neoxelox/gilk v0.5.0/go.mod h1:Q+WgmSMKWd5UAaVjLSmGPbVD11AmHFhlo3QrPum0vo0= -github.com/neoxelox/kit v0.37.0 h1:Oyeg56MIlJNgAJv5RmW5H3fTumfWY29LJzAmf1WX5+8= -github.com/neoxelox/kit v0.37.0/go.mod h1:t21ZtTIT1nOgLV6AtUcIZPuXiij+8XWJyJDJAs/QBAw= +github.com/neoxelox/kit v0.39.0 h1:1IcIW/xi4w4PpII4kQ70uYxIphK5M0uY4heMhdgqme8= +github.com/neoxelox/kit v0.39.0/go.mod h1:76+gub3MqourI1xxCPbxEkm19Br7fBSS/SKEKgtJgC0= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= -github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= @@ -349,8 +350,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= -golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -374,8 +375,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -408,8 +409,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws= +golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -426,8 +427,9 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -444,8 +446,8 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.10.0 h1:tvDr/iQoUqNdohiYm0LmmKcBk+q86lb9EprIUFhHHGg= -golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190410155217-1f06c39b4373/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190513163551-3ee3066db522/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/pkg/config/entity.go b/pkg/config/entity.go index b1be27e..8dc34e8 100644 --- a/pkg/config/entity.go +++ b/pkg/config/entity.go @@ -59,6 +59,7 @@ type ConfigCache struct { type ConfigServer struct { Host string Port int + BaseURL string Origins []string RequestHeaderMaxSize int RequestBodyMaxSize int