chore: update version/readme; minor auth logging and settings usage

This commit is contained in:
Shroominic
2025-09-08 10:53:41 +01:00
parent bb9991e7a5
commit 939a991d6b
3 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -91,7 +91,7 @@ The most common settings are shown below. See `.env.example` for the full list.
- `UPSTREAM_BASE_URL` – URL of the OpenAI-compatible service - `UPSTREAM_BASE_URL` – URL of the OpenAI-compatible service
- `UPSTREAM_API_KEY` – API key for the upstream service (optional) - `UPSTREAM_API_KEY` – API key for the upstream service (optional)
- `MODEL_BASED_PRICING` – Set to `true` to use pricing from `models.json` - `FIXED_PRICING` – Set to `true` to use a fixed per-request price; `false` (default) uses model pricing from `models.json`
- `ADMIN_PASSWORD` – Password for the `/admin/` dashboard - `ADMIN_PASSWORD` – Password for the `/admin/` dashboard
- `CASHU_MINTS` – Comma-separated list of Cashu mint URLs - `CASHU_MINTS` – Comma-separated list of Cashu mint URLs
- `NAME` – Name of the proxy - `NAME` – Name of the proxy
-4
View File
@@ -1,7 +1,3 @@
import dotenv
dotenv.load_dotenv()
from .core.main import app as fastapi_app # noqa from .core.main import app as fastapi_app # noqa
__all__ = ["fastapi_app"] __all__ = ["fastapi_app"]
+4 -8
View File
@@ -7,18 +7,14 @@ from sqlmodel import col, update
from .core import get_logger from .core import get_logger
from .core.db import ApiKey, AsyncSession from .core.db import ApiKey, AsyncSession
from .core.settings import settings
from .payment.cost_caculation import ( from .payment.cost_caculation import (
CostData, CostData,
CostDataError, CostDataError,
MaxCostData, MaxCostData,
calculate_cost, calculate_cost,
) )
from .wallet import ( from .wallet import credit_balance, deserialize_token_from_string
PRIMARY_MINT_URL,
TRUSTED_MINTS,
credit_balance,
deserialize_token_from_string,
)
logger = get_logger(__name__) logger = get_logger(__name__)
@@ -165,12 +161,12 @@ async def validate_bearer_key(
"has_expiry_time": bool(key_expiry_time), "has_expiry_time": bool(key_expiry_time),
}, },
) )
if token_obj.mint in TRUSTED_MINTS: if token_obj.mint in settings.cashu_mints:
refund_currency = token_obj.unit refund_currency = token_obj.unit
refund_mint_url = token_obj.mint refund_mint_url = token_obj.mint
else: else:
refund_currency = "sat" refund_currency = "sat"
refund_mint_url = PRIMARY_MINT_URL refund_mint_url = settings.primary_mint
new_key = ApiKey( new_key = ApiKey(
hashed_key=hashed_key, hashed_key=hashed_key,