diff --git a/README.md b/README.md index 3790bbe8..70563367 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,9 @@ All main configuration could be done thrue config.json. "html" : true, "img" : false }, - "oauth_client_id" : "891c251b925e4e967fa9", /* github app id */ - "oauth_client_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545", /* github app secret */ + "github_id" : "891c251b925e4e967fa9", /* github app id */ + "github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545", /* github app secret */ + "dropbox_id" : "o7d6llji052vijk", "show_keys_panel" : true, /* show classic panel with buttons of keys */ "server" : true, /* server mode or testing mode */ "logs" : false, /* logs or console ouput */ @@ -97,7 +98,7 @@ Authorization Thru openID Cloud Commander could authorize clients on GitHub. All things that should be done is must be added **id** and **secret** of application from github settings page and added to **config.json** or env varibles with names: -*oauth_client_id* and *oauth_client_secret* that is more secure way. +*github_id* and *github_secret* that is more secure way. Starting diff --git a/config.json b/config.json index f08472da..205537c8 100644 --- a/config.json +++ b/config.json @@ -7,8 +7,9 @@ "html" : false, "img" : true }, - "oauth_client_id" : "891c251b925e4e967fa9", - "oauth_client_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545", + "github_id" : "891c251b925e4e967fa9", + "github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545", + "dropbox_id" : "o7d6llji052vijk", "show_keys_panel" : true, "server" : true, "logs" : false, diff --git a/lib/client/storage/_github.js b/lib/client/storage/_github.js index ffdf9bdd..3f79e549 100644 --- a/lib/client/storage/_github.js +++ b/lib/client/storage/_github.js @@ -8,8 +8,8 @@ var CloudCommander, Util, DOM, $, Github, cb; APIURL = '/api/v1', AuthURL = APIURL + '/auth', - ClientIdURL = APIURL + '/client_id', - CLIENT_ID, + GitHubIdURL = APIURL + '/github_id', + GitHub_ID, Cache = DOM.Cache, GithubLocal, User, @@ -46,9 +46,9 @@ var CloudCommander, Util, DOM, $, Github, cb; function setConfig(pCallBack){ DOM.ajax({ - url : ClientIdURL, + url : GitHubIdURL, success : function(pData){ - CLIENT_ID = pData; + GitHub_ID = pData; Util.exec(pCallBack); } }); @@ -113,7 +113,7 @@ var CloudCommander, Util, DOM, $, Github, cb; //window.open('welcome.html', 'welcome','width=300,height=200,menubar=yes,status=yes')"> window.location = 'https://github.com/login/oauth/authorize?client_id=' + - CLIENT_ID + '&&scope=repo,user,gist'; + GitHub_ID + '&&scope=repo,user,gist'; } } diff --git a/lib/server/auth.js b/lib/server/auth.js index 629cd629..53a8e25c 100644 --- a/lib/server/auth.js +++ b/lib/server/auth.js @@ -36,18 +36,19 @@ }; function authenticate(pCode, pCallBack) { - var lId = Config.oauth_client_id, - lSecret = Config.oauth_client_secret, + var lId = Config.github_id, + lSecret = Config.github_secret, lEnv = process.env, - lClientId = lEnv.oauth_client_id || lId, - lClientSecret = lEnv.oauth_client_secret || lSecret; + lClientId = lEnv.github_id || lId, + lClientSecret = lEnv.github_secret || lSecret; var data = qs.stringify({ client_id : lClientId, client_secret : lClientSecret, code : pCode }); + console.log(data); GithubAuth.headers = { 'content-length': data.length }; diff --git a/lib/server/rest.js b/lib/server/rest.js index b66d77f9..866c4205 100644 --- a/lib/server/rest.js +++ b/lib/server/rest.js @@ -101,11 +101,11 @@ lResult = {info: 'Cloud Commander API v1'}; break; - case 'client_id': + case 'github_id': var lEnv = process.env, lConfig = main.config; - lResult = lEnv.oauth_client_id || lConfig.oauth_client_id; + lResult = lEnv.github_id || lConfig.github_id; break; case 'kill':