diff --git a/pyproject.toml b/pyproject.toml index 9924dc0ea..bfe8cc2cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "hatchling.build" name = "khoj-assistant" description = "An AI copilot for your Second Brain" readme = "README.md" -license = "GPL-3.0-or-later" +license = "AGPL-3.0-or-later" requires-python = ">=3.8" authors = [ { name = "Debanjum Singh Solanky, Saba Imran" }, diff --git a/src/interface/desktop/chat.html b/src/interface/desktop/chat.html index 11ccc4667..df6fadab0 100644 --- a/src/interface/desktop/chat.html +++ b/src/interface/desktop/chat.html @@ -892,6 +892,7 @@ display: inline-block; max-width: 80%; text-align: left; + white-space: pre-line; } /* color chat bubble by khoj blue */ .chat-message-text.khoj { diff --git a/src/khoj/app/settings.py b/src/khoj/app/settings.py index c0d2d8a8b..ce6b4eca3 100644 --- a/src/khoj/app/settings.py +++ b/src/khoj/app/settings.py @@ -13,6 +13,8 @@ import os from pathlib import Path +from khoj.utils.helpers import in_debug_mode + # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -24,7 +26,7 @@ SECRET_KEY = os.getenv("KHOJ_DJANGO_SECRET_KEY", "!secret") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = os.getenv("KHOJ_DEBUG") == "True" +DEBUG = in_debug_mode() # All Subdomains of KHOJ_DOMAIN are trusted KHOJ_DOMAIN = os.getenv("KHOJ_DOMAIN", "khoj.dev") diff --git a/src/khoj/configure.py b/src/khoj/configure.py index 5d82fa4db..620e83ccb 100644 --- a/src/khoj/configure.py +++ b/src/khoj/configure.py @@ -34,6 +34,7 @@ from khoj.database.models import ClientApplication, KhojUser, Subscription from khoj.processor.embeddings import CrossEncoderModel, EmbeddingsModel from khoj.routers.indexer import configure_content, configure_search, load_content +from khoj.routers.twilio import is_twilio_enabled from khoj.utils import constants, state from khoj.utils.config import SearchType from khoj.utils.fs_syncer import collect_files @@ -258,17 +259,25 @@ def configure_routes(app): from khoj.routers.api_config import api_config from khoj.routers.auth import auth_router from khoj.routers.indexer import indexer - from khoj.routers.subscription import subscription_router from khoj.routers.web_client import web_client app.include_router(api, prefix="/api") app.include_router(api_config, prefix="/api/config") app.include_router(indexer, prefix="/api/v1/index") + app.include_router(web_client) + app.include_router(auth_router, prefix="/auth") + if state.billing_enabled: + from khoj.routers.subscription import subscription_router + logger.info("💳 Enabled Billing") app.include_router(subscription_router, prefix="/api/subscription") - app.include_router(web_client) - app.include_router(auth_router, prefix="/auth") + + if is_twilio_enabled(): + logger.info("📞 Enabled Twilio") + from khoj.routers.api_phone import api_phone + + app.include_router(api_phone, prefix="/api/config/phone") def configure_middleware(app): diff --git a/src/khoj/interface/web/chat.html b/src/khoj/interface/web/chat.html index 462ae05d2..09659453f 100644 --- a/src/khoj/interface/web/chat.html +++ b/src/khoj/interface/web/chat.html @@ -965,6 +965,7 @@ display: inline-block; max-width: 80%; text-align: left; + white-space: pre-line; } /* color chat bubble by khoj blue */ .chat-message-text.khoj { diff --git a/src/khoj/interface/web/config.html b/src/khoj/interface/web/config.html index a045d58b6..ab8de4f39 100644 --- a/src/khoj/interface/web/config.html +++ b/src/khoj/interface/web/config.html @@ -194,7 +194,9 @@