hazel icon indicating copy to clipboard operation
hazel copied to clipboard

latest.yml error

Open ih3xcode opened this issue 5 years ago • 14 comments

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()}";

ih3xcode avatar May 10 '19 15:05 ih3xcode

I get the same error.

DIDICAST avatar Sep 02 '19 07:09 DIDICAST

same

ScarVite avatar Feb 13 '20 16:02 ScarVite

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...

AndreyZakatov avatar Feb 18 '20 05:02 AndreyZakatov

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

dr3adx avatar Feb 26 '20 01:02 dr3adx

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

dracarch avatar Mar 04 '20 07:03 dracarch

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

M4rcDev avatar Apr 06 '20 12:04 M4rcDev

Same error.

shickk avatar Jun 16 '20 19:06 shickk

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

trgkyle avatar Jun 02 '21 10:06 trgkyle

Same error here

GorlikItsMe avatar Jul 30 '21 14:07 GorlikItsMe

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

insd47 avatar Aug 22 '21 17:08 insd47

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

WMordy avatar Jan 17 '22 21:01 WMordy

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

ayorich avatar May 01 '22 09:05 ayorich

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?

asmaa3107 avatar Jun 07 '23 03:06 asmaa3107

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.

WMordy avatar Jun 07 '23 06:06 WMordy