akasma74 / Hass-Custom-Alarm

It is a fork of "Yet another take on a home assistant custom alarm" that will exist until its author is back to our Earth
80 stars 31 forks source link

Camera tab breaks due to http.ban: Login attempt or request with invalid authentication from 127.0.0.1 #93

Closed JasonSanDiego closed 4 years ago

JasonSanDiego commented 4 years ago

I was running HA .88 and always had an error message in my logs, but everything worked fine - camera feeds kept updating on my Fire tablet.

Yesterday, I updated to 0.103.6 (using virtualenv method) and found that these errors cause my camera feeds to break as my tablet is banned. Full error message, which shows up every 5 seconds, once for each camera feed shown (twice in my case):

WARNING (MainThread) [homeassistant.components.http.ban] Login attempt or request with invalid authentication from 127.0.0.1

I'm reverse proxying via nginx on the same machine. X-Forwarded-For is configured in nginx. My router is doing direct port forwarding to this machine.

I added this code, which changed the error message so that the IP address shows my router IP instead of 127.0.0.1 I'm not sure why that would be. My tablet is inside the network.

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 127.0.0.1
    - ::1

I read a LOT of discourse messages on this topic, and it seems the most likely problem is some sort of token issue where the component isn't getting the right or updated tokens.

Although http ban is supposedly disabled by default, adding this additional line to the http block "solves" the problem.

  ip_ban_enabled: False

I would love to keep ip ban enabled. though. Anyone else encounter this and find a solution?

akasma74 commented 4 years ago

sorry, I do not use ip_ban_enabled feature and camera feeds in my setup. maybe it'd be more efficient to ask at the HA forum as it looks like a HA 'feature" many custom components might stumble upon?

akasma74 commented 4 years ago

I'm closing the issue now. Feel free to re-open it/open a new one if you have new data.