mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
added shell directory with shell files
This commit is contained in:
parent
fa1caadede
commit
d46c17d46a
11 changed files with 110 additions and 34 deletions
39
config.json
39
config.json
|
|
@ -1,22 +1,19 @@
|
|||
{
|
||||
"cache" : {"allowed" : false},
|
||||
"appcache" : false,
|
||||
"minification" : {
|
||||
"js" : false,
|
||||
"css" : false,
|
||||
"html" : false,
|
||||
"img" : false
|
||||
},
|
||||
"github_id" : "891c251b925e4e967fa9",
|
||||
"github_secret" : "afe9bed1e810c5dc44c4c2a953fc6efb1e5b0545",
|
||||
"dropbox_key" : "0nd3ssnp5fp7tqs",
|
||||
"dropbox_secret" : "r61lxpchmk8l06o",
|
||||
"dropbox_chooser_key" : "o7d6llji052vijk",
|
||||
"show_keys_panel" : true,
|
||||
"server" : true,
|
||||
"logs" : false,
|
||||
"socket" : true,
|
||||
"port" : 80,
|
||||
"ip" : null,
|
||||
"rest" : true
|
||||
{
|
||||
"api_url" :"/api/v1",
|
||||
"appcache" : false,
|
||||
"cache" : {"allowed" : false},
|
||||
"minification" : {
|
||||
"js" : false,
|
||||
"css" : false,
|
||||
"html" : false,
|
||||
"img" : false
|
||||
},
|
||||
"github_id" : "ec1f2e74b35a361e10bc",
|
||||
"logs" : false,
|
||||
"show_keys_panel" : true,
|
||||
"server" : true,
|
||||
"socket" : true,
|
||||
"port" : 80,
|
||||
"ip" : null,
|
||||
"rest" : true
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
var CloudCommander, Util, DOM, CloudFunc, CodeMirror;
|
||||
var CloudCommander, Util, DOM, CodeMirror;
|
||||
/* object contains editors CodeMirror */
|
||||
(function(){
|
||||
"use strict";
|
||||
|
|
|
|||
|
|
@ -1,17 +1,18 @@
|
|||
var CloudCommander, Util, DOM, Dropbox;
|
||||
var CloudCommander, DOM, Dropbox;
|
||||
/* module for work with github */
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
const cloudcmd = CloudCommander;
|
||||
|
||||
const cloudcmd = CloudCommander,
|
||||
CHOOSER_API = 'https://www.dropbox.com/static/api/1/dropbox.js';
|
||||
|
||||
var CLIENT_ID,
|
||||
DropBoxStore = {},
|
||||
options = {
|
||||
linkType: "direct",
|
||||
success: function(files) {
|
||||
console.log("Here's the file link:" + files[0].link);
|
||||
console.log("Here's the file link:" + files[0].link);
|
||||
},
|
||||
cancel: function() {
|
||||
console.log('Chose something');
|
||||
|
|
@ -28,7 +29,7 @@ var CloudCommander, Util, DOM, Dropbox;
|
|||
|
||||
cloudcmd.getConfig(function(pConfig){
|
||||
var lElement = DOM.anyload({
|
||||
src : 'https://www.dropbox.com/static/api/1/dropbox.js',
|
||||
src : CHOOSER_API,
|
||||
not_append : true,
|
||||
id : 'dropboxjs',
|
||||
func : DropBoxStore.choose
|
||||
|
|
@ -38,6 +39,7 @@ var CloudCommander, Util, DOM, Dropbox;
|
|||
var lDropBoxId = pConfig.dropbox_chooser_key;
|
||||
lElement.setAttribute('data-app-key', lDropBoxId);
|
||||
document.body.appendChild(lElement);
|
||||
|
||||
console.timeEnd('dropbox load');
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
|
||||
var main = global.cloudcmd.main,
|
||||
Util = main.util,
|
||||
APIURL = '/api/v1',
|
||||
Config = main.config,
|
||||
APIURL = Config.api_url,
|
||||
OK = 200,
|
||||
Header = main.generateHeaders('api.json', false);
|
||||
|
||||
|
|
@ -94,7 +95,11 @@
|
|||
*/
|
||||
function onGET(pParams){
|
||||
var lResult = {error: 'command not found'},
|
||||
lCmd = pParams.command;
|
||||
lCmd = pParams.command,
|
||||
lConfig = main.config,
|
||||
lEnv = process.env,
|
||||
lEnvId,
|
||||
lConfigId;
|
||||
|
||||
switch(lCmd){
|
||||
case '':
|
||||
|
|
@ -102,12 +107,19 @@
|
|||
break;
|
||||
|
||||
case 'github_id':
|
||||
var lEnv = process.env,
|
||||
lConfig = main.config;
|
||||
|
||||
lResult = lEnv.github_id || lConfig.github_id;
|
||||
lEnvId = lEnv.github_id;
|
||||
lConfigId = lConfig.github_id,
|
||||
|
||||
lResult = lEnvId || lConfigId;
|
||||
break;
|
||||
|
||||
case 'dropbox_chooser_id':
|
||||
lEnvId = lEnv.dropbox_chooser_id;
|
||||
lConfigId = lConfig.dropbox_chooser_id;
|
||||
|
||||
lResult = lEnvId || lConfigId;
|
||||
break;
|
||||
|
||||
case 'kill':
|
||||
pParams.data = {
|
||||
mesage: 'Cloud Commander was killed'
|
||||
|
|
|
|||
12
shell/c9kill.sh
Executable file
12
shell/c9kill.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
kill -9 `ps ax|grep node-openshift|grep -v grep|awk '{print $1}'`
|
||||
# print finded process
|
||||
ProcessList=`ps ax|grep node-openshift`
|
||||
echo $ProcessList
|
||||
# getting pid of process
|
||||
PID=`echo "${ProcessList}"|grep -v grep|awk '{print $1}'`
|
||||
echo $PID
|
||||
#kill it
|
||||
if test ! $PID
|
||||
then echo 'process not found'
|
||||
else kill -9 $PID && echo 'killed process'
|
||||
fi
|
||||
|
|
@ -6,4 +6,4 @@
|
|||
:: 866 charset to Unicode 65001 sometime
|
||||
:: when it's neaded.
|
||||
:: -------------------------------------
|
||||
node cloudcmd || chcp 866
|
||||
node ../cloudcmd || chcp 866
|
||||
10
shell/deploy.sh
Executable file
10
shell/deploy.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
echo 'appfog'
|
||||
af update
|
||||
echo 'http://cloudcmd.aws.af.cm/'
|
||||
echo 'cloud foundry'
|
||||
vmc update
|
||||
echo 'http://cloudcmd.cloudfoundry.com/'
|
||||
echo 'nodester'
|
||||
git push nodester master
|
||||
echo 'heroku'
|
||||
git push heroku master
|
||||
17
shell/kill.js
Normal file
17
shell/kill.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
/* c9.io kill active node process */
|
||||
|
||||
(function(){
|
||||
"use strict";
|
||||
|
||||
var exec = require('child_process').exec,
|
||||
lCmd = 'kill -9' + ' ' + /* kill finded process */
|
||||
'`ps ax' + '|' + /* show all process */
|
||||
'grep node-openshift' + '|' + /* find node-openshift */
|
||||
'grep -v grep' + '|' + /* exlude grep command */
|
||||
'awk "{print $1}"`'; /* show first collumn */
|
||||
|
||||
exec(lCmd, function(error, stdout, stderr){
|
||||
console.log(error || stdout || stderr);
|
||||
});
|
||||
|
||||
})();
|
||||
13
shell/secret.bat
Normal file
13
shell/secret.bat
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# part of Cloud Commander
|
||||
# win32 version
|
||||
# secrets of github and dropbox
|
||||
# must not be shared
|
||||
# http://github.com/coderaiser/cloudcmd
|
||||
#
|
||||
# for using just add %-symbol on start and end of name
|
||||
# like %github_secret%
|
||||
|
||||
github_secret=e21b3724d84f0f7570d2d04d8e055f3cc3be3071
|
||||
dropbox_key=0nd3ssnp5fp7tqs
|
||||
dropbox_chooser_key=o7d6llji052vijk
|
||||
13
shell/secret.sh
Normal file
13
shell/secret.sh
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# part of Cloud Commander
|
||||
# *nix version
|
||||
# secrets of github and dropbox
|
||||
# must not be shared
|
||||
# http://github.com/coderaiser/cloudcmd
|
||||
#
|
||||
# for using just add $-symbol on start of name
|
||||
# like $github_secret
|
||||
|
||||
export github_secret=e21b3724d84f0f7570d2d04d8e055f3cc3be3071
|
||||
export dropbox_key=0nd3ssnp5fp7tqs
|
||||
export dropbox_chooser_key=o7d6llji052vijk
|
||||
Loading…
Add table
Add a link
Reference in a new issue