Skip to content

Commit

Permalink
🔥 Remove unused env vars and refactor as necessary (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiangolo authored Dec 5, 2024
1 parent cc21462 commit ac112e1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
13 changes: 3 additions & 10 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Domain
# This would be set to the production domain with an env var on deployment
DOMAIN=localhost
# The same hosts used for local development
FRONTEND_HOST=http://localhost:5173
# In staging, this should be
Expand All @@ -16,11 +13,11 @@ API_DOMAIN=api.fastapicloud.site

DEPLOYMENTS_DOMAIN=fastapicloud.club

# Environment: local, staging, production
# Environment: local, development, staging, production
ENVIRONMENT=local

PROJECT_NAME="FastAPI Cloud"
STACK_NAME=fastapi-cloud

RESERVED_APP_NAMES="fastapicloud,fastapilabs,fastapi-cloud,fastapi-labs,fastapilab,fastapi-lab,fastapi,fastapi-cli,sqlmodel,typer,asyncer"

# Backend
Expand Down Expand Up @@ -54,15 +51,11 @@ REDIS_SERVER=localhost
SENTRY_DSN=https://3ea679c3285d327a5c154499df41bce6@o4506985151856640.ingest.us.sentry.io/4506985168371712
BUILDER_SENTRY_DSN=https://352c4969563b6d282b9b1b43f9f75a6d@o4506985151856640.ingest.us.sentry.io/4507940416716800

# Configure these with your own Docker registry images
DOCKER_IMAGE_BACKEND=backend
DOCKER_IMAGE_FRONTEND=frontend

# AWS
AWS_DEPLOYMENT_BUCKET=s3-deployment-customer-apps
ECR_REGISTRY_URL=992382821657.dkr.ecr.us-east-1.amazonaws.com
AWS_REGION=us-east-1
BUILDER_API_URL=http://docker.default.svc.cluster.local
BUILDER_API_URL=http://docker
BUILDER_API_KEY="changethis"

CLOUDFLARE_ACCOUNT_ID=41ebb51429ef1839d2933c1a93b1163f
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/deploy-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ jobs:
working-directory: backend
env:
# Env vars for the app
DOMAIN: "${{ vars.DOMAIN }}"
FRONTEND_HOST: "${{ vars.FRONTEND_HOST }}"
API_HOST: "${{ vars.API_HOST }}"
API_DOMAIN: "${{ vars.API_DOMAIN }}"
DEPLOYMENTS_DOMAIN: "${{ vars.DEPLOYMENTS_DOMAIN }}"
ENVIRONMENT: ${{ matrix.environment }}
PROJECT_NAME: "${{ vars.PROJECT_NAME }}"
STACK_NAME: "${{ vars.STACK_NAME }}"
BACKEND_CORS_ORIGINS: "${{ vars.BACKEND_CORS_ORIGINS }}"
FIRST_SUPERUSER: "${{ vars.FIRST_SUPERUSER }}"
FIRST_SUPERUSER_FULL_NAME: "${{ vars.FIRST_SUPERUSER_FULL_NAME }}"
Expand Down Expand Up @@ -138,14 +136,12 @@ jobs:
IMAGE_URL: ${{ steps.login-ecr.outputs.registry }}/${{ env.ECR_REPOSITORY }}@${{ steps.docker-build.outputs.digest }}

# Env vars for the app
DOMAIN: "${{ vars.DOMAIN }}"
FRONTEND_HOST: "${{ vars.FRONTEND_HOST }}"
API_HOST: "${{ vars.API_HOST }}"
API_DOMAIN: "${{ vars.API_DOMAIN }}"
DEPLOYMENTS_DOMAIN: "${{ vars.DEPLOYMENTS_DOMAIN }}"
ENVIRONMENT: ${{ matrix.environment }}
PROJECT_NAME: "${{ vars.PROJECT_NAME }}"
STACK_NAME: "${{ vars.STACK_NAME }}"
BACKEND_CORS_ORIGINS: "${{ vars.BACKEND_CORS_ORIGINS }}"
FIRST_SUPERUSER: "${{ vars.FIRST_SUPERUSER }}"
FIRST_SUPERUSER_FULL_NAME: "${{ vars.FIRST_SUPERUSER_FULL_NAME }}"
Expand Down
2 changes: 1 addition & 1 deletion backend/app/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def all_cors_origins(self) -> list[str]:
self.FRONTEND_HOST
]

PROJECT_NAME: str
PROJECT_NAME: str = "FastAPI Cloud"
RESERVED_APP_NAMES: Annotated[list[str] | str, BeforeValidator(parse_list_or_str)]
SENTRY_DSN: HttpUrl | None = None

Expand Down

0 comments on commit ac112e1

Please sign in to comment.