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

How do I use the private github auto update feature? #1393

Closed
akorchev opened this issue Mar 21, 2017 · 14 comments
Closed

How do I use the private github auto update feature? #1393

akorchev opened this issue Mar 21, 2017 · 14 comments

Comments

@akorchev
Copy link
Contributor

  • Version:
    15.6.4

1.10.4

  • Target:
    Windows 32 bit

How does one enable private github API support? It seems that GH_TOKEN is the only thing required but for some reason my app continues to make HTTP requests to the repo URL instead of api.github.com. Do I need to use setFeedURL?

@AlienHoboken
Copy link
Contributor

AlienHoboken commented Mar 21, 2017

Hi @akorchev. You just need to set the GH_TOKEN environment variable. Please confirm that it is being picked up by your app by checking process.env.GH_TOKEN in your app. You can also set GH token programmatically using the same process.env.GH_TOKEN = your_gh_token if it works better for you.

N.B. private Github auto update is not yet working on Mac OSX, but I see you're on Windows so it should be fine

@akorchev
Copy link
Contributor Author

Hi @AlienHoboken. Do you mean to set GH_TOKEN during build time? If yes - I was setting it but it wasn't being picked up when the application was running. I checked the implementation and it looks as if the application needs GH_TOKEN at runtime which I don't know how to set on the client machine.

I ended up using setFeedUrl:

autoUpdater.setFeedURL({
   token: '***',
   owner: '***',
   repo: '***'
})

When I did that auto updates started working. BTW I tried on macOS and it also worked there. The only thing that didn't was starting the new version after the update was downloaded. But when I started it manually it was the latest version! Thanks for the great work!

@develar
Copy link
Member

develar commented Mar 21, 2017

which I don't know how to set on the client machine.

This provider ONLY if you have org and create DEDICATED user — only in this case you can share access token somehow. Otherwise you should use or proxy (#1370 (comment)), or s3.

@develar
Copy link
Member

develar commented Mar 21, 2017

We should add note that private GitHub provider only for very special cases and not intended/suitable for all users.

@AlienHoboken
Copy link
Contributor

You got it, @akorchev. Glad its working.

@develar agreed. My org actually have a separate release-only repository to distribute releases so source is locked down, and we distribute to controlled machines. It is a useful feature since no server is required, but special use case

@akorchev
Copy link
Contributor Author

Does electron-updater work with update servers such as https://github.com/GitbookIO/nuts? If yes do I just need to call setFeedURL? I have a nuts server deployed already. I just want to get rid of Squirrel for Windows.

@develar
Copy link
Member

develar commented Mar 21, 2017

My org actually have a separate release-only repository to distribute releases so source is locked down

Why not use s3 in this case? because github storage is free?

@develar
Copy link
Member

develar commented Mar 21, 2017

Does electron-updater work with update servers such as https://github.com/GitbookIO/nuts

Yes. Use generic provider and set url to https://YOUR_SERVER_URL/download as first provider (for auto-update), and second github (to publish to private repo).

update: downside is that url https://YOUR_SERVER_URL/download always points to a latest release files. So... well, yeach, we need to support nuts server explicitly — but for now no such requests.

@AlienHoboken
Copy link
Contributor

The adoption of additional platforms is not preferred within the org.

Also, can you use S3 with credentials through electron-updater?

@develar
Copy link
Member

develar commented Mar 21, 2017

can you use S3 with credentials through electron-updater

I suppose yes, since we use AWS SDK. You can set aws credentials env. But I am not sure.

@develar
Copy link
Member

develar commented Mar 21, 2017

The adoption of additional platforms is not preferred within the org.

+1 That's why I didn't reject your PR :)

@noahprince22
Copy link

@akorchev Did you ever get the NSIS installer working with Nuts? I've got a private repository, so I wanted to control distribution through Nuts.

@akorchev
Copy link
Contributor Author

Yes, I did. Here is how I configured it (I am using the programming API):

  builder.build({
   config: {
      publish: [
        {
          provider: 'generic',
          url: 'http://example.com/download'
        },
        {
          provider: 'github'
        }
      ],

@marceloavf
Copy link
Contributor

@akorchev Can you tell me about the use of the server when using Nuts to distribute the releases, please? Do you get any overload or everything just worked fine?

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

No branches or pull requests

5 participants