dev-lu / osint_toolkit

A full stack web application that combines many tools and services for security analysts into a single tool.
MIT License
479 stars 81 forks source link

Network Error Uncaught runtime errors #10

Closed Blason closed 11 months ago

Blason commented 11 months ago

Hi,

I complied using docker and it successfully got compiled however when I am accessing using browser it shows

ERROR Network Error ERROR Network Error ERROR Network Error ERROR Network Error

dev-lu commented 11 months ago

I assume you deployed the app on a remote machine like a Raspberry Pi. Did you modify the Docker Compose file and set the address where the application is deployed on?

0x4hm3d commented 11 months ago

Hello Same error and I changed the line in the docker compose file before deploying and got the same issue environment:

0x4hm3d commented 11 months ago

Also after seeing the docker-compose logs, everything was successful. Compiled successfully! frontend | frontend | You can now view osint-toolkit in the browser. frontend | frontend | Local: http://localhost:3000 frontend | On Your Network: http://172.18.0.3:3000 frontend | frontend | Note that the development build is not optimized. frontend | To create a production build, use npm run build. frontend | frontend | webpack compiled successfully

Thanks

dev-lu commented 11 months ago

As you can see in the Docker logs, the frontend runs on port 3000. The backend runs on port 8000 by default, so you should change the port in your compose file to 8000.

0x4hm3d commented 11 months ago

Change the port and the same error, Network Error in the UI environment:

dev-lu commented 11 months ago

Check out your browser console to see where the frontend is trying to connect to.

0x4hm3d commented 11 months ago

Check and found try to open localhost:3000, not the machine-ip:3000, how to change it with the machine-ip http://localhost:8000/api/apikeys/is_active net::ERR_BLOCKED_BY_CLIENT Thanks

dev-lu commented 11 months ago

Your Docker Compose file should look like this:

version: "3.8"
services:
  backend:
    build: ./backend
    container_name: backend
    ports:
      - "8000:8000"
  frontend:
    build: ./frontend
    container_name: frontend
    ports:
      - "3000:3000"
    environment:
      - BACKEND_URL=http://<IP_ADDRESS>:8000
    stdin_open: true
    tty: true

Maybe it helps to to use docker prune command, to delete old data.

0x4hm3d commented 11 months ago

I try to install it on WSL Ubuntu on Windows and it worked, but I need to install it on a server using Centos or Ubuntu I got the same issue with the network

dev-lu commented 11 months ago

It seems like the environment variables cannot be set, and the frontend falls back to the default settings. Try setting the environment variable called REACT_APP_BACKEND_URL manually inside the frontend docker container.

Renizmy commented 11 months ago

Hello, It works but the frontend is still trying to contact port 3000 with a websocket connection

dev-lu commented 11 months ago

This is intentional behavior and can be ignored. The WebSocket connection is because the app is still in a young development stage and, therefore, runs in development mode. This will change in the future.