diff --git a/.github/actions/set_aws_creds_env_vars/action.yml b/.github/actions/set_aws_creds_env_vars/action.yml index 0a173dbd..ee38e01b 100644 --- a/.github/actions/set_aws_creds_env_vars/action.yml +++ b/.github/actions/set_aws_creds_env_vars/action.yml @@ -53,6 +53,12 @@ inputs: CLOUDFLARE_API_BASE_URL: description: 'The base URL for the Cloudflare API' required: true + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE: + description: 'The Namespace key for the project Cloudflare KV Storage' + required: true + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID: + description: 'The Namespace ID for the project Cloudflare KV Storage' + required: true MARQO_API_KEY: description: 'The API key for the Marqo API' required: true @@ -107,10 +113,6 @@ runs: echo ZITADEL_ENCRYPTION_KEY=${{ inputs.ZITADEL_ENCRYPTION_KEY }} >> .env echo ZITADEL_INSTANCE_HOST=${{ inputs.ZITADEL_INSTANCE_HOST }} >> .env echo ZITADEL_BOT_ADMIN_TOKEN=${{ inputs.ZITADEL_BOT_ADMIN_TOKEN }} >> .env - echo CLOUDFLARE_ACCOUNT_ID=${{ inputs.CLOUDFLARE_ACCOUNT_ID }} >> .env - echo CLOUDFLARE_KV_NAMESPACE_ID=${{ inputs.CLOUDFLARE_KV_NAMESPACE_ID }} >> .env - echo CLOUDFLARE_API_TOKEN=${{ inputs.CLOUDFLARE_API_TOKEN }} >> .env - echo CLOUDFLARE_API_BASE_URL=${{ inputs.CLOUDFLARE_API_BASE_URL }} >> .env echo MARQO_API_KEY=${{ inputs.MARQO_API_KEY }} >> .env echo PROD_MARQO_API_BASE_URL=${{ inputs.PROD_MARQO_API_BASE_URL }} >> .env echo DEV_MARQO_API_BASE_URL=${{ inputs.DEV_MARQO_API_BASE_URL }} >> .env @@ -122,6 +124,12 @@ runs: echo DEV_STRIPE_PUBLISHABLE_KEY=${{ inputs.DEV_STRIPE_PUBLISHABLE_KEY }} >> .env echo DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET=${{ inputs.DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET }} >> .env echo PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET=${{ inputs.PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET }} >> .env + echo CLOUDFLARE_ACCOUNT_ID=${{ inputs.CLOUDFLARE_ACCOUNT_ID }} >> .env + echo CLOUDFLARE_KV_NAMESPACE_ID=${{ inputs.CLOUDFLARE_KV_NAMESPACE_ID }} >> .env + echo CLOUDFLARE_API_TOKEN=${{ inputs.CLOUDFLARE_API_TOKEN }} >> .env + echo CLOUDFLARE_API_BASE_URL=${{ inputs.CLOUDFLARE_API_BASE_URL }} >> .env + echo CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE=${{ inputs.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE }} >> .env + echo CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID=${{ inputs.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID }} >> .env - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: diff --git a/.github/workflows/deploy-dev.yml b/.github/workflows/deploy-dev.yml index 75b26328..e4b1119c 100644 --- a/.github/workflows/deploy-dev.yml +++ b/.github/workflows/deploy-dev.yml @@ -50,17 +50,13 @@ jobs: SCRAPINGBEE_API_KEY: ${{ secrets.SCRAPINGBEE_API_KEY }} GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - OPENAI_API_BASE_URL: ${{ secrets.OPENAI_API_KEY }} + OPENAI_API_BASE_URL: ${{ secrets.OPENAI_API_BASE_URL }} ZITADEL_CLIENT_ID: ${{ secrets.ZITADEL_CLIENT_ID }} ZITADEL_CLIENT_SECRET: ${{ secrets.ZITADEL_CLIENT_SECRET }} ZITADEL_PROJECT_ID: ${{ secrets.ZITADEL_PROJECT_ID }} ZITADEL_ENCRYPTION_KEY: ${{ secrets.ZITADEL_ENCRYPTION_KEY }} ZITADEL_INSTANCE_HOST: ${{ secrets.ZITADEL_INSTANCE_HOST }} ZITADEL_BOT_ADMIN_TOKEN: ${{ secrets.ZITADEL_BOT_ADMIN_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - CLOUDFLARE_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_NAMESPACE_ID }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_API_BASE_URL: ${{ secrets.CLOUDFLARE_API_BASE_URL }} MARQO_API_KEY: ${{ secrets.MARQO_API_KEY }} PROD_MARQO_API_BASE_URL: ${{ secrets.PROD_MARQO_API_BASE_URL }} DEV_MARQO_API_BASE_URL: ${{ secrets.DEV_MARQO_API_BASE_URL }} @@ -73,6 +69,12 @@ jobs: DEV_STRIPE_PUBLISHABLE_KEY: ${{ secrets.DEV_STRIPE_PUBLISHABLE_KEY }} DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET: ${{ secrets.DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET }} PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET: ${{ secrets.PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET }} + CLOUDFLARE_API_BASE_URL: ${{ secrets.CLOUDFLARE_API_BASE_URL }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_NAMESPACE_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE: ${{ secrets.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE }} + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID }} - name: Generate Cloudflare locations Go file uses: './.github/actions/generate_cloudflare_locations_file' - name: Deploy AWS resources via SST diff --git a/.github/workflows/deploy-feature.yml b/.github/workflows/deploy-feature.yml index 4881b1d1..e84bb547 100644 --- a/.github/workflows/deploy-feature.yml +++ b/.github/workflows/deploy-feature.yml @@ -64,10 +64,6 @@ jobs: ZITADEL_ENCRYPTION_KEY: ${{ secrets.ZITADEL_ENCRYPTION_KEY }} ZITADEL_INSTANCE_HOST: ${{ secrets.ZITADEL_INSTANCE_HOST }} ZITADEL_BOT_ADMIN_TOKEN: ${{ secrets.ZITADEL_BOT_ADMIN_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - CLOUDFLARE_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_NAMESPACE_ID }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_API_BASE_URL: ${{ secrets.CLOUDFLARE_API_BASE_URL }} MARQO_API_KEY: ${{ secrets.MARQO_API_KEY }} PROD_MARQO_API_BASE_URL: ${{ secrets.PROD_MARQO_API_BASE_URL }} DEV_MARQO_API_BASE_URL: ${{ secrets.DEV_MARQO_API_BASE_URL }} @@ -80,6 +76,12 @@ jobs: DEV_STRIPE_PUBLISHABLE_KEY: ${{ secrets.DEV_STRIPE_PUBLISHABLE_KEY }} DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET: ${{ secrets.DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET }} PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET: ${{ secrets.PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET }} + CLOUDFLARE_API_BASE_URL: ${{ secrets.CLOUDFLARE_API_BASE_URL }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_NAMESPACE_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE: ${{ secrets.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE }} + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID }} # Not set because this is dynamic in lower environments # APEX_URL: ${{ secrets.APEX_URL }} - name: Generate Cloudflare locations Go file diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index b65553aa..1e38d58a 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -57,10 +57,6 @@ jobs: ZITADEL_ENCRYPTION_KEY: ${{ secrets.ZITADEL_ENCRYPTION_KEY }} ZITADEL_INSTANCE_HOST: ${{ secrets.ZITADEL_INSTANCE_HOST }} ZITADEL_BOT_ADMIN_TOKEN: ${{ secrets.ZITADEL_BOT_ADMIN_TOKEN }} - CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - CLOUDFLARE_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_NAMESPACE_ID }} - CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} - CLOUDFLARE_API_BASE_URL: ${{ secrets.CLOUDFLARE_API_BASE_URL }} MARQO_API_KEY: ${{ secrets.MARQO_API_KEY }} PROD_MARQO_API_BASE_URL: ${{ secrets.PROD_MARQO_API_BASE_URL }} DEV_MARQO_API_BASE_URL: ${{ secrets.DEV_MARQO_API_BASE_URL }} @@ -73,6 +69,12 @@ jobs: DEV_STRIPE_PUBLISHABLE_KEY: ${{ secrets.DEV_STRIPE_PUBLISHABLE_KEY }} DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET: ${{ secrets.DEV_STRIPE_CHECKOUT_WEBHOOK_SECRET }} PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET: ${{ secrets.PROD_STRIPE_CHECKOUT_WEBHOOK_SECRET }} + CLOUDFLARE_API_BASE_URL: ${{ secrets.CLOUDFLARE_API_BASE_URL }} + CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + CLOUDFLARE_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_KV_NAMESPACE_ID }} + CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE: ${{ secrets.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE }} + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID: ${{ secrets.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID }} - name: Generate Cloudflare locations Go file uses: './.github/actions/generate_cloudflare_locations_file' - name: Deploy AWS resources via SST diff --git a/stacks/shared/env.ts b/stacks/shared/env.ts index 79c1793a..7880af89 100644 --- a/stacks/shared/env.ts +++ b/stacks/shared/env.ts @@ -9,10 +9,12 @@ export default { ZITADEL_ENCRYPTION_KEY: process.env.ZITADEL_ENCRYPTION_KEY, ZITADEL_INSTANCE_HOST: process.env.ZITADEL_INSTANCE_HOST, ZITADEL_BOT_ADMIN_TOKEN: process.env.ZITADEL_BOT_ADMIN_TOKEN, + CLOUDFLARE_API_BASE_URL: process.env.CLOUDFLARE_API_BASE_URL, CLOUDFLARE_ACCOUNT_ID: process.env.CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_KV_NAMESPACE_ID: process.env.CLOUDFLARE_KV_NAMESPACE_ID, CLOUDFLARE_API_TOKEN: process.env.CLOUDFLARE_API_TOKEN, - CLOUDFLARE_API_BASE_URL: process.env.CLOUDFLARE_API_BASE_URL, + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE: process.env.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE, + CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID: process.env.CLOUDFLARE_MNM_SUBDOMAIN_KV_NAMESPACE_ID, MARQO_API_KEY: process.env.MARQO_API_KEY, PROD_MARQO_API_BASE_URL: process.env.PROD_MARQO_API_BASE_URL, DEV_MARQO_API_BASE_URL: process.env.DEV_MARQO_API_BASE_URL,