-
Notifications
You must be signed in to change notification settings - Fork 641
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 to config electron-updater for a private GitHub Repo #14
Comments
I've only ever published on GitHub, but I'm pretty sure you can do it on other providers (including your own). I'm guessing you want to configure So (and I'm just guessing here) do this: Step 3.5: Update {
...
"build": {
"publish": [{
"provider": "generic",
"url": "https://example.com"
}],
}
...
} Step 4 is GitHub specific. Step 5: Build the project: Step 6 is GitHub specific. I'm not sure what the correct values for Please reopen if you have more questions. |
Thank you for the answer, it really helped. Two more things though.
|
I'm not sure. @develar, how should files be laid out on the fileserver for a |
Url — it is base URL for installer and channel update info files. I.e both exe and latest.yml must uploaded. Layout — nothing specific. E.g https://example.com/foo — dir foo must contains these files. |
So:
with these files on the webserver:
Does that work, @mbtakanov ? |
Ok, I did what you said. I uploaded the
Unfortunately, when I start the app, an error pops up:
Could you tell me what's wrong? There is nothing in google when I search the error. And just out of curiosity, in |
@mbtakanov If you use your browser to go to the url mentioned in the error do you get a 404 or does it download the file? @develar is the problem that |
@mbtakanov Does this work for you? https://gist.github.com/iffy/0ff845e8e3f59dbe7eaf2bf24443f104 It worked for my updating my macOS app. |
Hi, thank you for going through this with me.
|
What software are you using to host your git repos on the web? GitHub? BitBucket? GitLab? Something else? I imagine most of them have a way to serve raw files. More information would help me help you.
|
If you cannot use GitHub or Bintray to serve artifacts — just use Amazon S3. It is very cheap. |
My company repo is based on GitHub, everything is the same as github.com, but it's on a private domain. Imagine I'm at the folder where are the |
@mbtakanov Can you use the |
@mbtakanov if you want silent update for boring installer — file issue to electron-builder. If you want to use private GitHub repo for update — no way (see docs for more details). |
@iffy I have few questions:
Is this ok?
in the electron file, I get the error which I posted earlier:
Is @develar right saying using private GitHub repo for update is impossible? |
Docs is clear — https://github.com/electron-userland/electron-builder/wiki/Auto-Update#private-github-update-repo So, in short, do not use private GitHub repo for autoupdate. |
@mbtakanov I'm closing this (as it seems your use case isn't supported). But open a new issue or comment on this if you have more questions. |
If @develar is correct -- then the documentation is misleading with regards to the Auto Update feature. Please change the docs to indicate that private github repos are not supported for Auto Updating. The docs at https://github.com/electron-userland/electron-builder/wiki/Auto-Update#private-github-update-repo say... "You can use a private repository for updates with electron-updater" |
@nbcnc can you file an issue on that repo? Or better yet a PR. I don't control those docs :) |
will do |
Actually, no need to change the docs. I looked at the source code and Auto Updater does support private github accounts. The only way I could get it to work is by calling the Of course, doing that is a serious security issue because your private repo token will need to be stored in the source code. Too bad GitHub doesn't offer read-only repo tokens. |
@marc-parillo Yes, as stated in the docs. https://github.com/electron-userland/electron-builder/wiki/Auto-Update#private-github-update-repo
Please read solution in the linked issue — electron-userland/electron-builder#1393 (comment) |
I know this is old, but @marc-parillo thanks for this. This was the only way I could get electron-updater working in a build with a regular private GH setup, and an org would just add unneeded overhead. Of course hard-coded tokens were far from ideal, so I ended up accessing each value via an environment variable set by dotenv on startup from an ignored .env file.
Yes, the variables are still in the built source itself, but I'm obfuscating this after webpack, so finding these are not that feasible. Its great to see it working now. 👍 By the way, what are the future plans of this feature now? I still see the docs state support for "Private GH Repos". |
@MutableLoss I'm glad you found it helpful. Fortunately, I was eventually able to host everything in an S3 bucket so I was able to bypass GH altogether. |
Hello, I can't understand from the given examples how to configure the updater. I have private company git repo on a company website and the example is all about GitHub. Where do I have to add the url to the repo? Do I have to add a credentials? If yes - where? What is the thing with the access token? I can't understand anything. Can you explain points 4, 5(what do you mean by "Publish with the publish.sh script"?) and 6 without involving GitHub?
The text was updated successfully, but these errors were encountered: