vercel / hazel

Lightweight update server for Electron apps
https://twitter.com/notquiteleo/status/893547786255421441
MIT License
2.91k stars 387 forks source link

latest.yml error #63

Open ih3xcode opened 5 years ago

ih3xcode commented 5 years ago

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 commented 5 years ago

I get the same error.

ScarVite commented 4 years ago

same

AndreyZakatov commented 4 years ago

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 commented 4 years ago

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

dracarch commented 4 years ago

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 commented 4 years ago

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

shickk commented 4 years ago

Same error.

trgkyle commented 3 years ago

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

GorlikItsMe commented 3 years ago

Same error here

insd47 commented 3 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

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.