Coverage for app/config.py: 100.00%

12 statements  

« prev     ^ index     » next       coverage.py v7.15.2, created at 2026-07-25 16:05 +0000

1from pydantic_settings import BaseSettings, SettingsConfigDict 

2 

3 

4class Settings(BaseSettings): 

5 # Celery 

6 CELERY_BROKER_URL: str = "amqp://admin:admin@rabbitmq:5672/" 

7 CELERY_RESULT_BACKEND: str = "redis://redis:6379/0" 

8 

9 # Worker settings 

10 TEMP_REPO_BASE_PATH: str = "/tmp/worker_repos" 

11 

12 # Terraform/Packer paths (installed in container) 

13 TERRAFORM_PATH: str = "/usr/local/bin/terraform" 

14 PACKER_PATH: str = "/usr/local/bin/packer" 

15 

16 # Symmetric Fernet key shared with the backend. The worker never reaches 

17 # the database; it receives ciphertext envelopes via Celery and decrypts 

18 # them in-process with this key. 

19 CREDENTIAL_ENCRYPTION_KEY: str 

20 

21 # Terraform remote state — Postgres connection string for the worker-only 

22 # `postgres-tfstate` container. Empty string means "no remote backend" 

23 # (legacy local-state behaviour, only useful for unit tests). In production 

24 # this is always set; an empty value at task time will raise. 

25 TFSTATE_DATABASE_URL: str = "" 

26 

27 # Git 

28 GIT_ACCESS_TOKEN: str = "" 

29 

30 model_config = SettingsConfigDict( 

31 env_file=".env", 

32 case_sensitive=True, 

33 extra="ignore", 

34 ) 

35 

36 

37settings = Settings()