first
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
"""Runtime configuration read from environment variables.
|
||||
|
||||
AppFactory injects variables/secrets as environment variables (see AGENTS.md).
|
||||
This module holds only NON-secret infrastructure configuration. Per-request
|
||||
credentials are never stored here - they arrive in X- headers (see
|
||||
``app.credentials``).
|
||||
"""
|
||||
import os
|
||||
|
||||
# Public app metadata
|
||||
APP_NAME = os.getenv("APP_NAME", "analytics")
|
||||
APP_VERSION = os.getenv("APP_VERSION", "1.0.0")
|
||||
|
||||
# Reverse-proxy prefix injected by AppFactory (e.g. "/apps/analytics").
|
||||
# Empty when running locally at the domain root.
|
||||
ROOT_PATH = os.getenv("ROOT_PATH", "")
|
||||
|
||||
# --- Google Analytics ---------------------------------------------------------
|
||||
# Base URLs are configurable so we can point at a staging/mock endpoint, but
|
||||
# default to the production Google endpoints.
|
||||
GA_DATA_BASE_URL = os.getenv(
|
||||
"GA_DATA_BASE_URL", "https://analyticsdata.googleapis.com/v1beta"
|
||||
)
|
||||
GA_ADMIN_BASE_URL = os.getenv(
|
||||
"GA_ADMIN_BASE_URL", "https://analyticsadmin.googleapis.com/v1beta"
|
||||
)
|
||||
# OAuth scope requested when minting an access token from a service account.
|
||||
# analytics.readonly is sufficient for reporting (Data API) and for listing
|
||||
# accounts/properties/data streams (Admin API read operations).
|
||||
GA_SCOPE = os.getenv(
|
||||
"GA_SCOPE", "https://www.googleapis.com/auth/analytics.readonly"
|
||||
)
|
||||
|
||||
# --- Sklik (Seznam) -----------------------------------------------------------
|
||||
# Sklik "Drak" JSON API. The method name is appended to this base URL and the
|
||||
# HTTP body is a JSON array of positional arguments.
|
||||
SKLIK_BASE_URL = os.getenv("SKLIK_BASE_URL", "https://api.sklik.cz/drak/json/v5")
|
||||
|
||||
# --- HTTP ---------------------------------------------------------------------
|
||||
# Upstream request timeout in seconds.
|
||||
HTTP_TIMEOUT_SECONDS = float(os.getenv("HTTP_TIMEOUT_SECONDS", "60"))
|
||||
Reference in New Issue
Block a user