fix: open api configuration (#3044)

* dev: fix openapi config default for docker setup

* dev: remove the default values from google client id and github client id

* dev: handle case for google and github client id
This commit is contained in:
Nikhil 2023-12-08 19:46:46 +05:30 committed by GitHub
parent fffcb2d947
commit b487e2defe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -90,8 +90,8 @@ class ConfigurationEndpoint(BaseAPIView):
data = {}
# Authentication
data["google_client_id"] = GOOGLE_CLIENT_ID if GOOGLE_CLIENT_ID else None
data["github_client_id"] = GITHUB_CLIENT_ID if GITHUB_CLIENT_ID else None
data["google_client_id"] = GOOGLE_CLIENT_ID if GOOGLE_CLIENT_ID and GOOGLE_CLIENT_ID != "\"\"" else None
data["github_client_id"] = GITHUB_CLIENT_ID if GITHUB_CLIENT_ID and GITHUB_CLIENT_ID != "\"\"" else None
data["github_app_name"] = GITHUB_APP_NAME
data["magic_login"] = (
bool(EMAIL_HOST_USER) and bool(EMAIL_HOST_PASSWORD)
@ -106,7 +106,7 @@ class ConfigurationEndpoint(BaseAPIView):
data["posthog_host"] = POSTHOG_HOST
# Unsplash
data["has_unsplash_configured"] = UNSPLASH_ACCESS_KEY
data["has_unsplash_configured"] = bool(UNSPLASH_ACCESS_KEY)
# Open AI settings
data["has_openai_configured"] = bool(OPENAI_API_KEY)

View File

@ -41,7 +41,7 @@ x-app-env : &app-env
- DEFAULT_PASSWORD=${DEFAULT_PASSWORD:-password123}
# OPENAI SETTINGS - Deprecated can be configured through admin panel
- OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1}
- OPENAI_API_KEY=${OPENAI_API_KEY:-"sk-"}
- OPENAI_API_KEY=${OPENAI_API_KEY:-""}
- GPT_ENGINE=${GPT_ENGINE:-"gpt-3.5-turbo"}
# LOGIN/SIGNUP SETTINGS - Deprecated can be configured through admin panel
- ENABLE_SIGNUP=${ENABLE_SIGNUP:-1}