From ba506c503c7aa2fb7f217d60e3ec4442e649feea Mon Sep 17 00:00:00 2001 From: Bartek Wrona Date: Wed, 26 Nov 2025 00:42:01 +0100 Subject: [PATCH 1/3] Eliminated .env file bash processing to avoid problems with complex value variables --- .gitlab-ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7da38b3..8e0ab34 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -177,8 +177,16 @@ deploy_prototyping_environment: script: # First start helper proxy, which redirects traffic to backend and frontend accordingly # This way we can use publicly one endpoint: https://prototyping.openhive.network both for the app like pointing backend - - ./scripts/ci-helpers/backend-api-proxy/start_api_proxy.sh - - !reference [.webapp_deploy_template, script] + - | + ./scripts/ci-helpers/backend-api-proxy/start_api_proxy.sh + # credits of solution for gitlab bug: https://gitlab.com/gitlab-org/gitlab/-/issues/294292#note_1070210709 + export DEPLOYMENT_ENV_FILE=${!DEPLOYMENT_ENV_FILE} + ./scripts/run_instance.sh \ + --image="$IMAGE_NAME" \ + --name="$CONTAINER_NAME" \ + --port=$PORT \ + --env-file="${DEPLOYMENT_ENV_FILE}" \ + --detach rules: - if: '$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH && $CI_COMMIT_REF_PROTECTED == "true"' -- GitLab From 30c93eac0dfeab968cd5440a17d02872302e63a8 Mon Sep 17 00:00:00 2001 From: Bartek Wrona Date: Wed, 26 Nov 2025 02:42:12 +0100 Subject: [PATCH 2/3] Eliminated hardcoded GoogleWallet API issuer ID --- server/api/google-wallet.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/api/google-wallet.ts b/server/api/google-wallet.ts index e086294..32689c2 100644 --- a/server/api/google-wallet.ts +++ b/server/api/google-wallet.ts @@ -2,9 +2,6 @@ import { GoogleAuth } from 'google-auth-library'; import { defineEventHandler, readBody } from 'h3'; import jwt from 'jsonwebtoken'; -const issuerId = '3388000000023034095'; -const classId = `${issuerId}.codelab_class`; - const init = () => { const config = useRuntimeConfig(); @@ -39,6 +36,11 @@ export default defineEventHandler(async (event) => { if (!credentials.client_email || !credentials.private_key) throw createError({ statusCode: 500, message: 'Invalid service account credentials' }); + const appRuntimeConfig = useRuntimeConfig(); + const issuerId = appRuntimeConfig.googleWalletIssuerId; + const classId = `${issuerId}.codelab_class`; + + // Use service account email for object suffix const objectSuffix = `${credentials.client_email.replace(/[^\w.-]/g, '_')}`; const objectId = `${issuerId}.${objectSuffix}.${operationalPublicKey}`; -- GitLab From 9fd8ef156997b3d9c89fbcdfe304c1158fb296a9 Mon Sep 17 00:00:00 2001 From: Bartek Wrona Date: Wed, 26 Nov 2025 02:42:46 +0100 Subject: [PATCH 3/3] Added ability to specify Google Wallet IssuerID using env. --- .env.example | 3 ++- nuxt.config.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index b7525ca..f119fc5 100644 --- a/.env.example +++ b/.env.example @@ -15,6 +15,7 @@ NUXT_PUBLIC_CTOKENS_API_URL= NUXT_PUBLIC_HIVE_NODE_ENDPOINT= NUXT_PUBLIC_HIVE_CHAIN_ID= NUXT_GOOGLE_APPLICATION_CREDENTIALS_JSON= - +# Your Google Wallet Issuer ID. You can find it on Google Pay and Wallet Console -> Google Wallet API, as IssuerID +NUXT_GOOGLE_WALLET_ISSUER_ID= # For development, you can set a mock server URL # NUXT_PUBLIC_CTOKENS_API_URL=http://localhost:8080/mock-ctokens-api diff --git a/nuxt.config.ts b/nuxt.config.ts index 3fef0e1..ea17f4d 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -62,6 +62,7 @@ export default defineNuxtConfig({ snapOrigin: '', snapVersion: '' }, - googleApplicationCredentialsJson: {} + googleApplicationCredentialsJson: {}, + googleWalletIssuerId: '' } }); -- GitLab