Align env templates with shared secret inventory

This commit is contained in:
Alexa Amundson
2025-11-16 19:58:22 -06:00
parent a59e0113ee
commit 9e0b06a0a0
5 changed files with 40 additions and 7 deletions

View File

@@ -24,7 +24,15 @@ router = APIRouter(prefix="/api/digitalocean", tags=["digitalocean"])
# DigitalOcean API configuration
DO_API_URL = "https://api.digitalocean.com/v2"
DO_TOKEN = os.getenv("DIGITALOCEAN_TOKEN", "")
def get_digital_ocean_token() -> str:
"""Return the configured DigitalOcean API key, preferring the canonical name."""
return os.getenv("DIGITAL_OCEAN_API_KEY") or os.getenv("DIGITALOCEAN_TOKEN", "")
DO_TOKEN = get_digital_ocean_token()
class DropletCreate(BaseModel):