Compare commits

...

4 Commits

Author SHA1 Message Date
1ff0096a24 --
Some checks failed
Sync OpenAPI Spec / sync-spec (push) Successful in 5s
Deploy / DeployService (push) Has been cancelled
Deploy / CreateImage (push) Has been cancelled
2025-09-21 15:27:41 +03:00
4fed99f3de ci: fix runner in apisyncer
Some checks failed
Deploy / DeployService (push) Has been cancelled
Deploy / CreateImage (push) Has been cancelled
2025-09-21 15:26:14 +03:00
ba92325e08 chore: rename api dir\nci: fix base image in containerfile
Some checks failed
Deploy / CreateImage (push) Successful in 3m22s
Deploy / DeployService (push) Successful in 29s
Sync OpenAPI Spec / sync-spec (push) Has been cancelled
2025-09-21 15:13:55 +03:00
2dc5c1e7e0 debug: logging referer\nci: add apisync workflow
Some checks failed
Deploy / CreateImage (push) Failing after 38s
Deploy / DeployService (push) Has been skipped
2025-09-21 15:10:34 +03:00
5 changed files with 51 additions and 2 deletions

@ -0,0 +1,47 @@
name: Sync OpenAPI Spec
on:
push:
branches:
- 'main'
- 'staging'
paths:
- 'api/openapi.yaml'
jobs:
sync-spec:
runs-on: [hubstaging]
steps:
- name: Check out repository code
uses: https://gitea.pena/PenaDevops/actions.git/checkout@v1
- name: Install SSH tools on Alpine
run: |
apk update
apk add --no-cache openssh-client
- name: Set Ssh key
run: |
mkdir -p ~/.ssh
echo "${{ secrets.CENTRAL_REPO_SSH_KEY }}" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
ssh-keyscan -H gitea.pena >> ~/.ssh/known_hosts
- name: Push to Central Repo
run: |
ls ~/.ssh
# Для Gitea используем:
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
echo "Current branch: $CURRENT_BRANCH"
ssh-keygen -l -f ~/.ssh/deploy_key || echo "Key validation failed"
export GIT_SSH_COMMAND="ssh -i ~/.ssh/deploy_key -o IdentitiesOnly=yes"
# Клонируем центральный репозиторий используя SSH
git clone --depth 1 --single-branch --branch $BRANCH_NAME git@gitea.pena:PenaSide/docs.git
# Копируем файл, даём уникальное имя
cp api/openapi.yaml docs/$(echo "${{ gitea.repository }}" | tr '/' '-')-openapi.yaml
cd docs
git config user.name "Gitea Actions Bot"
git config user.email "actions-bot@example.com"
git add .
git commit -m "chore: update OpenAPI spec from ${{ gitea.repository }}"
# Пушим используя SSH
git push

@ -1,5 +1,5 @@
# BUILD
FROM gitea.pena/penadevops/container-images/golang:main as build
FROM gitea.pena/penadevops/container-images/golang:1.23.8-alpine as build
# Update packages and clear cache
RUN apk add --no-cache curl

@ -1,7 +1,7 @@
openapi: 3.0.0
info:
title: Codeword Recovery Service API
version: 1.0.0
version: 1.0
description: API для обработки восстановления паролей для сервиса Codeword.
tags:

@ -11,6 +11,7 @@ import (
"gitea.pena/PenaSide/common/log_mw"
"time"
"strings"
"fmt"
)
type Deps struct {
@ -49,6 +50,7 @@ func (r *RecoveryController) HandleRecoveryRequest(c *fiber.Ctx) error {
}
referralURL := c.Get("Referer")
fmt.Println("REFERRER", referralURL)
if req.RedirectionURL == "" && referralURL != "" {
req.RedirectionURL = referralURL