Code Monkey home page Code Monkey logo

Comments (34)

ThePrez avatar ThePrez commented on August 16, 2024 2

PR opened to react here: facebook/create-react-app#6483

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024 1

Do you want me to increase the version number in package.json before I create a PR?

No need, I will handle that after merging.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024 1

3.1.0 released, sindresorhus/internal-ip#20 for downstream support.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Seems it's impossible to virtualize AIX on x86 hardware, so I have to pass on supporting it.

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

Hi there,
we‘re having an AIX system (ppc64 architecture) and we‘re interested in making this package available on it. Since this package is a dependency for Angular as well as React, it‘s kind of necessary for us to get it working on our machine, in order to use these frameworks.
So, if you‘re still interested on working on support, please let us know.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Can you post the exact output of these commands on a machine that ideally has both IPv4 and IPv6 gateways?

netstat -rn -f inet
netstat -rn -f inet6

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

I‘ll come back on Monday with the results. Thanks!

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

Unfortunately, the netstat command is not available in the AIX terminal.
I tried other commands as well (ifconfig, ip, net stat) but none of them is available.
There's a system command called netstat, but you cannot execute it in the bash ("Command NETSTAT invalid in this environment")
We're currently looking for some solution to access this information in node.
One option might be using IBM/nodejs-itoolkit - but I have to dig into it first.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Would like to avoid additional dependencies if possible. Is there a /proc/net/route and /proc/net/ipv6_route file maybe?

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

There's a database table qsys2/netstat_route_info where I can find the default gateway. There's a command "db2" available to run sql through the shell. But the statement will throw a "permission denied" exception when I try to just run it in the shell.
It might work if I run it with the proper package. I'm working on some prototype to test this.

What I didn't mention so far: It's actually not a full AIX setup we're using - It's an integrated subsystem inside a System i (also known as AS/400). That's why not all the AIX commands will work here.

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

It took a few moments, but I was able to make an aix.js file that runs on our system (tested with test.js)
You can have a look on it here: https://github.com/patrickhrastnik/default-gateway
Do you want me to increase the version number in package.json before I create a PR?

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

Sorry to say, but I wasn't able to make the aix.js file without any of the packages IBM provides for database access in node...
I added the idb-connector as an optional dependency, thus installing default-gateway won't raise an error if you're installing it on another system but aix.

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

According to this:
https://docs.npmjs.com/files/package.json#optionaldependencies

The difference is that build failures do not cause installation to fail.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Yeah, i was reminded of ldapjs/node-ldapjs#451, but as I see now, that failure there is on require when the optional dependency failed to build, not on the actual build build.

So as long as we guard the require in try ... catch, we should be fine.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Fixed in f32b881 ... f7903f5.

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

Is this current version now available in npm, or is there something left/pending? Is it still version 3.0.1, or is it gonna be another release version containing these changes?
Sorry for the dumb question, Idk how things work with npm package contribution.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Publishing soon after I finish travis changes. Then the change will need to propagate through the dependency chain. I'll do it for https://github.com/sindresorhus/internal-ip because that one is not depending on v3 yet.

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

Okay, thanks :)

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

This is open again, see #10. I will only accept pure JS support for AIX.

from default-gateway.

patrickhrastnik avatar patrickhrastnik commented on August 16, 2024

I‘m sorry the idb-connector package was kinda a miss... but what about a solution with odbc?
This will involve another dependency as well, but odbc is much more available (and less prone to fail on installation) than the idb-connector.

from default-gateway.

ThePrez avatar ThePrez commented on August 16, 2024

I second @patrickhrastnik's question, but also curious if you would accept the current change if IBM/nodejs-idb-connector#54 gets resolved. Currently, this issue only exists for AIX, and only for the non-IBMi variants of AIX. Once that issue is resolved, we will avoid the compile failures for any AIX

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

I would not accept a native dependency, sorry. What we could do is drop the os field in package.json which would prevent installation failures on AIX, so react development could still work, even without the module returning anything useful.

from default-gateway.

ThePrez avatar ThePrez commented on August 16, 2024

Ok. We have figured out a game plan for a pure js implementation, and should have it ready within a few days.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Great! Generally, the current approach with unspecified os should make react and friends still work on AIX if they treat the negative result from default-gateway (and in turn internal-ip) gracefully.

from default-gateway.

ThePrez avatar ThePrez commented on August 16, 2024

Installs of react-scripts still fail because of the old internal-ip


npm ERR! code EBADPLATFORM
npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"android,darwin,freebsd,linux,openbsd,sunos,win32","arch":"any"} (current: {"os":"aix","arch":"ppc64"})

(I think this is expected, just documenting a reminder of the upstream changes, as we will want to request version bumps).

webpack-dev-server installs fine as it pulls in internal-ip 4.1

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Yes, I assume react-scripts needs to update to webpack-dev-server 3.2.0 or higher.

from default-gateway.

ThePrez avatar ThePrez commented on August 16, 2024

To implement on mainline AIX, we could parse out the following command: netstat -r -f inet -n/netstat -r -f inet6 -n
I'd gladly work on this, but it may take me a while to procure a machine for development. That work can be tracked in this (or a separate) issue. In the meantime, I'd love for #11 to land as soon as the new db2util utility is available.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Sounds like a plan. For netstat parsing, you can use the other unixes like sunos.js as a template. The only difference between them is on which column the gateway entry is.

from default-gateway.

ThePrez avatar ThePrez commented on August 16, 2024

Thanks for landing the PR! Would you like to take the task of the upstream request to webpack-dev-server? I'd happily do it if you prefer, but I suspect origination from the package maintainer gives the request more legitimacy.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

No need to update webpack-dev-server, caret version takes care of it and they updated to [email protected] already.

from default-gateway.

ThePrez avatar ThePrez commented on August 16, 2024

Upon further inspection, it looks like the sunos implementation can be used as-is for AIX! (I will try to find somewhere to test)

from default-gateway.

ThePrez avatar ThePrez commented on August 16, 2024

ahh, so it's just react-scripts that needs to pull in a newer webpack-dev-server

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Yes, exactly, they to update to 3.2.1 or higher.

from default-gateway.

silverwind avatar silverwind commented on August 16, 2024

Fixed in eb1bce7 and released as [email protected].

from default-gateway.

Related Issues (15)

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.