Coder Social home page Coder Social logo

nuts's Introduction

Nuts

Nuts is a simple (and smart) application to serve desktop-application releases.

Schema

It uses GitHub as a backend to store assets, and it can easily be deployed to Heroku as a stateless service. It supports GitHub private repositories (useful to store releases of a closed-source application available on GitHub).

Deploy

Features

  • ✨ Store assets on GitHub releases
  • ✨ Proxy releases from private repositories to your users
  • ✨ Simple but powerful download urls
    • /download/latest
    • /download/latest/:os
    • /download/:version
    • /download/:version/:os
    • /download/channel/:channel
    • /download/channel/:channel/:os
  • ✨ Support pre-release channels (beta, alpha, ...)
  • ✨ Auto-updates with Squirrel
    • For Mac using /update?version=<x.x.x>&platform=osx
    • For Windows using Squirrel.Windows and Nugets packages
  • ✨ Private API
  • ✨ Use it as a middleware: add custom analytics, authentication
  • ✨ Serve the perfect type of assets: .zip for Squirrel.Mac, .nupkg for Squirrel.Windows, .dmg for Mac users, ...
  • ✨ Release notes endpoint
    • /notes/:version
  • ✨ Up-to-date releases (GitHub webhooks)
  • ✨ Atom/RSS feeds for versions/channels

Deploy it / Start it

Follow our guide to deploy Nuts.

Auto-updater / Squirrel

This server provides an endpoint for Squirrel auto-updater, it supports both OS X and Windows.

Documentation

Check out the documentation for more details.

nuts's People

Contributors

aarono avatar amilajack avatar benoror avatar burakcan avatar chris-burgin avatar chrisbarless avatar develar avatar etiktin avatar fasterthanlime avatar ide avatar john-griffin avatar jsloyer avatar mathieudutour avatar michaelbrooks avatar mzmousa avatar pyro2927 avatar rbkreisberg avatar samypesse avatar theflow avatar tow8ie avatar zeke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nuts's Issues

The cache directory is not created, thus nuts fails

When I try to use nuts, it throws an error on creating the cache directory, and throws this:

Error: EPERM: operation not permitted, stat 'C:\Users\khs\AppData\Local\Temp\nuts\6441f29b52975b97bf3c6b7eb9fb2e8341c28632'

Basically, the nuts directory does not exist, but the LRU-diskcache is trying to create a folder inside it. Whose responsibility should it be to check that the parent folder is created? LRU's or nuts' ?

Github hook calling "refresh" throws exception

It looks like the GitHubBackend class does not have a versions member.

I activated the hook from github. Tailing the heroku logs I see:

2016-04-14T20:25:05.963441+00:00 app[web.1]: /app/lib/backends/github.js:42
2016-04-14T20:25:05.963476+00:00 app[web.1]:         that.versions.list();
2016-04-14T20:25:05.963479+00:00 app[web.1]:                      ^
2016-04-14T20:25:05.963480+00:00 app[web.1]:
2016-04-14T20:25:05.963481+00:00 app[web.1]: TypeError: Cannot read property 'list' of undefined
2016-04-14T20:25:05.963482+00:00 app[web.1]:     at EventEmitter.<anonymous> (/app/lib/backends/github.js:42:22)
2016-04-14T20:25:05.963482+00:00 app[web.1]:     at emitOne (events.js:90:13)
2016-04-14T20:25:05.963483+00:00 app[web.1]:     at EventEmitter.emit (events.js:182:7)
2016-04-14T20:25:05.963484+00:00 app[web.1]:     at BufferList._callback (/app/node_modules/github-webhook-handler/github-webhook-handler.js:84:15)
2016-04-14T20:25:05.963484+00:00 app[web.1]:     at BufferList.end (/app/node_modules/bl/bl.js:83:10)
2016-04-14T20:25:05.963485+00:00 app[web.1]:     at IncomingMessage.onend (_stream_readable.js:498:10)
2016-04-14T20:25:05.963486+00:00 app[web.1]:     at IncomingMessage.g (events.js:273:16)
2016-04-14T20:25:05.963486+00:00 app[web.1]:     at emitNone (events.js:80:13)
2016-04-14T20:25:05.963487+00:00 app[web.1]:     at IncomingMessage.emit (events.js:179:7)
2016-04-14T20:25:05.963493+00:00 app[web.1]:     at endReadableNT (_stream_readable.js:913:12)
2016-04-14T20:25:06.986430+00:00 heroku[web.1]: Process exited with status 1
2016-04-14T20:25:07.003944+00:00 heroku[web.1]: State changed from up to crashed

