From 49531cc87c9cc198a88fb440282da218422a627e Mon Sep 17 00:00:00 2001 From: umeshpabbathireddy Date: Thu, 23 Jan 2025 01:21:52 -0600 Subject: [PATCH 1/3] Adding .env file and updated docs --- docs/security-testing/testrunner.mdx | 8 ++++---- static/artifacts/testrunner/.env | 2 ++ static/artifacts/testrunner/levoai-testrunner.sh | 13 ++++++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 static/artifacts/testrunner/.env diff --git a/docs/security-testing/testrunner.mdx b/docs/security-testing/testrunner.mdx index 1e4d53b65..ba88d2c61 100644 --- a/docs/security-testing/testrunner.mdx +++ b/docs/security-testing/testrunner.mdx @@ -111,10 +111,10 @@ If Docker is installed on your machine, follow these steps to start the testrunn chmod +x levoai-testrunner.sh ``` -3. Set the required environment variables: -```bash -export LEVOAI_AUTH_KEY='' -export LEVOAI_ORG_ID='' +3. Create .env file in the same directory to set the required environment variables: +``` +LEVOAI_AUTH_KEY='' +LEVOAI_ORG_ID='' ``` 4. Start the testrunner: diff --git a/static/artifacts/testrunner/.env b/static/artifacts/testrunner/.env new file mode 100644 index 000000000..25c829d8d --- /dev/null +++ b/static/artifacts/testrunner/.env @@ -0,0 +1,2 @@ +LEVOAI_AUTH_KEY=eyJhbGciOiJSUzI1NiIsImtpZCI6IlNLMmJLRmp2cnZudUZaM1gzOWJVR0xFZDhCTzh2IiwidHlwIjoiSldUIn0.eyJhbXIiOlsicHdkIl0sImRybiI6IkRTUiIsImV4cCI6MjA3NTc0MDE5OCwiaWF0IjoxNzM3MDUyMTk4LCJpc3MiOiJQMmJLRmpzZWRkOVkwR0Z4RGJkN1BOQ3hZaFExIiwic3ViIjoiVTJtdDVRZHVjb2hGYWFDSXZpOXdYb1pueWdrTCJ9.FbLOG65ASGoxIKlvUx60efFJ-O79M74ETCW_T9saivNRgxhFGOEBIb8Az0M7nZz992XmeUFD70gt9EODKGAGAQxSHLY-5cVKp5uXt8hRwL8N1pzflO44zH8SXgS0lDh3me5vcaoBRKZRujQNgU5G8UpONFmqsMVS8mt-p_MaemYUE9X19ABxkKvZWlx8SEmuC0c9W-y8bT5mPRqg04LiTF69_jfa_-60DZDpDdkp_YvIj7mvrRDsUsWGbemYDgrPMwx-aWXjJlpBp-agWS9ihZvgSvl6eQ5ridkCUXTQhrtUcLOasWye_k0gw1Lbru8PSrocreJ_OmwrMGbH3l_Sdw +LEVOAI_ORG_ID=ef3419bb-3928-4330-a604-0c8c80e30982 \ No newline at end of file diff --git a/static/artifacts/testrunner/levoai-testrunner.sh b/static/artifacts/testrunner/levoai-testrunner.sh index 0611140b6..cc3f74c34 100755 --- a/static/artifacts/testrunner/levoai-testrunner.sh +++ b/static/artifacts/testrunner/levoai-testrunner.sh @@ -2,7 +2,15 @@ CONTAINER_NAME="levoai-testrunner" IMAGE_NAME="levoai/levo:stable" -DEFAULT_LEVOAI_BASE_URL="https://api.levo.ai" +DEFAULT_LEVOAI_BASE_URL="https://api.dev.levo.ai" + +# Load environment variables from .env file +if [ -f .env ]; then + export $(cat .env | grep -v '#' | awk '/=/ {print $1}') +else + echo "Error: .env file not found." + exit 1 +fi # Function to display usage information show_usage() { @@ -47,8 +55,7 @@ check_env_var() { local var_value="${!var_name}" if [[ -z "$var_value" ]]; then echo "Error: Environment variable $var_name is not set." - echo "Try setting the $var_name using the following command:" - echo "export $var_name='value'" + echo "Try setting the $var_name in the .env file." exit 1 fi } From 09f15480e89e411458104fece89bb550726874df Mon Sep 17 00:00:00 2001 From: umeshpabbathireddy Date: Thu, 23 Jan 2025 01:27:49 -0600 Subject: [PATCH 2/3] Adding .env file and updated docs --- static/artifacts/testrunner/.env | 4 ++-- static/artifacts/testrunner/levoai-testrunner.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/static/artifacts/testrunner/.env b/static/artifacts/testrunner/.env index 25c829d8d..f48dea7a8 100644 --- a/static/artifacts/testrunner/.env +++ b/static/artifacts/testrunner/.env @@ -1,2 +1,2 @@ -LEVOAI_AUTH_KEY=eyJhbGciOiJSUzI1NiIsImtpZCI6IlNLMmJLRmp2cnZudUZaM1gzOWJVR0xFZDhCTzh2IiwidHlwIjoiSldUIn0.eyJhbXIiOlsicHdkIl0sImRybiI6IkRTUiIsImV4cCI6MjA3NTc0MDE5OCwiaWF0IjoxNzM3MDUyMTk4LCJpc3MiOiJQMmJLRmpzZWRkOVkwR0Z4RGJkN1BOQ3hZaFExIiwic3ViIjoiVTJtdDVRZHVjb2hGYWFDSXZpOXdYb1pueWdrTCJ9.FbLOG65ASGoxIKlvUx60efFJ-O79M74ETCW_T9saivNRgxhFGOEBIb8Az0M7nZz992XmeUFD70gt9EODKGAGAQxSHLY-5cVKp5uXt8hRwL8N1pzflO44zH8SXgS0lDh3me5vcaoBRKZRujQNgU5G8UpONFmqsMVS8mt-p_MaemYUE9X19ABxkKvZWlx8SEmuC0c9W-y8bT5mPRqg04LiTF69_jfa_-60DZDpDdkp_YvIj7mvrRDsUsWGbemYDgrPMwx-aWXjJlpBp-agWS9ihZvgSvl6eQ5ridkCUXTQhrtUcLOasWye_k0gw1Lbru8PSrocreJ_OmwrMGbH3l_Sdw -LEVOAI_ORG_ID=ef3419bb-3928-4330-a604-0c8c80e30982 \ No newline at end of file +LEVOAI_AUTH_KEY= +LEVOAI_ORG_ID= \ No newline at end of file diff --git a/static/artifacts/testrunner/levoai-testrunner.sh b/static/artifacts/testrunner/levoai-testrunner.sh index cc3f74c34..7e7ae64ff 100755 --- a/static/artifacts/testrunner/levoai-testrunner.sh +++ b/static/artifacts/testrunner/levoai-testrunner.sh @@ -2,7 +2,7 @@ CONTAINER_NAME="levoai-testrunner" IMAGE_NAME="levoai/levo:stable" -DEFAULT_LEVOAI_BASE_URL="https://api.dev.levo.ai" +DEFAULT_LEVOAI_BASE_URL="https://api.levo.ai" # Load environment variables from .env file if [ -f .env ]; then From da4a57df7858d586ca37f9eb7d0460d92f071b5c Mon Sep 17 00:00:00 2001 From: umeshpabbathireddy Date: Thu, 23 Jan 2025 01:32:27 -0600 Subject: [PATCH 3/3] Deleting .env file --- static/artifacts/testrunner/.env | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 static/artifacts/testrunner/.env diff --git a/static/artifacts/testrunner/.env b/static/artifacts/testrunner/.env deleted file mode 100644 index f48dea7a8..000000000 --- a/static/artifacts/testrunner/.env +++ /dev/null @@ -1,2 +0,0 @@ -LEVOAI_AUTH_KEY= -LEVOAI_ORG_ID= \ No newline at end of file