#!/usr/bin/env python3
"""
Test environment variables loading
"""

import os
from dotenv import load_dotenv

load_dotenv()

print("Environment variables from .env:")
print("=" * 60)

billing_vars = [
    'BILLING_DB_HOST',
    'BILLING_DB_USER', 
    'BILLING_DB_PASS',
    'BILLING_DB_NAME',
    'BILLING_DB_1_HOST',
    'BILLING_DB_1_USER',
    'BILLING_DB_1_PASS',
    'BILLING_DB_1_NAME',
]

for var in billing_vars:
    value = os.getenv(var)
    if value:
        # Mask password for security
        if 'PASS' in var:
            masked = value[:3] + '***' + value[-3:] if len(value) > 6 else '***'
            print(f"{var}: {masked}")
        else:
            print(f"{var}: {value}")
    else:
        print(f"{var}: NOT SET")

print("\nVultr API Key (first few chars):")
vultr_key = os.getenv('VULTR_API_KEY')
if vultr_key:
    print(f"VULTR_API_KEY: {vultr_key[:10]}...")
else:
    print("VULTR_API_KEY: NOT SET")