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

latest.yml error #63

Open
ih3xcode opened this issue May 10, 2019 · 14 comments
Open

latest.yml error #63

ih3xcode opened this issue May 10, 2019 · 14 comments

Comments

@ih3xcode
Copy link

Im using electron-updater;
its throwing: Cannot find channel "latest.yml" update info: HttpError: 404
config:
const { autoUpdater } = require("electron-updater") const server = "https://hazel.mineinfo80.now.sh/"; const feed = "${server}/update/${process.platform}/${app.getVersion()}";

@DIDICAST
Copy link

DIDICAST commented Sep 2, 2019

I get the same error.

@ScarVite
Copy link

same

@AndreyZakatov
Copy link

Hello, mb you have double-"/" ? Cuz your server constant ended on '/' and feed is {server}/..

Seems like result feed is https://hazel.mineinfo80.now.sh//update...

@dr3adx
Copy link

dr3adx commented Feb 26, 2020

CAN ANYONE FUCKING ANSWER FROM THE FUCKING CREATORS U PIECES OF TRASH, EVERYONE HAS SAME ERROR, AND STUPID DUMB DOCUMENTATION EXPLAINS NOTHING

@dracarch
Copy link

dracarch commented Mar 4, 2020

I got the same error.
@electron/autoUpdater and @electron-updater/autoUpdater are different things
@electron/autoUpdater gets RELEASE file and download latest .nupkg package whose path written in RELEASE
@electron-updater/autoUpdater gets latest.yml and download the latest .exe installer whose path written in latest.yml
For usage of electron-updater server, a static file service is enough
image

@M4rcDev
Copy link

M4rcDev commented Apr 6, 2020

Same problem, package is not usable like this with @electron-updater/autoUpdater. Hazel is not supposed to be compatible...

@shickk
Copy link

shickk commented Jun 16, 2020

Same error.

@trgkyle
Copy link

trgkyle commented Jun 2, 2021

any one explane for this error? is Hazel is support for private repo and download release ???

@GorlikItsMe
Copy link

Same error here

@insd47
Copy link

insd47 commented Aug 22, 2021

I changed some codes to make electron-updater work well.
these codes will add /files route on your server, serving each release file directly.

./lib/routes.js

...
  // aded new lines below exports.releases
  exports.files = async (req, res) => {
    const { filename } = req.params;
    const latest = await loadCache();

    if (!latest.files[filename]) {
      send(res, 404, `can't load ${filename}`)
      return
    }

    if (shouldProxyPrivateDownload) {
      proxyPrivateDownload(latest.files[filename], req, res);
      return
    }

    res.writeHead(302, {
      Location: latest.files[filename].url
    })
    res.end()
  }
...

./lib/cache.js

