From b4bc47a047f8d72d9d6ded14f9ac83b9647446c0 Mon Sep 17 00:00:00 2001 From: gibbyDev Date: Sat, 20 Jun 2026 16:39:03 -0400 Subject: [PATCH] changed dockerfiles to be compatible with new protoc --- .gitea/workflows/deploy.yml | 29 +++++++++++++++++++++++++---- README.md | 2 +- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 66ad4b1..9bb3864 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -19,17 +19,38 @@ jobs: mkdir -p ~/.ssh chmod 700 ~/.ssh - # Accept raw private key or base64-encoded private key in DEPLOY_SSH_KEY. - if printf "%s" "$DEPLOY_SSH_KEY" | grep -q "BEGIN OPENSSH PRIVATE KEY"; then - printf "%s\n" "$DEPLOY_SSH_KEY" | tr -d '\r' > ~/.ssh/id_ed25519 + # Accept one of these DEPLOY_SSH_KEY formats: + # 1) Raw private key with real newlines + # 2) Raw private key with literal \n escapes + # 3) Base64-encoded private key + KEY_RAW="$(printf "%s" "$DEPLOY_SSH_KEY" | tr -d '\r')" + + if printf "%s" "$KEY_RAW" | grep -q "BEGIN OPENSSH PRIVATE KEY"; then + if printf "%s" "$KEY_RAW" | grep -q "\\n"; then + printf "%b\n" "$KEY_RAW" > ~/.ssh/id_ed25519 + else + printf "%s\n" "$KEY_RAW" > ~/.ssh/id_ed25519 + fi else - printf "%s" "$DEPLOY_SSH_KEY" | tr -d '\r' | base64 -d > ~/.ssh/id_ed25519 + printf "%s" "$KEY_RAW" | base64 -d > ~/.ssh/id_ed25519 fi chmod 600 ~/.ssh/id_ed25519 ssh-keygen -y -f ~/.ssh/id_ed25519 >/dev/null ssh-keyscan -p "${DEPLOY_PORT:-22}" -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts + - name: Verify deploy SSH connectivity + env: + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }} + run: | + set -euo pipefail + ssh -o BatchMode=yes -o StrictHostKeyChecking=yes \ + -p "${DEPLOY_PORT:-22}" \ + -i ~/.ssh/id_ed25519 \ + "$DEPLOY_USER@$DEPLOY_HOST" "true" + - name: Deploy latest main env: DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} diff --git a/README.md b/README.md index ff19725..78a3185 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Go Microservices -Test for actions workflows +Test for actions workflows. Test number 2 Go-based microservices backend with a REST API gateway, gRPC service-to-service communication, JWT auth, and local observability tooling. ## Overview