domru icon indicating copy to clipboard operation
domru copied to clipboard

button in web interface sends request to `localhost` instead of document url

Open moleus opened this issue 1 year ago • 2 comments

HostIp in rendered html document is localhost when running in docker container. Therefore "Открыть" button doesn't work. Maybe we should use document.URL in js to construct the url.

https://github.com/ad/domru/blob/1b093ba59c1b39aab6430345288a0684b68ee050/templates/home.html#L96 image image

moleus avatar Jan 14 '24 14:01 moleus

The problem is here https://github.com/ad/domru/blob/1b093ba59c1b39aab6430345288a0684b68ee050/handlers/auth.go#L186-L190

you don't have host ip, maybe you run code not from homeassistant addon

at that moment I don't have domofon for test :(

ad avatar Jan 15 '24 07:01 ad

U are right, I'm running application in a standalone docker container, not as the HA addon.

Thank you for the code reference. I'll have a look at this and test in a few weeks

moleus avatar Jan 15 '24 11:01 moleus