From c2c9c81e0a2f5f6cc0b117d7d0b04ea67b8a9e95 Mon Sep 17 00:00:00 2001 From: hoang Date: Thu, 24 Sep 2026 10:02:17 +0700 Subject: [PATCH] Add Promgen API configuration documentation We've added a new page to the Promgen documentation to guide administrators on configuring settings related to the Promgen API. --- docs/conf/api.rst | 40 ++++++++++++++++++++++++++++++++++++++++ docs/conf/index.rst | 1 + 2 files changed, 41 insertions(+) create mode 100644 docs/conf/api.rst diff --git a/docs/conf/api.rst b/docs/conf/api.rst new file mode 100644 index 000000000..12d7b053c --- /dev/null +++ b/docs/conf/api.rst @@ -0,0 +1,40 @@ +Configuring Promgen API +======================= + +Promgen API configuration is configurable via environment variables. + +The following settings are available: + + +API_TOKEN_MAX_QUOTA +------------------- +[Integer | default = None] + +Number of tokens a user is allowed to create. The default is None, which means unlimited. + +*This setting applies to API token creation on the Promgen Site and API endpoint but is not enforced +on the Django Admin Site. The Promgen Admin can create tokens on the Django Admin Site without restrictions.* + + +API_TOKEN_TTL_DAYS +------------------- +[Integer | default = None] + +Maximum number of days an API token is valid for. When set, Promgen will not allow the creation of +API tokens with expiry greater than this setting. The default is None, which means unlimited. + +*This setting applies to API token creation on the Promgen Site and API endpoint but is not enforced +on the Django Admin Site. The Promgen Admin can create tokens on the Django Admin Site without restrictions.* + + +V2_API_LOGGING_ENABLED +----------------------- +[Boolean | default = True] + +This setting enables logging of all V2 API (endpoints starts with "/rest/v2/") requests and +responses, providing a clear record of actions performed through these APIs. + +For requests, the method, path, and request body are logged. However, fields in the request body +are truncated to avoid filling up the log. By default, the character limit is set to 128, but fields +like "clause" are still logged in full as they are necessary. For responses, only the status and +response content size are logged. A unique trace ID is generated to link the request and response logs. diff --git a/docs/conf/index.rst b/docs/conf/index.rst index 6ca28883b..d6c51fe52 100644 --- a/docs/conf/index.rst +++ b/docs/conf/index.rst @@ -9,6 +9,7 @@ Installing Promgen /conf/alert /conf/docker /conf/django + /conf/api /conf/notification