-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Added proxy auth headers #919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@cemremengu before we can do anything with this, the OCA must be signed & accepted. |
@cjbj Done |
@cemremengu that's good news. And don't forget the signoff on the PR - see CONTRIBUTING. As you probably saw, I don't have ready access to a proxy that needs authentication, so it would be good to get a viable PR from someone. |
Sure, the commit message should have the signature under it as
I will make sure to add it for next commits as well. Let me know, once they get my email and anything else is needed |
Signed-off-by: Cemre MENGU <cemremengu@gmail.com>
@cjbj They rejected it and I sent an updated version same day. It's been 3-4 days haven't heard since. Could you please notify them if possible? |
@cemremengu they batch them up. I'll ping them. |
@cemremengu your OCA was approved - excellent! What about doing it this way?:
And also passing
|
Signed-off-by: Cemre MENGU <cemremengu@gmail.com>
This may sound dumb but how do I test this locally without npm package ? 😄
|
@cemremengu probably just create the build package with 'cd package; make npmpackage' |
I will try but the problem is that I am on windows 🤔 Anyways, I will find a unix machine somehwere to build it if it does not work 😄 |
@cemremengu the same steps are in MAKEPKG.BAT - just comment out the bits that are not related to creating oracledb-2.3.0.tgz. Effectively you need to run 'npm pack' with the
|
After some fiddling I am getting the error
Looks like it is putting a OK, needed to modify |
@cjbj Success! One thing is that I expected it to get the proxy from the
is there a way to get rid of this and instead propagate the npm proxy arg to the install script? |
I was thinking about that today when I helped someone else. The only way I know of right now is run |
Signed-off-by: Cemre MENGU <cemremengu@gmail.com>
Strange...It fails on some machines getting a 403 from github (https) CDN And |
@cemremengu npm has some quirks regarding proxies and firewalls, e.g npm/npm#18567. I don't know if you are hitting this. |
Yes it looks like it is this one and its very random. It also sometimes returns 407 although I provide credentials. Another thing is Similar to npm/npm#14458 |
@cemremengu it's a can of worms. |
Any news about this PR? I can't install oracledb anymore because none of the different installations proposal work:
|
@Getz85 I don't have an authenticated proxy to test with, so you could try this PR and let us know if it works for you. You'd need to build the package as I described above, and use that with 'npm install'. |
@Getz85 and you can always install with https://oracle.github.io/node-oracledb/INSTALL.html#manualextraction or https://oracle.github.io/node-oracledb/INSTALL.html#github |
Signed-off-by: Cemre MENGU <cemremengu@gmail.com>
I have tested this on 3 different machines (VM) for 2 of them it worked perfectly with So as an emergency option (borrowing from the old way) I added a fallback env variable to get the proxy from, in order not to block users installing the package (which eventually worked for the old VM as well). As described above there can be random proxy auth errors but that's on NPM I guess ¯\_(ツ)_/¯ @cjbj Let me know what you think and if you want to me to change the name of the env variable. |
@cemremengu good work. Because there are already so many proxy environment variables, I would use those instead of introducing a new one. Basically:
If |
Signed-off-by: Cemre MENGU <cemremengu@gmail.com>
I'm happy from visual inspection, but let's see if @dmcghan has any comments. :) |
ping @dmcghan :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me overall.
return envProxy; | ||
} | ||
|
||
const httpsProxy = execSync('npm config get https-proxy').toString().trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like we are favoring proxy settings from env over npm config. Is that standard? Should it be reversed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordering was chosen as a way to overcome the slow perf issues of npm config get
without needing an 'emergency option', see #919 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain further:
a) In order not to break current setups
b) Prevent blocking the installation due to any issues with npm config get
(though I think it should work fine most of the time)
@cjbj One more thing; should we add something like
Otherwise LGTM I think? 😄 |
@cemremengu I would not display the proxy details by default. For a start, I think we can probably cut down on what is displayed by default to reduce visual overload. And second, it's better not to display info we don't really need to avoid users over-sharing site info when they open issues. The details are already logged with I'm just waiting for a final ack from @dmcghan and then I'll merge to our internal repo so that the change will come out with the next push to GitHub. |
Yup, looks good to me. I'd probably have reversed the lookup to use NPM first, but that's always something that can be revisited in the future if needed. |
Thanks @dmcghan |
@cemremengu This fix is now on master ready for the next release. Thank you. |
Continuing #810 since I am currently bitten by this and have to move around
node_modules
😄@cjbj Anything else I need to sign & send? I didn't test this btw but assume that it's working given the previous conversations were towards merging it.