Skip to content

Commit aea6936

Browse files
committed
Updated source-code.
1 parent 886ff30 commit aea6936

19 files changed

+102
-21
lines changed

bundle.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
mkdir -p .bundle
2+
3+
cd .bundle
4+
cp -a ../controllers/ controllers
5+
cp -a ../databases/ databases
6+
cp -a ../definitions/ definitions
7+
cp -a ../public/ public
8+
cp -a ../private/ private
9+
cp -a ../schemas/ schemas
10+
cp -a ../resources/ resources
11+
cp -a ../tasks/ tasks
12+
cp -a ../views/ views
13+
14+
# cd ..
15+
total4 --bundle superadmin.bundle
16+
mv superadmin.bundle ../superadmin.bundle
17+
18+
cd ..
19+
rm -rf .bundle
20+
echo "DONE"

databases/cpu.sh

-1
This file was deleted.

databases/git.sh

-5
This file was deleted.

definitions/superadmin.js

+11-11
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ SuperAdmin.run_BK = function(port, callback) {
543543
var linker = app.linker;
544544
var log = app.debug ? Path.join(CONF.directory_www, linker, 'logs', 'debug.log') : Path.join(CONF.directory_console, linker + '.log');
545545

546-
!app.debug && Exec('bash {0} {1} {2}'.format(PATH.databases('backuplogs.sh'), log, log.replace(/\.log$/, '#' + NOW.format('yyyyMMdd-HHmm.log'))), NOOP);
546+
!app.debug && Exec('bash {0} {1} {2}'.format(PATH.private('backuplogs.sh'), log, log.replace(/\.log$/, '#' + NOW.format('yyyyMMdd-HHmm.log'))), NOOP);
547547

548548
// Reset output of analyzator
549549
app.analyzatoroutput = null;
@@ -552,7 +552,7 @@ SuperAdmin.run_BK = function(port, callback) {
552552
SuperAdmin.makescripts(app, function() {
553553
// Creates a log directory
554554
if (app.debug)
555-
Exec('bash {0} {1}'.format(PATH.databases('mkdir.sh'), Path.join(CONF.directory_www, linker, 'logs')), callback);
555+
Exec('bash {0} {1}'.format(PATH.private('mkdir.sh'), Path.join(CONF.directory_www, linker, 'logs')), callback);
556556
else
557557
callback();
558558
});
@@ -619,15 +619,15 @@ SuperAdmin.run = function(port, callback) {
619619
var linker = app.linker;
620620
var log = Path.join(CONF.directory_www, linker, 'logs', 'debug.log');
621621

622-
!app.debug && Exec('bash {0} {1} {2}'.format(PATH.databases('backuplogs.sh'), log, Path.join(CONF.directory_console, linker + NOW.format('yyyyMMdd-HHmm') + '.log')), NOOP);
622+
!app.debug && Exec('bash {0} {1} {2}'.format(PATH.private('backuplogs.sh'), log, Path.join(CONF.directory_console, linker + NOW.format('yyyyMMdd-HHmm') + '.log')), NOOP);
623623

624624
// Reset output of analyzator
625625
app.analyzatoroutput = null;
626626

627627
var fn = function(callback) {
628628
SuperAdmin.makescripts(app, function() {
629629
// Creates a log directory
630-
Exec('bash {0} {1}'.format(PATH.databases('mkdir.sh'), Path.join(CONF.directory_www, linker, 'logs')), callback);
630+
Exec('bash {0} {1}'.format(PATH.private('mkdir.sh'), Path.join(CONF.directory_www, linker, 'logs')), callback);
631631
});
632632
};
633633

@@ -683,7 +683,7 @@ SuperAdmin.npminstall = function(app, callback) {
683683
var directory = Path.join(CONF.directory_www, app.linker);
684684
F.path.exists(Path.join(directory, 'package.json'), function(e) {
685685
if (e)
686-
Exec('bash {0} {1}'.format(F.path.databases('npminstall.sh'), directory), (err) => callback(err));
686+
Exec('bash {0} {1}'.format(PATH.private('npminstall.sh'), directory), (err) => callback(err));
687687
else
688688
callback();
689689
});
@@ -941,7 +941,7 @@ SuperAdmin.versions = function(callback) {
941941

942942
SuperAdmin.backup = function(callback) {
943943
var filename = NOW.format('yyyyMMdd') + '-backup.tar.gz';
944-
Exec('bash {0} {1} {2}'.format(PATH.databases('backup.sh'), CONF.directory_dump, filename), function(err) {
944+
Exec('bash {0} {1} {2}'.format(PATH.private('backup.sh'), CONF.directory_dump, filename), function(err) {
945945
callback(err, Path.join(CONF.directory_dump, filename));
946946
});
947947
};
@@ -954,7 +954,7 @@ SuperAdmin.backupapp = function(app, callback) {
954954
}
955955

956956
var filename = Path.join(CONF.directory_dump, NOW.format('yyyyMMddHHmmss') + '_' + app.linker + '-backup.tar.gz');
957-
Exec('bash {0} {1} {2}'.format(PATH.databases('backup.sh'), CONF.directory_www + app.linker + '/', filename), function(err) {
957+
Exec('bash {0} {1} {2}'.format(PATH.private('backup.sh'), CONF.directory_www + app.linker + '/', filename), function(err) {
958958
SuperAdmin.ftp(filename, function() {
959959
SuperAdmin.logger('backuped: ' + filename, null, app);
960960
EMIT('superadmin_app_backup', app, filename);
@@ -971,7 +971,7 @@ SuperAdmin.ftp = function(filename, callback) {
971971
var password = auth[1];
972972
var target = U.getName(filename);
973973

974-
Exec('bash {0} {1} {2} {3} {4} {5}'.format(PATH.databases('ftp.sh'), ftp.hostname, username, password, filename, target), function(err) {
974+
Exec('bash {0} {1} {2} {3} {4} {5}'.format(PATH.private('ftp.sh'), ftp.hostname, username, password, filename, target), function(err) {
975975
Fs.unlink(filename, NOOP);
976976
callback && callback(err);
977977
});
@@ -1156,7 +1156,7 @@ SuperAdmin.makescripts = function(app, callback) {
11561156
var directory = Path.join(CONF.directory_www, linker);
11571157
Exec('mkdir -p ' + directory, function() {
11581158
Exec('chmod 777 {0}'.format(directory), function() {
1159-
SuperAdmin.copy(PATH.databases('index.js'), Path.join(directory, 'index.js'), function(err) {
1159+
SuperAdmin.copy(PATH.private('index.js'), Path.join(directory, 'index.js'), function(err) {
11601160
callback(err);
11611161
}, (response) => response.toString('utf8').format(app.version === 'total3' ? 'total.js' : app.version));
11621162
});
@@ -1205,8 +1205,8 @@ SuperAdmin.defaultssl = function(callback) {
12051205
Fs.lstat(filename, function(err) {
12061206

12071207
if (err) {
1208-
Fs.copyFile(PATH.databases('superadmin.key'), filename, NOOP);
1209-
Fs.copyFile(PATH.databases('superadmin.csr'), Path.join(CONF.directory_ssl, 'superadmin.csr'), NOOP);
1208+
Fs.copyFile(PATH.private('superadmin.key'), filename, NOOP);
1209+
Fs.copyFile(PATH.private('superadmin.csr'), Path.join(CONF.directory_ssl, 'superadmin.csr'), NOOP);
12101210
}
12111211

12121212
callback();
File renamed without changes.
File renamed without changes.

databases/ftp.sh private/ftp.sh

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

schemas/apps.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ NEWSCHEMA('Apps', function(schema) {
348348
var directory = Path.join(CONF.directory_www, linker);
349349

350350
// Backups application's data
351-
Exec('bash {0} {1} {2}'.format(PATH.databases('backup.sh'), Path.join(CONF.directory_www, linker), Path.join(CONF.directory_dump, linker + '-removed-backup.tar.gz')), function() {
351+
Exec('bash {0} {1} {2}'.format(PATH.private('backup.sh'), Path.join(CONF.directory_www, linker), Path.join(CONF.directory_dump, linker + '-removed-backup.tar.gz')), function() {
352352
Exec('rm -r ' + directory, function() {
353353

354354
EMIT('superadmin_app_remove', app);

schemas/operations.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ NEWSCHEMA('Operations', function(schema) {
1515
});
1616

1717
schema.addWorkflow('updatetotal', function($) {
18-
Exec(PATH.databases('update-total.sh'), $.done());
18+
Exec(PATH.private('update-total.sh'), $.done());
1919
});
2020

2121
});

schemas/templates.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ NEWSCHEMA('Templates', function(schema) {
8080

8181
schema.addWorkflow('backup', function($, model) {
8282
if (model.backup)
83-
Exec('bash {0} {1} {2}'.format(PATH.databases('backup.sh'), Path.join(CONF.directory_www, model.app.linker), Path.join(CONF.directory_dump, model.id + '-backup.tar.gz')), $.done());
83+
Exec('bash {0} {1} {2}'.format(PATH.private('backup.sh'), Path.join(CONF.directory_www, model.app.linker), Path.join(CONF.directory_dump, model.id + '-backup.tar.gz')), $.done());
8484
else
8585
$.success();
8686
});

superadmin.bundle

+67
Large diffs are not rendered by default.

tasks/nginx.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ NEWTASK('nginx', function(push) {
8484

8585
// Creates NGINX configuration
8686
push('create', function($, value) {
87-
Fs.readFile(PATH.databases('nginx.conf'), function(err, response) {
87+
Fs.readFile(PATH.private('nginx.conf'), function(err, response) {
8888
response = response.toString('utf8');
8989
Fs.writeFile(value.filename, VIEWCOMPILE(response, value.model).trim().replace(/\n\t\n/g, '\n').replace(/\n{3,}/g, '\n'), $.next2('test'));
9090
});

0 commit comments

Comments
 (0)