mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 21:29:11 +00:00
Allow starting khoj in non-GUI mode without config file instantiated
- Start khoj server (in non-GUI mode) without needing config file already instantiated. - But throw warning to configure khoj to use it - This allows plugins to configure the app via the /config/data APIs - To be used by the Khoj obsidian plugin to configure markdown content in khoj
This commit is contained in:
@@ -26,9 +26,10 @@ logger = logging.getLogger(__name__)
|
||||
def configure_server(args, required=False):
|
||||
if args.config is None:
|
||||
if required:
|
||||
print('Exiting as Khoj is not configured. Configure the application to use it.')
|
||||
logger.error(f'Exiting as Khoj is not configured.\nConfigure it via GUI or by editing {state.config_file}.')
|
||||
sys.exit(1)
|
||||
else:
|
||||
logger.warn(f'Khoj is not configured.\nConfigure it via khoj GUI, plugins or by editing {state.config_file}.')
|
||||
return
|
||||
else:
|
||||
state.config = args.config
|
||||
|
||||
Reference in New Issue
Block a user