-
Notifications
You must be signed in to change notification settings - Fork 51
/
app.js
113 lines (96 loc) · 1.93 KB
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
var tty = require('tty.js');
var pmx = require('pmx');
var probe = pmx.probe();
var conf = pmx.initModule({
widget : {
type : 'generic',
logo : 'http://www.creativetechs.com/iq/tip_images/TerminalApp-Icon.png',
// 0 = main element
// 1 = secondary
// 2 = main border
// 3 = secondary border
theme : ['#111111', '#1B2228', '#807C7C', '#807C7C'],
el : {
probes : false,
actions : false
},
block : {
actions : false,
issues : false,
meta : false,
cpu: false,
mem: false,
main_probes : ['Username', 'Port', 'Bind', 'HTTPS']
}
// Status
// Green / Yellow / Red
}
});
probe.metric({
name: 'Port',
value: function() {
return conf.port;
}
});
probe.metric({
name: 'Username',
value: function() {
return conf.username;
}
});
probe.metric({
name: 'Bind',
value: function() {
return conf.bind;
}
});
probe.metric({
name: 'HTTPS',
value: function() {
return conf.https;
}
});
var ssh_conf = {
shell : 'bash',
users : {},
port : parseInt(conf.port),
"hostname": conf.bind,
"limitGlobal": 10000,
"limitPerUser": 1000,
"term": {
"termName": "xterm",
"geometry": [180, 70],
"scrollback": 1000,
"visualBell": false,
"popOnBell": false,
"cursorBlink": false,
"screenKeys": false,
"colors": [
"#2e3436",
"#cc0000",
"#4e9a06",
"#c4a000",
"#3465a4",
"#75507b",
"#06989a",
"#d3d7cf",
"#555753",
"#ef2929",
"#8ae234",
"#fce94f",
"#729fcf",
"#ad7fa8",
"#34e2e2",
"#eeeeec"
]
}
};
ssh_conf.users[conf.username] = conf.password;
if (JSON.parse(conf.https) === true) {
ssh_conf['https'] = {
"key": conf.ssl_key || "./term-default.key",
"cert": conf.ssl_cert || "./term-default.crt"
};
}
var app = tty.createServer(ssh_conf);
app.listen();