Support redirecting to artifact if repo is Public

If the repository we link nuts to is public, can we add a config option to simply redirect to the public github download URL instead of proxying it through our server and caching it.

I understand the need for proxying and caching for private repositories but public ones would greatly benefit from the ability to simply redirect to the appropriate download URL.

If you could point me in the right direction I would be happy to try PR this in.

Undefined Error

ReferenceError: versions is not defined

  • at [...]/serve/node_modules/nuts-serve/lib/nuts.js:166:16
  • at _rejected ([...]/serve/node_modules/octocat/node_modules/q/q.js:844:24)
  • at [...]/serve/node_modules/octocat/node_modules/q/q.js:870:30
  • at Promise.when ([...]/serve/node_modules/octocat/node_modules/q/q.js:1122:31)
  • at Promise.promise.promiseDispatch ([...]/serve/node_modules/octocat/node_modules/q/q.- js:788:41)
  • at [...]/serve/node_modules/octocat/node_modules/q/q.js:604:44
  • at runSingle ([...]/serve/node_modules/octocat/node_modules/q/q.js:137:13)
  • at flush ([...]/serve/node_modules/octocat/node_modules/q/q.js:125:13)
  • at _combinedTickCallback (internal/process/next_tick.js:67:7)
  • at process._tickCallback (internal/process/next_tick.js:98:9)

Support for choosing to update from different channels

Does Nuts support being able to choose which channel I want to update from? For example, I have my app with version v0.1.0. If I want to choose between uploading to version v0.1.1 or v0.1.2-alpha (channel depends on tag names), is there a way to do this? like

