Skip to content

Commit

Permalink
feat: Move public api keys to secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Oct 17, 2024
1 parent 673dda1 commit 382acd0
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,13 @@ jobs:
ES_PASSWORD: ${{ secrets.ES_PASSWORD }}
WINDOWS_CREDENTIAL_ID_SIGNER: ${{ secrets.WINDOWS_CREDENTIAL_ID_SIGNER }}
ES_TOTP_SECRET: ${{ secrets.ES_TOTP_SECRET }}
# Segment API Key
SEGMENT_API_KEY: ${{ secrets.SEGMENT_API_KEY }}
# Sentry AUTH Token
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# AWS Secrets
AWS_ACCESS_KEY_ID: ${{ secrets.EXPLORER_TEAM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.EXPLORER_TEAM_AWS_DEFAULT_REGION }}
AWS_S3_BUCKET: ${{ secrets.EXPLORER_TEAM_S3_BUCKET }}
10 changes: 10 additions & 0 deletions .github/workflows/manual-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ jobs:
- run: npm run build
env:
MODE: production
# Segment API Key
SEGMENT_API_KEY: ${{ secrets.SEGMENT_API_KEY }}
# Sentry AUTH Token
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# AWS Secrets
AWS_ACCESS_KEY_ID: ${{ secrets.EXPLORER_TEAM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.EXPLORER_TEAM_AWS_DEFAULT_REGION }}
AWS_S3_BUCKET: ${{ secrets.EXPLORER_TEAM_S3_BUCKET }}

# Download 'SSLcom/esigner-codesign' to a folder called 'esigner-codesign' in the root of the project
- name: Checkout esigner-codesign repository (Windows)
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,23 @@ on:
ES_TOTP_SECRET:
description: 'Password to decrypt the certificate file'
required: true
SEGMENT_API_KEY:
description: 'Segment API key'
required: true
SENTRY_AUTH_TOKEN:
description: 'Sentry auth token'
required: true
SENTRY_DSN:
description: 'Sentry DSN to perform the requests'
required: true
EXPLORER_TEAM_AWS_ACCESS_KEY_ID:
required: true
EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY:
required: true
EXPLORER_TEAM_AWS_DEFAULT_REGION:
required: true
EXPLORER_TEAM_S3_BUCKET:
required: true

concurrency:
group: release-${{ github.ref }}
Expand Down Expand Up @@ -79,8 +94,16 @@ jobs:
env:
MODE: production
DRY_RUN: ${{ inputs.dry-run }}
# Sentry Auth Token
# Segment API Key
SEGMENT_API_KEY: ${{ secrets.SEGMENT_API_KEY }}
# Sentry AUTH Token
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
# AWS Secrets
AWS_ACCESS_KEY_ID: ${{ secrets.EXPLORER_TEAM_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.EXPLORER_TEAM_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.EXPLORER_TEAM_AWS_DEFAULT_REGION }}
AWS_S3_BUCKET: ${{ secrets.EXPLORER_TEAM_S3_BUCKET }}

- name: Generate Release Version
id: version
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getOSName, PLATFORM } from './helpers';

// Initialize Sentry
Sentry.init({
dsn: 'https://47fa1e9f4bfed88d2a4b2bdd7b3d48b6@o4504361728212992.ingest.us.sentry.io/4507924285161472',
dsn: import.meta.env.VITE_SENTRY_DSN,
enabled: import.meta.env.PROD,
});

Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/analytics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { v4 as uuid } from 'uuid';
import { type ANALYTICS_EVENTS } from './types';

const APP_ID = 'decentraland-launcher';
const SEGMENT_KEY = '4gsiGKen1LyWATLxpZpsGI9iGYyAEBAF';
const SEGMENT_KEY = import.meta.env.VITE_SEGMENT_API_KEY;

const noopAnalytics = {
track(_: Record<string, string>, resolve: () => void) {
Expand Down

0 comments on commit 382acd0

Please sign in to comment.