Coder Social home page Coder Social logo

Comments (9)

tmonck avatar tmonck commented on July 2, 2024 1

Ok I will dive deeper. I will also get a fix to support a trailing / on the base url as well. I'll link the PR to this issue so we can test.

from clean_up_snapshots.

ayavilevich avatar ayavilevich commented on July 2, 2024 1

@tmonck hey, np.

Tested, works ok now with and without back slash.

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

I'll take a look at this tomorrow. I am away from a computer at the moment. I'll also work on providing the example requested.

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

So I quickly double checked but line you referenced says that if it's not an ip address then to compare the scheme of the parsed url. Can you please provide the config for that you are using? Using the url you provided in the issue of 'http://hassio:8123' would result in a false value for ssl. I will look at getting an example up in the next day or so.

from clean_up_snapshots.

ayavilevich avatar ayavilevich commented on July 2, 2024

Hey, thanks for looking at this so quickly.

The code right now is:

        # Check if the url is an ip address
        result = not isgoodipv4(urlPieces.netloc)

        # If url is not an ip address then check
        return result or urlPieces.scheme == "https"

so if url == 'http://hassio:8123'
then result = true
so return will not even evaluate the scheme. Maybe you meant to use 'and' instead of 'or' or not use a 'not' with isgoodipv4.

Original intention is not clear.

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

@ayavilevich I have opened a PR. If you want to take a peek. It will now have support for a trailing / as well I believe I have resolved the bug with the ssl issue. You were correct that It was force SSL when not using an IP Address which was a mistake great catch!

For a note the reason I have support of not always using the scheme of the URL is because there is times where someone may what to use the ip address with a scheme of https yet the cert is not valid for the IP Address and is actually for their public URL. To support this I added a new configuration value which can allow you to let an IP Address to validate the cert. I have default it to off.

from clean_up_snapshots.

ayavilevich avatar ayavilevich commented on July 2, 2024

@tmonck I tried the branch.

Hostname works now. But I had to use "hassio.lan" as the host part in the url. You might want to add an example for that specifically. I supposed this is due to the way docker containers work.

Terminating '/' doesn't work. I also don't see any changes in the code to address that. Currently code will try to access: "http://hassio.lan:8123//api/hassio/snapshots" which will be invalid.

You might want to modify around hassio_url = '{}/api/hassio/'.format(conf.get(CONF_HOST)) .

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

Apparently I blew away the change I had for the trailing / I'll push up that fix now. I'll also add the example using lan and mention this issue as a reference. Not sure why it would require the .lan portion.

from clean_up_snapshots.

tmonck avatar tmonck commented on July 2, 2024

PR is updated @ayavilevich if you wouldn't mind trying once more. If the trailing slash is working I'll get a release and some release notes together.

from clean_up_snapshots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.