GitbookIO / nuts

:chestnut: Releases/downloads server with auto-updater and GitHub as a backend
http://nuts.gitbook.com
Apache License 2.0
1.25k stars 299 forks source link

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

Closed WeeJeWel closed 8 years ago

WeeJeWel commented 8 years ago

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 );
matjaz commented 8 years ago

+1, public repo should be able to run /wo auth.

MarshallOfSound commented 8 years ago

@WeeJeWel If you don't setup GitHub auth the API quickly reaches it's limit. Unauthenticated requests have an API limit of about 60 per hour.

SamyPesse commented 8 years ago

Sorry for being late.

@WeeJeWel, I agree in theory it should not require an API token, but as @MarshallOfSound said, the API limit is very low and it's probably better to enforce the use of an API authentication.

WeeJeWel commented 8 years ago

@SamyPesse then still I would suggest to use a console.info, and don't throw an exception. It's pretty harsh :)