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

Auto Update Custom Provider Example #4359

Closed
devinhaughey opened this issue Oct 28, 2019 · 2 comments
Closed

Auto Update Custom Provider Example #4359

devinhaughey opened this issue Oct 28, 2019 · 2 comments
Labels

Comments

@devinhaughey
Copy link

electron-builder: 20.38.5
electron-updater: 4.0.14
Target: Windows_64

I am trying to use the auto-updater to contact a custom server using authentication and bearer tokens, but it appears that there isn't an option for the generic server to pass http headers or any sort of authentication to a server. I looked into the source code and saw that it is possible to pass the http headers, but the libraries aren't exposed for usage in the generic server provider code or custom.

In researching this, I came across this post about custom providers #3261 which describes what I would like to, but there isn't any documentation on how to use it besides a comment to look at the test as an example.

Has anyone used the custom provider to pass http headers or authentication like I would like to do?
Could someone provide an example or update the documentation for usage of custom provider for auto-updater?

@W1M0R
Copy link

W1M0R commented Nov 14, 2019

You can look at these files for usage ideas:
https://github.com/electron-userland/electron-builder/blob/master/packages/electron-publish/src/publisher.ts
https://github.com/electron-userland/electron-builder/blob/master/test/src/PublishManagerTest.ts

For an electron-builder configuration in your package.json that looks like this:

  "build": {
    "directories": {
      "buildResources": "resources",
      "output": "release"
    },
    "publish": {
      "provider": "custom"
    }
  },

Put the following file in your buildResources folder, e.g. resources/electron-publisher-custom.js:

const electronPublish = require('electron-publish');
class Publisher extends electronPublish.Publisher {
  async upload(task) {
    console.log('electron-publisher-custom', task.file);
  }
};
module.exports = Publisher;

Run electron-builder --publish always to see the output of the custom provider.

@stale
Copy link

stale bot commented Jan 13, 2020

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the backlog label Jan 13, 2020
@stale stale bot closed this as completed Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants