Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(config): add sample local env files to ease initial setup #548

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions apps/api/env/.env.local.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
NETWORK=sandbox
DB_HOST_WITH_DEFAULT=${DB_HOST:-localhost}
AKASH_DATABASE_CS=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-akash-sandbox
AKASH_SANDBOX_DATABASE_CS=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-akash-sandbox
USER_DATABASE_CS=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-users
POSTGRES_DB_URI=postgres://postgres:password@${DB_HOST_WITH_DEFAULT}:5432/console-users
ANONYMOUS_USER_TOKEN_SECRET=ANONYMOUS_USER_TOKEN_SECRET
MASTER_WALLET_MNEMONIC=MASTER_WALLET_MNEMONIC
UAKT_TOP_UP_MASTER_WALLET_MNEMONIC=UAKT_TOP_UP_MASTER_WALLET_MNEMONIC
USDC_TOP_UP_MASTER_WALLET_MNEMONIC=USDC_TOP_UP_MASTER_WALLET_MNEMONIC

AKASHLYTICS_CORS_WEBSITE_URLS="http://localhost:3000,http://localhost:3001"
GITHUB_PAT=GITHUB_PAT

SERVER_ORIGIN=https://api-sandbox.cloudmos.io
AUTH0_AUDIENCE=https://api.cloudmos.io
AUTH0_ISSUER=AUTH0_ISSUER
AUTH0_JWKS_URI=AUTH0_ISSUER

BILLING_ENABLED=true
DEPLOYMENT_GRANT_DENOM=uakt
STRIPE_SECRET_KEY=STRIPE_SECRET_KEY
STRIPE_PRODUCT_ID=STRIPE_PRODUCT_ID
STRIPE_FIXED_PRICE_ID=STRIPE_FIXED_PRICE_ID
STRIPE_WEBHOOK_SECRET=STRIPE_WEBHOOK_SECRET
STRIPE_CHECKOUT_REDIRECT_URL=http://localhost:3000

SENTRY_ENABLED=true
SENTRY_DSN=SENTRY_DSN
DEPLOYMENT_ENV=local
40 changes: 40 additions & 0 deletions apps/deploy-web/.env.local.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
DEPLOYMENT_ENV=staging

# Provided Auth0 secrets are dummy values which should bypass the schema validation, however wouldn't allow to develop auth related features.
# To get the actual values, an Auth0 account is required.
AUTH0_SECRET=AUTH0_SECRET
AUTH0_BASE_URL=http://localhost:3000
AUTH0_ISSUER_BASE_URL=AUTH0_ISSUER_BASE_URL
AUTH0_CLIENT_ID=AUTH0_CLIENT_ID
AUTH0_CLIENT_SECRET=AUTH0_CLIENT_SECRET
AUTH0_AUDIENCE=AUTH0_AUDIENCE
AUTH0_SCOPE=openid profile email offline_access

NEXT_PUBLIC_BILLING_ENABLED=true
NEXT_PUBLIC_MANAGED_WALLET_NETWORK_ID=sandbox
NEXT_PUBLIC_MANAGED_WALLET_DENOM=uakt

# Create 3 wallets and put their addresses to below.
NEXT_PUBLIC_MASTER_WALLET_ADDRESS=NEXT_PUBLIC_MASTER_WALLET_ADDRESS
NEXT_PUBLIC_UAKT_TOP_UP_MASTER_WALLET_ADDRESS=NEXT_PUBLIC_UAKT_TOP_UP_MASTER_WALLET_ADDRESS
NEXT_PUBLIC_USDC_TOP_UP_MASTER_WALLET_ADDRESS=NEXT_PUBLIC_USDC_TOP_UP_MASTER_WALLET_ADDRESS

NEXT_PUBLIC_API_BASE_URL=http://localhost:3080
NEXT_PUBLIC_STATS_APP_URL=http://localhost:3001
NEXT_PUBLIC_PROVIDER_PROXY_URL=http://localhost:3040
NEXT_PUBLIC_PROVIDER_PROXY_URL_WS=ws://localhost:3040
NEXT_PUBLIC_NODE_ENV=$NODE_ENV
NEXT_PUBLIC_BASE_API_MAINNET_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_BASE_API_TESTNET_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_BASE_API_SANDBOX_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_DEFAULT_NETWORK_ID=mainnet

API_HOST_WITH_DEFAULT=${API_HOST:-localhost}

BASE_API_MAINNET_URL=http://${API_HOST_WITH_DEFAULT}:3080
BASE_API_TESTNET_URL=http://${BASE_API_MAINNET_URL}:3080
BASE_API_SANDBOX_URL=http://${BASE_API_MAINNET_URL}:3080

GITHUB_CLIENT_SECRET=GITHUB_CLIENT_SECRET
BITBUCKET_CLIENT_SECRET=BITBUCKET_CLIENT_SECRET
GITLAB_CLIENT_SECRET=GITLAB_CLIENT_SECRET
17 changes: 17 additions & 0 deletions apps/stats-web/.env.local.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
DEPLOYMENT_ENV=staging

NEXT_PUBLIC_API_BASE_URL=http://localhost:3080
NEXT_PUBLIC_NODE_ENV=$NODE_ENV
NEXT_PUBLIC_BASE_API_MAINNET_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_BASE_API_TESTNET_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_BASE_API_SANDBOX_URL=$NEXT_PUBLIC_API_BASE_URL
NEXT_PUBLIC_DEFAULT_NETWORK_ID=mainnet

API_HOST_WITH_DEFAULT=${API_HOST:-localhost}

BASE_API_MAINNET_URL=http://${API_HOST_WITH_DEFAULT}:3080
BASE_API_TESTNET_URL=http://${BASE_API_MAINNET_URL}:3080
BASE_API_SANDBOX_URL=http://${BASE_API_MAINNET_URL}:3080
LOG_LEVEL=debug

NEXT_PUBLIC_LOG_LEVEL=debug
14 changes: 14 additions & 0 deletions doc/apps-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ DATABASE_HOST=https://prod-db.example.com
SECRET_KEY=PROD_SECRET_KEY
```

#### Sample Local Environment Variables

To facilitate local development, some applications include a `.env.local.sample` file containing environment variables specific to local setups. Sensitive values in these files are set to dummy placeholders, enabling the app to start up and support most features during development.

However, certain functionalities may require real values to work properly. For example:

- **Authentication**: Features dependent on Auth0 will not function unless you provide real Auth0 credentials in the `deploy-web` application's `.env.local` file.
- **Managed Wallet Operations**: Wallet-related functionality will not work unless you create wallets and supply the necessary addresses, mnemonics, etc.

#### Using the Sample Files

1. Copy the `.env.local.sample` file to `.env.local` in the appropriate directory.
2. Update the placeholder values with the actual values as needed.

### Sample Environment Variables Template

A template for setting up the required environment variables is provided in the `env/.env.sample` file for both types of applications. This file contains examples of all the necessary environment variables.
Expand Down
Loading