From b487e2defe0f8653a3af6f34a8234cb1d2596437 Mon Sep 17 00:00:00 2001 From: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Date: Fri, 8 Dec 2023 19:46:46 +0530 Subject: [PATCH] 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 --- apiserver/plane/app/views/config.py | 6 +++--- deploy/selfhost/docker-compose.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apiserver/plane/app/views/config.py b/apiserver/plane/app/views/config.py index 7c341da4a..c53b30495 100644 --- a/apiserver/plane/app/views/config.py +++ b/apiserver/plane/app/views/config.py @@ -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) diff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.yml index ba0c28827..26be26ea5 100644 --- a/deploy/selfhost/docker-compose.yml +++ b/deploy/selfhost/docker-compose.yml @@ -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}