From a5ffa2342fad5a7e788f5f9dd38039a65fa42e17 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Thu, 30 Nov 2023 17:55:17 -0800 Subject: [PATCH] Add documentation for local setup and fix admin panel bugs - Wasn't able to login to the admin panel when KHOJ_DEBUG was not True. Fix this error so self-hosted users can get unblocked from accessing the admin settings - Don't force users to set their KHOJ_DJANGO_SECRET_KEY --- docs/setup.md | 3 +++ src/khoj/app/settings.py | 2 +- src/khoj/routers/indexer.py | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/setup.md b/docs/setup.md index eb2f362b..11b46995 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -186,6 +186,9 @@ To use the desktop client, you need to go to your Khoj server's settings page (h 1. Select files and folders to index [using the desktop client](./setup.md?id=_2-download-the-desktop-client). When you click 'Save', the files will be sent to your server for indexing. - Select Notion workspaces and Github repositories to index using the web interface. + +> Note: Using Safari on Mac? You might not be able to login to the admin panel. Try using Chrome or Firefox instead. + ### 4. Install Client Plugins (Optional) Khoj exposes a web interface to search, chat and configure by default.
The optional steps below allow using Khoj from within an existing application like Obsidian or Emacs. diff --git a/src/khoj/app/settings.py b/src/khoj/app/settings.py index 2b86e5cc..bacbf904 100644 --- a/src/khoj/app/settings.py +++ b/src/khoj/app/settings.py @@ -36,7 +36,7 @@ CSRF_TRUSTED_ORIGINS = [ ] COOKIE_SAMESITE = "None" -if DEBUG: +if DEBUG or os.getenv("KHOJ_DOMAIN") == None: SESSION_COOKIE_DOMAIN = "localhost" CSRF_COOKIE_DOMAIN = "localhost" else: diff --git a/src/khoj/routers/indexer.py b/src/khoj/routers/indexer.py index 0c906707..e4d220b2 100644 --- a/src/khoj/routers/indexer.py +++ b/src/khoj/routers/indexer.py @@ -341,7 +341,7 @@ def load_content( search_models: SearchModels, ): if content_config is None: - logger.warning("🚨 No Content configuration available.") + logger.debug("🚨 No Content configuration available.") return None if content_index is None: content_index = ContentIndex()