From 50f4ddf39d1220782f6e1f7a5c0e5ba0a40c23ec Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Tue, 10 Mar 2026 18:45:18 -0400 Subject: [PATCH] =?UTF-8?q?chore:=20Remove=20mounted=20API=20config=20file?= =?UTF-8?q?=20=E2=80=94=20now=20lives=20in=20aether=5Fapi=5Ffastapi=20repo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit API config is no longer injected via volume mount. app/config.py in the aether_api_fastapi repo reads all settings directly from env vars (.env). Updated README to reflect the new config location. Co-Authored-By: Claude Sonnet 4.6 --- README.md | 2 +- conf/aether_api_config.py | 78 --------------------------------------- 2 files changed, 1 insertion(+), 79 deletions(-) delete mode 100644 conf/aether_api_config.py diff --git a/README.md b/README.md index 4b6a9ca..7357f9f 100644 --- a/README.md +++ b/README.md @@ -108,7 +108,7 @@ These scripts are located in the root directory: ## 📂 Directory Map -* **`conf/`**: Configuration templates for Nginx, Gunicorn, and the API. +* **`conf/`**: Configuration templates for Nginx and Gunicorn. API config now lives in the `aether_api_fastapi` repo as `app/config.py` and reads settings directly from env vars. * **`logs/`**: Centralized logging for all containers. * **`srv/`**: Mount points for data and source code (managed via symlinks). * **`scripts/`**: Internal automation logic. diff --git a/conf/aether_api_config.py b/conf/aether_api_config.py deleted file mode 100644 index 0f94dce..0000000 --- a/conf/aether_api_config.py +++ /dev/null @@ -1,78 +0,0 @@ -# Configuration file for this FastAPI app. -import os -from pydantic import BaseSettings -from typing import Any, Dict, List, Optional, Union - -class Settings(BaseSettings): - AETHER_CFG: Dict[str, Any] = { - "id": os.getenv('AE_CFG_ID', 0) - } - - JWT_KEY: str = os.getenv('AE_API_JWT_KEY', 'EHmSXZFKfMEW65E8kxCKmQ') - - # Database Connection - # We use first-level attributes so BaseSettings can map them automatically if needed, - # but we keep the DB dictionary structure for compatibility with the rest of the app. - DB_SERVER: str = os.getenv('AE_DB_SERVER', 'mariadb') - DB_PORT: str = os.getenv('AE_DB_PORT', '3306') - DB_NAME: str = os.getenv('AE_DB_NAME', 'aether_dev') - DB_USER: str = os.getenv('AE_DB_USERNAME', 'aether_dev') - DB_PASS: str = os.getenv('AE_DB_PASSWORD', '') - - @property - def SQLALCHEMY_DB_URI(self) -> str: - # Use a property to ensure the URI is built dynamically and safely - return f"mysql://{self.DB_USER}:{self.DB_PASS}@{self.DB_SERVER}:{self.DB_PORT}/{self.DB_NAME}" - - @property - def DB(self) -> Dict[str, Any]: - # Compatibility dictionary - return { - "server": self.DB_SERVER, - "port": self.DB_PORT, - "name": self.DB_NAME, - "username": self.DB_USER, - "password": self.DB_PASS, - "connect_timeout": int(os.getenv('AE_DB_CONNECTION_TIMEOUT', 20)), - "pool_recycle": int(os.getenv('AE_DB_POOL_RECYCLE', 1800)) - } - - # Logging - LOG_PATH: Dict[str, str] = { - "app": os.getenv('AE_API_LOG_PATH', '/logs/aether_api.log') - } - - # Redis - REDIS: Dict[str, str] = { - "server": os.getenv('AE_REDIS_SERVER', 'redis'), - "port": os.getenv('AE_REDIS_PORT', '6379') - } - - # --- CRITICAL CONFIGURATIONS --- - # The following dictionaries are REQUIRED by the application logic. - # Do not remove them during refactors, as the app (e.g., lib_email.py) - # accesses these attributes directly on the settings object. - - # Send SMTP Email - # Used by app/lib_email.py for outbound communications. - SMTP: Dict[str, str] = { - "server": os.getenv('AE_SMTP_SERVER', 'linode.oneskyit.com'), - "port": os.getenv('AE_SMTP_PORT', '465'), - "username": os.getenv('AE_SMTP_USERNAME', 'send_mail'), - "password": os.getenv('AE_SMTP_PASSWORD', 'set-in-ae-sql-db-cnf-tbl') - } - - # Server Hosted File Paths - # Used extensively for file uploads, downloads, and exports. - FILES_PATH: Dict[str, str] = { - "hosted_files_root": os.getenv('AE_FILES_PATH_ROOT', '/srv/hosted_files'), - "hosted_tmp_root": os.getenv('AE_FILES_PATH_TMP', '/srv/hosted_tmp') - } - - # --- END CRITICAL CONFIGURATIONS --- - - # CORS - ORIGINS_REGEX: str = os.getenv('AE_API_ORIGINS_REGEX', '(https://.*\.oneskyit\.com)|(https://.*\.oneskyit\.com:4443)') - ORIGINS: List[str] = ['https://oneskyit.com'] - -settings = Settings()