Skip to content

Commit 95eb700

Browse files
authored
0.2.8 ready for pr (#133)
* make config.json optional * update package for 14.1 * push.sh - reset permissions after module load * build script updates * update build scripts
1 parent 63f368d commit 95eb700

File tree

16 files changed

+393
-104
lines changed

16 files changed

+393
-104
lines changed
38.5 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b5d91410538e7aac2c2ba1e28a2d965e2586492954c12a97817c7737c4f4c327 Build/Release/BIG-IP-ILX-WebSSH2-0.2.8.tgz
1+
e2e70f7d2949b6c8fe0299f888a3725763a62c01a1faea1fb729babc2ed51c92 Build/Release/BIG-IP-ILX-WebSSH2-0.2.8.tgz

ChangeLog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# Change Log
2-
## [0.2.8] TBD
2+
## [0.2.8] 2019-05-25
33
### Changes
44
- Fixes issue if no password is entered, browser must be closed and restart to attempt to re-auth. See issue [#118](../../issues/118). Thanks @smilesm2 for the idea.
55
- fixes broken `npm run (build|builddev)`
66
- update font-awesome fonts to 5.6.3
77
- update webpack and dependancies
88
- update xterm to 3.8.0
99

10+
### Fixes
11+
- ILX workspace may not always import properly due to symbolic links (specifically ./node_modules/.bin). This is removed from the ILX package
12+
1013
## [0.2.7] 2018-11-11
1114
### Changes
1215
- `config.reauth` was not respected if initial auth presented was incorrect, regardless of `reauth` setting in `config.json` reauth would always be attempted. fixes [#117](../../issues/117)
File renamed without changes.

app/server/app.js

Lines changed: 90 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,102 @@
33
// app.js
44

55
var path = require('path')
6-
// configPath = path.join(__dirname, 'config.json')
76
var nodeRoot = path.dirname(require.main.filename)
87
var configPath = path.join(nodeRoot, 'config.json')
98
var publicPath = path.join(nodeRoot, 'client', 'public')
109
console.log('WebSSH2 service reading config from: ' + configPath)
11-
var config = require('read-config')(configPath)
1210
var express = require('express')
1311
var logger = require('morgan')
12+
13+
// sane defaults if config.json or parts are missing
14+
let config = {
15+
'listen': {
16+
'ip': '0.0.0.0',
17+
'port': 2222
18+
},
19+
'user': {
20+
'name': null,
21+
'password': null
22+
},
23+
'ssh': {
24+
'host': null,
25+
'port': 22,
26+
'term': 'xterm-color',
27+
'readyTimeout': 20000,
28+
'keepaliveInterval': 120000,
29+
'keepaliveCountMax': 10
30+
},
31+
'terminal': {
32+
'cursorBlink': true,
33+
'scrollback': 10000,
34+
'tabStopWidth': 8,
35+
'bellStyle': 'sound'
36+
},
37+
'header': {
38+
'text': null,
39+
'background': 'green'
40+
},
41+
'session': {
42+
'name': 'WebSSH2',
43+
'secret': 'mysecret'
44+
},
45+
'options': {
46+
'challengeButton': true,
47+
'allowreauth': true
48+
},
49+
'algorithms': {
50+
'kex': [
51+
'ecdh-sha2-nistp256',
52+
'ecdh-sha2-nistp384',
53+
'ecdh-sha2-nistp521',
54+
'diffie-hellman-group-exchange-sha256',
55+
'diffie-hellman-group14-sha1'
56+
],
57+
'cipher': [
58+
'aes128-ctr',
59+
'aes192-ctr',
60+
'aes256-ctr',
61+
'aes128-gcm',
62+
'aes128-gcm@openssh.com',
63+
'aes256-gcm',
64+
'aes256-gcm@openssh.com',
65+
'aes256-cbc'
66+
],
67+
'hmac': [
68+
'hmac-sha2-256',
69+
'hmac-sha2-512',
70+
'hmac-sha1'
71+
],
72+
'compress': [
73+
'none',
74+
'zlib@openssh.com',
75+
'zlib'
76+
]
77+
},
78+
'serverlog': {
79+
'client': false,
80+
'server': false
81+
},
82+
'accesslog': false,
83+
'verify': false
84+
}
85+
86+
// test if config.json exists, if not provide error message but try to run
87+
// anyway
88+
try {
89+
if (fs.existsSync(configPath)) {
90+
console.log('ephemeral_auth service reading config from: ' + configPath)
91+
config = require('read-config')(configPath)
92+
} else {
93+
console.error('\n\nERROR: Missing config.json for webssh. Current config: ' + JSON.stringify(config))
94+
console.error('\n See config.json.sample for details\n\n')
95+
}
96+
} catch (err) {
97+
console.error('\n\nERROR: Missing config.json for webssh. Current config: ' + JSON.stringify(config))
98+
console.error('\n See config.json.sample for details\n\n')
99+
console.error('ERROR:\n\n ' + err)
100+
}
101+
14102
var session = require('express-session')({
15103
secret: config.session.secret,
16104
name: config.session.name,

bin/BIG-IP-ILX-WebSSH2-current.tgz

38.5 KB
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
b5d91410538e7aac2c2ba1e28a2d965e2586492954c12a97817c7737c4f4c327 Build/Release/BIG-IP-ILX-WebSSH2-0.2.8.tgz
1+
e2e70f7d2949b6c8fe0299f888a3725763a62c01a1faea1fb729babc2ed51c92 Build/Release/BIG-IP-ILX-WebSSH2-0.2.8.tgz

scripts/build.sh

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,42 @@
11
#!/bin/bash
22
## Syncs from BIG-IP and builds a release based on version in extensions/ephemeral_auth/package.json
3-
3+
#
44
source ./scripts/env.sh
5-
65
source ./scripts/util.sh
76

87
./scripts/pull.sh
9-
8+
if [ $? -ne 0 ]; then
9+
# failure
10+
tput bel;tput bel;tput bel;tput bel
11+
echo -e "\n${fgLtRed}Pull command failed. Giving up.${fgLtWhi}\n"
12+
echo ${output}
13+
exit 255
14+
fi
15+
16+
# get version of package from package.json
1017
package_version=$(jq -r ".version" workspace/extensions/webssh2/package.json)
11-
18+
# creates new workspace name with version
1219
webssh_workspace_name=$webssh_workspace_name-$package_version
1320

14-
ssh -o ClearAllForwardings=yes $webssh_ilxhost /bin/tar czf - -C /var/ilx/workspaces/Common/$webssh_workspace_name . > Build/Release/$webssh_package_name-$package_version.tgz
21+
echoNotice "Creating workspace package"
22+
runCommand "ssh -o ClearAllForwardings=yes $webssh_ilxhost /bin/tar --exclude='./extensions/webssh2/config.json' -czf - -C /var/ilx/workspaces/Common/$webssh_workspace_name . > Build/Release/$webssh_package_name-$package_version.tgz"
23+
24+
echoNotice "Creating SHA256 hash"
25+
runCommand "shasum -a 256 Build/Release/$webssh_package_name-$package_version.tgz > Build/Release/$webssh_package_name-$package_version.tgz.sha256"
26+
27+
echoNotice "Copying to current"
28+
runCommand "cp Build/Release/$webssh_package_name-$package_version.tgz $webssh_pua_location/$webssh_package_name-current.tgz && \
29+
cp Build/Release/$webssh_package_name-$package_version.tgz.sha256 $webssh_pua_location/$webssh_package_name-current.tgz.sha256"
30+
31+
echoNotice "Deleting any '.DS_Store' files"
32+
runCommand "find . -name '.DS_Store' -type f -delete"
1533

16-
shasum -a 256 Build/Release/$webssh_package_name-$package_version.tgz > Build/Release/$webssh_package_name-$package_version.tgz.sha256
34+
echo -e "\nWorkspace packages located at:\n"
35+
echo " Build/Release/$webssh_package_name-$package_version.tgz"
36+
echo " Build/Release/$webssh_package_name-$package_version.tgz.sha256"
37+
echo " $webssh_pua_location/$webssh_package_name-current.tgz"
38+
echo " $webssh_pua_location/$webssh_package_name-current.tgz.sha256"
1739

18-
cp Build/Release/$webssh_package_name-$package_version.tgz $webssh_pua_location/$webssh_package_name-current.tgz
19-
cp Build/Release/$webssh_package_name-$package_version.tgz.sha256 $webssh_pua_location/$webssh_package_name-current.tgz.sha256
40+
echo -e "\n👍 Build Complete 👍\n"
2041

21-
find . -name '.DS_Store' -type f -delete
42+
exit 0

scripts/env.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
2-
3-
webssh_ilxhost=root@192.168.30.209
2+
#webssh_ilxhost=root@192.168.30.209
3+
webssh_ilxhost=root@192.168.30.203
44
webssh_workspace_name=webssh2
55
webssh_package_name=BIG-IP-ILX-WebSSH2
6-
webssh_pua_location=./bin
6+
webssh_pua_location=./bin

scripts/pull.sh

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,25 @@
66
#
77
# Pulls an ILX workspace from a BIG-IP and syncs to ./workspace, excludes
88
# ./workspace/extensions/ephemeral_auth/node_modules.
9-
9+
#
1010
source ./scripts/env.sh
11-
1211
source ./scripts/util.sh
1312

13+
# get version of package from package.json
1414
PACKAGE_VERSION=$(jq -r ".version" workspace/extensions/webssh2/package.json 2>&1)
15-
15+
# creates new workspace name with version
1616
webssh_workspace_name=$webssh_workspace_name-$PACKAGE_VERSION
1717

18+
echo "Pull ${fgLtCya}$webssh_workspace_name${fgLtWhi} from ${fgLtCya}$webssh_ilxhost${fgLtWhi}"
19+
1820
# check to see if the workspace actually exists before attempting to copy over
1921

20-
output=$(ssh -o ClearAllForwardings=yes $webssh_ilxhost tmsh list ilx workspace $webssh_workspace_name one-line 2>&1)
21-
result="$?" 2>&1
22+
echoNotice "Checking for existing workspace ${fgLtCya}$webssh_workspace_name${fgLtWhi}"
23+
runCommand "ssh -o ClearAllForwardings=yes $webssh_ilxhost tmsh list ilx workspace $webssh_workspace_name one-line 2>&1"
2224

23-
if [ $result -ne 0 ]; then
24-
echo -e "\n\n"
25-
echo "Workspace: $webssh_workspace_name not found, are you sure that's the right one?"
26-
echo -e "\n\n"
27-
echo "Terminating."
28-
echo -e "\n\n"
29-
exit 255
30-
fi
25+
echoNotice "Pulling ${fgLtCya}$webssh_workspace_name${fgLtWhi} from ${fgLtCya}$webssh_ilxhost${fgLtWhi}"
26+
runCommand "rsync -e 'ssh -o ClearAllForwardings=yes -ax' -avq --include=\"extensions/ephemeral_auth/node_modules/f5-*\" --exclude=\".DS_Store\" --exclude=\"extensions/ephemeral_auth/node_modules/*\" $webssh_ilxhost:/var/ilx/workspaces/Common/$webssh_workspace_name/. workspace/. 2>&1"
3127

32-
output=$(rsync -e 'ssh -o ClearAllForwardings=yes -ax' -avq --include="extensions/ephemeral_auth/node_modules/f5-*" --exclude=".DS_Store" --exclude="extensions/ephemeral_auth/node_modules/*" $webssh_ilxhost:/var/ilx/workspaces/Common/$webssh_workspace_name/. workspace/. 2>&1)
33-
result="$?" 2>&1
28+
echo -e "\n👍 Pull complete 👍\n"
3429

35-
if [ $result -ne 0 ]; then
36-
echo -e "\n\n"
37-
echo "Something went wrong with the rsync..."
38-
echo -e "\n\n"
39-
echo "Terminating."
40-
echo -e "\n\n"
41-
exit 255
42-
fi
30+
exit 0

0 commit comments

Comments
 (0)