-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
electron-publish fails behind proxy server #6286
Comments
It seems clear that the mechanisms used by electron-updater clearly can work with a proxy server. The real issue is a lack of documentation on how to manually configure the autoUpdater to use a proxy. While it appears that I can workaround this by doing `MyElectronApp.AppImage --proxy-server=my.proxy.host:80, I don't want our users to have to specify this on the command line. Is there another way to specify this information either with configuration or programmatically? |
By the way, the publish step also seems to require additional configuration to work with the proxy server on all platforms... |
I'm not familiar with how the
Is it possible to add a Host to your headers for electron-updater?
|
Thanks, --proxy-server does allow me to get past the Checking for Updates issue on Linux. The remaining problem is how to get |
@robertpatrick would you be willing to provide any console logs with |
@mmaietta I am willing to share this output with you directly but I am hesitant to put it on GitHub for all to see due to concerns about exposing sensitive information. If you want to send me an email to robert (dot) patrick at oracle (dot) com, I will send them to you. If you have some other way in which you would prefer me sharing this data, just let me know... |
@mmaietta OK, here is the output from my Windows machine (since it doesn't contain any sensitive info): |
@mmaietta It seems clear to me that the publishing process itself is not honoring the proxy server and instead trying to push the artifacts directly to GitHub (140.82.112.5 -- lb-140-82-112-5-iad.github.com) rather than routing those requests through the proxy server. The rest of electron-builder seems to work with the proxy server so it would be great if we could figure out how to get uploading the artifacts during publishing to honor/use the proxy server. |
I found this, would this help with routing? Allows you to specify a dedicated host. Perhaps you could route it internally to reach github? Might be a potential workaround, but just a shot in the dark. electron-builder/packages/electron-publish/src/gitHubPublisher.ts Lines 259 to 261 in 286d768
electron-builder/packages/builder-util-runtime/src/publishOptions.ts Lines 96 to 100 in 286d768
I'm not familiar without how to set up a debug environment for this. This is the first time I've read of a proxy not working tbh |
@mmaietta I spent some time looking at this code yesterday. It seems to me that the problem is that we need to be able to configure the I could get by with a mechanism to generate the |
For example, this code below is an example of one of the places const HttpsProxyAgent = require('https-proxy-agent');
...
githubRequest(path, token, data = null, method) {
// host can contains port, but node http doesn't support host as url does
const baseUrl = url_1.parse(`https://${this.info.host || "api.github.com"}`);
const options = {
hostname: baseUrl.hostname,
port: baseUrl.port,
path: this.info.host != null && this.info.host !== "github.com" ? `/api/v3${path.startsWith("/") ? path : `/${path}`}` : path,
headers: { accept: "application/vnd.github.v3+json" },
};
const proxy = process.env.HTTPS_PROXY || process.env.HTTP_PROXY;
if (proxy) {
options.agent = new HttpsProxyAgent(proxy);
}
return builder_util_runtime_1.parseJson(nodeHttpExecutor_1.httpExecutor.request(builder_util_runtime_1.configureRequestOptions(options, token, method), this.context.cancellationToken, data));
} |
In looking at the
|
makes use of 'http_proxy' and 'https_proxy' environment variables in order to allow for various tasks to be performed from behind a corporate proxy. Requires third party dependencies because node's standard built in http.Agent does not handle proxies natively. closes electron-userland#5906 fixes electron-userland#6286
From following through these code paths, it appears that all of these places end up using |
@baparham That makes sense. I chimed in on your PR so hopefully it will be merged! |
…6286) (#5906) makes use of 'http_proxy' and 'https_proxy' environment variables in order to allow for various tasks to be performed from behind a corporate proxy. Requires third party dependencies because node's standard built in http.Agent does not handle proxies natively. closes #5906 fixes #6286
Released in 22.14.7 |
Explicitly set the protocol to https on the request objects to allow publishing to work from behind a proxy server when the https_proxy environment variable is set. Closes electron-userland#6286
Explicitly set the protocol to https on the request objects to allow publishing to work from behind a proxy server when the https_proxy environment variable is set. Closes #6286
I have forked the electron-updater-example and updated it to use current versions and include MacOS code-signing. You can find the repo at Electron Updater Example.
After publishing artifacts for MacOS and Linux (so far), the MacOS app seems to work fine from inside of our corporate network (which requires the use of a proxy server to reach the Internet).
The AppImage version of the app is failing while trying to check for updates inside our corporate network.
What am I missing? curl and firefox are able to find github.com without issue. How do I get electron-updater to use our proxy server on Linux?
The text was updated successfully, but these errors were encountered: