Skip to content

Commit

Permalink
Merge pull request #294 from levoai/cloudflare-worker-wrangler
Browse files Browse the repository at this point in the history
Troubleshooting wrangler login & Testrunner with sudo.
  • Loading branch information
gannaraputeja authored Dec 11, 2024
2 parents e66113a + be13d5e commit e6ac4a6
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1 deletion.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/cloudflare/Wrangler_consentform.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/install-traffic-capture-sensors/cloudflare-worker.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,23 @@ or if the [daily request limit](https://developers.cloudflare.com/workers/platfo
alt="Adding a Cloudflare Worker route"
style={{ display: 'block', margin: 'auto', paddingTop: '24px'}}
/>


### Troubleshooting wrangler login

If you encounter an error while running `npx wrangler login`, make sure you have the latest version of Node.js installed.

- Running above command should open a browser window where you can log in to your Cloudflare account.
- Once you have logged in successfully, you should be prompted with a consent form to allow Wrangler to access your Cloudflare account.

![](../assets/cloudflare/Wrangler_consentform.png)

- After you click on `Allow`, you will be redirected to a page with a success message.

![](../assets/cloudflare/Wrangler_access_granted.png)

- Now you can close the browser window and return to your terminal where you should see a success message.


### Need Help?
For further assistance, please reach out to [Levo.ai Support](mailto:[email protected]).
12 changes: 12 additions & 0 deletions docs/security-testing/testrunner.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,18 @@ export LEVOAI_ORG_ID='<your-organization-id>'
./levoai-testrunner.sh start
```

:::note

If you are running the script with `sudo`, ensure that the environment variables are also set with `sudo`. Otherwise, the script will not have access to these variables.

Alternatively, you can use the `-E` flag with `sudo` to preserve the user-defined environment variables, like this:
```bash
sudo -E ./levoai-testrunner.sh start
```
This ensures the script can access the required environment variables without explicitly redefining them under sudo.

:::

5. Stop the testrunner:
```bash
./levoai-testrunner.sh stop
Expand Down
1 change: 0 additions & 1 deletion static/artifacts/testrunner/levoai-testrunner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ start_container() {
check_env_var "LEVOAI_ORG_ID"

local base_url="${LEVOAI_BASE_URL:-$DEFAULT_LEVOAI_BASE_URL}"
echo "LEVOAI_BASE_URL: $base_url"

echo "Starting the $CONTAINER_NAME..."
mkdir -p $HOME/.config/configstore
Expand Down

0 comments on commit e6ac4a6

Please sign in to comment.