Bläddra i källkod

modified backend

tomoya 2 år sedan
förälder
incheckning
99c839bb57
1 ändrade filer med 15 tillägg och 34 borttagningar
  1. 15 34
      backend/app/app/core/config.py

+ 15 - 34
backend/app/app/core/config.py

@@ -9,12 +9,12 @@ class Settings(BaseSettings):
     SECRET_KEY: str = secrets.token_urlsafe(32)
     # 60 minutes * 24 hours * 8 days = 8 days
     ACCESS_TOKEN_EXPIRE_MINUTES: int = 60 * 24 * 8
-    SERVER_NAME: str 
-    SERVER_HOST: AnyHttpUrl 
+    SERVER_NAME: str  = "cloud.choozmo.com:8080"
+    SERVER_HOST: AnyHttpUrl  = "http://cloud.choozmo.com:8080"
     # BACKEND_CORS_ORIGINS is a JSON-formatted list of origins
     # e.g: '["http://localhost", "http://localhost:4200", "http://localhost:3000", \
     # "http://localhost:8080", "http://local.dockertoolbox.tiangolo.com"]'
-    BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = []
+    BACKEND_CORS_ORIGINS: List[AnyHttpUrl] = ["https://cloud.choozmo:8080", "http://cloud.choozmo.com:8080", "https://cloud.choozmo.com", "http://cloud.choozmo.com","http://172.105.219.42", "http://local.ai-anchor.com:5173", "http://local.ai-anchor.com:8080", "http://localhost", "http://localhost:4200", "http://localhost:3000", "http://localhost:5173", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.ai-anchor.com:3000", "http://dev.ai-anchor.com:5173", "http://dev.ai-anchor.com:8080"]
     
     @validator("BACKEND_CORS_ORIGINS", pre=True)
     def assemble_cors_origins(cls, v: Union[str, List[str]]) -> Union[List[str], str]:
@@ -25,19 +25,13 @@ class Settings(BaseSettings):
         raise ValueError(v)
     
     PROJECT_NAME: str = "ai-anchor"
-    SENTRY_DSN: Optional[HttpUrl] = None
+    SENTRY_DSN: Optional[HttpUrl] = "http://SENTRY_DSN"
 
     @validator("SENTRY_DSN", pre=True)
     def sentry_dsn_can_be_blank(cls, v: str) -> Optional[str]:
         if len(v) == 0:
             return None
-        return v
-
-    POSTGRES_SERVER: str
-    POSTGRES_USER: str
-    POSTGRES_PASSWORD: str
-    POSTGRES_DB: str
-    SQLALCHEMY_DATABASE_URI: Optional[PostgresDsn] = None
+        return 
 
     '''
     @validator("SQLALCHEMY_DATABASE_URI", pre=True)
@@ -52,19 +46,6 @@ class Settings(BaseSettings):
             path=f"/{values.get('POSTGRES_DB') or ''}",
         )
     '''
-    '''
-    @validator("SQLALCHEMY_DATABASE_URI", pre=True)
-    def assemble_db_connection(cls, v: Optional[str], values: Dict[str, Any]) -> Any:
-        if isinstance(v, str):
-            return v
-        return PostgresDsn.build(
-            scheme="mysql",
-            user="choozmo",
-            password="pAssw0rd",
-            host="db.ptt.cx:3306",
-            path=f"/ai-anchor",
-        )
-    '''
 
     SMTP_TLS: bool = True
     SMTP_PORT: Optional[int] = None
@@ -93,20 +74,20 @@ class Settings(BaseSettings):
         )
 
     EMAIL_TEST_USER: EmailStr = "test@example.com"  # type: ignore
-    FIRST_SUPERUSER: EmailStr
-    FIRST_SUPERUSER_PASSWORD: str
+    FIRST_SUPERUSER: EmailStr = "admin@ai-anchor.com"
+    FIRST_SUPERUSER_PASSWORD: str = "password"
     USERS_OPEN_REGISTRATION: bool = False
 
-    MEMBERSHIP_TYPES: List[str]
-    PROGRESS_TYPES: List[str]
-
-    SERVER_ADDRESS: AnyHttpUrl
+    PROGRESS_STATE: List[str] = ['waiting', 'processing', 'completed']
+    MEMBERSHIP_STATUS : List[str] = ['normal', 'infinite']
+    
+    SERVER_ADDRESS: AnyHttpUrl = "http://172.105.219.42:8080"
 
-    CELERY_ZIP_STORAGE: str
-    CELERY_VIDEO_STORAGE: str
+    CELERY_ZIP_STORAGE: str = "/celery_storage/zips"
+    CELERY_VIDEO_STORAGE: str = "/celery_storage/videos"
 
-    BACKEND_ZIP_STORAGE: str
-    BACKEND_VIDEO_STORAGE: str
+    BACKEND_ZIP_STORAGE: str = "/backend_storage/zips"
+    BACKEND_VIDEO_STORAGE: str = "/backend_storage/videos"
 
     class Config:
         case_sensitive = True