-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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-updater and GitHub Releases from a private repo (2nd attempt) #2314
Comments
You need to set |
@MarkusBansky Thanks for your reply! What about users who do not have a |
You need to set |
For what it's worth, I had to go about it a different way. I didn't want to hard-code my GitHub Repo Token inside the application (it's not a read-only token), so as soon as the user of my application logs in, the app retrieves the GH token from my server and uses it to construct the setFeedURL for the updater just before it checks for updates:
|
Really glad you guys got to the bottom of how to use setFeedURL! I wasn't able to figure this out from the docs. A couple notes on GH tokens and private repos: I still need to use setFeedURL in order to test a new build (including updating to it) before distributing it to my install base. setFeedURL allows me to reference a "prerelease" or a "beta" channel so I can QA the upgrade to the new app. Now I just need to build a settings flag I can flip in the frontend of the app! I think the docs should be updated since saying "don't use setFeedURL" is misleading (especially when in the same doc it describes the method and its parameters). Any takers? If not, I'll try to update and send a PR (but @nbcnc should get credit for this one). |
@CydeSwype It costs to the server having to stream the file using transfer bandwidth or you give it through another way? |
Update from my earlier comment on Jan 22nd: auto updater has stopped working for GitHub private repos (and public repos from what I understand, though I haven't tested this independently). I have since switched my releases to use AWS S3 bucket and it is working. See this thread: |
@marceloavf yes there is a cost to stream the yml file, but it's a short text file, so cost is nominal (acceptable for our for-profit company's use case). You're right in assuming that the solution I mentioned of sitting in the middle of the request to provide more granular access control requires that the file transfer ALSO needs to go through that same service. If ever the end-user/client is making a direct request to GH with that token, they could discover that and use the token for any other purpose (i.e. deleting releases). @nbcnc I couldn't get reliable streaming of the binary files from GH with private repo (frequent timeouts on download) so we ended up writing a script to copy new build binaries to Google Cloud Storage. We still reference the yml files in our private GitHub repo that the desktop app checks to see if there's a new binary to download, but when the yml file references a newer version, the desktop app hits our webserver and then redirects that request to GCS for the actual binary. This set up has been very reliable for us. |
I try this way, but it still says in log authentication failed . TOken is invalid. |
Hello @hmpargi, I know this seems to be old, but I'm sure you should help your next colleagues with this difficulty.
NOTE: Be careful when using this method. |
Hello, and thanks @develar for your continued support! My previous issue #2292 was closed prematurely and may have since been buried.
Here's the quick summary: I'm building an app for use by employees at my company. I would like to use GitHub Releases to serve updates from a private repository. Can I do this by setting a
token
in the app'spackage.json
as follows?My
main.js
simply importselectron-updater
and callsautoUpdater.checkForUpdatesAndNotify()
when the app is ready. On startup, however, I get the following error in my logs:[error] Error: Error: Unable to find latest version on GitHub (https://api.github.com/repos/<owner>/training-tracker/releases/latest), please ensure a production release exists
followed byERR_CONNECTION_REFUSED
.Following the link above, I see this in my browser:
What am I missing? Your advice is appreciated!
The text was updated successfully, but these errors were encountered: