From 1a22666810c8edb669fb2b3bc1f7f789ee868d87 Mon Sep 17 00:00:00 2001 From: meherhendi Date: Wed, 26 Jul 2023 20:35:31 +0100 Subject: [PATCH] Adding vscode run & debug config (#216) Also adds `.env` to `.gitignore` files outside of the `deployment` dir --- .gitignore | 1 + .vscode/launch.json | 65 +++++++++++++++++++++++++++++++++++++++++++++ backend/.gitignore | 3 ++- 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .vscode/launch.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..2eea525d8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.env \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..c0af8ca0d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,65 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Danswer backend", + "type": "python", + "request": "launch", + "module": "uvicorn", + "cwd": "${workspaceFolder}/backend", + "env": { + "LOG_LEVEL": "DEBUG", + "DISABLE_AUTH": "True", + "TYPESENSE_API_KEY": "typesense_api_key", + "DYNAMIC_CONFIG_DIR_PATH": "./dynamic_config_storage", + }, + "args": [ + "danswer.main:app", + "--reload", + "--port", + "8080" + ] + }, + { + "name": "Danswer indexer", + "type": "python", + "request": "launch", + "program": "danswer/background/update.py", + "cwd": "${workspaceFolder}/backend", + "env": { + "LOG_LEVEL": "DEBUG", + "PYTHONPATH": ".", + "TYPESENSE_API_KEY": "typesense_api_key", + "DYNAMIC_CONFIG_DIR_PATH": "./dynamic_config_storage", + }, + }, + { + "name": "Danswer temp files deletion", + "type": "python", + "request": "launch", + "program": "danswer/background/file_deletion.py", + "cwd": "${workspaceFolder}/backend", + "env": { + "LOG_LEVEL": "DEBUG", + "PYTHONPATH": "${workspaceFolder}/backend", + }, + }, + // For the listner to access the Slack API, + // DANSWER_BOT_SLACK_APP_TOKEN & DANSWER_BOT_SLACK_BOT_TOKEN need to be set in .env file located in the root of the project + { + "name": "Danswer slack bot listener", + "type": "python", + "request": "launch", + "program": "danswer/listeners/slack_listener.py", + "cwd": "${workspaceFolder}/backend", + "envFile": "${workspaceFolder}/.env", + "env": { + "LOG_LEVEL": "DEBUG", + "PYTHONPATH": ".", + }, + } + ] +} \ No newline at end of file diff --git a/backend/.gitignore b/backend/.gitignore index 29c7cf8c4..8fcbadd18 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -5,4 +5,5 @@ site_crawls/ api_keys.py *ipynb qdrant-data/ -typesense-data/ \ No newline at end of file +typesense-data/ +.env \ No newline at end of file