Skip to content
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

Run keycloakify behind corporate proxy #257

Closed
boldt opened this issue Mar 3, 2023 · 10 comments Β· Fixed by #260
Closed

Run keycloakify behind corporate proxy #257

boldt opened this issue Mar 3, 2023 · 10 comments Β· Fixed by #260
Assignees

Comments

@boldt
Copy link

boldt commented Mar 3, 2023

If I run keycloakify behind a corporate proxy, I get the following error:

$ npx keycloakify
πŸ” Building the keycloak theme...⌚
node:events:491
      throw er; // Unhandled 'error' event
      ^

Error: connect ETIMEDOUT 140.82.121.3:443
    at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1300:16)
Emitted 'error' event on ClientRequest instance at:
    at TLSSocket.socketErrorListener (node:_http_client:494:9)
    at TLSSocket.emit (node:events:513:28)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4039,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: '140.82.121.3',
  port: 443
}

Node.js v18.11.0

Note

The npm config vars https-proxy, no-proxy and proxy are set and work well for the dependency installation and within other projects.

@lordvlad
Copy link
Collaborator

lordvlad commented Mar 4, 2023

the stack trace is a bit short, so its hard to figure out which command exactly fails, but I have a hunch that its this call here

https://github.com/InseeFrLab/keycloakify/blob/main/src/bin/tools/downloadAndUnzip.ts#L69

It should be adapted to support proxies like this https://stackoverflow.com/a/6781592

@garronej I can take a swing at it some time next week

@garronej
Copy link
Collaborator

garronej commented Mar 4, 2023

Hey @lordvlad,
Thank you, that would be great πŸ˜€

@lordvlad lordvlad self-assigned this Mar 7, 2023
lordvlad added a commit that referenced this issue Mar 7, 2023
Fixes #257

Use make-fetch-happen for the download step. This lib will use `PROXY`
and `HTTPS_PROXY` and `NO_PROXY` env vars out of the box.

Additionally we'll try and get proxy config from npm. Unfortunately,
the most straightforward options is to call npm config to do this, since
npm  config is not easily extracted as a lib and we don't want to
replicate the resolution mechanisms.
@lordvlad
Copy link
Collaborator

lordvlad commented Mar 7, 2023

@boldt I tested my implementation with squid proxy on localhost, let me know how it works for you

@garronej
Copy link
Collaborator

garronej commented Mar 7, 2023

@boldt 6.12.7-rc.0 is available if you want to test

EDIT: Sorry it's 6.13.0-rc.0 that contains the changes

@garronej garronej closed this as completed Mar 8, 2023
@garronej garronej reopened this Mar 8, 2023
@boldt
Copy link
Author

boldt commented Mar 9, 2023

npx keycloakify@6.12.7-rc.0 still throws the error.

The release 6.13.0-rc.0 is not available via npm yet:

@garronej
Copy link
Collaborator

garronej commented Mar 9, 2023

My bad! it's available now.

@boldt
Copy link
Author

boldt commented Mar 9, 2023

$ npx keycloakify@6.13.0-rc.0
npm ERR! code ETARGET
npm ERR! notarget No matching version found for keycloakify@6.13.0-rc.0.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

I still can't see it on npm: https://www.npmjs.com/package/keycloakify?activeTab=versions

@garronej
Copy link
Collaborator

garronej commented Mar 9, 2023

sorry for all the back en forth, I don't understand what whent up with the CI.
Anyway, it's available for real this time: https://www.npmjs.com/package/keycloakify/v/6.13.0-rc.0

@boldt
Copy link
Author

boldt commented Mar 13, 2023

That version works. Thanks!

@garronej
Copy link
Collaborator

Great thank you for the feedback, I'll release then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants