MMM-MotionEye icon indicating copy to clipboard operation
MMM-MotionEye copied to clipboard

CORS problems...

Open Snille opened this issue 3 years ago • 7 comments

Hi there! Been using your module for years now. :) However, now it's not working anymore, the picture from the cameras does not show (it shows a broken picture icon only). It has to do with the "CORES" security rule in Electron (now activated). Access to fetch at 'http://10.0.0.112:8080/motioneye/show/2' from origin 'http://0.0.0.0:8080' has been blocked by CORS policy: The request client is not a secure context and the resource is in more-private address space private. I'm not sure how to fix this... :)

Snille avatar Jan 07 '22 13:01 Snille

Yes. Here same problem with 2.18 too! If you config you adresse in config.js with address: "localhost', Then its working. But i have to configure address: 0.0.0.0, for MMM-Remote-Control.

OberfragGER avatar Jan 18 '22 14:01 OberfragGER

Ok, this sorta works... it fixed something i've been swearing at for two days. Now curl "http://localhost:8080/motioneye will show my camera feed - a camera feed that wasn't showing up at all before. Now the "autohide" of MotionEye doesn't work. Any idea how to fix that???

SdeGeata avatar Aug 24 '22 17:08 SdeGeata

Addendum: It works when sending the command from terminal, not from MMM-Remote. So again, the dilemma seems to be address: "localhost', if you want to use MotionEye, or address: "0.0.0.0', if you want to use MMM-Remote-Control. I hope this can be fixed soon.

SdeGeata avatar Aug 24 '22 17:08 SdeGeata

So has anyone found a work-around for this yet? I have been playing with the webcontrol_localhost and set that to false. It is my understanding that this allows any machine on your network to control MotionEye? It seems to have no effect.

I don't know why this needs to be such a pain, I am running Motion/MotionEye on the same Rpi as my Magic Mirror. They just can't seem to speak to each other.

SdeGeata avatar Nov 21 '22 21:11 SdeGeata

Have exactly the same problem ... any solutions until now?

StefanTR96 avatar Jan 29 '23 15:01 StefanTR96

Hello @StefanTR96 !

I didn’t find a working solution to this, but i did find a work-around. I ended up installing MMM-WebView on the mirror, pointing it to an RTSP feed from my Home Assistant. That seems to do the trick for me. I have some Home Assistant automations that hide/show the module via some command line prompts.

SdeGeata avatar Jan 29 '23 19:01 SdeGeata

Hello @StefanTR96 !

I didn’t find a working solution to this, but i did find a work-around. I ended up installing MMM-WebView on the mirror, pointing it to an RTSP feed from my Home Assistant. That seems to do the trick for me. I have some Home Assistant automations that hide/show the module via some command line prompts.

For me...its working now. port: 8080, address: '192.168.178.80', // address: '0.0.0.0', ipWhitelist: [], ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.178.1/120", "192.168.178.100/24"], language: 'de',

192.168.178.80 = IP of my MagicMirror 192.168.178.100 = my Proxmox-Server, it think its not needed 192.168.178.1 = my Fritzbox...maybe the range

[Adress ](address: '0.0.0.0) is uncommented so this line is not needed anymore

OberfragGER avatar Jan 29 '23 19:01 OberfragGER