fix: Dockerfile for private repo

This commit is contained in:
skeris 2024-03-14 12:55:33 +03:00
parent bf7133846c
commit a9bf4486c3
3 changed files with 12 additions and 6 deletions

@ -8,7 +8,11 @@ WORKDIR /app
# Create binary directory
RUN mkdir /app/bin -p
# Add main files to app
RUN apk add git
ADD . .
ENV GOPRIVATE=penahub.gitlab.yandexcloud.net/backend/penahub_common
RUN git config --global url."https://buildToken:glpat-axA8ttckx3aPf_xd2Dym@penahub.gitlab.yandexcloud.net/".insteadOf "https://penahub.gitlab.yandexcloud.net/"
RUN go mod download
# Build app
RUN GOOS=linux go build -o bin ./...

@ -32,6 +32,12 @@ services:
DEFAULT_REDIRECTION_URL: 'https://shub.pena.digital/'
AUTH_EXCHANGE_URL: 'http://10.6.0.11:59300/auth/exchange'
RECOVER_URL: 'https://shub.pena.digital/codeword/recover/'
JWT_AUDIENCE: 'pena'
JWT_ISSUER: 'pena-auth-service'
JWT_PUBLIC_KEY: "-----BEGIN PUBLIC KEY-----\nMIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgHgnvr7O2tiApjJfid1orFnIGm6980fZp+Lpbjo+NC/0whMFga2Biw5b1G2Q/B2u0tpO1Fs/E8z7Lv1nYfr5jx2S8x6BdA4TS2kB9Kf0wn0+7wSlyikHoKhbtzwXHZl17GsyEi6wHnsqNBSauyIWhpha8i+Y+3GyaOY536H47qyXAgMBAAE=\n-----END PUBLIC KEY-----"
KAFKA_BROKERS: "10.6.0.11:9092"
KAFKA_TOPIC_TARIFF: "tariffs"
DISCOUNT_ADDRESS: "http://10.6.0.11:9001"
ports:
- 59664:3000
networks:

@ -75,11 +75,7 @@ func (r *RecoveryController) HandleRecoveryRequest(c *fiber.Ctx) error {
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{"error": "Internal Server Error"})
}
<<<<<<< HEAD
signUrl := redirectionURL
=======
signUrl := req.RedirectionURL
>>>>>>> dev
sign := base64.URLEncoding.EncodeToString(key)
id, err := r.service.StoreRecoveryRecord(c.Context(), models.StoreRecDeps{
@ -114,12 +110,12 @@ func (r *RecoveryController) HandleRecoveryLink(c *fiber.Ctx) error {
record, err := r.service.GetRecoveryRecord(c.Context(), sign)
if err != nil {
r.logger.Error("Recovery link expired", zap.String("signature", key))
r.logger.Error("Recovery link expired", zap.String("signature", sign))
return c.Redirect("https://shub.pena.digital/recover/expired")
}
if time.Since(record.CreatedAt) > 15*time.Minute {
r.logger.Error("Recovery link expired", zap.String("signature", key))
r.logger.Error("Recovery link expired", zap.String("signature", sign))
return c.Redirect(record.SignUrl+"/expired")
}