GithubHelp home page GithubHelp logo

Comments (5)

CrCati avatar CrCati commented on August 20, 2024 1

You're great! AFAIK, https is not supported for now; I'll forward your suggestion and solution to the community development team for consideration in future releases. Your feedback is valuable to us. You're welcome to modify the source code available in the latest release and compile your own version with HTTPS support.

from go-btfs.

CrCati avatar CrCati commented on August 20, 2024

Hi, @JeanCarloEM. As for the specific routing configuration you've mentioned (port 5001 internally routed through port 443 with Let's Encrypt), it does not appear to be the direct cause of this error. Is the http://xxx format working well for your node? Any error message for this format?

from go-btfs.

JeanCarloEM avatar JeanCarloEM commented on August 20, 2024

Hi @CrCati, thanks for your attention. It doesn't work, I suppose that traefik itself automatically redirects port 80 to 443, not being possible to access it only on port 80. The information displayed on the console is "request blocked"

from go-btfs.

CrCati avatar CrCati commented on August 20, 2024

That may caused by your K8s settings. Does the 'http://' format work well if you deployed a node on your host?

from go-btfs.

JeanCarloEM avatar JeanCarloEM commented on August 20, 2024

It doesn't work, because the error I mentioned happens when configuring the field. That is, the error does not occur when accessing the API that has nothing to do with Kubernetes, Docker and much less with traefik, but with a directive programmed in the dashboard. Is there any validation javascript function on the "submit" button that checks if the entered URL is valid. I assume it's some REGEX because it's the most common, but there are other ways to validate a field.

I actually located where the validation is done, although I'm not sure if that's the only place it's done. But REGEX is not used.

Maybe I should open this issue on bittorrent/btfs-dashboard, after all I don't know what level of affinity between the developers of the tools. But anyway...

File "btfs-dashboard/src/utils/checks.js", on function urlCheck() from line 21:

export const urlCheck = (url) => {
    try {
        if (url.indexOf('http://') < 0 || !url.split(":")[2]) {
            Emitter.emit('showMessageAlert', {message: 'api_invalid', status: 'error', type: 'frontEnd'});
            return false;
        } else {
            return true;
        }
    } catch (e) {
        console.log(e)
    }
};

The check specifically takes place on line 23:

        if (url.indexOf('http://') < 0 || !url.split(":")[2]) {

I suggest something like this:

        if (/^https?\:\/\/(localhost|[\w\d]+(\.[\w\d]+)+)(\:\d{3,6})?\/?$/i.test(url)){

from go-btfs.

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.