converge / instapy-dashboard

(discontinued) InstaPy Dashboard developed using React.js and Node.js
GNU Affero General Public License v3.0
218 stars 44 forks source link

Running on Raspberry Pi 3 through noip.com #9

Open tiaringhio opened 5 years ago

tiaringhio commented 5 years ago

Hi! Thanks in advance for all the work you've done! I successfully installed everything but i was wondering how i should edit the config file to run the dashboard from a pc not connected to the same Wi-Fi network as the raspberry pi on which i'm running InstaPy. My raspberry has port forwarding to a host created with noip and i would like to access the dashboard with somthing like this:

hostexample.hopto.org:3000

Thank you again!

converge commented 5 years ago

Hey @tiaringhio, thank you! and it's my pleasure!

I'm preparing some improvements in this aspect for the next weeks.

For now, you could just add your host to the configuration.js file on "allowedHosts" parameter.

tiaringhio commented 5 years ago

Thank you @converge ! I can't wait

tiaringhio commented 5 years ago

Just wanted to follow up by saying that it's working the way i described, thanks a lot @converge ! the only thing is that's it does not load te user statistics, i guess they'll come up after a few runs?

GaWr26 commented 5 years ago

Hi guys,

I got this working on localhost and I love it. Thank you for this @converge! Also I installed port forwarding and use noip to get to my network. Unfortunately when accessing from a different machine in the same network or even from outside the page loads but I see the loading animation for ever.

Any ideas what could cause this?

Cheers

GaWr26 commented 5 years ago

Managed to get it working from other machines on my network. I found a different issue where someone mentioned to change: REACT_APP_API_ENTRY_POINT from localhost to the actual ip of the machine.

flyingnobita commented 5 years ago

Managed to get it working from other machines on my network and even from outside. I found a different issue where someone mentioned to change: REACT_APP_API_ENTRY_POINT from localhost to the actual ip of the machine.

Thanks for your tip, I was experiencing the same problem and it helped me get it working from other machines on the same network. However I can't get it working outside my network. i.e. still seeing the loading animation running forever.

I've already: 1) turned on port forwarding on my router (port 3000 on UDP and TCP) 2) setup firewall exception on my Windows machine, even tried completely disabling it

But still not working.

Can you share what you did to your network configs?

Thanks.

flyingnobita commented 5 years ago

Ah, just realized from the browser console that it's due to a blocked CORS request. So not related to my networking setup (which makes sense and got me baffled earlier).

But how did you get around this problem? Did you add cors to the package source yourself or you got a more cleaver way?

GaWr26 commented 5 years ago

@flyingnobita sorry mate, I made a mistake when I wrote the comment. I was actually accessing from inside my network but via the noip url. It doesn't actually work from outside. I also just get the loading animation. If you find a fix I would be very interested.

converge commented 5 years ago

hey guys, it will work anywhere with the right setup, basically: REACT_APP_API_ENTRY_POINT is the server your running the dashboard (and the API) ALLOWED_HOSTS are the hosts that can actually connects to the API

Example: the dashboard is at example.no-ip.com the API is also running at example.no-ip.com the setup will be:

REACT_APP_API_ENTRY_POINT=http://example.no-ip.com:3001 ALLOWED_HOSTS=http://example.no-ip.com:3000

In short: hitting http://example.no-ip.com:3000 will load the dashboard, the dashboard will try to connect to its API, the API will be set to http://example.no-ip.com:3001 , CORS will check if http://example.no-ip.com:3000 is allowed to use the API.

flyingnobita commented 5 years ago

Thank you for your reply. Got it to work!