...
    // Clear list of download links
    this.latest.platforms = {}
    this.latest.files = {}

    for (const asset of release.assets) {
      const { name, browser_download_url, url, content_type, size } = asset

      // added new lines
      this.latest.files[name] = {
        name,
        api_url: url,
        url: browser_download_url,
        content_type,
        size: Math.round(size / 1000000 * 10) / 10
      }

      if (name === 'RELEASES') {
...

./lib/index.js

...
  // Define a route for every relevant path
  ...
  router.get('/files/:filename', routes.files);
...

and then I removed autoUpdater.setFeedURL({ url }) and added dev-app-update.yml at ./

provider: generic
url: <hazel-server-url>/files

@WMordy
Copy link

WMordy commented Jan 17, 2022

I changed some codes to make electron-updater work well. these codes will add /files route on your server, serving each release file directly.

./lib/routes.js

...
  // aded new lines below exports.releases
  exports.files = async (req, res) => {
    const { filename } = req.params;
    const latest = await loadCache();

    if (!latest.files[filename]) {
      send(res, 404, `can't load ${filename}`)
      return
    }

    if (shouldProxyPrivateDownload) {
      proxyPrivateDownload(latest.files[filename], req, res);
      return
    }

    res.writeHead(302, {
      Location: latest.files[filename].url
    })
    res.end()
  }
...

./lib/cache.js

...
    // Clear list of download links
    this.latest.platforms = {}
    this.latest.files = {}

    for (const asset of release.assets) {
      const { name, browser_download_url, url, content_type, size } = asset

      // added new lines
      this.latest.files[name] = {
        name,
        api_url: url,
        url: browser_download_url,
        content_type,
        size: Math.round(size / 1000000 * 10) / 10
      }

      if (name === 'RELEASES') {
...

./lib/index.js

...
  // Define a route for every relevant path
  ...
  router.get('/files/:filename', routes.files);
...

and then I removed autoUpdater.setFeedURL({ url }) and added dev-app-update.yml at ./

provider: generic
url: <hazel-server-url>/files

Thanks this one did the trick

@ayorich
Copy link

ayorich commented May 1, 2022

I changed some codes to make electron-updater work well. these codes will add /files route on your server, serving each release file directly.

./lib/routes.js

...
  // aded new lines below exports.releases
  exports.files = async (req, res) => {
    const { filename } = req.params;
    const latest = await loadCache();

    if (!latest.files[filename]) {
      send(res, 404, `can't load ${filename}`)
      return
    }

    if (shouldProxyPrivateDownload) {
      proxyPrivateDownload(latest.files[filename], req, res);
      return
    }

    res.writeHead(302, {
      Location: latest.files[filename].url
    })
    res.end()
  }
...

./lib/cache.js

...
    // Clear list of download links
    this.latest.platforms = {}
    this.latest.files = {}

    for (const asset of release.assets) {
      const { name, browser_download_url, url, content_type, size } = asset

      // added new lines
      this.latest.files[name] = {
        name,
        api_url: url,
        url: browser_download_url,
        content_type,
        size: Math.round(size / 1000000 * 10) / 10
      }

      if (name === 'RELEASES') {
...

./lib/index.js

...
  // Define a route for every relevant path
  ...
  router.get('/files/:filename', routes.files);
...

and then I removed autoUpdater.setFeedURL({ url }) and added dev-app-update.yml at ./

provider: generic
url: <hazel-server-url>/files

thanks for this, it really did the trick. Have to make some edits to suite my bundled app

@asmaa3107
Copy link

I changed some codes to make electron-updater work well. these codes will add /files route on your server, serving each release file directly.

./lib/routes.js

...
  // aded new lines below exports.releases
  exports.files = async (req, res) => {
    const { filename } = req.params;
    const latest = await loadCache();

    if (!latest.files[filename]) {
      send(res, 404, `can't load ${filename}`)
      return
    }

    if (shouldProxyPrivateDownload) {
      proxyPrivateDownload(latest.files[filename], req, res);
      return
    }

    res.writeHead(302, {
      Location: latest.files[filename].url
    })
    res.end()
  }
...

./lib/cache.js

...
    // Clear list of download links
    this.latest.platforms = {}
    this.latest.files = {}

    for (const asset of release.assets) {
      const { name, browser_download_url, url, content_type, size } = asset

      // added new lines
      this.latest.files[name] = {
        name,
        api_url: url,
        url: browser_download_url,
        content_type,
        size: Math.round(size / 1000000 * 10) / 10
      }

      if (name === 'RELEASES') {
...

./lib/index.js

...
  // Define a route for every relevant path
  ...
  router.get('/files/:filename', routes.files);
...

and then I removed autoUpdater.setFeedURL({ url }) and added dev-app-update.yml at ./

provider: generic
url: <hazel-server-url>/files

I am Facing Same Issue But I am working with github releases with private repo , ANY HELP in my case?

@WMordy
Copy link

WMordy commented Jun 7, 2023

I changed some codes to make electron-updater work well. these codes will add /files route on your server, serving each release file directly.

./lib/routes.js

...
  // aded new lines below exports.releases
  exports.files = async (req, res) => {
    const { filename } = req.params;
    const latest = await loadCache();

    if (!latest.files[filename]) {
      send(res, 404, `can't load ${filename}`)
      return
    }

    if (shouldProxyPrivateDownload) {
      proxyPrivateDownload(latest.files[filename], req, res);
      return
    }

    res.writeHead(302, {
      Location: latest.files[filename].url
    })
    res.end()
  }
...

./lib/cache.js

...
    // Clear list of download links
    this.latest.platforms = {}
    this.latest.files = {}

    for (const asset of release.assets) {
      const { name, browser_download_url, url, content_type, size } = asset

      // added new lines
      this.latest.files[name] = {
        name,
        api_url: url,
        url: browser_download_url,
        content_type,
        size: Math.round(size / 1000000 * 10) / 10
      }

      if (name === 'RELEASES') {
...

./lib/index.js

...
  // Define a route for every relevant path
  ...
  router.get('/files/:filename', routes.files);
...

and then I removed autoUpdater.setFeedURL({ url }) and added dev-app-update.yml at ./

provider: generic
url: <hazel-server-url>/files

I am Facing Same Issue But I am working with github releases with private repo , ANY HELP in my case?
You have to setup Github credentials on hazel before deploy and then it will download the artifact correctly I had the same use case.

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

No branches or pull requests