var platform = ...;
var version = ...; // the usual
autoUpdater.setFeedURL('http://.../update/channel/stable/platform/version")

or

autoUpdater.setFeedURL("http://.../update/channel/alpha/plaform/version")

I know electron-release-server does this, but I want to stick with Nuts.

Official Docker image to hub.docker.com

Hi,
any change to add automatic build to hub.docker.com by Gitbook? I don't want to maintain a fork just for this.
The docker run command in documentation doesn't work because gitbook/nuts image not found.

Would make getting started easier, thanks!

Support for linux

What is the update strategy for Linux? In true Linux fashion there should be a yum repo and and a repo for apt-get.

Additionally it looks like this being discussed in the atom project, atom/atom#2956.

It looks like nuts doesn't differentiate between debian and fedora based distro's. https://github.com/GitbookIO/nuts/blob/master/lib/nuts.js#L144 and https://github.com/GitbookIO/nuts/blob/master/lib/nuts.js#L145

I am going to submit a PR to support the following platform types.

  • linux_deb_64
  • linux_deb_32
  • linux_rpm_64
  • linux_rpm_32

Prerelease channel updates across releases

I'm hoping to start using nuts and I ran into a small problem. I want nuts to manage updates for two private prerelease channels (alpha and beta) in addition to public stable production channel. I want the alpha and beta clients to always get the latest available prerelease on their channel, even if it is for a different stable release. In other words, if an alpha client is currently at version 1.1.1-alpha.2 and 1.1.2-alpha.1 is available I want nuts to respond to the client's request to /updates/osx/1.1.1-alpha.2 with information about 1.1.2-alpha.1, and not just the latest stable release, 1.1.2.

I understand that the existing behavior is driven by the semver module that nuts uses. And the semver authors explicitly state that they do not support the functionality that I'm looking for. The semver-extra module offers more flexibility for working with prereleases, and it seems to have been created largely out of frustration with semver's limitations in this area.

Is there an easy way to solve this problem with nuts? (Maybe there's something I'm missing.) Or, if not, would you be open to a PR with changes to support this kind of prerelease update?

Deploy without github

Hi! Is it possible to use nuts without github (use private git or mercurial repo on the same server where nuts was deployed)?

Version not found: latest

I have correctly deployed nuts on heroku and connected it to github repository.

  • /download/0.10.0 works correctly (it's my only released version). it returns zip to download
  • /download route should give me latest version (0.10.0), instead it says "Version not found: latest"

What should I do to make "latest" work? Github release is marked "latest", so that should not be a problem, right?

screen shot 2016-07-13 at 13 55 34

Non-optimal update behavior with Squirrel.Windows

Squirrel.Windows works well with simply all releases served statically: Squirrel/Squirrel.Windows#517

However nuts is really convenient for many different reasons, but currently, it serves a truncated 'RELEASES' file, with -delta files filtered out.

The result is (from what I'm seeing)

  • squirrel downloads the RELEASES file
  • squirrel downloads the full .nuget package once
  • squirrel notifies that there's a new version
  • squirrel downloads the RELEASES file again
  • squirrel downloads the full .nuget package a second time
  • squirrel unpacks the upgrade

Ideally, what would happen is this:

  • squirrel downloads the RELEASES file
  • squirrel notifies that there's a new version
  • squirrel downloads the delta .nuget package once
  • squirrel applies the delta upgrade

Since it looks like -delta nupkg are filtered on purpose, I was wondering what was the thinking behind it?

Problem with deploying it on my server

I'm a a newbie and I need a bit help with deploying the app on my server (Debian on DigitalOcean). I deployed on Heroku (The deploy button on documentation page is not working, had to do it manually) and it works fine but when I'm trying to deploy it on my own server I can not get access to it page. I tested it locally and still can not access it through the localhost.
I followed the documentation and set all the variables and when running, it says ´Listening at Listening at http://:::6000 but I always get the page is not available, should I set something else too? thanks a lot

Update route not returning proper RELEASES file entries when using a pre-release tag (Windows).

Let's say I have 0.1.0-alpha and 0.1.1-alpha as pre-release versions for Windows.

If I call http://localhost:5000/update/win32/0.1.1-alpha/RELEASES

Then I get a RELEASES file with the following content:

522DF065733B0F00656530709A96694DC4B19E2E http://localhost:5000/download/0.1.1/lifesize.cloud-0.1.1-alpha-ia32-full.nupkg 46509171

The version is missing the -alpha tag.

If you go to that URL you get an error (see below). If you add the -alpha tag then things work.


Error: Version not found: 0.1.1
    at c:\src\nuts\lib\versions.js:120:29
    at _fulfilled (c:\src\nuts\node_modules\octocat\node_modules\q\q.js:834:54)
    at Promise.then.Q.nextTick.self.promiseDispatch.done (c:\src\nuts\node_modules\octocat\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (c:\src\nuts\node_modules\octocat\node_modules\q\q.js:796:13)
    at c:\src\nuts\node_modules\octocat\node_modules\q\q.js:604:44
    at runSingle (c:\src\nuts\node_modules\octocat\node_modules\q\q.js:137:13)
    at flush (c:\src\nuts\node_modules\octocat\node_modules\q\q.js:125:13)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)

Am I missing something here?

Squirrel.Windows receives unexpected response from RELEASES request, throws Exception

edited

I think this line needs to be removed:
https://github.com/GitbookIO/nuts/blob/master/lib/index.js#L214

Starting with a update check in Squirrel Windows:
https://github.com/Squirrel/Squirrel.Windows/blob/1ed86dbc6f4cf3adb7d111986b28203c5178a27e/src/Update/Program.cs#L240

As the response to a request to /update/:platform/:version, Squirrel.Windows expects to get a list of releases if the response has a success status code. I believe that the 204 that nuts sends back qualifies as a "Success Code".

https://github.com/Squirrel/Squirrel.Windows/blob/d6f83880ee6ebf068f1f2325c6f97255a237678c/src/Squirrel/UpdateManager.Factory.cs#L70

Squirrel.Windows probably takes the empty result and has tags the release to apply as the latest known version ( as a fallback)

https://github.com/Squirrel/Squirrel.Windows/blob/237cf945e492d1fcad678eb5522fe3565db4960e/src/Squirrel/UpdateInfo.cs#L78

Squirrel then requests the RELEASES file for the latest known version:
https://github.com/Squirrel/Squirrel.Windows/blob/d6f83880ee6ebf068f1f2325c6f97255a237678c/src/Squirrel/UpdateManager.CheckForUpdates.cs#L76

and receives another 204 with no response body:
https://github.com/GitbookIO/nuts/blob/master/lib/index.js#L214

the result is that Squirrel throws an Exception from the empty response:
https://github.com/Squirrel/Squirrel.Windows/blob/d6f83880ee6ebf068f1f2325c6f97255a237678c/src/Squirrel/UpdateManager.CheckForUpdates.cs#L124

How to release both x64 and ia32 versions for Windows

Hi,

I need to release both 32 and 64bit versions for Windows, however I am not really sure how to name and upload assets to github release.

I have /installers folder with 2 folders /win32-x64 and /win32-ia32 . Both these folders contain RELEASE, setup.exe and nupkg files.

I can rename nupkg and and setup.exe to include the platform so app-x64.nupkg, setup-x64.exe and app-ia32.nupkg, setup-ia32.exe. But what should I do with the RELEASES file?

Thanks for help

Nuts not compatible with Squirrel Windows

In digging into Squirrel Windows it seems nuts is not compatiable right now with Squirrel Windows. Squirrel is looking for a URL like the following.

/api/versions/RELEASES?version=0.9.9&platform=win32&id=appid&localVersion=0.9.9&arch=amd64

Check out the squirrel code here.

Snippet below.

uri = Utility.AddQueryParamsToUri(uri, new Dictionary<string, string> {
   { "id", latestLocalRelease.PackageName },
   { "localVersion", latestLocalRelease.Version.ToString() },
   { "arch", Environment.Is64BitOperatingSystem ? "amd64" : "x86" }
);

Route update/win/version/releases not returning latest release for prerelease versions (alpha, beta, etc)

I am testing nuts for an Electron-based application. Specifically, I’m checking on the autoUpdater feature that in turns uses Squirrel.Windows. Squirrel.Windows is normally very straight forward as it just uses files, but as I am considering nuts for OSX, and it would be worth using the same framework for Windows too.

Let’s say I have 2 Windows releases 0.1.0-alpha and 0.1.1-alpha.
If I call http://localhost:5000/api/resolve?platform=win&channel=alpha I correctly get my files from 0.1.1 alpha (RELEASE, .EXE and .NUPKG).

The atom feeder looks good too:

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <id>versions/channels/all</id>
    <title>Versions (all)</title>
    <updated>2016-03-30T21:27:59Z</updated>
    <link rel="alternate" href="http://localhost:5000/feed/channel/all.atom"/>
    <generator>Feed for Node.js</generator>
    <entry>
        <title type="html"><![CDATA[0.1.1-alpha]]></title>
        <id>http://localhost:5000/download/version/0.1.1-alpha</id>
        <link href="http://localhost:5000/download/version/0.1.1-alpha">
        </link>
        <updated>2016-03-30T21:00:13Z</updated>
    </entry>
    <entry>
        <title type="html"><![CDATA[0.1.0-alpha]]></title>
        <id>http://localhost:5000/download/version/0.1.0-alpha</id>
        <link href="http://localhost:5000/download/version/0.1.0-alpha">
        </link>
        <updated>2016-03-30T20:02:45Z</updated>
        <summary type="html"><![CDATA[This would be the release notes.]]></summary>
    </entry>
</feed>

Given the suggested auto-updater code for Electron:

var app = require('app');
var os = require('os');
var autoUpdater = require('auto-updater');
var platform = os.platform() + '_' + os.arch();
var version = app.getVersion();
autoUpdater.setFeedUrl('http://localhost:5000/update/'+platform+'/'+version);

If I’m running v0.1.0-alpha then the URL would behttp://localhost:5000/update/win/0.1.0-alpha. When it gets to this point, electron will tell Squirrel about this URL, and in turns Squirrel will try to grab “RELEASES” from that URL.

All good until now. However, when I examine the RELEASES content from this call this is all I get:

C0C95B542B50E5C48AE70D92E5C2F733BA32D4BD http://localhost:5000/download/0.1.0/lifesize.cloud-0.1.0-alpha-ia32-full.nupkg 46509055

So once I am in 0.1.0-alpha, I am pretty much stuck, because RELEASES does not contain the latest version (0.1.1).

Am I missing something here or using it wrongly? I’d expect that when I call http://localhost:5000/update/win/0.1.0-alpha?RELEASES I should get the address that points to the latest release.

I am probably wrong, but I was thinking I was going to get something along the lines of:

C0C95B542B50E5C48AE70D92E5C2F733BA32D4BD http://localhost:5000/download/0.1.0/lifesize.cloud-0.1.0-alpha-ia32-full.nupkg 46509055
522DF065733B0F00656530709A96694DC4B19E2E http://localhost:5000/download/0.1.1/lifesize.cloud-0.1.1-alpha-ia32-full.nupkg 46509171

Indicating Squirrel that now there’s a new version that can be downloaded and installed.

Nuts assumes it's always at root URL: constructs bad URLs

For example if I do app.use('/api/update/', nuts.router);, nuts will construct a wrong download URL when responding to an update request, for example: http://localhost:5050/download/version/2.1.1/linux_64?filetype=zip instead of http://localhost:5050/api/update/download/version/2.1.1/linux_64?filetype=zip

Support for /update specific channels

The rest of nuts supports channels however the /update route does not.

Currently the routes are the following.

/update/:platform/:version
/update/:platform/:version/RELEASES

I am proposing the following, adding an optional channel.

/update/:platform/:version/:channel
/update/:platform/:version/RELEASES/:channel

I can submit a PR for this but I want buy in before submitting. @SamyPesse thoughts?

Cloud service

It will be cool to setup cloud service. So, any developer (github account) can use auto update server in seconds without any efforts.

It is safe since you should sign your app in any case (so, even if server will be compromised, users will not be affected because OS will just block unsigned/unidentified app).

Is there particular reason why do you stream artifact (and cache it) instead of just redirect to github?

I am going to implement redirection instead of streaming and launch such service.

`req is not defined` from debug API

Just deployed a fresh version of nuts to heroku (using the button) and am seeing the following error on all debug API calls.

2016-02-16T19:55:27.770666+00:00 app[web.1]: ReferenceError: req is not defined
2016-02-16T19:55:27.770670+00:00 app[web.1]:     at Nuts.<anonymous> (/app/bin/web.js:59:26)
2016-02-16T19:55:27.770672+00:00 app[web.1]:     at nextInterceptor (/app/node_modules/understudy/index.js:93:23)
2016-02-16T19:55:27.770672+00:00 app[web.1]:     at iterate (/app/node_modules/understudy/index.js:108:23)
2016-02-16T19:55:27.770673+00:00 app[web.1]:     at Nuts.perform (/app/node_modules/understudy/index.js:161:5)
2016-02-16T19:55:27.770674+00:00 app[web.1]:     at wrapper (/app/node_modules/lodash/index.js:3189:19)
2016-02-16T19:55:27.770674+00:00 app[web.1]:     at Promise.apply (/app/node_modules/q/q.js:1107:26)
2016-02-16T19:55:27.770675+00:00 app[web.1]:     at Promise.promise.promiseDispatch (/app/node_modules/q/q.js:748:41)
2016-02-16T19:55:27.770676+00:00 app[web.1]:     at /app/node_modules/q/q.js:1333:14
2016-02-16T19:55:27.770677+00:00 app[web.1]:     at flush (/app/node_modules/q/q.js:110:17)
2016-02-16T19:55:27.770677+00:00 app[web.1]:     at nextTickCallbackWith0Args (node.js:453:9)

Heroku required fields

The following fields were said to be optional in the documentation but are required by heroku:

screen shot 2016-07-06 at 9 05 14 pm

Heroku Deploy Broken

Clicking the Heroku Deploy button from the docs leads to the following console error on heroku, I'm not sure if this is on you or them. The error appears to originate in their code.

longboard-classic.heroku.com/github/account/integration/:1 GET https://longboard-classic.heroku.com/github/account/integration/ 404 (Not Found)
ember.prod.js:29144SyntaxError: Unexpected token < in JSON at position 0
    at Object.parse (native)
    at https://d39g7yxq73p8i2.cloudfront.net/assets/dashboard-8b6438b1964d5e4832ae5c1ad0e45404.js:16:24339
    at y (https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:18:30923)
    at b (https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:18:31018)
    at g (https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:18:30826)
    at https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:13:23908
    at r.invoke (https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:6:6711)
    at Object.r.flush (https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:6:7243)
    at Object.n.flush (https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:6:5272)
    at Object.o.end (https://d39g7yxq73p8i2.cloudfront.net/assets/vendor-f769b9e85222fd33990db4f4a1a32575.js:5:31223)a @ ember.prod.js:29144e.default.trigger @ ember.prod.js:49166(anonymous function) @ ember.prod.js:50160r.invoke @ ember.prod.js:978r.flush @ ember.prod.js:1042n.flush @ ember.prod.js:838o.end @ ember.prod.js:166(anonymous function) @ ember.prod.js:675

URL to releases when using electron-builder

I use electron-builder to build installers / updates.

To create delta updates I have to add a URL to package.json which points to the existing releases like so:

"build": {
  "win": {
    "remoteReleases": "https://MY-NUTS.herokuapp.com/update/win32/0.3.5/",
  }
}

When I use that URL, Heroku logs tell me

method=GET path="/update/win32/0.3.5/RELEASES […] status 200
[...]
downloaded my-app-0.3.5-full.nupkg for version 0.3.5 on channel stable for windows_32

Do I have to bump the version in the URL every time? There seems to be no way to point to latest.

See also: electron-userland/electron-builder#294

Error: GitHub backend require "username" and "token" options

I'm trying to fetch assets from a public repository, but nuts keeps asking for a secret or token, both which shouldn't be needed.

Stack trace:

Error: GitHub backend require "username" and "token" options
    at new GitHubBackend (/Users/emile/Git/athom-cloud-nuts/node_modules/nuts-serve/lib/backends/github.js:21:15)
    at new Nuts (/Users/emile/Git/athom-cloud-nuts/node_modules/nuts-serve/lib/nuts.js:48:20)
    at Object.Nuts (/Users/emile/Git/athom-cloud-nuts/node_modules/nuts-serve/lib/nuts.js:21:41)
    at Object.<anonymous> (/Users/emile/Git/athom-cloud-nuts/node_modules/nuts-serve/bin/web.js:20:19)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Function.Module.runMain (module.js:441:10)
    at startup (node.js:139:18)

app.js:

var express = require('express');
var Nuts = require('nuts-serve').Nuts;

var app = express();
var nuts = Nuts({
    repository      : process.env.REPOSITORY        || "athombv/node-athom-gui",
    refreshSecret   : process.env.REFRESH_SECRET    || 'blahblah'
});

app.use('/', nuts.router);
app.listen( process.env.PORT || 4000 );

Update returning same version

I have 2 versions of my app and trying to make nuts work but; update requests are returning the same versions. Am i missing something?

screen shot 2016-03-07 at 10 48 21

screen shot 2016-03-07 at 10 48 11

Simple setFeedUrl do not work

Hi there !

Thanks a lot for this project !
In the documentation, the autoupdate seems pretty straightforward.
const autoUpdater = require('auto-updater');
autoUpdater.setFeedUrl('http://download.myapp.com/update/'+platform+'/'+version);

However, I don't understand why I get TypeError: autoUpdater.setFeedURL is not a function. After reading https://www.npmjs.com/package/auto-updater, there is no reference to such method. Are you sure the tutorial is using the right package ?

Thank a lot in advance,

Baptiste

Internal server error when client version not found for Windows RELEASES

Requesting RELEASES with a test version number (a higher version number than any released on github yet) generates an internal server error. A 500 is sent back. This causes Squirrel to throw an exception on the client.

For example: a request to /update/win32/2.2.0/RELEASES?id=xxx&localVersion=2.2.0&arch=amd64" when the highest released version is 2.1.1

The log on Heroku:

2016-04-28T16:53:48.279371+00:00 app[web.1]: Error: Version not found
2016-04-28T16:53:48.279380+00:00 app[web.1]:     at /app/lib/nuts.js:268:28
2016-04-28T16:53:48.279384+00:00 app[web.1]:     at flush (/app/node_modules/q/q.js:110:17)
2016-04-28T16:53:48.279383+00:00 app[web.1]:     at Promise.promise.promiseDispatch (/app/node_modules/q/q.js:756:13)
2016-04-28T16:53:48.368077+00:00 app[web.1]:     at _fulfilled (/app/node_modules/q/q.js:794:54)
2016-04-28T16:53:48.368064+00:00 app[web.1]: Error: Version not found
2016-04-28T16:53:48.368076+00:00 app[web.1]:     at /app/lib/nuts.js:268:28
2016-04-28T16:53:48.279381+00:00 app[web.1]:     at _fulfilled (/app/node_modules/q/q.js:794:54)
2016-04-28T16:53:48.279382+00:00 app[web.1]:     at self.promiseDispatch.done (/app/node_modules/q/q.js:823:30)
2016-04-28T16:53:48.279385+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:67:7)
2016-04-28T16:53:48.279383+00:00 app[web.1]:     at /app/node_modules/q/q.js:564:44
2016-04-28T16:53:48.368082+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:67:7)
2016-04-28T16:53:48.368079+00:00 app[web.1]:     at Promise.promise.promiseDispatch (/app/node_modules/q/q.js:756:13)
2016-04-28T16:53:48.457197+00:00 app[web.1]:     at /app/lib/nuts.js:268:28
2016-04-28T16:53:48.457185+00:00 app[web.1]: Error: Version not found
2016-04-28T16:53:48.457198+00:00 app[web.1]:     at _fulfilled (/app/node_modules/q/q.js:794:54)
2016-04-28T16:53:48.368081+00:00 app[web.1]:     at flush (/app/node_modules/q/q.js:110:17)
2016-04-28T16:53:48.457281+00:00 app[web.1]:     at self.promiseDispatch.done (/app/node_modules/q/q.js:823:30)
2016-04-28T16:53:48.279385+00:00 app[web.1]:     at process._tickCallback (internal/process/next_tick.js:98:9)
2016-04-28T16:53:48.368083+00:00 app[web.1]:     at process._tickCallback (internal/process/next_tick.js:98:9)
2016-04-28T16:53:48.368078+00:00 app[web.1]:     at self.promiseDispatch.done (/app/node_modules/q/q.js:823:30)
2016-04-28T16:53:48.368080+00:00 app[web.1]:     at /app/node_modules/q/q.js:564:44
2016-04-28T16:53:48.457284+00:00 app[web.1]:     at Promise.promise.promiseDispatch (/app/node_modules/q/q.js:756:13)
2016-04-28T16:53:48.457285+00:00 app[web.1]:     at /app/node_modules/q/q.js:564:44
2016-04-28T16:53:48.457285+00:00 app[web.1]:     at flush (/app/node_modules/q/q.js:110:17)
2016-04-28T16:53:48.457286+00:00 app[web.1]:     at _combinedTickCallback (internal/process/next_tick.js:67:7)
2016-04-28T16:53:48.457287+00:00 app[web.1]:     at process._tickCallback (internal/process/next_tick.js:98:9)

Using Nuts for the remoteReleases URL in electron-installers

I am using Nuts as my endpoint for autoUpdater, and grunt-electron-installer to generate my installer, with .nupkg, setup,exe, and RELEASES files. I was wondering if it could also be used as the URL for remoteReleases in grunt-electron-installer as it would be convenient instead of having to host separate servers for nuts and my .nupkg, RELEASES, and Setup.exe files.

ReferenceError: versions is not defined

Steps:

git clone
nvm use 4.4.4
git checkout 3.1.0
npm install
PORT=23000 GITHUB_REPO=lestad/nonstandard.js GITHUB_TOKEN=df0c8..54e0 npm start
open http://localhost:23000

Output in console:

> [email protected] start /Users/ssova/projects/nuts
> node bin/web.js

Listening at http://:::23000
ReferenceError: versions is not defined
    at /Users/ssova/projects/nuts/lib/nuts.js:166:16
    at _rejected (/Users/ssova/projects/nuts/node_modules/octocat/node_modules/q/q.js:844:24)
    at /Users/ssova/projects/nuts/node_modules/octocat/node_modules/q/q.js:870:30
    at Promise.when (/Users/ssova/projects/nuts/node_modules/octocat/node_modules/q/q.js:1122:31)
    at Promise.promise.promiseDispatch (/Users/ssova/projects/nuts/node_modules/octocat/node_modules/q/q.js:788:41)
    at /Users/ssova/projects/nuts/node_modules/octocat/node_modules/q/q.js:604:44
    at runSingle (/Users/ssova/projects/nuts/node_modules/octocat/node_modules/q/q.js:137:13)
    at flush (/Users/ssova/projects/nuts/node_modules/octocat/node_modules/q/q.js:125:13)
    at nextTickCallbackWith0Args (node.js:420:9)
    at process._tickCallback (node.js:349:13)

node v4.4.4
npm v3.8.9
OS X 10.11.4

Download aborted from Heroku due to several redirects

This is what is happening, I have deployed a free instance to test and I get:

2016-03-14T23:30:50.687511+00:00 app[web.1]: download awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:30:50.696131+00:00 app[web.1]: downloaded awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:31:59.629849+00:00 heroku[router]: at=info method=GET path="/update/win32/0.0.5/RELEASES" host=powerful-mountain-77823.herokuapp.com request_id=573d84b1-08ef-425e-83da-199a3fc95f1b fwd="190.190.128.99" dyno=web.1 connect=0ms service=159ms status=200 bytes=398
2016-03-14T23:32:00.034508+00:00 heroku[router]: at=info method=GET path="/download/0.0.5/awesome-0.0.5-full.nupkg" host=powerful-mountain-77823.herokuapp.com request_id=6ffee451-58a7-4c7a-8844-3701672c00ca fwd="190.190.128.99" dyno=web.1 connect=0ms service=6ms status=302 bytes=383
2016-03-14T23:32:00.037276+00:00 app[web.1]: download awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:32:00.038427+00:00 app[web.1]: downloaded awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:32:01.529319+00:00 heroku[router]: at=info method=GET path="/download/0.0.5/awesome-0.0.5-full.nupkg" host=powerful-mountain-77823.herokuapp.com request_id=d22ad041-49a8-49b6-831a-ecd63a4ccc29 fwd="190.190.128.99" dyno=web.1 connect=0ms service=28ms status=302 bytes=383
2016-03-14T23:32:01.528566+00:00 app[web.1]: download awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:32:01.529635+00:00 app[web.1]: downloaded awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:32:02.164249+00:00 heroku[router]: at=info method=GET path="/download/0.0.5/awesome-0.0.5-full.nupkg" host=powerful-mountain-77823.herokuapp.com request_id=3e2da614-ebf8-4db7-9c9c-d0da0e8048cd fwd="190.190.128.99" dyno=web.1 connect=2ms service=4ms status=302 bytes=383
2016-03-14T23:32:02.166949+00:00 app[web.1]: download awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:32:02.167763+00:00 app[web.1]: downloaded awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:32:02.798781+00:00 heroku[router]: at=info method=GET path="/download/0.0.5/awesome-0.0.5-full.nupkg" host=powerful-mountain-77823.herokuapp.com request_id=21481a98-3ceb-4436-a5eb-0b8f08c9328c fwd="190.190.128.99" dyno=web.1 connect=0ms service=7ms status=302 bytes=383
2016-03-14T23:32:02.801879+00:00 app[web.1]: download awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32
2016-03-14T23:32:02.806252+00:00 app[web.1]: downloaded awesome-0.0.5-full.nupkg for version 0.0.5 on channel stable for windows_32

Is this expected?

It only happens if I try grunt create-windows-installer, if I do a GET manually it works like a charm

Multiple instances of the app

@SamyPesse I was thinking of the architecture a bit for this app, it really only works with the /refresh URI with one instance. If you have multiple instances of the app running it will only refresh the versions on one of the instances. To fix this a common cache is needed. Thoughts on adding an optional dependency redis or memcached?

This is the node module I am looking at using, https://github.com/BryanDonovan/node-cache-manager. It can default to memory if an environment variable is not set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.