From 795ec9eb5568d014f97ef28afb1cb657b2c9acfc Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 14 Nov 2023 16:09:56 -0800 Subject: [PATCH] Add KHOJ_prefix to server admin credentials environment variables --- docker-compose.yml | 4 ++-- src/khoj/utils/initialization.py | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 857b4a4a..365d2572 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,8 +43,8 @@ services: - POSTGRES_PORT=5432 - KHOJ_DJANGO_SECRET_KEY=secret - KHOJ_DEBUG=True - - ADMIN_EMAIL=username@example.com - - ADMIN_PASSWORD=password + - KHOJ_ADMIN_EMAIL=username@example.com + - KHOJ_ADMIN_PASSWORD=password command: --host="0.0.0.0" --port=42110 -vv --anonymous-mode diff --git a/src/khoj/utils/initialization.py b/src/khoj/utils/initialization.py index f7c7556e..c797f848 100644 --- a/src/khoj/utils/initialization.py +++ b/src/khoj/utils/initialization.py @@ -21,8 +21,8 @@ def initialization(): logger.info( "👩‍✈️ Setting up admin user. These credentials will allow you to configure your server at /server/admin." ) - email_addr = os.getenv("ADMIN_EMAIL") or input("Email: ") - password = os.getenv("ADMIN_PASSWORD") or input("Password: ") + email_addr = os.getenv("KHOJ_ADMIN_EMAIL") or input("Email: ") + password = os.getenv("KHOJ_ADMIN_PASSWORD") or input("Password: ") admin_user = KhojUser.objects.create_superuser(email=email_addr, username=email_addr, password=password) logger.info(f"👩‍✈️ Created admin user: {admin_user.email}") @@ -37,6 +37,8 @@ def initialization(): return try: + # Note: gpt4all package is not available on all devices. + # So ensure gpt4all package is installed before continuing this step. import gpt4all use_offline_model = input("Use offline chat model? (y/n): ")