Compare commits

...

588 commits
0.0.2 ... main

Author SHA1 Message Date
Bill Church
9c0ba04b31
Update action-test.yml 2024-08-26 07:58:02 -04:00
Bill Church
e499287079
Update action-test.yml 2024-08-26 07:57:04 -04:00
Bill Church
2a9a6c3562
Update docker-multiplatform-tag.yml 2024-08-22 14:03:09 -04:00
Bill Church
ad5d38259c
Update docker-multiplatform-tag.yml 2024-08-22 13:49:22 -04:00
Bill Church
7c1f8fa48e
Update docker-multiplatform-tag.yml 2024-08-22 13:47:08 -04:00
Bill Church
8dd4d0fda4
Create docker-multiplatform-tag.yml 2024-08-22 13:46:42 -04:00
Bill Church
5bbfcee0b6
chore: testing 2024-07-08 16:48:17 -04:00
Bill Church
cb5c1fa809
chore: update dev env 2024-04-27 10:41:44 +00:00
Bill Church
64e86994f7
chore: bump version 2023-08-22 18:55:53 +00:00
Bill Church
a97003bac2
chore: update release workflow 2023-08-22 18:55:53 +00:00
Bill Church
2576a495cf
chore: remove json-merger add ncu 2023-08-22 18:55:52 +00:00
Bill Church
d2ea50a0f2
chore: update dev environment 2023-08-22 18:55:52 +00:00
Bill Church
3246df75b6
fix: cols and rows were not properly assigned for terminal (#337)
* fix: set correct vars and cols property

* fix: add cols and rows to session.ssh property

* style: remove const assignment

---------

Co-authored-by: w-v <wtv@protonmail.ch>
Co-authored-by: bc 064 <87337961+bcvort@users.noreply.github.com>
2023-08-22 09:16:10 -04:00
Bill Church
acb4e42fde
docs: update confusion around docker configs #317 2023-02-06 12:37:19 -05:00
Bill Church
c3e54ef0d8
chore: dev env update 2023-02-06 09:48:25 -05:00
Bill Church
d9b6e47e88
chore(main): release webssh2 0.5.0-pre-4 (#309) 2022-08-07 08:14:28 -04:00
Bill Church
8b56826363
chore: release 0.4.7-pre-5
Release-As: 0.4.7-pre-5
2022-08-07 12:13:19 +00:00
Bill Church
476b566c08
feat: test change for release 2022-08-07 12:10:36 +00:00
Bill Church
298f45178f
chore: update workflow 2022-08-07 12:07:22 +00:00
Bill Church
adc964e823
chore: update workflow 2022-08-07 12:03:32 +00:00
Bill Church
3d06d74645
chore: update workflow 2022-08-07 12:01:02 +00:00
Bill Church
8f19909cc1
Merge branch 'main' of github.com:billchurch/webssh2 2022-08-07 11:55:26 +00:00
Bill Church
3fdba6e880
chore: update workflow to publish to npm 2022-08-07 11:55:08 +00:00
Bill Church
8c64f8e026
chore(main): release webssh2 0.4.7-pre-4 (#308) 2022-08-03 10:39:36 -04:00
Bill Church
ad9f303380
docs: add LICENSE to /app 2022-08-03 14:35:32 +00:00
Bill Church
7d4ba87bc1
chore: release 0.4.7-pre-4
Release-As: 0.4.7-pre-4
2022-08-03 14:31:52 +00:00
Bill Church
8585aba89f
chore: update changelog 2022-08-03 14:30:22 +00:00
Bill Church
3b8c7a770e
chore: update workflows 2022-08-03 14:29:47 +00:00
Bill Church
9d5a0cd12c
chore(main): release webssh2 0.4.7-pre-3 (#307) 2022-08-03 10:25:12 -04:00
Bill Church
0322b1694a
chore: update release-please workflow 2022-08-03 14:22:19 +00:00
Bill Church
3b460dda66
Merge branch 'main' of github.com:billchurch/webssh2 2022-08-03 14:16:42 +00:00
Bill Church
0c78c1f31c
chore: release 0.4.7-pre-3
Release-As: 0.4.7-pre-3
2022-08-03 14:16:30 +00:00
Bill Church
7985bd0143
chore(main): release webssh2 0.4.7-pre-2 (#305) 2022-08-03 10:13:57 -04:00
Bill Church
1862acceb5
Merge branch 'main' of github.com:billchurch/webssh2 2022-08-03 14:13:19 +00:00
Bill Church
0bcc37a0f7
chore: update release please workflow fixes #283 2022-08-03 14:12:21 +00:00
Bill Church
b29242dfd4
chore: release 0.4.7-pre-3
Release-As: 0.4.7-pre-3
2022-08-03 14:11:57 +00:00
Bill Church
a284ca07ca
chore: update package(-lock).json 2022-08-03 14:11:57 +00:00
Bill Church
f048b46667
chore: update Dockerfile 2022-08-03 14:11:56 +00:00
Bill Church
31f7728602
chore: update .dockerignore 2022-08-03 14:11:55 +00:00
Bill Church
e3c11cce16
Update SECURITY.md 2022-08-03 14:11:55 +00:00
Bill Church
2159709812
chore: update workflows 2022-08-03 14:11:54 +00:00
Bill Church
b36e40357d
chore: update workflows 2022-08-03 14:11:53 +00:00
Bill Church
8749c21f4d
chore: update bug report 2022-08-03 14:11:53 +00:00
Bill Church
0ea6c16ac4
chore: update bug reporting 2022-08-03 14:11:52 +00:00
Bill Church
abb6b71e62
chore: update bug reporter 2022-08-03 14:11:51 +00:00
Bill Church
6370f83466
chore: update bug reporter 2022-08-03 14:11:51 +00:00
Bill Church
1717d42faf
chore: update bug templates 2022-08-03 14:11:50 +00:00
Bill Church
01720cd9e0
Update issue templates 2022-08-03 14:11:50 +00:00
Bill Church
b3faa1d7b5
chore: update bug report template 2022-08-03 14:11:49 +00:00
Bill Church
b1384788f5
Delete ISSUE_TEMPLATE 2022-08-03 14:11:48 +00:00
Bill Church
b238df4f49
Create ISSUE_TEMPLATE 2022-08-03 14:11:48 +00:00
Bill Church
10e59b25f9
Delete ISSUE_TEMPLATE.md 2022-08-03 14:11:47 +00:00
Bill Church
13db095885
Delete Build/Release directory 2022-08-03 14:11:46 +00:00
Bill Church
000b294999
Update README.md 2022-08-03 14:11:46 +00:00
Bill Church
e91454875b
Delete screenshots directory 2022-08-03 14:11:45 +00:00
Bill Church
942af6a91d
Delete bin directory 2022-08-03 14:11:45 +00:00
github-actions[bot]
37a3dac008
chore(main): release webssh2 0.4.7-pre-2 (#304)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-03 14:11:44 +00:00
Bill Church
cb73084dc5
chore: test release workflows 2022-08-03 14:11:43 +00:00
github-actions[bot]
0e966a64e5
chore(main): release webssh2 0.4.7-pre-1 (#303)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-03 14:11:42 +00:00
Bill Church
da86943cb6
chore: release testing 2022-08-03 14:11:42 +00:00
Bill Church
ee235e2294
chore: release testing 2022-08-03 14:11:41 +00:00
github-actions[bot]
837bb2380d
chore(main): release webssh2 0.4.7-pre-0 (#302)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-03 14:11:40 +00:00
Bill Church
5f565d3aae
chore: update workflow 2022-08-03 14:11:39 +00:00
Bill Church
dbd46f4484
chore: update workflow 2022-08-03 14:11:39 +00:00
Bill Church
d756b11b60
Test branch (#300)
* chore: release workflow testing
2022-08-03 14:11:38 +00:00
Bill Church
85eeee0000
chore: bootstrap releases for path: . (#298) 2022-08-03 14:11:37 +00:00
Bill Church
64e093931a
chore: update release workflow 2022-08-03 14:11:37 +00:00
Bill Church
09ca7bd838
chore: update release workflow 2022-08-03 14:11:36 +00:00
Bill Church
7d88f7068b
Update SECURITY.md 2022-08-03 14:11:36 +00:00
Bill Church
2d0fff581e
Create SECURITY.md 2022-08-03 14:11:35 +00:00
Bill Church
206d725663
Dev (#296)
* chore: update ssh2 and development deps

* feat: take LISTEN, PORT, and other env vars #294

* chore: rebuild client files

* docs: update readme

* chore: bump version

* chore: setup gpg for dev container
2022-08-03 14:11:34 +00:00
Bill Church
73442fe8c2
chore: update release please workflow fixes #283 2022-08-03 14:06:36 +00:00
Bill Church
6c7d242679
chore: release 0.4.7-pre-3
Release-As: 0.4.7-pre-3
2022-08-03 14:04:53 +00:00
Bill Church
7c41f5dca0
chore: update package(-lock).json 2022-08-03 13:56:37 +00:00
Bill Church
5b827b6acf
chore: update Dockerfile 2022-08-03 13:54:48 +00:00
Bill Church
1db557a399
chore: update .dockerignore 2022-08-03 13:54:32 +00:00
Bill Church
41259a6971
Merge branch 'main' of github.com:billchurch/webssh2 2022-08-02 18:14:20 +00:00
Bill Church
657c4bd688
chore: update workflows 2022-08-02 18:14:16 +00:00
Bill Church
3b564c6d4b
chore: update workflows 2022-08-02 18:12:30 +00:00
Bill Church
28f8f9b5b3
Update SECURITY.md 2022-08-02 12:54:02 -04:00
Bill Church
0448c231ac
chore: update bug report 2022-08-02 16:52:32 +00:00
Bill Church
639ae09fe1
chore: update bug reporting 2022-08-02 16:51:02 +00:00
Bill Church
aa07c8447a
chore: update bug reporter 2022-08-02 16:47:27 +00:00
Bill Church
b4615658dd
chore: update bug reporter 2022-08-02 16:47:23 +00:00
Bill Church
7d6fea45cc
chore: update bug templates 2022-08-02 16:45:13 +00:00
Bill Church
bb243fb00d
Update issue templates 2022-08-02 12:44:35 -04:00
Bill Church
2bb81c05b5
chore: update bug report template 2022-08-02 16:42:44 +00:00
Bill Church
ec76f95510
Delete ISSUE_TEMPLATE 2022-08-02 12:40:15 -04:00
Bill Church
80e47c2a61
Create ISSUE_TEMPLATE 2022-08-02 12:38:47 -04:00
Bill Church
a2bd4b38af
Delete ISSUE_TEMPLATE.md 2022-08-02 12:38:24 -04:00
Bill Church
8e6563fa67
Delete Build/Release directory 2022-08-02 12:27:50 -04:00
Bill Church
2aa713fe20
Update README.md 2022-08-02 12:27:27 -04:00
Bill Church
92dac9a17e
Delete screenshots directory 2022-08-02 12:24:38 -04:00
Bill Church
ca62af669e
Delete bin directory 2022-08-02 12:24:24 -04:00
github-actions[bot]
784387cbc7
chore(main): release webssh2 0.4.7-pre-2 (#304)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-02 11:43:38 -04:00
Bill Church
0d4ebf715c
chore: test release workflows 2022-08-02 15:41:45 +00:00
github-actions[bot]
a3019ad7e3
chore(main): release webssh2 0.4.7-pre-1 (#303)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-02 11:24:09 -04:00
Bill Church
14ea80d54e
chore: release testing 2022-08-02 15:22:44 +00:00
Bill Church
da8e6573f9
chore: release testing 2022-08-02 15:21:35 +00:00
github-actions[bot]
1c358fabf7
chore(main): release webssh2 0.4.7-pre-0 (#302)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-02 11:05:46 -04:00
Bill Church
09f17906cb
chore: update workflow 2022-08-02 15:04:01 +00:00
Bill Church
75d41af8d6
chore: update workflow 2022-08-02 14:59:17 +00:00
Bill Church
3db0095947
Test branch (#300)
* chore: release workflow testing
2022-08-02 10:57:02 -04:00
Bill Church
d43da9993e
chore: bootstrap releases for path: . (#298) 2022-08-02 09:34:43 -04:00
Bill Church
d77f885d52
chore: update release workflow 2022-08-02 13:17:37 +00:00
Bill Church
a99a0d5959
chore: update release workflow 2022-08-02 13:14:19 +00:00
Bill Church
9dd4dc8868
Update SECURITY.md 2022-08-01 15:34:08 -04:00
Bill Church
7b3da3a1e3
Create SECURITY.md 2022-08-01 15:33:21 -04:00
Bill Church
c0e67d2d57
Dev (#296)
* chore: update ssh2 and development deps

* feat: take LISTEN, PORT, and other env vars #294

* chore: rebuild client files

* docs: update readme

* chore: bump version

* chore: setup gpg for dev container
2022-08-01 15:27:44 -04:00
Bill Church
0bbc99a1ba chore: dotenv module 2022-08-01 14:11:54 +00:00
Bill Church
2bc9dc9382 docs: update readme 2022-08-01 13:49:48 +00:00
Bill Church
97f3088780 feat: add fontFamily, letterSpacing, lineHeight 2022-07-31 01:34:52 +00:00
Bill Church
140e1e24b1 feat: reorder viewport setup at ssh handshake #292 2022-07-30 20:49:20 +00:00
Bill Church
2289c6736b docs: update docs 2022-07-30 20:45:57 +00:00
Bill Church
1965a7460d chore: version bump 2022-07-30 20:14:12 +00:00
Bill Church
5e78812974 feat: add fontSize option #292 2022-07-30 20:13:36 +00:00
Bill Church
6fa65a3f85 chore: updare workflows 2022-07-30 19:38:36 +00:00
Bill Church
2c2e454c08 chore: update workflows 2022-07-30 19:37:39 +00:00
Bill Church
2d77dae40e chore: workflow update 2022-07-30 19:34:14 +00:00
Bill Church
a8457e96bf chore: update workflow 2022-07-30 19:32:31 +00:00
Bill Church
60929d53c2 chore: debug workflow 2022-07-30 19:06:39 +00:00
Bill Church
4d24a79d7d chore: debug workflow 2022-07-30 19:05:25 +00:00
Bill Church
f8c6eda108 Merge branch 'main' of github.com:billchurch/webssh2 2022-07-30 18:58:53 +00:00
Bill Church
19a60abc11 update workflow 2022-07-30 18:58:26 +00:00
Bill Church
7d12e1009c
Update README.md 2022-07-30 14:53:21 -04:00
Bill Church
8b451a344b chore: update workflow 2022-07-30 18:45:02 +00:00
Bill Church
dcfd7d671a chore: pkg maint 2022-07-30 18:23:35 +00:00
Bill Church
48d1f6ccca chore: ci stuff 2022-07-30 18:19:20 +00:00
Bill Church
420332da8d chore: update docker workflow 2022-07-30 16:13:59 +00:00
Bill Church
3c1bba597d chore: update dev environment 2022-07-30 16:11:23 +00:00
Bill Church
897c161c88
Update README.md 2022-07-30 12:06:38 -04:00
Bill Church
29c3bb82ea chore: update workflow 2022-07-30 11:40:44 -04:00
Bill Church
d7a245d974 chore: update workflow 2022-07-30 11:39:46 -04:00
Bill Church
8c8ca7da4a chore: bump version 0.4.7-alpha-1 2022-07-30 11:19:24 -04:00
Bill Church
ec809d829a chore: workflow testing 2022-07-30 11:07:04 -04:00
Bill Church
6d5540bf77 chore: test workflow 2022-07-30 11:03:18 -04:00
Bill Church
71a272c526 chore: worklfow testing 2022-07-30 11:01:23 -04:00
Bill Church
3b0cb975ef chore: update docker build workflow 2022-07-30 10:55:19 -04:00
Bill Church
f041c779e9 fix: docker multiplatform build on push fixes #293 2022-07-30 10:52:56 -04:00
Bill Church
d1f945b09e chore: workflow testing 2022-07-30 10:34:51 -04:00
Bill Church
b90499ca5d chore: workflow testing 2022-07-30 10:31:18 -04:00
Bill Church
363aa4e2df test: workflow testing [CI Skip] 2022-07-30 10:22:51 -04:00
Bill Church
58a0412091
test: workflow 2022-07-29 16:06:35 -04:00
Bill Church
9ff17b87ba
test: workflow 2022-07-29 16:04:53 -04:00
Bill Church
b2c6c555d7
test: workflow 2022-07-29 16:01:33 -04:00
Bill Church
1706c44e3b
test: workflow 2022-07-29 15:58:55 -04:00
Bill Church
f2e1beba96
test: workflow 2022-07-29 15:43:41 -04:00
Bill Church
e4697f4e5c
test: workflow 2022-07-29 15:42:59 -04:00
Bill Church
1c4793b202
test: workflow 2022-07-29 12:46:36 -04:00
Bill Church
673435c624
test: workflow 2022-07-29 12:37:03 -04:00
Bill Church
f87607465b
test: workflow 2022-07-29 09:49:27 -04:00
Bill Church
464d56e1ab
test: workflow 2022-07-29 09:48:59 -04:00
Bill Church
be279047e9
test: workflow 2022-07-29 09:46:51 -04:00
Bill Church
fe80e6a97e
test: workflow 2022-07-29 09:46:04 -04:00
Bill Church
7209bb9324
test: workflow testing 2022-07-29 09:39:16 -04:00
Bill Church
3fae0951ff
test: workflow test 2022-07-29 09:37:34 -04:00
Bill Church
2deb5d9cde
test: rename test workflow 2022-07-29 09:35:57 -04:00
Bill Church
e6b48dff7e
test: workflow testing 2022-07-29 09:34:26 -04:00
Bill Church
1edfd5e748
chore: testing 2022-07-29 09:06:54 -04:00
Bill Church
63f36432cb
chore: update workflow 2022-07-29 08:50:40 -04:00
Bill Church
9b3371bbb9
chore: update workflow 2022-07-29 08:48:01 -04:00
Bill Church
3dc6fc491b
chore: update dockerbuild 2022-07-29 08:45:40 -04:00
Bill Church
a41a971300
chore: update muiltiplatform with correct branch name 2022-07-29 08:35:49 -04:00
Bill Church
6e3a340e23
chore: add multiplatform support to docker builds 2022-07-29 08:29:42 -04:00
dependabot[bot]
28b295dc86
build(deps): bump terser from 5.7.1 to 5.14.2 in /app (#291) 2022-07-20 06:28:29 -04:00
Bill Church
b189dbe9d5 chore: docker main tag 2022-07-08 16:51:30 -04:00
Bill Church
7ba5143133 chore: rename workflows 2022-07-08 16:19:29 -04:00
Bill Church
c19fb9397c chore: push docker image on new tag #287 2022-07-08 16:14:02 -04:00
Bill Church
4f3e806708 chore: docker-image workflow for #287 2022-07-08 16:08:46 -04:00
Bill Church
a06b50dd2a
Create docker-image.yml 2022-07-08 15:51:56 -04:00
Bill Church
dc089a8f41 chore: update dockerfile node 16 alpine 2022-07-08 15:40:59 -04:00
Bill Church
05e69507ac BREAKING CHANGE: remove internet explorer compat 2022-07-08 15:30:53 -04:00
Bill Church
6ef27725d3 chore: formatting 2022-07-08 15:26:43 -04:00
Bill Church
841dbee74c chore: light code cleanup 2022-07-08 14:29:52 -04:00
Bill Church
cc7c6b4210 chore: remove unused module 2022-07-07 18:36:57 -04:00
Bill Church
46c1560e3c feat: add additional params for POST requests #290 2022-07-07 18:34:55 -04:00
Bill Church
0a4e419fb3 feat: add additional vars to POST requests #290 2022-07-07 18:34:17 -04:00
Bill Church
5b8f88cfef feat: credentials over http post for #290 2022-07-07 11:21:49 -04:00
zhangchao
40cbb35616
fix: Fix the parameter passing problem of setDefaultCredentials to make it perform data initialization normally (#288)
Co-authored-by: wooc <wooc@hwj-robots.com>
2022-07-05 11:24:39 -04:00
Bill Church
e75392b879 refactor: light refactoring 2022-05-20 15:12:01 -04:00
Bill Church
0dcaa6e150 feat!: validate referer to /reauth is valid 2022-05-20 15:05:29 -04:00
Bill Church
e0742db22f refactor: clean up shutdown and move sockets 2022-05-19 16:17:56 -04:00
Bill Church
3f22c8b8e0 refactor: move some functions out of app.js 2022-05-19 12:10:41 -04:00
Bill Church
9dfa8031c0 refactor: cleanup basic auth code 2022-05-19 10:13:26 -04:00
Bill Church
78dafebb2b package: remove colors module 2022-05-19 09:05:18 -04:00
Bill Church
8aebdc54a5 chore: rebuild client 2022-05-18 22:39:13 -04:00
Bill Church
09e2f9bc39 package: bump socket.io@4.5.1, express@4.18.1 2022-05-18 22:37:39 -04:00
Bill Church
84c09ec8a1 package!: bump xterm to 4.18.0 2022-05-18 22:32:59 -04:00
Bill Church
57af568586 refactor: remove unneccessary variable assignment 2022-05-18 22:13:19 -04:00
Bill Church
50cfcb9778 feat!: consistent logging messages see #286 2022-05-18 21:50:33 -04:00
Bill Church
9fa6c50d76 chore: jsconfig file 2022-05-18 21:46:25 -04:00
Bill Church
53a601cadc package: bump debug to v 4.3.4 2022-05-18 15:58:17 -04:00
Bill Church
8d93ffab91 package: bump ssh2 to v1.10.0 2022-05-18 12:22:06 -04:00
Bill Church
7c9e00cdfe refactor: add debug for client socket.emit events 2022-05-17 15:48:53 -04:00
Bill Church
9c99b0940e
feat!: config system changes #284 (#285) 2022-05-17 15:24:32 -04:00
BIll Church
ef40aa0266 docs: correct paths for BUILDING.md 2022-05-17 10:39:08 -04:00
BIll Church
5e48d42e61 docs: update readme 2022-05-17 10:37:45 -04:00
BIll Church
e6864f595b docs: update README.md 2022-05-17 10:34:51 -04:00
Bill Church
1e2e73e617
Update README.md 2022-05-17 09:55:03 -04:00
Bill Church
dd2f8217be
Update README.md 2022-05-17 09:54:01 -04:00
Bill Church
486e5dae0c refactor: socket.js 2022-05-13 10:13:14 -04:00
Bill Church
3438c93a14 refactor: socket.js 2022-05-11 14:25:17 -04:00
Bill Church
5cc1a6f072 refactor: remove comments from client index.ts 2022-05-11 13:25:05 -04:00
Bill Church
6b1066975a refactor: socket.js 2022-05-11 11:41:09 -04:00
Bill Church
0787aa695c refactor: socket.js 2022-05-11 10:44:37 -04:00
Bill Church
522278fa4e refactor: app.js 2022-05-11 10:44:07 -04:00
Bill Church
d835d919f3 refactor: client files 2022-05-11 10:36:47 -04:00
Bill Church
ffab5345dc fix: invalid css in style.css 2022-05-11 10:00:56 -04:00
Bill Church
f457a4a520 chore: update changelog 2022-04-17 10:57:43 -04:00
Bill Church
cf4d8c3847 chore(release): 0.4.6 2022-04-17 10:52:59 -04:00
Bill Church
3e82c0dc4d fix: update read-config-ng to 3.0.5, fixes #277 2022-04-17 10:51:22 -04:00
Bill Church
4434f7db48 Merge branch 'main' of github.com:billchurch/webssh2 into main 2022-03-31 08:52:53 -04:00
Bill Church
a6c77f2cdf chore(release): 0.4.5 2022-03-31 08:52:49 -04:00
Bill Church
bd0e1f2ec0 chore(release): 0.4.5 2022-03-31 08:51:47 -04:00
Bill Church
5f6d4e9e3b chore: update socket.io and read-config-ng 2022-03-31 08:24:27 -04:00
Bill Church
55b6dc43de chore: remove warning from ts about IE stuff 2021-12-09 10:16:11 -05:00
Bill Church
d903da87c4 fix: deprecated term.setOption 2021-12-09 09:59:18 -05:00
Bill Church
c801ef9e58 fix: update xterm.js fixes #261 2021-12-09 09:48:22 -05:00
Bill Church
96c7713267 chore: update dev deps 2021-12-09 09:42:04 -05:00
Bill Church
de5dc82dff chore: update docs 2021-12-09 09:29:53 -05:00
Bill Church
d31f536959 bump version 0.4.4 2021-12-09 09:25:54 -05:00
Bill Church
a32f6f2578 chore: prep for 0.4.4 release 2021-12-09 09:23:37 -05:00
Bill Church
bbe82ceb7e chore: prep for 0.4.4 release 2021-12-09 09:23:18 -05:00
Fabien Benetou
2528a54360
docs: docker run billchurch/webssh2 for direct testing (#269)
In addition to local docker run webssh2 pulling from billchurch/webssh2 allows testing (or even running) without clone the repo.
2021-12-09 09:20:53 -05:00
Samuel Weibel
8a68ccaffa
fix: dockerignore (#272)
it wasn't properly ignoring the node_modules and thus the produced image was quite big.
2021-12-09 09:08:35 -05:00
Bill Church
ae8516db9f chore: bump version 0.4.3 2021-10-19 10:16:24 -04:00
Bill Church
23acab325b docs: update changelog 2021-10-19 10:15:39 -04:00
Bill Church
5ea8813fba Merge branch 'dependabot/npm_and_yarn/app/ssh2-1.4.0' into main 2021-10-19 10:11:37 -04:00
Bill Church
4bc00d4120 Merge branch 'main' into dependabot/npm_and_yarn/app/ssh2-1.4.0 2021-10-19 10:11:13 -04:00
Bill Church
12eba20917
docs: update docs for ssh.term and sshterm options (#265) 2021-10-19 10:07:03 -04:00
dependabot[bot]
2e1d844853
build(deps): bump ssh2 from 0.8.9 to 1.4.0 in /app
Bumps [ssh2](https://github.com/mscdex/ssh2) from 0.8.9 to 1.4.0.
- [Release notes](https://github.com/mscdex/ssh2/releases)
- [Commits](https://github.com/mscdex/ssh2/compare/v0.8.9...v1.4.0)

---
updated-dependencies:
- dependency-name: ssh2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 17:03:35 +00:00
Bill Church
f3d5358c90
update readme [skip ci] 2021-08-13 10:33:19 -04:00
Bill Church
8e167741d8
update readme [skip ci] 2021-08-13 10:31:44 -04:00
Bill Church
b3c45c1bf1
update readme [skip ci] 2021-08-13 10:30:19 -04:00
Bill Church
faeb7dc646
update readme [skip ci] 2021-08-13 10:26:15 -04:00
Bill Church
c57b99788d
0.4.2 release (#260)
* chore: update dependencies and bump version

* chore: update dev dependency snyk
2021-08-13 10:23:15 -04:00
Bill Church
8c4702972c docs: update changelog 2021-08-05 18:38:28 -04:00
Bill Church
5254baf8fb update docs 2021-08-05 22:31:21 +00:00
Bill Church
f187cf8e0d chore: update bundle after dev dep updates 2021-07-03 15:16:45 +00:00
Bill Church
7b52350f2d chore: resolutions for trim-newlines to 3.0.1 2021-07-03 14:56:46 +00:00
Bill Church
a75f6d73a5
Dev 4 (#256)
* Update config.json.sample (#253)

* Update package.json

* Update CI tools (#248)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* update dev tools (#249)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* build tools update

* chore: udpate dev tools

* Update config.json.sample

fix: lost comma in config.json.sample

Co-authored-by: Bill Church <billchurch@users.noreply.github.com>

* build(deps): bump ws from 7.4.5 to 7.4.6 in /app (#251)

* Update package.json

* Update CI tools (#248)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* update dev tools (#249)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* build tools update

* chore: udpate dev tools

* build(deps): bump ws from 7.4.5 to 7.4.6 in /app

Bumps [ws](https://github.com/websockets/ws) from 7.4.5 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.5...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: Bill Church <billchurch@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update config.json.sample (#253)

* Update package.json

* Update CI tools (#248)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* update dev tools (#249)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* build tools update

* chore: udpate dev tools

* Update config.json.sample

fix: lost comma in config.json.sample

Co-authored-by: Bill Church <billchurch@users.noreply.github.com>

* build(deps): bump ws from 7.4.5 to 7.4.6 in /app (#251)

* Update package.json

* Update CI tools (#248)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* update dev tools (#249)

* chore: ci tools updates

* ci tools updates

* chore: update ci

* build tools update

* chore: udpate dev tools

* build(deps): bump ws from 7.4.5 to 7.4.6 in /app

Bumps [ws](https://github.com/websockets/ws) from 7.4.5 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.5...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: Bill Church <billchurch@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: James Yang <26634873@qq.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-03 10:33:16 -04:00
dependabot[bot]
eb24faf742
build(deps): bump ws from 7.4.5 to 7.4.6 in /app (#255)
Bumps [ws](https://github.com/websockets/ws) from 7.4.5 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.5...7.4.6)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-03 10:21:54 -04:00
dependabot[bot]
d8652b4845
build(deps): bump normalize-url from 4.5.0 to 4.5.1 in /app (#252)
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)

---
updated-dependencies:
- dependency-name: normalize-url
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-03 10:17:25 -04:00
Bill Church
3fd941a9ee
update dev tools (#249)
* chore: ci tools updates

* ci tools updates

* chore: update ci

* build tools update

* chore: udpate dev tools
2021-05-19 12:23:03 -04:00
Bill Church
dbdac0ddd1
Update CI tools (#248)
* chore: ci tools updates

* ci tools updates

* chore: update ci
2021-05-19 12:13:37 -04:00
Bill Church
89ff3187b5
Update package.json 2021-05-19 11:10:20 -04:00
Bill Church
95f0c3f240 Merge branch 'master' of github.com:billchurch/webssh2 2021-05-19 14:58:52 +00:00
Bill Church
0ba29ad458 chore: update version 0.4.0 2021-05-19 14:58:42 +00:00
Bill Church
583a756c50
Delete build_only.yml 2021-05-19 10:31:12 -04:00
Bill Church
8b198500b0
Delete build_publish.yml 2021-05-19 10:30:58 -04:00
Bill Church
6bc9ffe2ed
0.4.0 Release (#246)
* feat: upgrade to socket.io 4.1.1 #242

* chore: lint ./app/client/src/js/index.js #242

* chore: eslint disable global Blob warning #242

* chore: lint ./app/index.js #242

* chore: lint ./app/server/app.js #242

* chore: setup eslint and airbnb rules disable standard #242

* Delete package-lock-old.json

* chore: lint ./app/index.js #242

* feat: implement alpine docker image from #213

* chore: lint ./app/server/app.js still TODO for stop function #242

* chore: lint ./app/server/util.js #242

* chore: lint ./app/server/app.js reorg socket and safe shutdown

* chore: grammar / spelling

* chore: fix some misplaced next returns in some Express routes #242

* chore: lint ./app/server/socket.js #242

* chore: bump version in ./app/package.json #242

* docs: update docs for 0.4.0 #242

* chore: update package-lock.json

* chore: install Prettier code linter #242

* chore: linting for Prettier #242

* chore: lint ./app/client/src/js/index.js #242

* chore: client linting #242

* Update package-lock.json

* chore: repackage wbssh2 bundle for testing #242

* chore: convert ./app/client/src/js/index.js to typescript #242

* chore: remove html rendering from node

* Update tsconfig.json

* Update tsconfig.json

* Delete index.js

* Update ChangeLog.md

* chore: config for development container #242

* Update BUILDING.md

* feat: pull in #234 staged for 0.4.0 #242

* docs: update changelog

* update package.json

* chore: split config from app/server/app.js #242

* chore: version bump

* chore: consistency

* feat: overridebasic fixes #243 included for #242

* chore: remove serverlog code

* docs: update changelog
2021-05-19 10:22:29 -04:00
Bill Church
379335b9e7 docs: spelling 2021-05-13 05:59:01 -04:00
Bill Church
8af11efa1a chore: release 3.1 2021-05-13 05:54:50 -04:00
Bill Church
ddc2ff8467
docs: update readme 2021-05-13 05:31:45 -04:00
Bill Church
7b2086b668
docs: create building doc 2021-05-13 05:30:13 -04:00
Bill Church
7f056fe355 docs: update changelog 2021-05-12 08:53:29 -04:00
Bill Church
83b59b41a4 docs: update changelog 2021-05-12 08:52:51 -04:00
Bill Church
c6a8db3536 docs: update changelog 2021-05-11 15:35:34 -04:00
Bill Church
26803d60f9 chore: linting 2021-05-11 15:34:01 -04:00
Bill Church
09c375c590 docs: update changelog 2021-05-11 15:33:44 -04:00
Bill Church
b324f338ad feat: CORS support
Support setting origins for socket.io, fixes #240
2021-05-11 14:55:38 -04:00
Bill Church
043c03e2d0 docs: update changelog 2021-05-11 12:39:16 -04:00
dependabot[bot]
e3550d738a
build(deps): bump ssri from 6.0.1 to 6.0.2 in /app (#233)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:03:41 -04:00
dependabot[bot]
2eab129bc1
build(deps): bump hosted-git-info from 2.8.5 to 2.8.9 in /app (#237)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.5 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.5...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:03:32 -04:00
dependabot[bot]
411c9f257e
build(deps): bump lodash from 4.17.19 to 4.17.21 in /app (#236)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:03:22 -04:00
dependabot[bot]
78d7879610
build(deps): bump handlebars from 4.7.6 to 4.7.7 in /app (#235)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:03:11 -04:00
dependabot[bot]
32023d7e4f
build(deps): bump y18n from 4.0.0 to 4.0.1 in /app (#230)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:02:57 -04:00
dependabot[bot]
ac599787a6
build(deps): bump elliptic from 6.5.3 to 6.5.4 in /app (#228)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:02:46 -04:00
dependabot[bot]
d49982df1c
build(deps): bump ini from 1.3.5 to 1.3.8 in /app (#217)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 12:01:55 -04:00
Bill Church
dcfd81b454
fix: fixes default for allowreauth (#239)
fixes #238
2021-05-11 11:58:47 -04:00
Bill Church
7b7e8e7533 fix: obey host ssh.host in config fixes #190 2020-09-17 07:55:52 -04:00
Matteo Pietro Dazzi
8598183b2f
Use docker build to create multi-arch images (#202)
* Buildx docker image

* Doker hub user on image name

* Change destination platforms

Co-authored-by: Matteo Pietro Dazzi <matteopietro.dazzi@gft.com>
2020-09-17 06:39:30 -04:00
Chia-Chi Hsu
d0a19774c2
Update README.md (#207)
Add new lines after <ignorestart> and <ignoreend>.
2020-09-17 06:38:10 -04:00
dependabot[bot]
9c5ab09c7c
build(deps): bump elliptic from 6.5.2 to 6.5.3 in /app (#205)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-30 12:32:41 -04:00
dependabot[bot]
4b981c7dbf
build(deps): bump lodash from 4.17.15 to 4.17.19 in /app (#204)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-30 12:30:03 -04:00
dependabot[bot]
6564f532cf
build(deps-dev): bump standard-version from 7.1.0 to 8.0.1 in /app (#203)
Bumps [standard-version](https://github.com/conventional-changelog/standard-version) from 7.1.0 to 8.0.1.
- [Release notes](https://github.com/conventional-changelog/standard-version/releases)
- [Changelog](https://github.com/conventional-changelog/standard-version/blob/master/CHANGELOG.md)
- [Commits](https://github.com/conventional-changelog/standard-version/compare/v7.1.0...v8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-30 12:29:40 -04:00
CChemin
fc2b7d4625
fix missing value for verify in the config.json sample (#192) 2020-03-30 23:59:42 -04:00
Bill Church
ed793aaba3 docs: update changelog 2020-03-19 10:38:45 -04:00
Bill Church
5cdc9d0978 chore: update config.json.sample 2020-03-19 10:37:00 -04:00
Bill Church
5fd290ea0a chore: bump pre-release version 2020-03-19 10:33:00 -04:00
Bill Church
c1d3a42d22 Merge branch 'edgarogh-safe-shutdown' 2020-03-19 10:31:58 -04:00
Bill Church
04503e5d8f chore: add .dockerignore 2020-03-19 10:30:19 -04:00
Bill Church
675b4f5a3a feat: add SIGTERM to safe shutdown feature 2020-03-19 10:30:06 -04:00
Bill Church
6a3a47a13d fix: missing ENTRYPOINT for Dockerfile 2020-03-19 10:29:40 -04:00
Edgar Onghena
2934c66bf4 Add safeShutdownDuration config info to README.md 2020-03-18 19:50:11 +01:00
Edgar Onghena
61672c3f1e Add shutdown middleware to prevent requests 2020-03-18 19:35:52 +01:00
Edgar Onghena
61f19ae3ce Make "safeShutdownDuration" configurable
Defaults to 300s = 5min
2020-03-18 19:25:48 +01:00
Edgar Onghena
eb7d91ffbc Add safe shudown
- SIGINT is intercepted and force-quits the 2nd time
 - Live countdown on Web UI
 - Countdown ignored if all clients disconnect
 - Clean exit function
2020-03-18 19:01:53 +01:00
Bill Church
7a89d45e48 chore: 3.0 release 2020-03-15 14:07:58 -04:00
Bill Church
58c3601af0
Module updates (#185)
* chore: removed compression option code, standardjs

* chore: update packages

* chore: update favicon.ico location

* chore: standardjs run

* chore: update changelog
2020-03-14 13:18:20 -04:00
Bill Church
fcfa6874cd chore: update readme 2020-03-14 11:49:25 -04:00
Bill Church
546ac911c9 Merge branch 'pathchanges' 2020-03-14 11:25:33 -04:00
Bill Church
4686d1d6f2 Merge branch 'master' into pathchanges 2020-03-14 11:24:56 -04:00
Bill Church
5e76bb527e chore: update changelog 2020-03-14 11:19:42 -04:00
Bill Church
2db504467c chore: pull changes from master 2020-03-14 11:10:29 -04:00
Bill Church
ec9870e2a6 chore: remove old ilx build scripts 2020-03-14 11:10:04 -04:00
Bill Church
d61aec3862 chore: pull changelog and readme from master 2020-03-14 11:08:28 -04:00
Bill Church
152ac1e898 chore: update to read-config-ng 2020-03-14 09:48:02 -04:00
Bill Church
506918dc68 config.json fix from #177 2020-03-14 09:47:38 -04:00
Bill Church
2bc5c030e3 chore: move read-config to read-config-ng 2020-03-14 09:27:40 -04:00
Bill Church
dd33a8b6b0 chore: move root path for all resources under /ssh 2020-03-14 09:06:10 -04:00
Chia-Chi Hsu
42f973b479 Fix: update config.json.sample (#177) 2020-01-17 04:43:25 -08:00
Bill Church
2289036605 chore: update validator to 12.1 for better IPv6 support 2019-11-23 09:21:36 -05:00
Bill Church
d79e050b87 Update ChangeLog.md 2019-11-23 09:03:01 -05:00
Bill Church
e796f9fb58 fix: subnet unauthorized now emits "ssherror" which persists across websocket termination 2019-11-23 09:00:28 -05:00
Bill Church
16a27ce62a
Pr/163 (#164)
* Add configuration option to restrict connections to specified subnets

Signed-off-by: Matt Oswalt <matt@keepingitclassless.net>

* Remove accidentally included message

Signed-off-by: Matt Oswalt <matt@keepingitclassless.net>

* Move to cidr-matcher

Signed-off-by: Matt Oswalt <matt@keepingitclassless.net>

* feat: Add configuration option to restrict connections to specified subnets
2019-11-23 08:45:59 -05:00
Bill Church
9a96637cb4
Username get (#162)
* feat(auth): ssh private key auth implemented via config.json

If config.json is present and user.privatekey has an ssh-rsa private key defined as well as a user.name, the SSH server will staticlly authenticate to whatever host is specified on the URL with those credentials.

The ssh-rsa private key must have is line returns replaced with the litaral \n

Example: "-----BEGIN RSA PRIVATE KEY-----\nblahblahblah\n"

* docs:update README.com
2019-11-15 17:34:13 -05:00
Bill Church
342df8eb9c
feat(auth): ssh private key auth implemented via config.json (#161)
If config.json is present and user.privatekey has an ssh-rsa private key defined as well as a user.name, the SSH server will staticlly authenticate to whatever host is specified on the URL with those credentials.

The ssh-rsa private key must have is line returns replaced with the litaral \n

Example: "-----BEGIN RSA PRIVATE KEY-----\nblahblahblah\n"
2019-11-15 17:22:53 -05:00
Bill Church
65d6ec6845
feat(config): specify local source address and port for client connections fixes #152 (#158) 2019-11-15 15:55:54 -05:00
Bill Church
ca20321625
update build environment (#157)
* Accept default username/password overrides from config. Clarified supplying custom config. (#146)

* feat(auth): username and password may now be sourced from config.json fixes #104

* style:remove test changelog

* build:remove uglify from build process and reaplce with terser

* style:format changelog
2019-11-15 13:01:51 -05:00
Bill Church
212df80fb6
User pass (#156)
* Accept default username/password overrides from config. Clarified supplying custom config. (#146)

* feat(auth): username and password may now be sourced from config.json fixes #104
2019-11-15 12:58:50 -05:00
Bill Church
eebc32b2c9 Merge branch 'package-updates'
build: fix stuff
2019-11-15 11:21:03 -05:00
Bill Church
b8318d2238 build: Add standard-version to build process 2019-11-15 11:20:12 -05:00
Bill Church
9f3c661bdc chore(release): 0.2.10-0 2019-11-15 11:06:09 -05:00
Bill Church
9355ad7b5c
Updated packages: (#153)
Updated packages:

    "colors": "~1.4.0",
    "compression": "~1.7.4",
    "debug": "^4.1.1",
    "express": "~4.17.1",
    "express-session": "~1.17.0",
    "socket.io": "2.2.0",
    "ssh2": "~0.8.6",
    "terser-webpack-plugin": "^2.2.1",
    "validator": "~12.0.0",
    "xterm-addon-fit": "^0.3.0",
    "xterm-addon-search": "^0.3.0",
    "xterm-addon-web-links": "^0.2.1"
    "@fortawesome/fontawesome-svg-core": "^1.2.25",
    "@fortawesome/free-solid-svg-icons": "^5.11.2",
    "clean-webpack-plugin": "^3.0.0",
    "copy-webpack-plugin": "^5.0.5",
    "cross-env": "^6.0.3",
    "css-loader": "^3.2.0",
    "file-loader": "^4.2.0",
    "postcss-discard-comments": "^4.0.2",
    "standard": "^14.3.1",
    "style-loader": "^1.0.0",
    "url-loader": "^2.2.0",
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.10",
    "webpack-merge": "^4.2.2",
    "xterm": "^4.2.0"
2019-11-15 10:50:40 -05:00
Bill Church
93303ad132 Updated packages:
Updated packages:

    "colors": "~1.4.0",
    "compression": "~1.7.4",
    "debug": "^4.1.1",
    "express": "~4.17.1",
    "express-session": "~1.17.0",
    "socket.io": "2.2.0",
    "ssh2": "~0.8.6",
    "terser-webpack-plugin": "^2.2.1",
    "validator": "~12.0.0",
    "xterm-addon-fit": "^0.3.0",
    "xterm-addon-search": "^0.3.0",
    "xterm-addon-web-links": "^0.2.1"
    "@fortawesome/fontawesome-svg-core": "^1.2.25",
    "@fortawesome/free-solid-svg-icons": "^5.11.2",
    "clean-webpack-plugin": "^3.0.0",
    "copy-webpack-plugin": "^5.0.5",
    "cross-env": "^6.0.3",
    "css-loader": "^3.2.0",
    "file-loader": "^4.2.0",
    "postcss-discard-comments": "^4.0.2",
    "standard": "^14.3.1",
    "style-loader": "^1.0.0",
    "url-loader": "^2.2.0",
    "webpack": "^4.41.2",
    "webpack-cli": "^3.3.10",
    "webpack-merge": "^4.2.2",
    "xterm": "^4.2.0"
2019-11-15 10:50:15 -05:00
Bill Church
1cbb195739 remove big-iip ILX code 2019-10-18 17:55:14 -04:00
Bill Church
4ad7e7ed3f lock package versions 2019-10-18 17:24:22 -04:00
Bill Church
341e61eb01 Merge branch 'master' of github.com:billchurch/WebSSH2 2019-10-01 09:29:55 -04:00
Bill Church
1be03d79f5 rebuild 2019-10-01 09:29:52 -04:00
bara666
c4315a2f91 Update README.md (#144)
Change exmple URL, param color change to headerBackground
2019-09-30 13:30:15 -04:00
Jared Henderson
c2c3aee311 make it clear that you install in the app dir (#150)
I got confused from the instructions, I think similarly to #147.
2019-09-30 13:29:43 -04:00
Bill Church
dbcf973773 remove module provisioning 2019-09-18 08:57:33 -07:00
Bill Church
56086b01dd Missing require('fs') in server/app.js See issue [#135](../../issues/135)
- Missing require('fs') in `server/app.js` See issue [#135](../../issues/135)
- Patched read-config to mitigate vulnerability in js-yaml
  - issue not exploitable on webssh2 implementation
  - patched anyway
  - sending my patch upstream to read-config, webssh2 package.json points to patched version in my repository https://github.com/billchurch/nodejs-read-config
  - See https://github.com/nodeca/js-yaml/issues/475 for more detail
2019-06-13 14:39:47 -04:00
Bill Church
7cdcbec5f1 add missing fs
that was embarassing... fixes #135
2019-06-13 13:43:46 -04:00
Bill Church
95eb700a21
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
2019-05-25 22:54:32 -04:00
Bill Church
63f368dee2 Update .gitignore 2019-05-16 11:52:38 -04:00
Bill Church
1b40a37d83 update build scripts, removed BIG-IP version prefix 2019-05-16 07:35:52 -04:00
Bill Church
b7d3ec3152 scripts update 2019-05-13 20:29:19 -04:00
Bill Church
28283ecd9f Update README.md 2019-02-12 08:53:50 -05:00
Bill Church
f1e08810a3 Update README.md 2019-02-12 08:49:29 -05:00
Bill Church
12d6b9a0c7 added details for options.allowreauth 2019-02-12 08:48:53 -05:00
Bill Church
d996045a19
Update README.md 2019-01-30 16:49:29 -05:00
Bill Church
9e84a410bd
Update README.md 2019-01-30 16:49:10 -05:00
Bill Church
49fc526c08 resolve issues with webpack 2019-01-18 13:51:17 -05:00
Bill Church
09394933ac Update ChangeLog.md 2019-01-10 10:33:57 -05:00
Bill Church
ccee67b7e8
Issue 125 (#126)
* fix `npm run build`

fixes #125
- update font-awesome fonts to 5.6.3
- update webpack and dependancies
- update xterm to 3.8.0
2019-01-10 09:29:48 -06:00
Bill Church
3d244054c4
Merge pull request #119 from billchurch/isuse118
Isuse118
2018-11-21 12:04:07 -05:00
Bill Church
29fabbb631 Update package.json 2018-11-21 11:55:52 -05:00
Bill Church
04c2846828 Update ChangeLog.md 2018-11-21 11:55:32 -05:00
Bill Church
e452dc0fb1 Update util.js
fixes 118, thanks @smilesm2
2018-11-21 11:53:00 -05:00
Bill Church
e512fca4d0
Update ISSUE_TEMPLATE.md 2018-11-21 11:29:19 -05:00
Bill Church
8ee76ffe44 update dev dependencies
- Update developer dependencies
  - Font-Awesome deprecated packages update
    - https://github.com/FortAwesome/Font-Awesome/blob/master/UPGRADING.md#50x-to-510
- silence bogus eslint error
2018-11-11 11:20:39 -05:00
Bill Church
395904d5a2 fix reauth option, move files into /app, update dockerfile, update packages
- `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
- **BREAKING** moved app files to /app, this may be a breaking change
- Updated dockerfile for new app path
- Updated app dependancies
  - xterm v3.8.0
    - https://github.com/xtermjs/xterm.js/releases/tag/3.8.0
  - basic-auth v2.0.1
    - https://github.com/jshttp/basic-auth/releases/tag/v2.0.1
  - express v4.16.4
    - https://github.com/expressjs/express/releases/tag/4.16.4
  - validator v10.9.0
    - https://github.com/chriso/validator.js/releases/tag/10.9.0
- Updated dev dependancies
  - snazzy v8.0.0
  - standard v12.0.1
  - uglifyjs-webpack-plugin v2.0.1
  - ajv v6.5.5
  - copy-webpack-plugin v4.6.0
  - css-loader v1.0.1
  - nodemon v1.18.6
  - postcss-discard-comments v4.0.1
  - snyk v1.108.2
  - url-loader v1.1.2
  - webpack v4.25.1
  - webpack-cli v3.1.2
2018-11-11 10:07:37 -05:00
Bill Church
1d09fa22ef update ilx workspace 2018-11-07 07:57:37 -05:00
Bill Church
d33db26c4b update bundle 2018-11-07 07:47:18 -05:00
Bill Church
6a4eb1e985 version bump 2018-11-07 07:26:16 -05:00
Bill Church
9f551774f6
Merge pull request #113 from vvalchev/re-request-auth-on-login-failure
Fixes #112 - Re-auth doesn't work if incorrect auth was provided initially
2018-11-07 07:24:41 -05:00
Bill Church
e7db491c8d
Merge pull request #108 from billchurch/greenkeeper/file-loader-2.0.0
Update file-loader to the latest version 🚀
2018-11-07 07:24:09 -05:00
Bill Church
14755fdd7a
Merge pull request #109 from billchurch/greenkeeper/style-loader-0.23.1
Update style-loader to the latest version 🚀
2018-11-07 07:23:28 -05:00
Bill Church
0efaf6a493 Update .codeclimate.yml 2018-11-07 06:51:14 -05:00
Bill Church
0eb937eaee
Merge pull request #116 from billchurch/greenkeeper/snyk-1.108.0
chore(package): update snyk to version 1.108.0
2018-11-07 06:38:53 -05:00
Bill Church
76665b5a04
Merge pull request #115 from perlun/patch-1
package.json: Support node.js versions greater than 6
2018-11-07 06:37:27 -05:00
Per Lundberg
0fb4f28f0a
package.json: Support node.js versions greater than 6 2018-11-05 22:14:58 +02:00
greenkeeper[bot]
eb90f82168 chore(package): update snyk to version 1.108.0 2018-11-05 13:16:37 +00:00
Bill Church
7a033e1bd4 Merge branch 'master' of https://github.com/billchurch/WebSSH2 2018-10-23 10:53:58 -04:00
Bill Church
809c1db941 Update Jenkinsfile 2018-10-23 10:53:55 -04:00
Valentin Valchev
a18efd20ad Fixes #112 - Re-auth doesn't work if incorrect auth was provided initially.
https://github.com/billchurch/WebSSH2/issues/112

This commit send 'reauth' command to the client, when err.level === 'client-authentication'.

The client itself binds the 'reauthSession' function to that command, so it will automatically request authentication, every time the authentication fails.

The client bundle (webpack) is also rebuild with the made changes.
2018-10-11 11:18:01 +03:00
greenkeeper[bot]
8d88992b37 chore(package): update style-loader to version 0.23.1 2018-10-08 13:50:49 +00:00
greenkeeper[bot]
c0e5334786 chore(package): update file-loader to version 2.0.0 2018-10-05 22:50:36 +00:00
Bill Church
238208cb53
Merge pull request #102 from billchurch/DEV
Dev
2018-09-11 15:46:27 -04:00
Bill Church
86fba56b92 update changelog 2018-09-11 15:45:07 -04:00
Bill Church
263494f11c updated debug
non-essential, update debug package
2018-09-11 15:44:06 -04:00
Bill Church
7cb17becaf update changelog, increment version 2018-09-11 15:32:52 -04:00
Bill Church
f125085600 update jsthints 2018-09-11 15:13:32 -04:00
Bill Church
88f050bbcf
Update README.md 2018-09-06 09:09:00 -04:00
Bill Church
7d4eced151
Update README.md 2018-09-06 09:08:15 -04:00
Bill Church
05934e8b19 codeclimate 2018-08-08 07:56:53 -04:00
Bill Church
3cfeead263
Merge pull request #89 from billchurch/package-upgrade-test
approved, update packages to most recent, client files rebuilt
2018-08-07 07:15:27 -04:00
Bill Church
6fc0317b23 fix .codeclimate.yml 2018-08-07 07:04:20 -04:00
Bill Church
fcfbf24d45 update codeclimate
getting "hit" for workspace/ duplication (needed for F5 specific stuff) made exception. also getting "hit" for upstream TODO/HACK in xterm.js, excluding compiled files.
2018-08-07 06:59:37 -04:00
Bill Church
fe7e523151 rebuild client support files 2018-08-07 06:52:29 -04:00
Bill Church
806c9f0b42 Merge remote-tracking branch 'origin/master' into package-upgrade-test 2018-08-07 06:50:51 -04:00
Bill Church
f5f2180e7d update packages 2018-08-07 06:49:31 -04:00
Bill Church
8f16772380
Update README.md 2018-07-30 12:17:15 -04:00
Bill Church
d670266c22 rebuild client files 2018-07-30 10:28:07 -04:00
Bill Church
f87bde04a8 update changelog 2018-07-30 09:55:24 -04:00
Bill Church
9bbc116120 reauth feature
fixes #75 and potentially #51 thanks to both @vbeskrovny and @vvalchev
2018-07-30 09:54:36 -04:00
Bill Church
a518f0748f
Merge pull request #85 from vvalchev/logout_support
re-authentication support
2018-07-30 08:20:04 -04:00
Bill Church
29804c7bc8
Update socket.js
changing from `logout` to `reauth`
2018-07-30 08:18:26 -04:00
Bill Church
21f2c4ef9f
Update app.js
changed URL to `reauth` from `logout` as it's not quite performing a `logout` function.
2018-07-30 08:17:39 -04:00
Bill Church
3586e17a63 upgrade all packages to potentially help with compatability issues on some platforms 2018-07-28 10:19:48 -04:00
Valentin Valchev
771800b02a The provided patch, will add a /logout URL, which will re-request the authentication and then redirect you back to the referrer (e.g like http://localhost:2222/ssh/host/myhost.com).
It also adds a menu entry "Switch User" that opens /logout and forces re-authentication.
2018-07-23 13:02:50 +03:00
Bill Church
a1fdc0974d update changelog 2018-07-18 16:05:42 -04:00
Bill Church
02a88761b8 Merge branch 'master' of https://github.com/billchurch/WebSSH2 2018-07-18 15:45:34 -04:00
Bill Church
cd45468b58 updated build scripts 2018-07-18 15:45:31 -04:00
Bill Church
6e69aa0d98 buildscripts and bigip workspace addition 2018-07-18 12:28:44 -04:00
Bill Church
da102c75c4
Delete BIG-IP-ILX-ephemeral_auth-current.tgz 2018-07-18 11:57:21 -04:00
Bill Church
9a53cbf7b5 update client bundles 2018-05-10 16:05:45 -04:00
Bill Church
1eaa4f5bfd
Merge pull request #70 from billchurch/greenkeeper/@fortawesome/fontawesome-1.1.7
chore(package): update @fortawesome/fontawesome to version 1.1.7
2018-05-10 15:54:39 -04:00
Bill Church
bf7ab75285
Merge branch 'master' into greenkeeper/@fortawesome/fontawesome-1.1.7 2018-05-10 15:52:24 -04:00
Bill Church
f61fc9c298
Merge pull request #71 from billchurch/greenkeeper/@fortawesome/fontawesome-free-solid-5.0.11
chore(package): update @fortawesome/fontawesome-free-solid to version…
2018-05-10 15:51:58 -04:00
Bill Church
d70463a311
Merge branch 'master' into greenkeeper/@fortawesome/fontawesome-free-solid-5.0.11 2018-05-10 15:40:19 -04:00
Bill Church
4e8bfc7d6b
Merge pull request #69 from billchurch/greenkeeper/update-to-node-10
Greenkeeper/update to node 10
2018-05-10 15:27:25 -04:00
Bill Church
567f4f433f keeping package.json at 6 2018-05-10 15:27:09 -04:00
Bill Church
e37f6d3de1 update changelog 2018-05-10 11:02:03 -04:00
Bill Church
42523fc568
Merge pull request #68 from billchurch/greenkeeper/ssh2-0.6.1
fix(package): update ssh2 to version 0.6.1
2018-05-10 11:00:40 -04:00
Bill Church
00f59bf967
Merge branch 'master' into greenkeeper/ssh2-0.6.1 2018-05-10 11:00:16 -04:00
Bill Church
f4b4618015 update changelog 2018-05-10 10:56:48 -04:00
Bill Church
29478d11f6 rebuilt /client
- Updated dev dependancies
- rebuilt /client with new version of webpack
2018-05-10 10:56:40 -04:00
Bill Church
23ae7d5ce7
Merge pull request #67 from billchurch/greenkeeper/validator-10.1.0
fix(package): update validator to version 10.1.0
2018-05-10 10:15:42 -04:00
Bill Church
092f2f1a85
Merge pull request #66 from billchurch/greenkeeper/url-loader-1.0.1
chore(package): update url-loader to version 1.0.1
2018-05-10 10:14:22 -04:00
Bill Church
8f4bc70c26
Merge branch 'master' into greenkeeper/url-loader-1.0.1 2018-05-10 10:10:38 -04:00
Bill Church
2ca27397c6
Merge pull request #59 from billchurch/greenkeeper/style-loader-0.21.0
Update style-loader to the latest version 🚀
2018-05-10 10:09:41 -04:00
Bill Church
25d454d405
Merge branch 'master' into greenkeeper/style-loader-0.21.0 2018-05-10 10:07:20 -04:00
Bill Church
418513309c
Merge pull request #65 from billchurch/greenkeeper/webpack-4.7.0
chore(package): update webpack to version 4.7.0
2018-05-10 10:05:02 -04:00
Bill Church
a2fd7a23fb
Merge pull request #50 from billchurch/greenkeeper/standard-11.0.0
Update standard to the latest version 🚀
2018-05-10 10:02:07 -04:00
Bill Church
9667031bf2
add note about node versions older than 6.x 2018-05-10 10:01:07 -04:00
greenkeeper[bot]
bf15b3e11d fix(package): update ssh2 to version 0.6.1
Closes #55
2018-05-10 11:58:11 +00:00
greenkeeper[bot]
1a15fa57bb fix(package): update validator to version 10.1.0
Closes #62
2018-05-04 23:15:06 +00:00
greenkeeper[bot]
1410aabebb chore(package): update webpack to version 4.7.0
Closes #52
2018-05-04 12:31:16 +00:00
greenkeeper[bot]
c9b37ee0cb chore(package): update @fortawesome/fontawesome to version 1.1.7 2018-05-03 19:23:53 +00:00
greenkeeper[bot]
b2be2595a9 chore(package): update @fortawesome/fontawesome-free-solid to version 5.0.11 2018-05-01 20:39:27 +00:00
greenkeeper[bot]
a6ad5d62f2 Update engines to node 10 in package.json 2018-04-26 13:58:03 +00:00
greenkeeper[bot]
64a81b3ef6 Update to node 10 in .travis.yml 2018-04-26 13:58:00 +00:00
greenkeeper[bot]
60821f9827 chore(package): update style-loader to version 0.21.0 2018-04-18 22:48:43 +00:00
greenkeeper[bot]
e0d9a0bd6f chore(package): update url-loader to version 1.0.1
Closes #54
2018-03-03 08:27:32 +00:00
Bill Church
8a89b687c4
Create CONTRIBUTING.md 2018-02-28 21:58:59 -05:00
Bill Church
86d65790f2
Create ISSUE_TEMPLATE.md 2018-02-28 21:54:28 -05:00
Bill Church
fb8399bc6a
Merge pull request #53 from billchurch/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2018-02-28 21:52:25 -05:00
Bill Church
d6ff08ed67
Create CODE_OF_CONDUCT.md 2018-02-28 21:52:15 -05:00
billchurch
1989717f2d 0.2.10 2018-02-28 10:51:23 -05:00
greenkeeper[bot]
d59b2cce4c chore(package): update standard to version 11.0.0 2018-02-19 00:36:26 +00:00
billchurch
86d781a8c6 update package.json 2018-02-17 15:24:57 -05:00
billchurch
ebbe5a6e17 remove comments from config.json, set default listen IP to 0.0.0.0 2018-02-17 15:24:42 -05:00
billchurch
a8dfc5b36e rename 2018-02-17 15:23:22 -05:00
billchurch
6db77fcc07 0.2.3-test 2018-02-17 15:22:33 -05:00
billchurch
41476a0113 update engine to 6.9.1 2018-02-17 11:19:39 -05:00
billchurch
d99693b37c ESC]0; is now removed from log files when using the browser-side logging feature. fixes #49 2018-02-17 11:19:22 -05:00
billchurch
d8e8fcca9b update 2018-02-17 10:26:55 -05:00
billchurch
e46d4bbade update 2018-02-17 10:26:22 -05:00
billchurch
61bcfe7459 update readme 2018-02-17 10:25:53 -05:00
Bill Church
b53eb4b219
Merge pull request #48 from billchurch/greenkeeper/initial
Add Greenkeeper badge 🌴
2018-02-17 10:24:39 -05:00
billchurch
af10753cc8 update travis 2018-02-17 10:15:41 -05:00
greenkeeper[bot]
4a9b782ab6 docs(readme): add Greenkeeper badge 2018-02-17 15:09:22 +00:00
billchurch
dd45d38a9a updated for bellStyle option 2018-02-17 10:03:05 -05:00
billchurch
3138a7c9db Upgrade xterm.js to 3.1.0, add bellStyle options
- Added bellStyle options
  - `GET var`: **bellStyle** - _string_ - Style of terminal bell:
("sound"|"none"). **Default:** "sound". **Enforced Values:** "sound",
"none"
  - `config.json`: **terminal.bellStyle** - _string_ - Style of
terminal bell: (sound|none). **Default:** "sound".
### Changed
- Updated xterm.js to 3.1.0
  - https://github.com/xtermjs/xterm.js/releases/tag/3.1.0
2018-02-17 10:02:22 -05:00
billchurch
3a700eedf1 browser title now changes with xterm escape sequences. see
http://tldp.org/HOWTO/Xterm-Title-3.html
2018-02-17 09:21:43 -05:00
billchurch
cd8b829675 updating logging
added ip:port logging, updated verbiage for configuration file log
2018-02-17 01:23:59 -05:00
billchurch
6fc1a7912b unused file 2018-02-17 01:20:40 -05:00
billchurch
200c18cc17 fixed terminal height calculation after <!DOCTYPE html> addition
html needed a height: 100% attribute, otherwise terminal-container did
not take up the entire window (less header/footer)
2018-02-17 01:18:38 -05:00
billchurch
de19843aad Revert "Revert "more housekeeping""
This reverts commit 8ef6698a33.
2018-02-17 01:07:14 -05:00
billchurch
7b5224d7d1 Revert "Revert "housekeeping""
This reverts commit 67b15e1c2f.
2018-02-17 01:06:37 -05:00
billchurch
67b15e1c2f Revert "housekeeping"
This reverts commit bc19432dfa.
2018-02-17 01:05:52 -05:00
billchurch
8ef6698a33 Revert "more housekeeping"
This reverts commit 7d21b78ba1.
2018-02-17 01:04:18 -05:00
billchurch
7d21b78ba1 more housekeeping 2018-02-17 00:32:03 -05:00
billchurch
bc19432dfa housekeeping
Move bulk of server .js file files to /server, all client related files
live in /client (including /public), webpack scripts now live in
/scripts, cleanup of paths in /client/src/js/index.js and webpack.js.
2018-02-16 23:48:00 -05:00
billchurch
cd3ac433e8 correct var 2018-02-15 16:01:37 -05:00
billchurch
d01d2c7c2e update read-config to v2 2018-02-15 15:52:10 -05:00
billchurch
790011a456 ephem auth package update 0.2.9 2018-02-14 07:21:36 -06:00
billchurch
1f88e7c9b1 move menu content serverside
to control display based on options enabled, better UI experience.
still in progress
2018-02-12 13:14:12 -05:00
billchurch
4fbe42092a package edit 2018-02-12 10:49:00 -05:00
billchurch
5c9369d57a Updated config path statement
config path now uses “require.main.filename” which should switch
between being used a module or as an application.
2018-02-12 10:48:26 -05:00
billchurch
3dabb4779e update readme 2018-02-10 15:54:55 -05:00
billchurch
dc901e4345 demo screenshot 2018-02-10 15:52:19 -05:00
billchurch
ad360da2f6 updated readme/gitignore 2018-02-10 14:38:30 -05:00
billchurch
c7ef520d46 update webssh binaries for big-ip 2018-02-10 11:22:01 -05:00
billchurch
10264d0ca3 updating package.json 2018-02-10 11:20:42 -05:00
billchurch
a55bebf9e4 increment to v2.0 2018-02-10 10:36:09 -05:00
billchurch
ff875f92db magnification, resize logic
- minification is now default, utilize ‘webpack*.js’ scripts to change
behavior and run ‘npm run rebuild’
- sizing and resize takes into account optional headers (#header) and
footer (#footer)
2018-02-10 10:11:28 -05:00
billchurch
29040d328a enable compression...testing... 2018-02-10 00:08:36 -05:00
billchurch
dbc546b5d7 formatting 2018-02-09 22:41:16 -05:00
billchurch
ad4cf49b76 fixes #43 2018-02-09 22:22:12 -05:00
billchurch
d3bf809f75 update resize logic
fixes #43
tested with IE11,Edge,Chrome 64,Firefox 58,Safari 11,Opera 46
2018-02-09 22:21:53 -05:00
billchurch
d456a180d9 added boolean conversion from url strings, continuing browser resize additions 2018-02-09 19:06:43 -05:00
billchurch
15945f0d16 update 2018-02-09 09:22:45 -05:00
billchurch
fb000fc21d readme pointers 2018-02-09 09:20:54 -05:00
billchurch
075d3a7c30 readme pointer for /src 2018-02-09 09:16:53 -05:00
billchurch
f6e41d4b45 updating styling 2018-02-09 09:06:56 -05:00
billchurch
fdcb21d5de config.json defaults 2018-02-08 15:57:17 -05:00
billchurch
4e68947cb0 updating socket.io again 2018-02-08 15:55:14 -05:00
billchurch
0f00e12e81 update changelog 2018-02-08 15:42:22 -05:00
billchurch
207832d318 preparing for 0.2.0...
Still a work in progress. Adding menu system and fontawsome
integration.
2018-02-08 15:34:33 -05:00
billchurch
8af3d3c695 removing grunt configs 2018-02-06 15:05:03 -05:00
billchurch
875aecf09a split css out to improve loading perception 2018-02-06 15:04:55 -05:00
billchurch
d44e62dc3a fix typo 2018-02-06 13:54:11 -05:00
billchurch
bcb2050971 cleanup 2018-02-06 12:24:09 -05:00
billchurch
01d025a7bf organize web pack to prod/vs/dev 2018-02-06 12:17:34 -05:00
billchurch
52f5ba1dad cleanup of public and supporting files
/public is now volatile, any changes to templates should be made in
/src and then run either “npm run build” or “npm run builder”
2018-02-06 12:11:39 -05:00
billchurch
977d109316 update changeling 2018-02-06 10:45:07 -05:00
billchurch
7dc8cfb0f1 remove references to host key hashes 2018-02-06 10:43:15 -05:00
billchurch
397b3c0068 update xterm.js to 3.0.2, switch to webpack, move javascript out of html
fixes #40
fixes #41
moved /js/client.js to /js/index.js
todo: rework build scripts to utilize webpack vs gulp
2018-02-06 10:24:53 -05:00
billchurch
88ad8210f3 updated sizes 2018-01-31 09:48:23 -05:00
billchurch
34868be18e screenshots for BIG-IP upgrade 2018-01-31 09:39:41 -05:00
billchurch
f890c46de3 fix binaries 2018-01-30 18:35:13 -05:00
billchurch
3b634b1f35 increment to v0.1.4 2018-01-30 18:31:43 -05:00
billchurch
08400b0544 added keepaliveInterval, keepaliveCountMax options 2018-01-30 18:09:16 -05:00
billchurch
7dd019d0e6 bin/ephemeral-auth current 2018-01-30 11:22:33 -05:00
billchurch
3e8be4b289 create bin/current 2018-01-30 11:13:13 -05:00
billchurch
2d725e9fe0 implement global keep alive option
keepaliveInterval in config.json. time in ms, 0=disable
2017-12-12 15:02:19 -05:00
billchurch
c6f6daeaf6 commenting on host key hash verification and renaming 2017-12-12 14:43:07 -05:00
billchurch
783327b014 host key verification poc 2017-12-12 14:34:45 -05:00
billchurch
5ed695bb32 typo 2017-12-12 12:44:35 -05:00
billchurch
2b12825a0c moving files around to get rid of unneeded directories 2017-12-12 12:41:54 -05:00
Bill Church
07d90cd2e3
Merge pull request #29 from billchurch/snyk-fix-68970435
[Snyk Update] New fixes for 2 vulnerable dependency paths
2017-12-12 12:36:58 -05:00
snyk-bot
196d76922e fix: package.json to reduce vulnerabilities
The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/npm:ws:20171108

Latest report for billchurch/webssh2:
https://snyk.io/test/github/billchurch/webssh2
2017-11-18 05:46:02 +00:00
Bill Church
72acb0dcc4 Merge pull request #27 from jgroom33/master
add Dockerfile
2017-10-10 10:36:35 -05:00
vagrant
398df7f4c4 add Dockerfile 2017-10-10 03:09:27 +00:00
billchurch
be50151108 update validator, morgan, express, express-session dependencies
express@4.16.1, express-session@1.15.6, morgan@1.9, validator@9
2017-10-02 10:44:37 -04:00
billchurch
891f7b48a5 improve readability 2017-09-29 17:48:26 -04:00
billchurch
d38ff32452 improving readability 2017-09-29 17:46:51 -04:00
billchurch
bb318f7ab8 codeclimate prefs update 2017-09-29 17:08:22 -04:00
billchurch
eb9810dfac prefs for codeclimate 2017-09-29 17:04:22 -04:00
billchurch
1651fada48 increment to 0.1.3 2017-09-28 17:59:02 -04:00
billchurch
95f8fbb7d9 update license to MIT 2017-09-27 16:20:57 -04:00
billchurch
88d53ba1f6 prep for npm publish 2017-09-27 16:13:14 -04:00
billchurch
13398de212 prep for npm publish 2017-09-27 16:11:57 -04:00
billchurch
ddb5969c36 update debug/express/basic-auth modules 2017-09-27 15:54:01 -04:00
billchurch
47268fcee7 update .bithoundrc 2017-09-27 15:48:14 -04:00
billchurch
0a65634bd6 update .bithoundrc 2017-09-27 15:42:29 -04:00
billchurch
349d2abe7d Upgrade express to 4.15.5 2017-09-27 14:38:10 -04:00
billchurch
c4a670e6a0 updating snyk for ReDoS issues 2017-09-26 15:23:07 -04:00
billchurch
321b23eebb Revert to debug@2.6.9 to eliminate ReDoS in %o formatter 2017-09-26 11:37:42 -04:00
Bill Church
7a71b5d0a1 Update README.md 2017-09-26 10:47:40 -04:00
Bill Church
51f3d87234 Update README.md 2017-09-26 10:47:26 -04:00
billchurch
e5b46bf52c fixed formatting typo 2017-08-21 10:03:36 -04:00
billchurch
d849f7432e adding readyTimeout option, updating packages
adding readyTimeout option, updating packages
2017-08-21 09:21:52 -04:00
Bill Church
458747d64e Merge pull request #21 from billchurch/snyk-fix-2918e004
[Snyk Update] New fixes for 1 vulnerable dependency path
2017-08-05 16:55:03 -04:00
snyk-bot
e65a964621 fix: package.json to reduce vulnerabilities
Latest report for billchurch/webssh2:
https://snyk.io/test/github/billchurch/webssh2

Some vulnerabilities weren't fixed or ignored, and so will still fail
the Snyk test report.
2017-08-05 05:46:06 +00:00
billchurch
1683c8ad35 update xterm and ssh2
- Updated xterm.js to 2.8.1 from 2.6.0
  - See https://github.com/sourcelair/xterm.js/releases/tag/2.8.1
  - See https://github.com/sourcelair/xterm.js/releases/tag/2.8.0
  - See https://github.com/sourcelair/xterm.js/releases/tag/2.7.0
- Updated ssh2 to 0.5.5 to keep current, no fixes impacting WebSSH2
  - ssh-streams to 0.1.19 from 0.1.16
2017-07-31 10:20:58 -05:00
billchurch
f67b91a415 updating snyk preferences 2017-07-31 07:20:15 -05:00
billchurch
3464aea510 update readme 2017-06-03 17:08:52 -04:00
Bill Church
c4e24d80b7 Update README.md 2017-06-03 17:00:01 -04:00
billchurch
7cbfed20e9 refactoring, socket.io update
more refactoring, code standards, updated socket.io to 1.7.4, increment
release to 0.1.1
2017-06-03 16:50:45 -04:00
Bill Church
9dace2501c Update README.md 2017-05-28 13:23:52 -04:00
Bill Church
cee6df948e Update ChangeLog.md 2017-05-27 18:44:15 -04:00
billchurch
64182e70b0 update readme.md 2017-05-27 18:40:48 -04:00
Bill Church
d7a4bc6326 Update README.md 2017-05-27 18:37:41 -04:00
Bill Church
f448fcc7e1 Update README.md 2017-05-27 18:36:30 -04:00
Bill Church
ec9cda660f typos 2017-05-27 18:29:13 -04:00
billchurch
4bae568d42 update Changelog 0.1.0 2017-05-27 18:24:32 -04:00
billchurch
cdd50f7b22 removed mixed operators from last commit 2017-05-27 18:22:28 -04:00
billchurch
4540cc6e0e updated documents, added validation to user input strings
term= query option to specify TERM environment variable for host, valid
strings are alpha-numeric with a hypen (validated). Otherwise the
default ssh.term variable from `config.json` will be used.
- validation for host (v4,v6,fqdn,hostname), port (integer 2-65535),
and header (sanatized) from URL input
2017-05-27 18:12:02 -04:00
billchurch
a0b0ec8632 support utf-8 characters
pull request form @bara666. this closes #12 cheers!
2017-05-27 14:42:37 -04:00
billchurch
f2db7bdfc4 adding ignore files to .bithoundrc
also removing superfluous file
2017-05-27 14:25:56 -04:00
billchurch
8ec480e999 updating .bithoundrc 2017-05-27 13:39:13 -04:00
billchurch
7ae68e2c9d updating .bithoundrc
updating .bithoundrc file to ignore public/src as it contains source
from other modules this project is not responsible for
2017-05-27 13:38:46 -04:00
billchurch
7b6d060bc3 minification and concatenation
minification and concatenation of javascript and css.
added new feature to specify minification in config.json (use minified)
updated readme and changelog
tasks in grunt to build minified and concatenated files
2017-05-27 13:29:26 -04:00
billchurch
481cebfab5 update docs 2017-05-26 20:49:38 -04:00
billchurch
c27c463da9 update docs 2017-05-26 17:40:49 -04:00
billchurch
3901f33fee update docs 2017-05-26 17:31:28 -04:00
billchurch
d995e7ddd7 updated documentation and version 2017-05-26 17:30:41 -04:00
billchurch
f8dcd70b33 reformatting
reformatted readme.md, added details for algorithms
2017-05-26 14:52:26 -04:00
billchurch
63e2c3fa4b update readme 2017-05-26 11:29:51 -04:00
billchurch
2e912dd9cc refactoring
moved some events into socket/index.js to better organize code
created session.ssh property for application session variables
moved crypto algorithms to config.json and assigned to
..session.ssh.algorithms variable
2017-05-26 11:25:44 -04:00
billchurch
938e2fbfa4 cleanup 2017-05-21 10:57:07 -04:00
billchurch
6d5dc21c95 move from sys. to util. for utility functions 2017-05-20 21:37:43 -04:00
billchurch
e90f04253a declaring variable 2017-05-20 21:31:42 -04:00
billchurch
41508276b6 additional debug log statements 2017-05-20 18:00:15 -04:00
billchurch
8da0bda5ce update changelog 2017-05-20 17:37:01 -04:00
billchurch
2c1c3ac911 error handling fixups
added some additional error handing functions and debugging points
- `DEBUG=ssh` will put the ssh2 module into debug mode
- `debug=WebSSH2` will output additional debug messages for functions
and events in the application (not including the ssh2 module debug)
- created socket/index.js to start the process of separating out app
functions, just holds error logging function at this point
- corrected some events on public/client.js so the primary error cause
is not overwritten
- ensure that ssh connection is terminated when websocked is
disconnected by the client
2017-05-20 17:26:18 -04:00
Bill Church
e3b8ff8189 Update README.md 2017-05-19 22:02:06 -04:00
Bill Church
a3d5f1b33f Create ChangeLog.md 2017-05-19 21:59:37 -04:00
Bill Church
58c0d6a99b Update README.md 2017-05-19 21:37:39 -04:00
Bill Church
1bbefdbb4b Update README.md 2017-05-19 21:26:18 -04:00
billchurch
c4a78fb1d7 delinting 2017-05-19 21:19:41 -04:00
billchurch
efb48ab711 formatting 2017-05-19 20:58:26 -04:00
billchurch
252306322b typo 2017-05-19 20:56:30 -04:00
billchurch
0a250ab84d typo 2017-05-19 20:54:24 -04:00
billchurch
0aa410e370 adding bithound ci 2017-05-19 20:51:42 -04:00
Bill Church
4d43ff1506 Update README.md 2017-05-19 20:16:12 -04:00
Bill Church
2470b580da Update README.md 2017-05-19 20:07:35 -04:00
billchurch
13f2ea7428 updating sync profile 2017-05-19 19:55:39 -04:00
billchurch
7f55613de8 Refactoring, Session maintenance
- start of some refactoring
- linking socket.io and express sessions
- cleaning up some potential error conditions

todo:
- re-work status updates on client side for unexpected websocket
disconnects while not overwriting ssh server errors un termination
2017-05-19 19:49:59 -04:00
Bill Church
b466d100ae Update README.md 2017-05-18 16:14:20 -04:00
Bill Church
2b904e1840 Update README.md 2017-05-18 16:14:06 -04:00
billchurch
bcf732c2c9 updated .travis.yml" 2017-05-18 16:07:53 -04:00
Bill Church
5ba4612b52 Create .travis.yml 2017-05-18 15:54:54 -04:00
billchurch
8838150c22 codelint and cross platform improvements 2017-05-08 12:07:47 -07:00
billchurch
aad3744552 codelint and cross platform improvements
Used [standard](https://github.com/feross/standard) to lint some of the
code.

Cross-platform directory handling (updated references to filesystem
paths to use path.join)
2017-05-08 12:03:18 -07:00
billchurch
cef50b870c formatting changes 2017-03-29 11:55:38 -04:00
billchurch
6b05e5e34f minor formatting and name cleanup 2017-03-24 11:23:45 -04:00
billchurch
35009f91f4 moving up credentials dialog hiding to top
insignificant change
2017-03-23 21:18:28 -04:00
billchurch
4c95d1c30b version increment 2017-03-23 18:26:37 -04:00
Bill Church
9f9ac25e2e Update README.md 2017-03-23 18:17:30 -04:00
Bill Church
8afd55a247 Update README.md 2017-03-23 18:15:09 -04:00
billchurch
17233f11de fixed auto fit and column/row settings for SSH, added experimental client-side logging
line wrapping should work correctly now.
experimental client side logging.
2017-03-23 18:12:33 -04:00
Bill Church
3b8182fb3f Update README.md 2017-03-23 13:17:26 -04:00
billchurch
a9d7959228 moved terminal selection to config.json
Defaulting to xterm-color for better support across *nixs
2017-03-23 11:24:03 -04:00
Bill Church
e45ded7aad Update package.json 2017-03-23 09:46:38 -04:00
billchurch
569a40bf1f Minor code formatting cleanup. 2017-03-23 09:37:35 -04:00
billchurch
70e36daa55 setting xterm-256color as default terminal
previously vt100 would be assumed, this caused some programs to not
properly receive mouse events or display full color.
2017-03-23 09:26:27 -04:00
billchurch
43c290de2a Updating xterm to 2.4.0 2017-03-23 09:23:42 -04:00
Bill Church
8347b6760e updating xterm to 2.3.0 2017-02-16 16:30:59 -05:00
Bill Church
72a767aa0a fixed misspelled config.ssh.port property
fixes #7
2017-02-14 13:45:58 -05:00
billchurch
9ebd56ddb9 fixed error message status overwriting
Fixed issue where error message would be overwritten in status bar as
websocket connection is closed. Added additional logging elements in
some events.
2017-02-10 10:56:11 -05:00
billchurch
e06d2570ae Fixes issue #4
Add a test for a blank (not null) username. Also added feature to
re-prompt for credentials if none are entered.
2017-02-10 08:23:06 -05:00
Bill Church
b86ae3e88d Fixed the banner newline/carriage return fix...
To not capture \r\n when looking for \r to fix formatting of banner messages.
2017-02-09 11:49:51 -05:00
63 changed files with 14841 additions and 1051 deletions

2
.csslintrc Normal file
View file

@ -0,0 +1,2 @@
--exclude-exts=.min.css
--ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes

View file

@ -0,0 +1,37 @@
{
"name": "Node.js & TypeScript",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"mounts": [
"source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh/personal_id_rsa.pub,target=/home/vscode/.hostssh/id_rsa.pub,readonly,type=bind,consistency=cached"
],
"features": {
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {},
},
// Configure tool-specific properties.
"customizations": {
// Configure properties specific to VS Code.
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode-remote.remote-containers",
"dbaeumer.vscode-eslint",
"GitHub.copilot",
"GitHub.copilot-chat",
"esbenp.prettier-vscode",
"rvest.vs-code-prettier-eslint",
"bierner.markdown-mermaid",
"stylelint.vscode-stylelint"
]
}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "/bin/bash ./.devcontainer/scripts/tools.sh >> ~/post-create-tools.log",
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}

View file

@ -0,0 +1,12 @@
#!/bin/bash
mkdir -p ~/.ssh && \
touch ~/.ssh/known_hosts && \
sudo tee ~/.ssh/config > /dev/null << EOF
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.hostssh/id_rsa.pub
EOF
sudo chown -R vscode:vscode ~/.ssh

9
.dockerignore Normal file
View file

@ -0,0 +1,9 @@
.git
.cache
app/node_modules
app/client/src
app/scripts
app/.*
app/*.sample
app/client/tsconfig.json
app/CHANGELOG.md

75
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View file

@ -0,0 +1,75 @@
name: Bug Report
description: File a bug report
title: "[Bug]: "
labels: ["bug", "triage"]
assignees:
- billchurch
body:
- type: markdown
attributes:
value: |
Depending on the type of issue, please include the follwing information:
- type: textarea
id: what-happened
attributes:
label: What happened?
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: input
id: node_ver
attributes:
label: Node Version
description: version of Node this problem occurs on
placeholder: npm -v
validations:
required: true
- type: input
id: npm_ver
attributes:
label: NPM Version
description: version of NPM this problem occurs on
placeholder: npm -v
validations:
required: true
- type: input
id: server_ver
attributes:
label: Server OS Version
description: Server OS Version / Distribution / Processor Architecture
placeholder: uname -a;cat /etc/os-release
validations:
required: true
- type: input
id: webssh2_ver
attributes:
label: WebSSH2 release version
description: Version of WebSSH you are using
placeholder: grep version app/package.json
validations:
required: true
- type: input
id: sshhost_ver
attributes:
label: OS and Version of SSH server
description: OS and Version of SSH server connecting to
placeholder: 'on target server run: uname -a;sshd -v'
validations:
required: false
- type: input
id: browser_ver
attributes:
label: Browser Version
description: Information from brwoser's About... or a screenshot of the about screen.
placeholder:
validations:
required: false
- type: textarea
id: logs
attributes:
label: Relevant log output
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: shell

10
.github/ISSUE_TEMPLATE/custom.md vendored Normal file
View file

@ -0,0 +1,10 @@
---
name: Question
about: General how-to questions
title: ''
labels: ''
assignees: ''
---

View file

@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

65
.github/workflows/action-test.yml vendored Normal file
View file

@ -0,0 +1,65 @@
name: Manually Release Previous Tag
on:
workflow_dispatch:
inputs:
tag:
description: 'Repo Branch/Tag'
default: 'main'
type: 'string'
required: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
with:
ref: ${{ inputs.tag }}
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
VERSION=${{ inputs.tag }}
VERSION="${VERSION//v}"
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}"
# If the VERSION looks like a version number, assume that
# this is the most recent version of the image and also
# tag it 'latest'.
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}"
fi
# Set output parameters.
echo ::set-output name=tags::${TAGS}
echo ::set-output name=docker_image::${DOCKER_IMAGE}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: true
tags: ${{ steps.prep.outputs.tags }}

View file

@ -0,0 +1,69 @@
---
name: 'Build Docker On Tag'
on:
push:
branches:
- bigip-server
tags:
- 'v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'
workflow_dispatch: # Allows manual triggering from the GitHub UI
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
# If this is a git tag, use the tag name as a docker tag
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/v}
TAGS="${DOCKER_IMAGE}:${VERSION}"
fi
# If this is a git branch, use the branch name as a docker tag
if [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=${GITHUB_REF#refs/heads/}
TAGS="${DOCKER_IMAGE}:${VERSION}"
fi
# If the VERSION looks like a version number, also tag as 'latest'
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:latest"
fi
# Set output parameters
echo ::set-output name=tags::${TAGS}
echo ::set-output name=docker_image::${DOCKER_IMAGE}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build
uses: docker/build-push-action@v4
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: true
tags: ${{ steps.prep.outputs.tags }}

View file

@ -0,0 +1,67 @@
---
name: 'Build Docker Images'
on:
release:
types: [published]
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v3
- name: Prepare
id: prep
run: |
DOCKER_IMAGE=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPOSITORY#*/}
# If this is git tag, use the tag name as a docker tag
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/webssh2-v}
TAGS="${DOCKER_IMAGE}:${VERSION}"
fi
# If this is git branch, use the branch name as a docker tag
if [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=${GITHUB_REF#refs/heads/}
TAGS="${DOCKER_IMAGE}:${VERSION}"
fi
# If the VERSION looks like a version number, assume that
# this is the most recent version of the image and also
# tag it 'latest'. This is done by just specifying the ${DOCKER_IMAGE}
# without a tag.
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}"
fi
# Set output parameters.
echo ::set-output name=tags::${TAGS}
echo ::set-output name=docker_image::${DOCKER_IMAGE}
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64,linux/ppc64le
push: true
tags: ${{ steps.prep.outputs.tags }}

47
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,47 @@
---
name: 'Create Release'
on:
push:
branches:
- main
paths-ignore:
- '.github/**'
- '.devcontainer/**'
- '.**'
- '**.md'
jobs:
release:
runs-on: ubuntu-latest
outputs:
paths_released: ${{ steps.manifest_release.outputs.paths_released }}
steps:
- uses: google-github-actions/release-please-action@v3
id: manifest_release
with:
token: ${{ secrets.RELEASE_PLEASE_UAT }}
command: manifest
package-name: webssh2
path: app
default-branch: main
release-type: node
publish:
runs-on: ubuntu-20.04
needs: release
strategy:
fail-fast: false
matrix:
path: ${{fromJson(needs.release.outputs.paths_released)}}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: 'https://registry.npmjs.org'
- name: publish-to-npm
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: |
cd ${{ matrix.path }}
npm install
npx lerna bootstrap
npx lerna publish from-package --no-push --no-private --yes

18
.gitignore vendored
View file

@ -1,8 +1,20 @@
#Docs
docs
ssl/*
bigip/*
config.json
# Logs # Logs
logs logs
*.log *.log
npm-debug.log* npm-debug.log*
# Editor preference files
*.sublime-*
# Runtime data # Runtime data
pids pids
*.pid *.pid
@ -23,9 +35,6 @@ coverage
# node-waf configuration # node-waf configuration
.lock-wscript .lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories # Dependency directories
node_modules node_modules
jspm_packages jspm_packages
@ -38,3 +47,6 @@ jspm_packages
#Mac Files #Mac Files
.DS_Store .DS_Store
Build/Release
app/bob_rsa

View file

@ -0,0 +1,3 @@
{
"app": "0.5.0-pre-4"
}

6
.travis.yml Normal file
View file

@ -0,0 +1,6 @@
language: node_js
node_js:
- 14
- 16
before_install:
- npm i -g snyk

13
BUILDING.md Normal file
View file

@ -0,0 +1,13 @@
# Buliding
To rebuild the client files, you need at least Node v14.
The source of the client files are located in `./app/client/src`
`npm run build` will compile the source files there into `./app/client/public/`. This directory is considered to be volitile and is deleted every time `npm run build` is invoked.
WebPack is used for building and the configuration is located in `./app/scripts`
If one wishes to make changes to the javascript, the html, or the css it should be done in `./app/client/src` and then complied using `npm run build`
For development purposes, you may also utilize `npm run builddev` which will not minimize the source and allow you to more easily troubleshoot while making customizations.

46
CODE_OF_CONDUCT.md Normal file
View file

@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at wmchurch@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

94
CONTRIBUTING.md Normal file
View file

@ -0,0 +1,94 @@
Guidelines for contributing code:
Make sure code passes linting from (StandardJS)[https://standardjs.com/]
# Contributing
When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.
Please note we have a code of conduct, please follow it in all your interactions with the project.
## Pull Request Process
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
build.
2. Make sure code passes linting from (StandardJS)[https://standardjs.com/]
3. Explain what you're trying to accomplish in your commits
4. Update changelog and Readme if needed.
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

3
ChangeLog.md Normal file
View file

@ -0,0 +1,3 @@
# Changelog Moved
See [app/CHANGELOG.md](app/CHANGELOG.md)

9
Dockerfile Normal file
View file

@ -0,0 +1,9 @@
FROM node:16-alpine
RUN apk update && apk add bash
WORKDIR /usr/src
COPY app/ /usr/src/
RUN npm ci --audit=false --bin-links=false --fund=false
EXPOSE 2222/tcp
ENTRYPOINT [ "/usr/local/bin/node", "index.js" ]

695
LICENSE
View file

@ -1,674 +1,21 @@
GNU GENERAL PUBLIC LICENSE MIT License
Version 3, 29 June 2007
Copyright (c) 2017 Bill Church
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies Permission is hereby granted, free of charge, to any person obtaining a copy
of this license document, but changing it is not allowed. of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
Preamble to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
The GNU General Public License is a free, copyleft license for furnished to do so, subject to the following conditions:
software and other kinds of works.
The above copyright notice and this permission notice shall be included in all
The licenses for most software and other practical works are designed copies or substantial portions of the Software.
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
share and change all versions of a program--to make sure it remains free IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
software for all its users. We, the Free Software Foundation, use the FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
GNU General Public License for most of our software; it applies also to AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
any other work released this way by its authors. You can apply it to LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
your programs, too. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
{one line to give the program's name and a brief idea of what it does.}
Copyright (C) {year} {name of author}
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
{project} Copyright (C) {year} {fullname}
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

2
Makefile Normal file
View file

@ -0,0 +1,2 @@
test:
cd ./app; npm run test

356
README.md
View file

@ -1,35 +1,367 @@
# WebSSH2 # WebSSH2
[![Build Status](https://travis-ci.com/billchurch/webssh2.svg?branch=main)](https://travis-ci.com/billchurch/webssh2) [![GitHub version](https://img.shields.io/github/v/release/billchurch/webssh2)](https://github.com/billchurch/webssh2/releases/latest) [![docker build images](https://github.com/billchurch/webssh2/actions/workflows/docker-multiplatform.yml/badge.svg)](https://github.com/billchurch/webssh2/actions/workflows/docker-multiplatform.yml)
[![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/billchurch)
Web SSH Client using ssh2, socket.io, xterm.js, and express Web SSH Client using ssh2, socket.io, xterm.js, and express
Bare bones example of using SSH2 as a client on a host to proxy a Websocket / Socket.io connection to a SSH2 server. A bare bones example of an HTML5 web-based terminal emulator and SSH client. We use SSH2 as a client on a host to proxy a Websocket / Socket.io connection to a SSH2 server.
<img width="1044" alt="screenshot 2016-05-18 13 29 53" src="https://cloud.githubusercontent.com/assets/1668075/15368633/d2c9c4ca-1cfc-11e6-9961-b5b52a07b9ff.png"> <img width="600" height="340" alt="WebSSH2 v0.2.0 demo" src="https://user-images.githubusercontent.com/1668075/182425293-acc8741e-cc92-4105-afdc-9538e1685d4b.gif">
# Requirements
Node v14.x or above. If using <v14.x you should be able to run by replacing the "read-config" package to @1 like this (after a clone):
`npm install --save read-config@1
`
Just keep in mind that there is no intention to ensure compatability with Node < v14
# Instructions # Instructions
The instructions previously showed cloning directly from main, while normally safe may include "work in progress". It's recommended that after you clone, you switch to a particular tag.
To install: To install:
1. Clone to a location somewhere and `npm install` 1. Clone to a location somewhere
2. If desired, edit config.json to change the listener to your liking. There are also some default options which may be definied for a few of the variables. 2. Checkout to the `current` tag using `git checkout current` or choose a particular [release](https://github.com/billchurch/webssh2/releases/) tag
3. Run `npm start` 3. `cd app` and `npm install --production`. If you want to develop and rebuild javascript and other files utilize `npm install` instead.
4. Fire up a browser, navigate to IP/port of your choice and specify a host (https isn't used here because it's assumed it will be off-loaded to 4. If desired, edit app/config.json to change the listener to your liking. There are also some default options which may be definied for a few of the variables.
some sort of proxy):
5. Run `npm start`
6. Fire up a browser, navigate to IP/port of your choice and specify a host (https isn't used here because it's assumed it will be off-loaded to some sort of proxy):
http://localhost:2222/ssh/host/127.0.0.1 http://localhost:2222/ssh/host/127.0.0.1
You will be prompted for credentials to use on the SSH server via HTTP Basic authentcaiton. This is to permit usage with some SSO systems that can replay credentials over HTTP basic. You will be prompted for credentials to use on the SSH server via HTTP Basic authentcaiton. This is to permit usage with some SSO systems that can replay credentials over HTTP basic.
# Options (GET request vars) Alternatively in main for testing, you can send credentials via POST with the variables "username" and "userpassword".
port= - port of SSH server (defaults to 22) # Customizing client files
header= - optional header to display on page See [BUILDING.md](BUILDING.md) for more details.
headerBackground= - optional background color of header to display on page # Docker
## NOTICE
Docker versions differ from what is in `main` and are release dependant.
Meaning billchurch/webssh2:latest is the latest official release. This does NOT sync with what is in `main` on this repo. `main` is development and will change until it gets a release tag.
On occasion, examples or instructions on `main` will drift from what is released. You should refer to the tag of the version you're using to ensure you are following the proper guidance.
That being said the most current release version is [0.4.6](https://github.com/billchurch/webssh2/tree/0.4.6), see that tag for details.
## Instructions
Some configuration options are available as [Environment Variables](#environment-variables). If there is a configuration option you require which does not have an environment variable please [open an issue requesting](../../issues/new/choose).
[webssh2 images are available in docker hub](https://hub.docker.com/repository/docker/billchurch/webssh2).
the `latest` tag will pull the most recent stable release, otherwise you can pull individual tags/releases/versions of this repo by using a particular version in the tag.
For instance:
```docker pull billchurch/webssh2:0.4.6```
or
```docker pull billchurch/webssh2:0.4.7-alpha.2```
or
```docker pull billchurch/webssh2```
for the most recent
If you want to play around localy:
Copy app/config.json.template to app/config.json and modify the latter:
```js
{
// ...
"listen": {
"ip": "0.0.0.0",
"port": 2222
}
// ...
}
```
Rebuild and run
```bash
docker build -t webssh2 .
docker run --name webssh2 -d -p 2222:2222 webssh2
```
Alternatively if you don't want to rebuild, mount the config at runtime:
```bash
docker run --name webssh2 -d -p 2222:2222 -v `pwd`/app/config.json:/usr/src/config.json webssh2
```
Alternatively if you don't want to build either and mount the config at runtime relying on the community image :
```bash
docker run --name webssh2 -d -p 2222:2222 -v `pwd`/app/config.json:/usr/src/config.json billchurch/webssh2
```
# Options
## Environment Variables
Environment variables introduced in 0.4.7 will override anything specified in `config.json`. This is useful for settings that may be per-node, or in a container environment. These are optional and will default to whatever their peer config.json settings are
* **LISTEN** - _string_ - IP address node should listen on for client connections, defaults to `127.0.0.1`. Peer is **listen.ip**
* **PORT** - _integer_ - Port node should listen on for client connections, defaults to `2222`. Peer is **listen.port**
* **SOCKETIO_ORIGINS** - _array_ - COORS origins to allow connections from to socket.io server, defaults to `localhost:2222`. Changed in 0.3.1, to enable previous, less secure, default behavior of everything use `*:*` (not recommended). Check [#240](../../issues/240). Peer is **socketio.origins**
* **SOCKETIO_PATH** _string_ - Path to socket.io client files. Default: `/ssh/socket.io`. Peer is **socketio.path**
* **SOCKETIO_SERVECLIENT** _boolean_ - serve the socket.io client. This is built into the custom javascript, so you shouldn't need this. Kept as an option just in case. Default: `false`. Peer is **socketio.serveClient**
## POST request vars (in main branch for testing)
* **username** - _string_ - username to log into ssh with
* **userpassword** _string_ password to log into ssh with
* **port=** - _integer_ - port of SSH server (defaults to 22)
* **header=** - _string_ - optional header to display on page
* **headerBackground=** - _string_ - optional background color of header to display on page
* **sshterm=** - _string_ - optional specify terminal emulation to use, defaults to `ssh.term` in `config.json` or `vt100` if that is null
* **readyTimeout=** - _integer_ - How long (in milliseconds) to wait for the SSH handshake to complete. **Default:** 20000. **Enforced Values:** Min: 1, Max: 300000
* **cursorBlink** - _boolean_ - Cursor blinks (true), does not (false) **Default:** true.
* **scrollback** - _integer_ - Lines in the scrollback buffer. **Default:** 10000. **Enforced Values:** Min: 1, Max: 200000
* **tabStopWidth** - _integer_ - Tab stops at _n_ characters **Default:** 8. **Enforced Values:** Min: 1, Max: 100
* **bellStyle** - _string_ - Style of terminal bell: ("sound"|"none"). **Default:** "sound". **Enforced Values:** "sound", "none"
* **fontSize** - _number_ - Size of terminal font. **Default:** 12
* **fontFamily** - _string_ - Font family
* **letterSpacing** - _number_ - Letter spacing
* **lineHeight** - _number_ - Line height
## GET request vars
* **port=** - _integer_ - port of SSH server (defaults to 22)
* **header=** - _string_ - optional header to display on page
* **headerBackground=** - _string_ - optional background color of header to display on page
* **sshterm=** - _string_ - optional specify terminal emulation to use, defaults to `ssh.term` in `config.json` or `vt100` if that is null
* **readyTimeout=** - _integer_ - How long (in milliseconds) to wait for the SSH handshake to complete. **Default:** 20000. **Enforced Values:** Min: 1, Max: 300000
* **cursorBlink** - _boolean_ - Cursor blinks (true), does not (false) **Default:** true.
* **scrollback** - _integer_ - Lines in the scrollback buffer. **Default:** 10000. **Enforced Values:** Min: 1, Max: 200000
* **tabStopWidth** - _integer_ - Tab stops at _n_ characters **Default:** 8. **Enforced Values:** Min: 1, Max: 100
* **bellStyle** - _string_ - Style of terminal bell: ("sound"|"none"). **Default:** "sound". **Enforced Values:** "sound", "none"
* **fontSize** - _number_ - Size of terminal font. **Default:** "12"
* **fontFamily** - _string_ - Font family
* **letterSpacing** - _number_ - Letter spacing
* **lineHeight** - _integer_ - Line height
## Headers
* **allowreplay** - _boolean_ - Allow use of password replay feature, example `allowreplay: true`
* **mrhsession** - _string_ - Can be used to pass APM session for event correlation `mrhsession: abc123`
## Config File Options
`config.json` contains several options which may be specified to customize to your needs, vs editing the javascript directly. This is JSON format so mind your spacing, brackets, etc...
* **listen.ip** - _string_ - IP address node should listen on for client connections, defaults to `127.0.0.1`
* **listen.port** - _integer_ - Port node should listen on for client connections, defaults to `2222`
* **socketio.serveClient** - _boolean_ - serve the socket.io client. This is built into the custom javascript, so you shouldn't need this. Kept as an option just in case. Default: `false`
* **socketio.path** - _string_ - Path to socket.io client files. Default: `/ssh/socket.io`
* **socketio.origins** - _array_ - COORS origins to allow connections from to socket.io server, defaults to `localhost:2222`. Changed in 0.3.1, to enable previous, less secure, default behavior of everything use `*:*` (not recommended). Check [#240](../../issues/240)
* **user.name** - _string_ - Specify user name to authenticate with. In normal cases this should be left to the default `null` setting.
* **user.password** - _string_ - Specify password to authenticate with. In normal cases this should be left to the default `null` setting.
* **user.overridebasic** - _boolean_ - When set to `true` ignores `Authorization: Basic` header sent from client and use credentials defined in `user.name` and `user.password` instead. Defaults to `false`. [issue 242](../../issues/242) for more information.
* **ssh.host** - _string_ - Specify host to connect to. May be either hostname or IP address. Defaults to `null`.
* **ssh.port** - _integer_ - Specify SSH port to connect to, defaults to `22`
* **ssh.term** - _string_ - Specify terminal emulation to use, defaults to `vt100` if null
* **ssh.readyTimeout** - _integer_ - How long (in milliseconds) to wait for the SSH handshake to complete. **Default:** 20000.
* **ssh.keepaliveInterval** - _integer_ - How often (in milliseconds) to send SSH-level keepalive packets to the server (in a similar way as OpenSSH's ServerAliveInterval config option). Set to 0 to disable. **Default:** 120000.
* **ssh.keepaliveCountMax** - _integer_ - How many consecutive, unanswered SSH-level keepalive packets that can be sent to the server before disconnection (similar to OpenSSH's ServerAliveCountMax config option). **Default:** 10.
* **allowedSubnets** - _array_ - A list of subnets that the server is allowed to connect to via SSH. An empty array means all subnets are permitted; no restriction. **Default:** empty array.
* **terminal.cursorBlink** - _boolean_ - Cursor blinks (true), does not (false) **Default:** true.
* **terminal.scrollback** - _integer_ - Lines in the scrollback buffer. **Default:** 10000.
* **terminal.tabStopWidth** - _integer_ - Tab stops at _n_ characters **Default:** 8.
* **terminal.bellStyle** - _string_ - Style of terminal bell: (sound|none). **Default:** "sound".
* **terminal.fontSize** - _number_ - Size of terminal font. **Default:** 14.
* **terminal.fontFamily** - _string_ - Font family
* **terminal.letterSpacing** - _number_ - Letter spacing
* **terminal.lineHeight** - _number_ - Line height
* **header.text** - _string_ - Specify header text, defaults to `My Header` but may also be set to `null`. When set to `null` no header bar will be displayed on the client.
* **header.background** - _string_ - Header background, defaults to `green`.
* **session.name** - _string_ - Name of session ID cookie. it's not a horrible idea to make this something unique.
* **session.secret** - _string_ - Secret key for cookie encryption. You should change this in production.
* **options.challengeButton** - _boolean_ - Challenge button. This option, which is still under development, allows the user to resend the password to the server (in cases of step-up authentication for things like `sudo` or a router `enable` command.
* **options.allowreauth** - _boolean_ - Reauth button. This option creates an option to provide a button to create a new session with new credentials. See [issue 51](../../issues/51) and [pull 85](../../pull/85) for more detail.
* **algorithms** - _object_ - This option allows you to explicitly override the default transport layer algorithms used for the connection. Each value must be an array of valid algorithms for that category. The order of the algorithms in the arrays are important, with the most favorable being first. Valid keys:
* **kex** - _array_ - Key exchange algorithms.
* Default values:
1. ecdh-sha2-nistp256 **(node v0.11.14 or newer)**
2. ecdh-sha2-nistp384 **(node v0.11.14 or newer)**
3. ecdh-sha2-nistp521 **(node v0.11.14 or newer)**
4. diffie-hellman-group-exchange-sha256 **(node v0.11.12 or newer)**
5. diffie-hellman-group14-sha1
* Supported values:
* ecdh-sha2-nistp256 **(node v0.11.14 or newer)**
* ecdh-sha2-nistp384 **(node v0.11.14 or newer)**
* ecdh-sha2-nistp521 **(node v0.11.14 or newer)**
* diffie-hellman-group-exchange-sha256 **(node v0.11.12 or newer)**
* diffie-hellman-group14-sha1
* diffie-hellman-group-exchange-sha1 **(node v0.11.12 or newer)**
* diffie-hellman-group1-sha1
* **cipher** - _array_ - Ciphers.
* Default values:
1. aes128-ctr
2. aes192-ctr
3. aes256-ctr
4. aes128-gcm **(node v0.11.12 or newer)**
5. aes128-gcm@openssh.com **(node v0.11.12 or newer)**
6. aes256-gcm **(node v0.11.12 or newer)**
7. aes256-gcm@openssh.com **(node v0.11.12 or newer)**
* Supported values:
* aes128-ctr
* aes192-ctr
* aes256-ctr
* aes128-gcm **(node v0.11.12 or newer)**
* aes128-gcm@openssh.com **(node v0.11.12 or newer)**
* aes256-gcm **(node v0.11.12 or newer)**
* aes256-gcm@openssh.com **(node v0.11.12 or newer)**
* aes256-cbc
* aes192-cbc
* aes128-cbc
* blowfish-cbc
* 3des-cbc
* arcfour256
* arcfour128
* cast128-cbc
* arcfour
* **hmac** - _array_ - (H)MAC algorithms.
* Default values:
1. hmac-sha2-256
2. hmac-sha2-512
3. hmac-sha1
* Supported values:
* hmac-sha2-256
* hmac-sha2-512
* hmac-sha1
* hmac-md5
* hmac-sha2-256-96
* hmac-sha2-512-96
* hmac-ripemd160
* hmac-sha1-96
* hmac-md5-96
* **compress** - _array_ - Compression algorithms.
* Default values:
1. none
2. zlib@openssh.com
3. zlib
* Supported values:
* none
* zlib@openssh.com
* zlib
* **serverlog.client** - _boolean_ - Enables client command logging on server log (console.log). Very simple at this point, buffers data from client until it receives a line-feed then dumps buffer to console.log with session information for tracking. Will capture anything send from client, including passwords, so use for testing only... Default: false. Example:
* _serverlog.client: GcZDThwA4UahDiKO2gkMYd7YPIfVAEFW/mnf0NUugLMFRHhsWAAAA host: 192.168.99.80 command: ls -lat_
* **serverlog.server** - _boolean_ - not implemented, default: false.
* **accesslog** - _boolean_ - http style access logging to console.log, default: false
* **safeShutdownDuration** - _integer_ - maximum delay, in seconds, given to users before the server stops when doing a safe shutdown
# Client-side logging
Clicking `Start logging` on the status bar will log all data to the client. A `Download log` option will appear after starting the logging. You may download at any time to the client. You may stop logging at any time my pressing the `Logging - STOP LOG`. Note that clicking the `Start logging` option again will cause the current log to be overwritten, so be sure to download first.
# Example: # Example:
http://localhost:2222/ssh/host/192.168.1.1?port=2244&header=My%20Header&color=red http://localhost:2222/ssh/host/192.168.1.1?port=2244&header=My%20Header&headerBackground=red
# CONTRIBUTING
As of 0.4.0, we're trying our best to conform to the [Airbnb Javascript Style Guide](https://airbnb.io/projects/javascript/). I'm hoping this will make contributions easier and keep the code readable. I love shortcuts more than anyone but I've found when making changes to code I've not looked at in a while, it can take me a few momements to deconstruct what was being done due to readbility issues. While I don't agree with every decision in the style guide (semi-colons, yuk), it is a good base to keep the code consistent.
If you've not used it before, I recommend installing the [vscode extensions](https://blog.echobind.com/integrating-prettier-eslint-airbnb-style-guide-in-vscode-47f07b5d7d6a) for that and [Prettier](https://prettier.io/) and getting familiar. The autocorrections are great (especially if you hate dealing with semi-colons...)
All contributions are welcome, all may not make it into a release... To increase the chances of your contribution making it into a release, try your best to conform to the style guides and targets of the project.
# Tips
* You can enable extended debug messages in the browser Java console using:
* `localStorage.debug = '*';` - Debug Everything (a lot of messages)
* `localStorage.debug = 'WebSSH2';` - Debug potentially interesting WebSSH2 related messages (replaying credentials, resizing data, other control messages)
* If you want to add custom JavaScript to the browser client you can either modify `./src/client.html` and add a **\<script\>** element, modify `./src/index.js` directly, or check out `webpack.*.js` and add your custom javascript file to a task there (best option).

16
SECURITY.md Normal file
View file

@ -0,0 +1,16 @@
# Security Policy
## Supported Versions
The following versions will get security updates.
| Version | Supported |
| ------- | ------------------ |
| 0.4.x | :white_check_mark: |
| 0.3.x | :x: |
| 0.2.x | :x: |
| 0.1.x | :x: |
## Reporting a Vulnerability
If you find a vulnerability, simply [open an issue](../../issues/new) with the details, use the label `security`.

24
app/.eslintrc.json Normal file
View file

@ -0,0 +1,24 @@
{
"ignorePatterns": ["**/*{.,-}min.js"],
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"airbnb-base",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"prettier"
],
"rules": {
"prettier/prettier": ["error"]
}
}

1
app/.npmrc Normal file
View file

@ -0,0 +1 @@
tag-version-prefix=""

4
app/.prettierrc Normal file
View file

@ -0,0 +1,4 @@
{
"printWidth": 100,
"singleQuote": true
}

4
app/.snyk Normal file
View file

@ -0,0 +1,4 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.22.1
ignore: {}
patch: {}

461
app/CHANGELOG.md Normal file
View file

@ -0,0 +1,461 @@
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [0.5.0-pre-4](https://github.com/billchurch/webssh2/compare/webssh2-v0.4.7-pre-4...webssh2-v0.5.0-pre-4) (2022-08-07)
### Features
* test change for release ([476b566](https://github.com/billchurch/webssh2/commit/476b566c08a84bd35aaccf847253875b2c3afb10))
## [0.4.7-pre-4](https://github.com/billchurch/webssh2/compare/webssh2-v0.4.7-pre-3...webssh2-v0.4.7-pre-4) (2022-08-03)
### Miscellaneous Chores
* release 0.4.7-pre-4 ([7d4ba87](https://github.com/billchurch/webssh2/commit/7d4ba87bc1c198600ea33ee220553ef46ea2a103))
## [0.4.7-pre-3](https://github.com/billchurch/webssh2/compare/webssh2-v0.4.7-pre-2...webssh2-v0.4.7-pre-3) (2022-08-03)
### Miscellaneous Chores
* release 0.4.7-pre-3 ([0c78c1f](https://github.com/billchurch/webssh2/commit/0c78c1f31cc6380b7f0706822fc418cfede11413))
## [0.4.7-pre-2](https://github.com/billchurch/webssh2/compare/webssh2-v0.4.6...webssh2-v0.4.7-pre-2) (2022-08-02)
### ⚠ BREAKING CHANGES
* validate referer to /reauth is valid
* bump xterm to 4.18.0
* consistent logging messages see #286
* config system changes #284 (#285)
### Features
* add additional params for POST requests [#290](https://github.com/billchurch/webssh2/issues/290) ([46c1560](https://github.com/billchurch/webssh2/commit/46c1560e3c126376e18124e14e5c7fb8c029a0a1))
* add additional vars to POST requests [#290](https://github.com/billchurch/webssh2/issues/290) ([0a4e419](https://github.com/billchurch/webssh2/commit/0a4e419fb371ae95340fa890497022a2aa9d063a))
* add fontFamily, letterSpacing, lineHeight ([97f3088](https://github.com/billchurch/webssh2/commit/97f3088780744e13a6724a4967a4896aac3f20d8))
* add fontSize option [#292](https://github.com/billchurch/webssh2/issues/292) ([5e78812](https://github.com/billchurch/webssh2/commit/5e788129744d326e78ec91bda86ed5cecfd70d3f))
* config system changes [#284](https://github.com/billchurch/webssh2/issues/284) ([#285](https://github.com/billchurch/webssh2/issues/285)) ([9c99b09](https://github.com/billchurch/webssh2/commit/9c99b0940ec726193deae3c4999d25a297874d67))
* consistent logging messages see [#286](https://github.com/billchurch/webssh2/issues/286) ([50cfcb9](https://github.com/billchurch/webssh2/commit/50cfcb97788cbd3409b4605adceef3d47e370e38))
* credentials over http post for [#290](https://github.com/billchurch/webssh2/issues/290) ([5b8f88c](https://github.com/billchurch/webssh2/commit/5b8f88cfef1745c88748277217204e6c38c7ff7e))
* reorder viewport setup at ssh handshake [#292](https://github.com/billchurch/webssh2/issues/292) ([140e1e2](https://github.com/billchurch/webssh2/commit/140e1e24b14d6b74848e9d250c2b44f806ad627d))
* validate referer to /reauth is valid ([0dcaa6e](https://github.com/billchurch/webssh2/commit/0dcaa6e15062cdc3252ce52abd9057caf4c00a30))
### Bug Fixes
* Fix the parameter passing problem of setDefaultCredentials to make it perform data initialization normally ([#288](https://github.com/billchurch/webssh2/issues/288)) ([40cbb35](https://github.com/billchurch/webssh2/commit/40cbb35616fa17c1c36520690f40ebce0b488153))
* invalid css in style.css ([ffab534](https://github.com/billchurch/webssh2/commit/ffab5345dcb568fa2bb50a96f403174ad3728286))
### package
* bump xterm to 4.18.0 ([84c09ec](https://github.com/billchurch/webssh2/commit/84c09ec8a1909e4bbd0051debdbb905276a4245e))
### [0.4.6](https://github.com/billchurch/WebSSH2/compare/v0.2.10-0...v0.4.6) (2022-04-17)
### Features
* add SIGTERM to safe shutdown feature ([675b4f5](https://github.com/billchurch/WebSSH2/commit/675b4f5a3a92b187b620684eb1ce1b7afa0e2e08))
* **auth:** ssh private key auth implemented via config.json ([#161](https://github.com/billchurch/WebSSH2/issues/161)) ([342df8e](https://github.com/billchurch/WebSSH2/commit/342df8eb9cafba52eb63b50a60e11e1431d6fbd4))
* **config:** specify local source address and port for client connections fixes [#152](https://github.com/billchurch/WebSSH2/issues/152) ([#158](https://github.com/billchurch/WebSSH2/issues/158)) ([65d6ec6](https://github.com/billchurch/WebSSH2/commit/65d6ec68452b80c42fd62534355e456ce1f16a32))
* CORS support ([b324f33](https://github.com/billchurch/WebSSH2/commit/b324f338adeb3518322941639fb83ba9370814cc)), closes [#240](https://github.com/billchurch/WebSSH2/issues/240)
### Bug Fixes
* deprecated term.setOption ([d903da8](https://github.com/billchurch/WebSSH2/commit/d903da87c41882a3736683c7de497cb8bd37f885))
* dockerignore ([#272](https://github.com/billchurch/WebSSH2/issues/272)) ([8a68cca](https://github.com/billchurch/WebSSH2/commit/8a68ccaffa374584b5d9531f9dbeae616bd971f5))
* fixes default for allowreauth ([#239](https://github.com/billchurch/WebSSH2/issues/239)) ([dcfd81b](https://github.com/billchurch/WebSSH2/commit/dcfd81b454b9fe66edec489266dc35a765464c6b)), closes [#238](https://github.com/billchurch/WebSSH2/issues/238)
* missing ENTRYPOINT for Dockerfile ([6a3a47a](https://github.com/billchurch/WebSSH2/commit/6a3a47a13de3cd70d603379a27e055f08a6ee62c))
* obey host ssh.host in config fixes [#190](https://github.com/billchurch/WebSSH2/issues/190) ([7b7e8e7](https://github.com/billchurch/WebSSH2/commit/7b7e8e753358ed48f52eb9aa2fc359bf758f304b))
* subnet unauthorized now emits "ssherror" which persists across websocket termination ([e796f9f](https://github.com/billchurch/WebSSH2/commit/e796f9fb5874d6557433f25e8976b7aa58fa8144))
* update config.json.sample ([#177](https://github.com/billchurch/WebSSH2/issues/177)) ([42f973b](https://github.com/billchurch/WebSSH2/commit/42f973b4796f7f50237dc8ce613e477aa89352ca))
* update read-config-ng to 3.0.5, fixes [#277](https://github.com/billchurch/WebSSH2/issues/277) ([3e82c0d](https://github.com/billchurch/WebSSH2/commit/3e82c0dc4d31d1c97a7cf98139ef8e6dc0213b22))
* update xterm.js fixes [#261](https://github.com/billchurch/WebSSH2/issues/261) ([c801ef9](https://github.com/billchurch/WebSSH2/commit/c801ef9e5826e13a403a6462241cf8a4ff456d45))
## 0.4.5 [20220417]
### Fixes
- update read-config-ng to 3.0.5, fixes [#277](../../issues/277)
## 0.4.5 [20220331]
### Fixes
- Update socket.io to 4.2.0
- Update read-config-ng to 3.0.4
## 0.4.4 [20211209]
### Fixes
- Add ./node_modules to .dockerignore [#240](../../issues/240) thanks @UncleSamSwiss
- validator to 13.7.0 [to mitigate potential Regular Expression Denial of Service (ReDoS)](https://snyk.io/vuln/SNYK-JS-VALIDATOR-1090600)
- cidr-matcher should be [re-installed to pickup >json-schema@4.0.0 due to prototype pollution vulnerability](https://snyk.io/vuln/SNYK-JS-JSONSCHEMA-1920922)
- Update xterm.js to 4.15.0 [#261](../../issues/261)
- Replace deprecated term.setOptions with term.options
### Changes
- update README.md for additional Docker methods thanks @Utopiah
## 0.4.3 [20211019]
- update dependencies
- ssh2 to 1.4.0 [to mitigate potential command injection in windows](https://snyk.io/vuln/SNYK-JS-SSH2-1656673)
## 0.4.2 [20210813]
### changes
- update dependencies
- socket.io to 4.1.1
- read-config-ng to 3.0.2
- debug to 4.3.1
## 0.4.1 [20210703]
### Fixes
- lost comma in config.json.sample 71fe377
### Changes
- bump ws@7.4.6 to [mitigate potential ReDoS vulnerability](https://github.com/websockets/ws/releases/tag/7.4.6)
- dev: update CI tools
- dev: update dev tools
- dev: update build tools
## 0.4.0 [20210519]
### BREAKING
- Disabled ssh.serverlog.client option, this disables the POC which allowed for logging of the data sent between the client/server to the console.log.
- Dropping support for node versions under 14
### Changes
- Removed HTML menu code from ./app/server/socket.js, the menu is now fully laid out in the ./app/client/src/index.html and the option elements are hidden by default. Not sure why it wasn't done this way from the start, but there it is.
- Updated socket.io to v4.1.1
- Client javascript `./app/client/src/js/index.ts` is now built on TypeScript (`npm run build` will generate javascript for client and place into `app/client/public/webssh2.bundle.js` as before)
- Build environment changes
- removed unused xterm-addon-search, xterm-addon-weblinks, standard, postcss-discard-comments
- added prettier 2.3.0, typescript modules, socket.io-client 4.1.1, airbnb linting tools
### Added
- Lookup ip address for hostname in URL, fixes #199 thanks to @zwiy
- Ability to override `Authorization: Basic` header and replace with credentials specified in `config.json` fixes #243. New config.json option `user.overridebasic`
### CONTRIBUTING
In this release, we're trying our best to conform to the [Airbnb Javascript Style Guide](https://airbnb.io/projects/javascript/). I'm hoping this will make contributions easier and keep the code readable. I love shortcuts more than anyone but I've found when making changes to code I've not looked at in a while, it can take me a few momements to deconstruct what was being done due to readbility issues. While I don't agree with every decision in the style guide (semi-colons, yuk), it is a good base to keep the code consistent.
If you've not used it before, I recommend installing the [vscode extensions](https://blog.echobind.com/integrating-prettier-eslint-airbnb-style-guide-in-vscode-47f07b5d7d6a) for that and [Prettier](https://prettier.io/) and getting familiar. The autocorrections are great (especially if you hate dealing with semi-colons...)
As of 0.4.0-testing-0, the client code is written in [TypeScript](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html). It's not that much different from JavaScript, and the introduction strong typing will ultimately help to produce better code. Eventually we want to move the whole project to TypeScript but that make take a bit more time. Take a moment to look at ./app/client/src/js/index.ts to see what TypeScript looks like.
## 0.3.1 [20210513]
### BREAKING
- Ability to configure CORS settings for socket.io see [#240](../../issues/240) for more information on how this may break existing deployments. Default settings in example `config.json` are currently permissive `http.origins: ["*:*"]` please note that if a `config.json` is not present, the default is `http.origins: ["localhost:2222"]
### Added
- Safe Shutdown Feature - thanks to @edgarogh
- Sending SIGINT or SIGTERM to node process responsible for WebSSH2 or Docker process will result in a "safe" shutdown
- Timer is configured in config.safeShutdownDuration
- feat: Use docker build to create multi-arch images (#202)
### Fixed
- obey host ssh.host in config fixes #190
### Changed
- `config.json.sample`: `allowreauth` now defaults to `false` fixes #238
- update ssh2 to 0.8.8 -> 0.8.9 - [comparison at ssh2 repo](https://github.com/mscdex/ssh2/compare/v0.8.8...v0.8.9)
- update xterm to 4.12.0 [comparison at xtermjs repo](https://github.com/xtermjs/xterm.js/compare/4.4.0...4.12.0)
- update read-config-ng to 3.0.2
- update morgan to 1.10.0
- update debug to 4.3.1
- update express-session to 1.17.1
- update validator to 13.6.0
- development tools updates (build environment requires minimum of Node 10, only needed for customization)
- update @fortawesome/fontawesome-svg-core to 1.2.35
- update @fortawesome/free-solid-svg-icons to 5.15.3
- update copy-webpack-plugin to 8.1.1
- update cross-env to 7.0.3
- update css-loader to 5.2.4
- update file-loader to 6.2.0
- update mini-css-extract-plugin to 1.6.0
- update postcss-discard-comments to 5.0.0
- update snazzy to 9.0.0
- update standard to 16.0.3
- update standard-version to 9.3.0
- update style-loader to 2.0.0
- update terser-webpack-plugin to 5.1.1
- update url-loader to 4.1.1
- update webpack to 5.37.0
- update webpack-cli to 4.7.0
- update webpack-merge to 5.7.3
- update webpack-stream to 6.1.2
- update xterm-addon-fit to 0.5.0
- update xterm-addon-search to 0.8.0
- update xterm-addon-web-links to 0.4.0
- update ssri from 6.0.1 to 6.0.2 [#233](../../pull/233)
- update hosted-git-info from 2.8.5 to 2.8.9 [#237](../../pull/237)
- update lodash from 4.17.19 to 4.17.21 [#236](../../pull/236)
- update handlebars from 4.7.6 to 4.7.7 [#235](../../pull/235)
- update y18n from 4.0.0 to 4.0.1 [#230](../../pull/230)
- update elliptic from 6.5.3 to 6.5.4 [#228](../../pull/222833)
- update ini from 1.3.5 to 1.3.8 [#217](../../pull/217)
## 0.3.0 [20200315]
🍀🍀🍀
### Added
- Add configuration option to restrict connections to specified subnets thanks to @Mierdin
- favicon
- added module `serve-favicon` to serve favicon from root if pre-fetched by browser
- added `link rel=icon` line in client.htm to serve favico.ico out of /ssh/
### Changed
- Using new repo for read-config -> read-config-ng-
- removed express compression feature, added no real value.
- module updates
- ssh2 to 0.8.6 -> 0.8.8 - [comparison at ssh2 repo](https://github.com/mscdex/ssh2/compare/v0.8.6...v0.8.8)
- xterm 4.2.0 -> 4.4.0 - [comparison at xtermjs repo](https://github.com/xtermjs/xterm.js/compare/4.2.0...4.4.0)
- read-config-ng 3.0.1 - (taking over abandoned repo)n
- development module updates (does not impact production, only for development and rebuilding)
- fortawesome/fontawesome-svg-core 1.2.27
- fortawesome/free-solid-svg-icons 5.12.1
- standard-version 7.1.0
- webpack 4.42.0
- webpack-cli 3.3.11
- terser-webpack-plugin 2.3.5
- copy-webpack-plugin 5.1.1
- cross-env 7.0.2
- css-loader 3.4.2
- file-loader 5.1.0
- style-loader 1.1.3
- url-loader 3.0.0
### Potentially Breaking Changes
- Move all child resources to start from under /ssh
- /socket.io -> /ssh/socket.io
- /webssh2.css -> /ssh/webssh2.css
- /webssh2.bundle.js -> /ssh/webssh2.bundle.js
- /reauth -> /ssh/reauth
- perhaps more
### Fixes
- Typo in config.json.sample, thanks @wuchihsu, fixes #173
### Housekeeping
- Removed irrelavant build scripts from /scripts
## 0.2.9 [2019-06-13]
### Changes
- Missing require('fs') in `server/app.js` See issue [#135](../../issues/135)
- Patched read-config to mitigate vulnerability in js-yaml
- issue not exploitable on webssh2 implementation
- patched anyway
- sending my patch upstream to read-config, webssh2 package.json points to patched version in my repository https://github.com/billchurch/nodejs-read-config
- See https://github.com/nodeca/js-yaml/issues/475 for more detail
## 0.2.8 [2019-05-25]
### Changes
- 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.
- fixes broken `npm run (build|builddev)`
- update font-awesome fonts to 5.6.3
- update webpack and dependancies
- update xterm to 3.8.0
### Fixes
- ILX workspace may not always import properly due to symbolic links (specifically ./node_modules/.bin). This is removed from the ILX package
## 0.2.7 [2018-11-11]
### Changes
- `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)
- **BREAKING** moved app files to /app, this may be a breaking change
- Updated dockerfile for new app path
- Updated app dependancies
- xterm v3.8.0
- https://github.com/xtermjs/xterm.js/releases/tag/3.8.0
- basic-auth v2.0.1
- https://github.com/jshttp/basic-auth/releases/tag/v2.0.1
- express v4.16.4
- https://github.com/expressjs/express/releases/tag/4.16.4
- validator v10.9.0
- https://github.com/chriso/validator.js/releases/tag/10.9.0
- Updated dev dependancies
- snazzy v8.0.0
- standard v12.0.1
- uglifyjs-webpack-plugin v2.0.1
- ajv v6.5.5
- copy-webpack-plugin v4.6.0
- css-loader v1.0.1
- nodemon v1.18.6
- postcss-discard-comments v4.0.1
- snyk v1.108.2
- url-loader v1.1.2
- webpack v4.25.1
- webpack-cli v3.1.2
## 0.2.6 [2018-11-09]
### Changes
- Reauth didn't work if intial auth presented was incorrect, (see issue #112) fixed thanks @vvalchev
- Update node version supported to >=6 (PR #115) thanks @perlun
- Update packages
- developer dependencies
## 0.2.5 [2018-09-11]
### Added
- Reauth function thanks to @vbeskrovny and @vvalchev (9bbc116)
- Controlled by `config.json` option `options.allowreauth` true presents reauth dialog and false hides dialog
### Changed
- `options.challengeButton` enabled
- previously this configuration option did nothing, this now enables the Credentials button site-wide regardless of the `allowreplay` header value
- Updated debug module to v4
## 0.2.4 [2018-07-18]
### Added
- Browser title window now changes with xterm escape sequences (see http://tldp.org/HOWTO/Xterm-Title-3.html)
- Added bellStyle options
- `GET var`: **bellStyle** - _string_ - Style of terminal bell: ("sound"|"none"). **Default:** "sound". **Enforced Values:** "sound "none"
- `config.json`: **terminal.bellStyle** - _string_ - Style of terminal bell: (sound|none). **Default:** "sound".
- `workspace` folder on GITHUB for BIG-IP specific fixes/changes
### Changed
- Updated xterm.js to 3.1.0
- https://github.com/xtermjs/xterm.js/releases/tag/3.1.0
- Default listen IP in `config.json` changed back to 127.0.0.1
### Fixed
- ESC]0; is now removed from log files when using the browser-side logging feature
## 0.2.3 unreleased
### Fixed
- ESC]0; is now removed from log files when using the browser-side logging feature
## 0.2.0 [2018-02-10]
Mostly client (browser) related changes in this release
### Added
- Menu system
- Fontawesome icons
- Resizing browser window sends resize events to terminal container as well as SSH session (pty)
- New terminal options (config.json as well as GET vars)
- terminal.cursorBlink - boolean - Cursor blinks (true), does not (false) Default: true.
- terminal.scrollback - integer - Lines in the scrollback buffer. Default: 10000.
- terminal.tabStopWidth - integer - Tab stops at n characters Default: 8.
- New serverside (nodejs) terminal configuration options (cursorBlink, scrollback, tabStopWidth)
- Logging of MRH session (unassigned if not present)
- Express compression feature
### Changed
- Updated xterm.js to 3.0.2
- See https://github.com/xtermjs/xterm.js/releases/tag/3.0.2
- See https://github.com/xtermjs/xterm.js/releases/tag/3.0.1
- See https://github.com/xtermjs/xterm.js/releases/tag/3.0.0
- Moved javascript events out of html into javascript
- Changed asset packaging from grunt to Webpack to be inline with xterm.js direction
- Moved logging and credentials buttons to menu system
- Removed non-minified options (if you need to disable minification, modify webpack scripts and 'npm run build')
### Fixed
- Resolved loss of terminal foucs when interacting with option buttons (Logging, etc...)
## 0.1.4 [2018-01-30]
### Changed
- Moved socket and util out of folders into .js in root.
- added keepaliveInterval and keepaliveCountMax config options
## 0.1.3 [2017-09-28]
### Changed
- Upgrade to debug@3.1 to eliminate ReDoS in %o formatter
- Upgrade Express to 4.15.5 for ReDOS
- Upgrade basic-auth to v2.0
## 0.1.2 [2017-07-31]
### Added
- ssh.readyTimeout option in config.json (time in ms, default 20000, 20sec)
### Changed
- Updated xterm.js to 2.9.2 from 2.6.0
- See https://github.com/sourcelair/xterm.js/releases/tag/2.9.2
- See https://github.com/sourcelair/xterm.js/releases/tag/2.9.1
- See https://github.com/sourcelair/xterm.js/releases/tag/2.9.0
- See https://github.com/sourcelair/xterm.js/releases/tag/2.8.1
- See https://github.com/sourcelair/xterm.js/releases/tag/2.8.0
- See https://github.com/sourcelair/xterm.js/releases/tag/2.7.0
- Updated ssh2 to 0.5.5 to keep current, no fixes impacting WebSSH2
- ssh-streams to 0.1.19 from 0.1.16
- Updated validator.js to 8.0.0, no fixes impacting WebSSH2
- https://github.com/chriso/validator.js/releases/tag/8.0.0
- Updated Express to 4.15.4, no fixes impacting WebSSH2
- https://github.com/expressjs/express/releases/tag/4.15.4
- Updated Express-session to 1.15.5, no fixes impacting WebSSH2
- https://github.com/expressjs/session/releases/tag/v1.15.5
- Updated Debug to 3.0.0, no fixes impacting WebSSH2
- https://github.com/visionmedia/debug/releases/tag/3.0.0
- Running in strict mode ('use strict';)
## 0.1.1 [2017-06-03]
### Added
- `serverlog.client` and `serverlog.server` options added to `config.json` to enable logging of client commands to server log (only client portion implemented at this time)
- morgan express middleware for logging
### Changed
- Updated socket.io to 1.7.4
- continued refactoring, breaking up `index.js`
- revised error handling methods
- revised session termination methods
### Fixed
### Removed
- color console decorations from `util/index.js`
- SanatizeHeaders function from `util/index.js`
## 0.1.0 [2017-05-27]
### Added
- This ChangeLog.md file
- Support for UTF-8 characters (thanks @bara666)
- Snyk, Bithound, Travis CI
- Cross platform improvements (path mappings)
- Session fixup between Express and Socket.io
- Session secret settings in `config.json`
- env variable `DEBUG=ssh2` will put the `ssh2` module into debug mode
- env variable `DEBUG=WebSSH2` will output additional debug messages for functions
and events in the application (not including the ssh2 module debug)
- using Grunt to pull js and css source files from other modules `npm run build` to rebuild these if changed or updated.
- `useminified` option in `config.json` to enable using minified client side javascript (true) defaults to false (non-minified)
- sshterm= query option to specify TERM environment variable for host, valid strings are alpha-numeric with a hypen (validated). Otherwise the default ssh.term variable from `config.json` will be used.
- validation for host (v4,v6,fqdn,hostname), port (integer 2-65535), and header (sanitized) from URL input
### Changed
- error handling in public/client.js
- moved socket.io operations to their own file /socket/index.js, more changes like this to come (./socket/index.js)
- all session based variables are now under the req.session.ssh property or socket.request.ssh (./index.js)
- moved SSH algorithms to `config.json` and defined as a session variable (..session.ssh.algorithms)
-- prep for future feature to define algorithms in header or some other method to enable separate ciphers per host
- minified and combined all js files to a single js in `./public/webssh2.min.js` also included a sourcemap `./public/webssh2.min.js` which maps to `./public/webssh2.js` for easier troubleshooting.
- combined all css files to a single css in `./public/webssh2.css`
- minified all css files to a single css in `./public/webssh2.min.css`
- copied all unmodified source css and js to /public/src/css and /public/src/js respectively (for troubleshooting/etc)
- sourcemaps of all minified code (in /public/src and /public/src/js)
- renamed `client.htm` to `client-full.htm`
- created `client-min.htm` to serve minified javascript
- if header.text is null in `config.json` and header is not defined as a get parameter the Header will not be displayed. Both of these must be null / undefined and not specified as get parameters.
### Fixed
- Multiple errors may overwrite status bar which would cause confusion as to what originally caused the error. Example, ssh server disconnects which prompts a cascade of events (conn.on('end'), socket.on('disconnect'), conn.on('close')) and the original reason (conn.on('end')) would be lost and the user would erroneously receive a WEBSOCKET error as the last event to fire would be the websocket connection closing from the app.
- ensure ssh session is closed when a browser disconnects from the websocket
- if headerBackground is changed, status background is changed to the same color (typo, fixed)
### Removed
- Express Static References directly to module source directories due to concatenating and minifying js/css
## 0.0.5 - [2017-03-23]
### Added
- Added experimental support for logging (see Readme)
### Fixed
- Terminal geometry now properly fills the browser screen and communicates this to the ssh session. Tested with IE 11 and recent versions of Chrome/Safari/Firefox.
## 0.0.4 - [2017-03-23]
### Added
- Set default terminal to xterm-color
- Mouse event support
- New config option, config.ssh.term to set terminal
### Changed
- Update to Xterm.js 2.4.0
- Minor code formatting cleanup
## 0.0.3 - [2017-02-16]
### Changed
- Update xterm to latest (2.3.0)
### Fixed
- Fixed misspelled config.ssh.port property
## 0.0.2 - [2017-02-01]
### Changed
- Moving terminal emulation to xterm.js
- updating module version dependencies
### Fixed
- Fixed issue with banners not being displayed properly from UNIX hosts when only lf is used
## 0.0.1 - [2016-06-28]
### Added
- Initial proof of concept and release. For historical purposes only.

21
app/LICENSE Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Bill Church
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

BIN
app/bun.lockb Executable file

Binary file not shown.

View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>WebSSH2</title>
<style>
html, body {background-color: #000;height: 100%;margin: 0;}.dropup-content {display: none;}
</style>
<link rel="stylesheet" href="/ssh/webssh2.css" />
<link rel="icon" href="/ssh/favicon.ico" />
</head>
<body>
<div class="box">
<div id="header"></div>
<div id="terminal-container" class="terminal"></div>
<div id="bottomdiv">
<div class="dropup" id="menu">
<i class="fas fa-bars fa-fw"></i> Menu
<div id="dropupContent" class="dropup-content">
<a id="logBtn"><i class="fas fa-clipboard fa-fw"></i> Start Log</a>
<a id="downloadLogBtn"><i class="fas fa-download fa-fw"></i> Download Log</a>
<a id="reauthBtn" style="display: none;"><i class="fas fa-key fa-fw"></i> Switch User</a>
<a id="credentialsBtn" style="display: none;"><i class="fas fa-key fa-fw"></i> Credentials</a>
</div>
</div>
<div id="footer"></div>
<div id="status"></div>
<div id="countdown"></div>
</div>
</div>
<script src="/ssh/webssh2.bundle.js" defer></script>
</body>
</html>

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,366 @@
/**
* Copyright (c) 2014 The xterm.js authors. All rights reserved.
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/term.js
* @license MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Originally forked from (with the author's permission):
* Fabrice Bellard's javascript vt100 for jslinux:
* http://bellard.org/jslinux/
* Copyright (c) 2011 Fabrice Bellard
* The original design remains. The terminal itself
* has been extended to include xterm CSI codes, among
* other features.
*/
/**
* Default styles for xterm.js
*/
.xterm {
cursor: text;
position: relative;
user-select: none;
-ms-user-select: none;
-webkit-user-select: none;
}
.xterm.focus,
.xterm:focus {
outline: none;
}
.xterm .xterm-helpers {
position: absolute;
top: 0;
/**
* The z-index of the helpers must be higher than the canvases in order for
* IMEs to appear on top.
*/
z-index: 5;
}
.xterm .xterm-helper-textarea {
padding: 0;
border: 0;
margin: 0;
/* Move textarea out of the screen to the far left, so that the cursor is not visible */
position: absolute;
opacity: 0;
left: -9999em;
top: 0;
width: 0;
height: 0;
z-index: -5;
/** Prevent wrapping so the IME appears against the textarea at the correct position */
white-space: nowrap;
overflow: hidden;
resize: none;
}
.xterm .composition-view {
/* TODO: Composition position got messed up somewhere */
background: #000;
color: #FFF;
display: none;
position: absolute;
white-space: nowrap;
z-index: 1;
}
.xterm .composition-view.active {
display: block;
}
.xterm .xterm-viewport {
/* On OS X this is required in order for the scroll bar to appear fully opaque */
background-color: #000;
overflow-y: scroll;
cursor: default;
position: absolute;
right: 0;
left: 0;
top: 0;
bottom: 0;
}
.xterm .xterm-screen {
position: relative;
}
.xterm .xterm-screen canvas {
position: absolute;
left: 0;
top: 0;
}
.xterm .xterm-scroll-area {
visibility: hidden;
}
.xterm-char-measure-element {
display: inline-block;
visibility: hidden;
position: absolute;
top: 0;
left: -9999em;
line-height: normal;
}
.xterm.enable-mouse-events {
/* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */
cursor: default;
}
.xterm.xterm-cursor-pointer,
.xterm .xterm-cursor-pointer {
cursor: pointer;
}
.xterm.column-select.focus {
/* Column selection mode */
cursor: crosshair;
}
.xterm .xterm-accessibility:not(.debug),
.xterm .xterm-message {
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
z-index: 10;
color: transparent;
pointer-events: none;
}
.xterm .xterm-accessibility-tree:not(.debug) *::selection {
color: transparent;
}
.xterm .xterm-accessibility-tree {
user-select: text;
white-space: pre;
}
.xterm .live-region {
position: absolute;
left: -9999px;
width: 1px;
height: 1px;
overflow: hidden;
}
.xterm-dim {
/* Dim should not apply to background, so the opacity of the foreground color is applied
* explicitly in the generated class and reset to 1 here */
opacity: 1 !important;
}
.xterm-underline-1 { text-decoration: underline; }
.xterm-underline-2 { text-decoration: double underline; }
.xterm-underline-3 { text-decoration: wavy underline; }
.xterm-underline-4 { text-decoration: dotted underline; }
.xterm-underline-5 { text-decoration: dashed underline; }
.xterm-overline {
text-decoration: overline;
}
.xterm-overline.xterm-underline-1 { text-decoration: overline underline; }
.xterm-overline.xterm-underline-2 { text-decoration: overline double underline; }
.xterm-overline.xterm-underline-3 { text-decoration: overline wavy underline; }
.xterm-overline.xterm-underline-4 { text-decoration: overline dotted underline; }
.xterm-overline.xterm-underline-5 { text-decoration: overline dashed underline; }
.xterm-strikethrough {
text-decoration: line-through;
}
.xterm-screen .xterm-decoration-container .xterm-decoration {
z-index: 6;
position: absolute;
}
.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer {
z-index: 7;
}
.xterm-decoration-overview-ruler {
z-index: 8;
position: absolute;
top: 0;
right: 0;
pointer-events: none;
}
.xterm-decoration-top {
z-index: 2;
position: relative;
}
body, html {
font-family: helvetica, sans-serif, arial;
font-size: 1em;
background-color: rgb(0, 0, 0);
color: rgb(240, 240, 240);
height: 100%;
margin: 0;
}
#header {
color: rgb(240, 240, 240);
background-color: rgb(0, 128, 0);
width: 100%;
border-color: white;
border-style: none none solid none;
border-width: 1px;
text-align: center;
flex: 0 1 auto;
z-index: 99;
height:19px;
display: none;
}
.box {
display: block;
height: 100%;
}
#terminal-container {
display: block;
width: calc(100% - 1px);
margin: 0 auto;
padding: 2px;
height: calc(100% - 19px);
}
#terminal-container .terminal {
background-color: #000000;
color: #fafafa;
padding: 2px;
height: calc(100% - 19px);
}
#terminal-container .terminal:focus .terminal-cursor {
background-color: #fafafa;
}
#bottomdiv {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: rgb(50, 50, 50);
border-color: white;
border-style: solid none none none;
border-width: 1px;
z-index: 99;
height: 19px;
}
#footer {
display: inline-block;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 5px;
padding-right: 5px;
border-color: white;
border-style: none none none solid;
border-width: 1px;
text-align: left;
}
#status {
display: inline-block;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 10px;
padding-right: 10px;
border-color: white;
border-style: none solid none solid;
border-width: 1px;
text-align: left;
z-index: 100;
}
#countdown {
display: none;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 10px;
padding-right: 10px;
border-color: white;
border-style: none solid none solid;
border-width: 1px;
text-align: left;
z-index: 100;
}
#countdown.active {
display: inline-block;
animation: countdown infinite alternate 200ms;
}
@keyframes countdown {
from {
background-color: rgb(255, 255, 0);
}
to {
background-color: inherit;
}
}
#menu {
display: inline-block;
font-size: 16px;
color: rgb(255, 255, 255);
padding-left: 10px;
z-index: 100;
}
#menu:hover .dropup-content {
display: block;
}
#logBtn, #credentialsBtn, #reauthBtn {
color: #000;
}
.dropup {
position: relative;
display: inline-block;
cursor: pointer;
}
.dropup-content {
display: none;
position: absolute;
background-color: #f1f1f1;
font-size: 16px;
min-width: 160px;
bottom: 18px;
z-index: 101;
}
.dropup-content a {
color: #777;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropup-content a:hover {
background-color: #ccc
}
.dropup:hover .dropup-content {
display: block;
}
.dropup:active .dropup-content {
display: block;
}
.dropup:hover .dropbtn {
background-color: #3e8e41;
}

1
app/client/src/README.md Normal file
View file

@ -0,0 +1 @@
Customizations and modifications to the client (browser) go here. Then run "npm run build" to integrate into ../public (where client files are served from). Note that ../public is a flat directory structure. ../public directory is deleted and refreshed eatch thime "npm run build" is run.

32
app/client/src/client.htm Normal file
View file

@ -0,0 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<title>WebSSH2</title>
<style>
html, body {background-color: #000;height: 100%;margin: 0;}.dropup-content {display: none;}
</style>
<link rel="stylesheet" href="/ssh/webssh2.css" />
<link rel="icon" href="/ssh/favicon.ico" />
</head>
<body>
<div class="box">
<div id="header"></div>
<div id="terminal-container" class="terminal"></div>
<div id="bottomdiv">
<div class="dropup" id="menu">
<i class="fas fa-bars fa-fw"></i> Menu
<div id="dropupContent" class="dropup-content">
<a id="logBtn"><i class="fas fa-clipboard fa-fw"></i> Start Log</a>
<a id="downloadLogBtn"><i class="fas fa-download fa-fw"></i> Download Log</a>
<a id="reauthBtn" style="display: none;"><i class="fas fa-key fa-fw"></i> Switch User</a>
<a id="credentialsBtn" style="display: none;"><i class="fas fa-key fa-fw"></i> Credentials</a>
</div>
</div>
<div id="footer"></div>
<div id="status"></div>
<div id="countdown"></div>
</div>
</div>
<script src="/ssh/webssh2.bundle.js" defer></script>
</body>
</html>

View file

@ -0,0 +1,146 @@
body, html {
font-family: helvetica, sans-serif, arial;
font-size: 1em;
background-color: rgb(0, 0, 0);
color: rgb(240, 240, 240);
height: 100%;
margin: 0;
}
#header {
color: rgb(240, 240, 240);
background-color: rgb(0, 128, 0);
width: 100%;
border-color: white;
border-style: none none solid none;
border-width: 1px;
text-align: center;
flex: 0 1 auto;
z-index: 99;
height:19px;
display: none;
}
.box {
display: block;
height: 100%;
}
#terminal-container {
display: block;
width: calc(100% - 1px);
margin: 0 auto;
padding: 2px;
height: calc(100% - 19px);
}
#terminal-container .terminal {
background-color: #000000;
color: #fafafa;
padding: 2px;
height: calc(100% - 19px);
}
#terminal-container .terminal:focus .terminal-cursor {
background-color: #fafafa;
}
#bottomdiv {
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: rgb(50, 50, 50);
border-color: white;
border-style: solid none none none;
border-width: 1px;
z-index: 99;
height: 19px;
}
#footer {
display: inline-block;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 5px;
padding-right: 5px;
border-color: white;
border-style: none none none solid;
border-width: 1px;
text-align: left;
}
#status {
display: inline-block;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 10px;
padding-right: 10px;
border-color: white;
border-style: none solid none solid;
border-width: 1px;
text-align: left;
z-index: 100;
}
#countdown {
display: none;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 10px;
padding-right: 10px;
border-color: white;
border-style: none solid none solid;
border-width: 1px;
text-align: left;
z-index: 100;
}
#countdown.active {
display: inline-block;
animation: countdown infinite alternate 200ms;
}
@keyframes countdown {
from {
background-color: rgb(255, 255, 0);
}
to {
background-color: inherit;
}
}
#menu {
display: inline-block;
font-size: 16px;
color: rgb(255, 255, 255);
padding-left: 10px;
z-index: 100;
}
#menu:hover .dropup-content {
display: block;
}
#logBtn, #credentialsBtn, #reauthBtn {
color: #000;
}
.dropup {
position: relative;
display: inline-block;
cursor: pointer;
}
.dropup-content {
display: none;
position: absolute;
background-color: #f1f1f1;
font-size: 16px;
min-width: 160px;
bottom: 18px;
z-index: 101;
}
.dropup-content a {
color: #777;
padding: 12px 16px;
text-decoration: none;
display: block;
}
.dropup-content a:hover {
background-color: #ccc
}
.dropup:hover .dropup-content {
display: block;
}
.dropup:active .dropup-content {
display: block;
}
.dropup:hover .dropbtn {
background-color: #3e8e41;
}

BIN
app/client/src/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

285
app/client/src/js/index.ts Normal file
View file

@ -0,0 +1,285 @@
/* eslint-disable import/no-extraneous-dependencies */
import { io } from 'socket.io-client';
import { Terminal } from '@xterm/xterm';
import { FitAddon } from '@xterm/addon-fit';
import { library, dom } from '@fortawesome/fontawesome-svg-core';
import { faBars, faClipboard, faDownload, faKey, faCog } from '@fortawesome/free-solid-svg-icons';
library.add(faBars, faClipboard, faDownload, faKey, faCog);
dom.watch();
const debug = require('debug')('WebSSH2');
require('@xterm/xterm/css/xterm.css');
require('../css/style.css');
/* global Blob, logBtn, credentialsBtn, reauthBtn, downloadLogBtn */ // eslint-disable-line
let sessionLogEnable = false;
let loggedData = false;
let allowreplay = false;
let allowreauth = false;
let sessionLog: string;
let sessionFooter: any;
let logDate: {
getFullYear: () => any;
getMonth: () => number;
getDate: () => any;
getHours: () => any;
getMinutes: () => any;
getSeconds: () => any;
};
let currentDate: Date;
let myFile: string;
let errorExists: boolean;
const term = new Terminal();
// DOM properties
const logBtn = document.getElementById('logBtn');
const credentialsBtn = document.getElementById('credentialsBtn');
const reauthBtn = document.getElementById('reauthBtn');
const downloadLogBtn = document.getElementById('downloadLogBtn');
const status = document.getElementById('status');
const header = document.getElementById('header');
const footer = document.getElementById('footer');
const countdown = document.getElementById('countdown');
const fitAddon = new FitAddon();
const terminalContainer = document.getElementById('terminal-container');
term.loadAddon(fitAddon);
term.open(terminalContainer);
term.focus();
fitAddon.fit();
const socket = io({
path: '/ssh/socket.io',
});
// reauthenticate
function reauthSession () { // eslint-disable-line
debug('re-authenticating');
socket.emit('control', 'reauth');
window.location.href = '/ssh/reauth';
return false;
}
// cross browser method to "download" an element to the local system
// used for our client-side logging feature
function downloadLog () { // eslint-disable-line
if (loggedData === true) {
myFile = `WebSSH2-${logDate.getFullYear()}${
logDate.getMonth() + 1
}${logDate.getDate()}_${logDate.getHours()}${logDate.getMinutes()}${logDate.getSeconds()}.log`;
// regex should eliminate escape sequences from being logged.
const blob = new Blob(
[
sessionLog.replace(
// eslint-disable-next-line no-control-regex
/[\u001b\u009b][[\]()#;?]*(?:\d{1,4}(?:;\d{0,4})*)?[0-9A-ORZcf-nqry=><;]/g,
''
),
],
{
// eslint-disable-line no-control-regex
type: 'text/plain',
}
);
const elem = window.document.createElement('a');
elem.href = window.URL.createObjectURL(blob);
elem.download = myFile;
document.body.appendChild(elem);
elem.click();
document.body.removeChild(elem);
}
term.focus();
}
// Set variable to toggle log data from client/server to a varialble
// for later download
function toggleLog () { // eslint-disable-line
if (sessionLogEnable === true) {
sessionLogEnable = false;
loggedData = true;
logBtn.innerHTML = '<i class="fas fa-clipboard fa-fw"></i> Start Log';
currentDate = new Date();
sessionLog = `${sessionLog}\r\n\r\nLog End for ${sessionFooter}: ${currentDate.getFullYear()}/${
currentDate.getMonth() + 1
}/${currentDate.getDate()} @ ${currentDate.getHours()}:${currentDate.getMinutes()}:${currentDate.getSeconds()}\r\n`;
logDate = currentDate;
term.focus();
return false;
}
sessionLogEnable = true;
loggedData = true;
logBtn.innerHTML = '<i class="fas fa-cog fa-spin fa-fw"></i> Stop Log';
downloadLogBtn.style.color = '#000';
downloadLogBtn.addEventListener('click', downloadLog);
currentDate = new Date();
sessionLog = `Log Start for ${sessionFooter}: ${currentDate.getFullYear()}/${
currentDate.getMonth() + 1
}/${currentDate.getDate()} @ ${currentDate.getHours()}:${currentDate.getMinutes()}:${currentDate.getSeconds()}\r\n\r\n`;
logDate = currentDate;
term.focus();
return false;
}
// replay password to server, requires
function replayCredentials () { // eslint-disable-line
socket.emit('control', 'replayCredentials');
debug(`control: replayCredentials`);
term.focus();
return false;
}
// draw/re-draw menu and reattach listeners
// when dom is changed, listeners are abandonded
function drawMenu() {
logBtn.addEventListener('click', toggleLog);
if (allowreauth) {
reauthBtn.addEventListener('click', reauthSession);
reauthBtn.style.display = 'block';
}
if (allowreplay) {
credentialsBtn.addEventListener('click', replayCredentials);
credentialsBtn.style.display = 'block';
}
if (loggedData) {
downloadLogBtn.addEventListener('click', downloadLog);
downloadLogBtn.style.display = 'block';
}
}
function resizeScreen() {
fitAddon.fit();
socket.emit('resize', { cols: term.cols, rows: term.rows });
debug(`resize: ${JSON.stringify({ cols: term.cols, rows: term.rows })}`);
}
window.addEventListener('resize', resizeScreen, false);
term.onData((data) => {
socket.emit('data', data);
});
socket.on('data', (data: string | Uint8Array) => {
term.write(data);
if (sessionLogEnable) {
sessionLog += data;
}
});
socket.on('connect', () => {
socket.emit('geometry', term.cols, term.rows);
debug(`geometry: ${term.cols}, ${term.rows}`);
});
socket.on(
'setTerminalOpts',
(data: {
cursorBlink: boolean;
scrollback: number;
tabStopWidth: number;
bellStyle: 'none' | 'sound';
fontSize: number;
fontFamily: string;
letterSpacing: number;
lineHeight: number;
}) => {
term.options = data;
}
);
socket.on('title', (data: string) => {
document.title = data;
});
socket.on('menu', () => {
drawMenu();
});
socket.on('status', (data: string) => {
status.innerHTML = data;
});
socket.on('ssherror', (data: string) => {
status.innerHTML = data;
status.style.backgroundColor = 'red';
errorExists = true;
});
socket.on('headerBackground', (data: string) => {
header.style.backgroundColor = data;
});
socket.on('header', (data: string) => {
if (data) {
header.innerHTML = data;
header.style.display = 'block';
// header is 19px and footer is 19px, recaculate new terminal-container and resize
terminalContainer.style.height = 'calc(100% - 38px)';
resizeScreen();
}
});
socket.on('footer', (data: string) => {
sessionFooter = data;
footer.innerHTML = data;
});
socket.on('statusBackground', (data: string) => {
status.style.backgroundColor = data;
});
socket.on('allowreplay', (data: boolean) => {
if (data === true) {
debug(`allowreplay: ${data}`);
allowreplay = true;
drawMenu();
} else {
allowreplay = false;
debug(`allowreplay: ${data}`);
}
});
socket.on('allowreauth', (data: boolean) => {
if (data === true) {
debug(`allowreauth: ${data}`);
allowreauth = true;
drawMenu();
} else {
allowreauth = false;
debug(`allowreauth: ${data}`);
}
});
socket.on('disconnect', (err: any) => {
if (!errorExists) {
status.style.backgroundColor = 'red';
status.innerHTML = `WEBSOCKET SERVER DISCONNECTED: ${err}`;
}
socket.io.reconnection(false);
countdown.classList.remove('active');
});
socket.on('error', (err: any) => {
if (!errorExists) {
status.style.backgroundColor = 'red';
status.innerHTML = `ERROR: ${err}`;
}
});
socket.on('reauth', () => {
if (allowreauth) {
reauthSession();
}
});
// safe shutdown
let hasCountdownStarted = false;
socket.on('shutdownCountdownUpdate', (remainingSeconds: any) => {
if (!hasCountdownStarted) {
countdown.classList.add('active');
hasCountdownStarted = true;
}
countdown.innerText = `Shutting down in ${remainingSeconds}s`;
});
term.onTitleChange((title) => {
document.title = title;
});

9
app/client/tsconfig.json Normal file
View file

@ -0,0 +1,9 @@
{
"compilerOptions": {
"outDir": "./built",
"allowJs": true,
"target": "es6",
"moduleResolution": "node"
},
"include": ["./src/**/*"],
}

83
app/config.json.sample Normal file
View file

@ -0,0 +1,83 @@
{
"listen": {
"ip": "0.0.0.0",
"port": 2224
},
"socketio": {
"serveClient": false,
"path": "/ssh/socket.io",
"origins": ["localhost:2222"],
},
"user": {
"name": null,
"password": null,
"privatekey": null,
"overridebasic": false
},
"ssh": {
"host": null,
"port": 22,
"localAddress": null,
"localPort": null,
"term": "xterm-color",
"readyTimeout": 20000,
"keepaliveInterval": 120000,
"keepaliveCountMax": 10,
"allowedSubnets": []
},
"terminal": {
"cursorBlink": true,
"scrollback": 10000,
"tabStopWidth": 8,
"bellStyle": "sound",
"fontSize": 14
},
"header": {
"text": null,
"background": "green"
},
"session": {
"name": "WebSSH2",
"secret": "mysecret"
},
"options": {
"challengeButton": true,
"allowreauth": false
},
"algorithms": {
"kex": [
"ecdh-sha2-nistp256",
"ecdh-sha2-nistp384",
"ecdh-sha2-nistp521",
"diffie-hellman-group-exchange-sha256",
"diffie-hellman-group14-sha1"
],
"cipher": [
"aes128-ctr",
"aes192-ctr",
"aes256-ctr",
"aes128-gcm",
"aes128-gcm@openssh.com",
"aes256-gcm",
"aes256-gcm@openssh.com",
"aes256-cbc"
],
"hmac": [
"hmac-sha2-256",
"hmac-sha2-512",
"hmac-sha1"
],
"compress": [
"none",
"zlib@openssh.com",
"zlib"
]
},
"serverlog": {
"client": false,
"server": false
},
"accesslog": false,
"verify": false,
"safeShutdownDuration": 300
}

32
app/index.js Normal file
View file

@ -0,0 +1,32 @@
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
/* jshint esversion: 6, asi: true, node: true */
/*
* index.js
*
* WebSSH2 - Web to SSH2 gateway
* Bill Church - https://github.com/billchurch/WebSSH2 - May 2017
* See LICENSE file
*
* test change
*/
const { config } = require('./server/app');
const { server } = require('./server/app');
server.listen({ host: config.listen.ip, port: config.listen.port });
// eslint-disable-next-line no-console
console.log(`WebSSH2 service listening on ${config.listen.ip}:${config.listen.port}`);
server.on('error', (err) => {
if (err.code === 'EADDRINUSE') {
config.listen.port += 1;
console.warn(`WebSSH2 Address in use, retrying on port ${config.listen.port}`);
setTimeout(() => {
server.listen(config.listen.port);
}, 250);
} else {
// eslint-disable-next-line no-console
console.log(`WebSSH2 server.listen ERROR: ${err.code}`);
}
});

17
app/jsconfig.json Normal file
View file

@ -0,0 +1,17 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "preserve",
"strictFunctionTypes": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
],
"include": [
"server/*.js",
"index.js"
]
}

11335
app/package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

89
app/package.json Normal file
View file

@ -0,0 +1,89 @@
{
"name": "webssh2",
"version": "0.6.0-pre-1",
"ignore": [
".gitignore"
],
"bin": "./index.js",
"description": "A Websocket to SSH2 gateway using term.js, socket.io, ssh2, and express",
"homepage": "https://github.com/billchurch/WebSSH2",
"keywords": [
"ssh",
"webssh",
"terminal",
"webterminal"
],
"license": "SEE LICENSE IN FILE - LICENSE",
"private": false,
"repository": {
"type": "git",
"url": "git+https://github.com/billchurch/WebSSH2.git"
},
"contributors": [
{
"name": "Bill Church",
"email": "wmchurch@gmail.com"
}
],
"engines": {
"node": ">= 14"
},
"bugs": {
"url": "https://github.com/billchurch/WebSSH2/issues"
},
"dependencies": {
"basic-auth": "~2.0.1",
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
"express": "^4.19.2",
"express-session": "^1.18.0",
"morgan": "~1.10.0",
"read-config-ng": "^3.0.7",
"serve-favicon": "^2.5.0",
"socket.io": "^4.7.5",
"ssh2": "^1.15.0",
"validator": "^13.11.0",
"winston": "^3.13.0"
},
"scripts": {
"start": "node index.js",
"build": "webpack --progress --config scripts/webpack.prod.js",
"builddev": "webpack --progress --config scripts/webpack.dev.js",
"analyze": "webpack --json --config scripts/webpack.prod.js | webpack-bundle-size-analyzer",
"test": "snyk test",
"watch": "nodemon index.js",
"cleanmac": "find . -name '.DS_Store' -type f -delete",
"release": "standard-version"
},
"devDependencies": {
"@fortawesome/fontawesome-svg-core": "^6.5.2",
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.1",
"eslint": "^8.56.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-prettier": "^5.1.3",
"mini-css-extract-plugin": "^2.9.0",
"nodaemon": "0.0.5",
"npm-check-updates": "^16.14.20",
"prettier": "^3.2.5",
"snazzy": "^9.0.0",
"snyk": "^1.1290.0",
"socket.io-client": "^4.7.5",
"source-map-loader": "^5.0.0",
"standard-version": "^9.5.0",
"terser-webpack-plugin": "^5.3.10",
"ts-loader": "^9.5.1",
"typescript": "^5.4.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-merge": "^5.10.0"
}
}

View file

@ -0,0 +1,45 @@
/* eslint-disable import/no-extraneous-dependencies */
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = {
context: path.resolve('__dirname', '../'),
resolve: {
// Add '.ts' and '.tsx' as resolvable extensions.
extensions: ['', '.webpack.js', '.web.js', '.ts', '.tsx', '.js'],
},
entry: {
webssh2: './client/src/js/index.ts',
},
plugins: [
new CleanWebpackPlugin(),
new CopyWebpackPlugin({
patterns: ['./client/src/client.htm', './client/src/favicon.ico'],
}),
new MiniCssExtractPlugin(),
],
output: {
filename: '[name].bundle.js',
path: path.resolve(__dirname, '../client/public'),
},
module: {
rules: [
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
},
// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'.
{
test: /\.tsx?$/,
loader: 'ts-loader',
},
// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'.
{
test: /\.js$/,
loader: 'source-map-loader',
},
],
},
};

View file

@ -0,0 +1,10 @@
/* eslint-disable import/no-extraneous-dependencies */
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
devtool: 'inline-source-map',
devServer: {
contentBase: '../client/public',
},
});

View file

@ -0,0 +1,19 @@
/* eslint-disable import/no-extraneous-dependencies */
const TerserPlugin = require('terser-webpack-plugin');
const { merge } = require('webpack-merge');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'production',
optimization: {
minimize: true,
minimizer: [
new TerserPlugin({
terserOptions: {
ie8: false,
safari10: false,
},
}),
],
},
});

111
app/server/app.js Normal file
View file

@ -0,0 +1,111 @@
/* jshint esversion: 6, asi: true, node: true */
/* eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }],
no-console: ["error", { allow: ["warn", "error", "info"] }] */
// app.js
// eslint-disable-next-line import/order
const config = require('./config');
const path = require('path');
const nodeRoot = path.dirname(require.main.filename);
const publicPath = path.join(nodeRoot, 'client', 'public');
const express = require('express');
const logger = require('morgan');
const app = express();
const server = require('http').createServer(app);
const favicon = require('serve-favicon');
const io = require('socket.io')(server, config.socketio);
const session = require('express-session')(config.express);
const appSocket = require('./socket');
const { setDefaultCredentials, basicAuth } = require('./util');
const { webssh2debug } = require('./logging');
const { reauth, connect, notfound, handleErrors } = require('./routes');
setDefaultCredentials(config.user);
// safe shutdown
let remainingSeconds = config.safeShutdownDuration;
let shutdownMode = false;
let shutdownInterval;
let connectionCount = 0;
// eslint-disable-next-line consistent-return
function safeShutdownGuard(req, res, next) {
if (!shutdownMode) return next();
res.status(503).end('Service unavailable: Server shutting down');
}
// express
app.use(safeShutdownGuard);
app.use(session);
if (config.accesslog) app.use(logger('common'));
app.disable('x-powered-by');
app.use(favicon(path.join(publicPath, 'favicon.ico')));
app.use(express.urlencoded({ extended: true }));
app.post('/ssh/host/:host?', connect);
app.post('/ssh', express.static(publicPath, config.express.ssh));
app.use('/ssh', express.static(publicPath, config.express.ssh));
app.use(basicAuth);
app.get('/ssh/reauth', reauth);
app.get('/ssh/host/:host?', connect);
app.use(notfound);
app.use(handleErrors);
// clean stop
function stopApp(reason) {
shutdownMode = false;
if (reason) console.info(`Stopping: ${reason}`);
clearInterval(shutdownInterval);
io.close();
server.close();
}
// bring up socket
io.on('connection', appSocket);
// socket.io
// expose express session with socket.request.session
io.use((socket, next) => {
socket.request.res ? session(socket.request, socket.request.res, next) : next(next); // eslint disable-line
});
function countdownTimer() {
if (!shutdownMode) clearInterval(shutdownInterval);
remainingSeconds -= 1;
if (remainingSeconds <= 0) {
stopApp('Countdown is over');
} else io.emit('shutdownCountdownUpdate', remainingSeconds);
}
const signals = ['SIGTERM', 'SIGINT'];
signals.forEach((signal) =>
process.on(signal, () => {
if (shutdownMode) stopApp('Safe shutdown aborted, force quitting');
if (!connectionCount > 0) stopApp('All connections ended');
shutdownMode = true;
console.error(
`\r\n${connectionCount} client(s) are still connected.\r\nStarting a ${remainingSeconds} seconds countdown.\r\nPress Ctrl+C again to force quit`
);
if (!shutdownInterval) shutdownInterval = setInterval(countdownTimer, 1000);
})
);
module.exports = { server, config };
const onConnection = (socket) => {
connectionCount += 1;
socket.on('disconnect', () => {
connectionCount -= 1;
if (connectionCount <= 0 && shutdownMode) {
stopApp('All clients disconnected');
}
});
socket.on('geometry', (cols, rows) => {
// TODO need to rework how we pass settings to ssh2, this is less than ideal
socket.request.session.ssh.cols = cols;
socket.request.session.ssh.rows = rows;
webssh2debug(socket, `SOCKET GEOMETRY: termCols = ${cols}, termRows = ${rows}`);
});
};
io.on('connection', onConnection);

136
app/server/config.js Normal file
View file

@ -0,0 +1,136 @@
/* eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }],
no-console: ["error", { allow: ["warn", "error", "info"] }] */
const fs = require('fs');
const path = require('path');
const debugWebSSH2 = require('debug')('WebSSH2');
const crypto = require('crypto');
const util = require('util');
const readconfig = require('read-config-ng');
const nodeRoot = path.dirname(require.main.filename);
const configPath = path.join(nodeRoot, 'config.json');
let myConfig;
// establish defaults
const configDefault = {
listen: {
ip: '0.0.0.0',
port: 2222,
},
socketio: {
serveClient: false,
path: '/ssh/socket.io',
origins: ['localhost:2222'],
},
express: {
secret: crypto.randomBytes(20).toString('hex'),
name: 'WebSSH2',
resave: true,
saveUninitialized: false,
unset: 'destroy',
ssh: {
dotfiles: 'ignore',
etag: false,
extensions: ['htm', 'html'],
index: false,
maxAge: '1s',
redirect: false,
setHeaders(res) {
res.set('x-timestamp', Date.now());
},
},
},
user: {
name: null,
password: null,
privatekey: null,
overridebasic: false,
},
ssh: {
host: null,
port: 22,
term: 'xterm-color',
readyTimeout: 20000,
keepaliveInterval: 120000,
keepaliveCountMax: 10,
allowedSubnets: [],
},
terminal: {
cursorBlink: true,
scrollback: 10000,
tabStopWidth: 8,
bellStyle: 'sound',
},
header: {
text: null,
background: 'green',
},
options: {
challengeButton: true,
allowreauth: true,
},
algorithms: {
kex: [
'ecdh-sha2-nistp256',
'ecdh-sha2-nistp384',
'ecdh-sha2-nistp521',
'diffie-hellman-group-exchange-sha256',
'diffie-hellman-group14-sha1',
],
cipher: [
'aes128-ctr',
'aes192-ctr',
'aes256-ctr',
'aes128-gcm',
'aes128-gcm@openssh.com',
'aes256-gcm',
'aes256-gcm@openssh.com',
'aes256-cbc',
],
hmac: ['hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1'],
compress: ['none', 'zlib@openssh.com', 'zlib'],
},
serverlog: {
client: false,
server: false,
},
accesslog: false,
verify: false,
safeShutdownDuration: 300,
};
// test if config.json exists, if not provide error message but try to run anyway
try {
if (!fs.existsSync(configPath)) {
console.error(
`\n\nERROR: Missing config.json for WebSSH2. Current config: ${util.inspect(myConfig)}`
);
console.error('\n See config.json.sample for details\n\n');
}
console.info(`WebSSH2 service reading config from: ${configPath}`);
const configFile = readconfig(configPath, { override: true });
// myConfig = merger.mergeObjects([configDefault, configFile]);
myConfig = { ...configDefault, ...configFile };
debugWebSSH2(`\nCurrent config: ${util.inspect(myConfig)}`);
} catch (err) {
myConfig = configDefault;
console.error(
`\n\nERROR: Missing config.json for WebSSH2. Current config: ${util.inspect(myConfig)}`
);
console.error('\n See config.json.sample for details\n\n');
console.error(`ERROR:\n\n ${err}`);
}
const config = myConfig;
if (process.env.LISTEN) config.listen.ip = process.env.LISTEN;
if (process.env.PORT) config.listen.port = process.env.PORT;
if (process.env.SOCKETIO_ORIGINS) config.socketio.origins = process.env.SOCKETIO_ORIGINS;
if (process.env.SOCKETIO_PATH) config.socketio.path = process.env.SOCKETIO_PATH;
if (process.env.SOCKETIO_SERVECLIENT)
config.socketio.serveClient = process.env.SOCKETIO_SERVECLIENT;
module.exports = config;

36
app/server/form.html Normal file
View file

@ -0,0 +1,36 @@
<head><title>Post Test</title></head>
<html>
<body>
<h1>Credentials over HTTP POST test</h1>
<p>This is a test to demonstrate sending credentials over POST instead of requiring HTTP Basic. If you use this, be sure to secure the app/site with HTTPS!</p>
<form method="POST" action="http://localhost:2222/ssh/host/192.168.0.1">
<p>
<label for="username">Username</label>
<input name="username">
</p>
<label for="userpassword">Password</label>
<input name="userpassword" type="password">
</p>
<p>
<label for="header">Header text</label>
<input name="header" value="This is a test">
<p>
<label for="headerBackground">Header Background Color</label>
<input name="headerBackground" value="red">
</p>
<fieldset>
<legend>Cursor Blink:</legend>
<div>
<input type="radio" id="false" name="cursorBlink" value="false"
checked>
<label for="false">False</label>
</div>
<div>
<input type="radio" id="true" name="cursorBlink" value="true">
<label for="true">True</label>
</div>
</fieldset>
<button>Login</button>
</form>
</body>
</html>

47
app/server/logging.js Normal file
View file

@ -0,0 +1,47 @@
/* eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }],
no-console: ["error", { allow: ["warn", "error", "info"] }] */
/* jshint esversion: 6, asi: true, node: true */
// logging.js
// private
const debug = require('debug');
const util = require('util');
/**
* generate consistent prefix for log messages
* with epress session id and socket session id
* @param {object} socket Socket information
*/
function prefix(socket) {
return `(${socket.request.sessionID}/${socket.id})`;
}
// public
function webssh2debug(socket, msg) {
debug('WebSSH2')(`${prefix(socket)} ${msg}`);
}
/**
* audit log to console
* @param {object} socket Socket information
* @param {object} msg log message
*/
function auditLog(socket, msg) {
console.info(`WebSSH2 ${prefix(socket)} AUDIT: ${msg}`);
}
/**
* logs error to socket client (if connected)
* and console.
* @param {object} socket Socket information
* @param {string} myFunc Function calling this function
* @param {object} err error object or error message
*/
function logError(socket, myFunc, err) {
console.error(`WebSSH2 ${prefix(socket)} ERROR: ${myFunc}: ${err}`);
webssh2debug(socket, `logError: ${myFunc}: ${util.inspect(err)}`);
if (!socket.request.session) return;
socket.emit('ssherror', `SSH ${myFunc}: ${err}`);
}
module.exports = { logError, auditLog, webssh2debug };

203
app/server/routes.js Normal file
View file

@ -0,0 +1,203 @@
/* eslint-disable no-console */
// ssh.js
const validator = require('validator');
const path = require('path');
const nodeRoot = path.dirname(require.main.filename);
const publicPath = path.join(nodeRoot, 'client', 'public');
const { parseBool } = require('./util');
const config = require('./config');
exports.reauth = function reauth(req, res) {
let { referer } = req.headers;
if (!validator.isURL(referer, { host_whitelist: ['localhost'] })) {
console.error(
`WebSSH2 (${req.sessionID}) ERROR: Referrer '${referer}' for '/reauth' invalid. Setting to '/' which will probably fail.`
);
referer = '/';
}
res
.status(401)
.send(
`<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0; url=${referer}"></head><body bgcolor="#000"></body></html>`
);
};
exports.connect = function connect(req, res) {
res.sendFile(path.join(path.join(publicPath, 'client.htm')));
let { host, port } = config.ssh;
let { text: header, background: headerBackground } = config.header;
let { term: sshterm, readyTimeout } = config.ssh;
let {
cursorBlink,
scrollback,
tabStopWidth,
bellStyle,
fontSize,
fontFamily,
letterSpacing,
lineHeight,
} = config.terminal;
// capture, assign, and validate variables
if (req.params?.host) {
if (
validator.isIP(`${req.params.host}`) ||
validator.isFQDN(req.params.host) ||
/^(([a-z]|[A-Z]|\d|[!^(){}\-_~])+)?\w$/.test(req.params.host)
) {
host = req.params.host;
}
}
if (req.method === 'POST' && req.body.username && req.body.userpassword) {
req.session.username = req.body.username;
req.session.userpassword = req.body.userpassword;
if (req.body.port && validator.isInt(`${req.body.port}`, { min: 1, max: 65535 }))
port = req.body.port;
if (req.body.header) header = req.body.header;
if (req.body.headerBackground) {
headerBackground = req.body.headerBackground;
console.log(`background: ${req.body.headerBackground}`);
}
if (req.body.sshterm && /^(([a-z]|[A-Z]|\d|[!^(){}\-_~])+)?\w$/.test(req.body.sshterm))
sshterm = req.body.sshterm;
if (req.body.cursorBlink && validator.isBoolean(`${req.body.cursorBlink}`))
cursorBlink = parseBool(req.body.cursorBlink);
if (req.body.scrollback && validator.isInt(`${req.body.scrollback}`, { min: 1, max: 200000 }))
scrollback = req.body.scrollback;
if (req.body.tabStopWidth && validator.isInt(`${req.body.tabStopWidth}`, { min: 1, max: 100 }))
tabStopWidth = req.body.tabStopWidth;
if (req.body.bellStyle && ['sound', 'none'].indexOf(req.body.bellStyle) > -1)
bellStyle = req.body.bellStyle;
if (
req.body.readyTimeout &&
validator.isInt(`${req.body.readyTimeout}`, { min: 1, max: 300000 })
)
readyTimeout = req.body.readyTimeout;
if (req.body.fontSize && validator.isNumeric(`${req.body.fontSize}`))
fontSize = req.body.fontSize;
if (req.body.fontFamily) fontFamily = req.body.fontFamily;
if (req.body.letterSpacing && validator.isNumeric(`${req.body.letterSpacing}`))
letterSpacing = req.body.letterSpacing;
if (req.body.lineHeight && validator.isNumeric(`${req.body.lineHeight}`))
lineHeight = req.body.lineHeight;
}
if (req.method === 'GET') {
if (req.query?.port && validator.isInt(`${req.query.port}`, { min: 1, max: 65535 }))
port = req.query.port;
if (req.query?.header) header = req.query.header;
if (req.query?.headerBackground) headerBackground = req.query.headerBackground;
if (req.query?.sshterm && /^(([a-z]|[A-Z]|\d|[!^(){}\-_~])+)?\w$/.test(req.query.sshterm))
sshterm = req.query.sshterm;
if (req.query?.cursorBlink && validator.isBoolean(`${req.query.cursorBlink}`))
cursorBlink = parseBool(req.query.cursorBlink);
if (
req.query?.scrollback &&
validator.isInt(`${req.query.scrollback}`, { min: 1, max: 200000 })
)
scrollback = req.query.scrollback;
if (
req.query?.tabStopWidth &&
validator.isInt(`${req.query.tabStopWidth}`, { min: 1, max: 100 })
)
tabStopWidth = req.query.tabStopWidth;
if (req.query?.bellStyle && ['sound', 'none'].indexOf(req.query.bellStyle) > -1)
bellStyle = req.query.bellStyle;
if (
req.query?.readyTimeout &&
validator.isInt(`${req.query.readyTimeout}`, { min: 1, max: 300000 })
)
readyTimeout = req.query.readyTimeout;
if (req.query?.fontSize && validator.isNumeric(`${req.query.fontSize}`))
fontSize = req.query.fontSize;
if (req.query?.fontFamily) fontFamily = req.query.fontFamily;
if (req.query?.lineHeight && validator.isNumeric(`${req.query.lineHeight}`))
lineHeight = req.query.lineHeight;
if (req.query?.letterSpacing && validator.isNumeric(`${req.query.letterSpacing}`))
letterSpacing = req.query.letterSpacing;
}
req.session.ssh = {
host,
port,
localAddress: config.ssh.localAddress,
localPort: config.ssh.localPort,
header: {
name: header,
background: headerBackground,
},
algorithms: config.algorithms,
keepaliveInterval: config.ssh.keepaliveInterval,
keepaliveCountMax: config.ssh.keepaliveCountMax,
allowedSubnets: config.ssh.allowedSubnets,
term: sshterm,
terminal: {
cursorBlink,
scrollback,
tabStopWidth,
bellStyle,
fontSize,
fontFamily,
letterSpacing,
lineHeight,
},
cols: null,
rows: null,
allowreplay:
config.options.challengeButton ||
(validator.isBoolean(`${req.headers.allowreplay}`)
? parseBool(req.headers.allowreplay)
: false),
allowreauth: config.options.allowreauth || false,
mrhsession:
validator.isAlphanumeric(`${req.headers.mrhsession}`) && req.headers.mrhsession
? req.headers.mrhsession
: 'none',
serverlog: {
client: config.serverlog.client || false,
server: config.serverlog.server || false,
},
readyTimeout,
};
if (req.session.ssh.header.name) validator.escape(req.session.ssh.header.name);
if (req.session.ssh.header.background) validator.escape(req.session.ssh.header.background);
};
exports.notfound = function notfound(_req, res) {
res.status(404).send("Sorry, can't find that!");
};
exports.handleErrors = function handleErrors(err, _req, res) {
console.error(err.stack);
res.status(500).send('Something broke!');
};

241
app/server/socket.js Normal file
View file

@ -0,0 +1,241 @@
/* eslint-disable complexity */
/* eslint no-unused-expressions: ["error", { "allowShortCircuit": true, "allowTernary": true }],
no-console: ["error", { allow: ["warn", "error"] }] */
/* jshint esversion: 6, asi: true, node: true */
// socket.js
// private
const debug = require('debug');
const SSH = require('ssh2').Client;
const CIDRMatcher = require('cidr-matcher');
const validator = require('validator');
const dnsPromises = require('dns').promises;
const util = require('util');
const { webssh2debug, auditLog, logError } = require('./logging');
/**
* parse conn errors
* @param {object} socket Socket object
* @param {object} err Error object
*/
function connError(socket, err) {
let msg = util.inspect(err);
const { session } = socket.request;
if (err?.level === 'client-authentication') {
msg = `Authentication failure user=${session.username} from=${socket.handshake.address}`;
socket.emit('allowreauth', session.ssh.allowreauth);
socket.emit('reauth');
}
if (err?.code === 'ENOTFOUND') {
msg = `Host not found: ${err.hostname}`;
}
if (err?.level === 'client-timeout') {
msg = `Connection Timeout: ${session.ssh.host}`;
}
logError(socket, 'CONN ERROR', msg);
}
/**
* check ssh host is in allowed subnet
* @param {object} socket Socket information
*/
async function checkSubnet(socket) {
let ipaddress = socket.request.session.ssh.host;
if (!validator.isIP(`${ipaddress}`)) {
try {
const result = await dnsPromises.lookup(socket.request.session.ssh.host);
ipaddress = result.address;
} catch (err) {
logError(
socket,
'CHECK SUBNET',
`${err.code}: ${err.hostname} user=${socket.request.session.username} from=${socket.handshake.address}`
);
socket.emit('ssherror', '404 HOST IP NOT FOUND');
socket.disconnect(true);
return;
}
}
const matcher = new CIDRMatcher(socket.request.session.ssh.allowedSubnets);
if (!matcher.contains(ipaddress)) {
logError(
socket,
'CHECK SUBNET',
`Requested host ${ipaddress} outside configured subnets / REJECTED user=${socket.request.session.username} from=${socket.handshake.address}`
);
socket.emit('ssherror', '401 UNAUTHORIZED');
socket.disconnect(true);
}
}
// public
module.exports = function appSocket(socket) {
let login = false;
socket.once('disconnecting', (reason) => {
webssh2debug(socket, `SOCKET DISCONNECTING: ${reason}`);
if (login === true) {
auditLog(
socket,
`LOGOUT user=${socket.request.session.username} from=${socket.handshake.address} host=${socket.request.session.ssh.host}:${socket.request.session.ssh.port}`
);
login = false;
}
});
async function setupConnection() {
// if websocket connection arrives without an express session, kill it
if (!socket.request.session) {
socket.emit('401 UNAUTHORIZED');
webssh2debug(socket, 'SOCKET: No Express Session / REJECTED');
socket.disconnect(true);
return;
}
// If configured, check that requsted host is in a permitted subnet
if (socket.request.session?.ssh?.allowedSubnets?.length > 0) {
checkSubnet(socket);
}
const conn = new SSH();
conn.on('banner', (data) => {
// need to convert to cr/lf for proper formatting
socket.emit('data', data.replace(/\r?\n/g, '\r\n').toString('utf-8'));
});
conn.on('handshake', () => {
socket.emit('setTerminalOpts', socket.request.session.ssh.terminal);
socket.emit('menu');
socket.emit('allowreauth', socket.request.session.ssh.allowreauth);
socket.emit('title', `ssh://${socket.request.session.ssh.host}`);
if (socket.request.session.ssh.header.background)
socket.emit('headerBackground', socket.request.session.ssh.header.background);
if (socket.request.session.ssh.header.name)
socket.emit('header', socket.request.session.ssh.header.name);
socket.emit(
'footer',
`ssh://${socket.request.session.username}@${socket.request.session.ssh.host}:${socket.request.session.ssh.port}`
);
});
conn.on('ready', () => {
webssh2debug(
socket,
`CONN READY: LOGIN: user=${socket.request.session.username} from=${socket.handshake.address} host=${socket.request.session.ssh.host} port=${socket.request.session.ssh.port} allowreplay=${socket.request.session.ssh.allowreplay} term=${socket.request.session.ssh.term}`
);
auditLog(
socket,
`LOGIN user=${socket.request.session.username} from=${socket.handshake.address} host=${socket.request.session.ssh.host}:${socket.request.session.ssh.port}`
);
login = true;
socket.emit('status', 'SSH CONNECTION ESTABLISHED');
socket.emit('statusBackground', 'green');
socket.emit('allowreplay', socket.request.session.ssh.allowreplay);
const { term, cols, rows } = socket.request.session.ssh;
conn.shell({ term, cols, rows }, (err, stream) => {
if (err) {
logError(socket, `EXEC ERROR`, err);
conn.end();
socket.disconnect(true);
return;
}
socket.once('disconnect', (reason) => {
webssh2debug(socket, `CLIENT SOCKET DISCONNECT: ${util.inspect(reason)}`);
conn.end();
socket.request.session.destroy();
});
socket.on('error', (errMsg) => {
webssh2debug(socket, `SOCKET ERROR: ${errMsg}`);
logError(socket, 'SOCKET ERROR', errMsg);
conn.end();
socket.disconnect(true);
});
socket.on('control', (controlData) => {
if (controlData === 'replayCredentials' && socket.request.session.ssh.allowreplay) {
stream.write(`${socket.request.session.userpassword}\n`);
}
if (controlData === 'reauth' && socket.request.session.username && login === true) {
auditLog(
socket,
`LOGOUT user=${socket.request.session.username} from=${socket.handshake.address} host=${socket.request.session.ssh.host}:${socket.request.session.ssh.port}`
);
login = false;
conn.end();
socket.disconnect(true);
}
webssh2debug(socket, `SOCKET CONTROL: ${controlData}`);
});
socket.on('resize', (data) => {
stream.setWindow(data.rows, data.cols);
webssh2debug(socket, `SOCKET RESIZE: ${JSON.stringify([data.rows, data.cols])}`);
});
socket.on('data', (data) => {
stream.write(data);
});
stream.on('data', (data) => {
socket.emit('data', data.toString('utf-8'));
});
stream.on('close', (code, signal) => {
webssh2debug(socket, `STREAM CLOSE: ${util.inspect([code, signal])}`);
if (socket.request.session?.username && login === true) {
auditLog(
socket,
`LOGOUT user=${socket.request.session.username} from=${socket.handshake.address} host=${socket.request.session.ssh.host}:${socket.request.session.ssh.port}`
);
login = false;
}
if (code !== 0 && typeof code !== 'undefined')
logError(socket, 'STREAM CLOSE', util.inspect({ message: [code, signal] }));
socket.disconnect(true);
conn.end();
});
stream.stderr.on('data', (data) => {
console.error(`STDERR: ${data}`);
});
});
});
conn.on('end', (err) => {
if (err) logError(socket, 'CONN END BY HOST', err);
webssh2debug(socket, 'CONN END BY HOST');
socket.disconnect(true);
});
conn.on('close', (err) => {
if (err) logError(socket, 'CONN CLOSE', err);
webssh2debug(socket, 'CONN CLOSE');
socket.disconnect(true);
});
conn.on('error', (err) => connError(socket, err));
conn.on('keyboard-interactive', (_name, _instructions, _instructionsLang, _prompts, finish) => {
webssh2debug(socket, 'CONN keyboard-interactive');
finish([socket.request.session.userpassword]);
});
if (
socket.request.session.username &&
(socket.request.session.userpassword || socket.request.session.privatekey) &&
socket.request.session.ssh
) {
// console.log('hostkeys: ' + hostkeys[0].[0])
const { ssh } = socket.request.session;
ssh.username = socket.request.session.username;
ssh.password = socket.request.session.userpassword;
ssh.tryKeyboard = true;
ssh.debug = debug('ssh2');
conn.connect(ssh);
} else {
webssh2debug(
socket,
`CONN CONNECT: Attempt to connect without session.username/password or session varialbles defined, potentially previously abandoned client session. disconnecting websocket client.\r\nHandshake information: \r\n ${util.inspect(
socket.handshake
)}`
);
socket.emit('ssherror', 'WEBSOCKET ERROR - Refresh the browser and try again');
socket.request.session.destroy();
socket.disconnect(true);
}
}
setupConnection();
};

47
app/server/util.js Normal file
View file

@ -0,0 +1,47 @@
/* jshint esversion: 6, asi: true, node: true */
// util.js
// private
const debug = require('debug')('WebSSH2');
const Auth = require('basic-auth');
let defaultCredentials = { username: null, password: null, privatekey: null };
exports.setDefaultCredentials = function setDefaultCredentials({
name: username,
password,
privatekey,
overridebasic,
}) {
defaultCredentials = { username, password, privatekey, overridebasic };
};
exports.basicAuth = function basicAuth(req, res, next) {
const myAuth = Auth(req);
// If Authorize: Basic header exists and the password isn't blank
// AND config.user.overridebasic is false, extract basic credentials
// from client]
const { username, password, privatekey, overridebasic } = defaultCredentials;
if (myAuth && myAuth.pass !== '' && !overridebasic) {
req.session.username = myAuth.name;
req.session.userpassword = myAuth.pass;
debug(`myAuth.name: ${myAuth.name} and password ${myAuth.pass ? 'exists' : 'is blank'}`);
} else {
req.session.username = username;
req.session.userpassword = password;
req.session.privatekey = privatekey;
}
if (!req.session.userpassword && !req.session.privatekey) {
res.statusCode = 401;
debug('basicAuth credential request (401)');
res.setHeader('WWW-Authenticate', 'Basic realm="WebSSH"');
res.end('Username and password required for web SSH service.');
return;
}
next();
};
// takes a string, makes it boolean (true if the string is true, false otherwise)
exports.parseBool = function parseBool(str) {
return str.toLowerCase() === 'true';
};

BIN
bun.lockb Executable file

Binary file not shown.

View file

@ -1,21 +0,0 @@
{
"listen": {
"ip": "127.0.0.1",
"port": 2222
},
"user": {
"name": null,
"password": null
},
"ssh": {
"host": null,
"port": 22
},
"header": {
"text": "My Header",
"background": "green"
},
"options": {
"challengeButton": true
}
}

117
index.js
View file

@ -1,117 +0,0 @@
/*
* WebSSH2 - Web to SSH2 gateway
* Bill Church - https://github.com/billchurch - April 2016
*
*/
var express = require('express');
var app = express();
var cookieParser = require('cookie-parser')
var server = require('http').Server(app);
var io = require('socket.io')(server);
var path = require('path');
var basicAuth = require('basic-auth');
var ssh = require('ssh2');
var readConfig = require('read-config'),
config = readConfig(__dirname + '/config.json');
function logErrors(err, req, res, next) {
console.error(err.stack);
next(err);
}
server.listen({
host: config.listen.ip,
port: config.listen.port
}).on('error', function (err) {
if (err.code === 'EADDRINUSE') {
config.listen.port++;
console.log('Address in use, retrying on port ' + config.listen.port);
setTimeout(function () {
server.listen(config.listen.port);
}, 250);
}
});
app.use(express.static(__dirname + '/public')).use(function(req, res, next) {
var myAuth = basicAuth(req);
if (myAuth === undefined) {
res.statusCode = 401;
res.setHeader('WWW-Authenticate', 'Basic realm="WebSSH"');
res.end('Username and password required for web SSH service.');
} else {
config.user.name = myAuth.name;
config.user.password = myAuth.pass;
next();
}
}).use(cookieParser()).get('/ssh/host/:host?', function(req, res) {
res.sendFile(path.join(__dirname + '/public/client.htm'));
config.ssh.host = req.params.host;
if (typeof req.query.port !== 'undefined' && req.query.port !== null){ config.host.port = req.query.port;}
if (typeof req.query.header !== 'undefined' && req.query.header !== null){ config.header.text = req.query.header;}
if (typeof req.query.headerBackground !== 'undefined' && req.query.headerBackground !== null){ config.header.background = req.query.headerBackground;}
console.log ('webssh2 Login: user=' + config.user.name + ' from=' + req.ip + ' host=' + config.ssh.host + ' port=' + config.ssh.port + ' sessionID=' + req.headers['sessionid'] + ' allowreplay=' + req.headers['allowreplay']);
console.log ('Headers: ' + JSON.stringify(req.headers));
config.options.allowreplay = req.headers['allowreplay'];
}).use('/style',express.static(__dirname + '/public')).use('/src',express.static(__dirname + '/node_modules/xterm/dist')).use('/addons',express.static(__dirname + '/node_modules/xterm/dist/addons'));
io.on('connection', function(socket) {
var conn = new ssh();
conn.on('banner', function(d) {
//need to convert to cr/lf for proper formatting
d = d.replace(/\n/g, "\r\n");
socket.emit('data', d.toString('binary'));
}).on('ready', function() {
socket.emit('title', 'ssh://' + config.ssh.host);
socket.emit('headerBackground', config.header.background);
socket.emit('header', config.header.text);
socket.emit('footer', 'ssh://' + config.user.name + '@' + config.ssh.host + ':' + config.ssh.port);
socket.emit('status', 'SSH CONNECTION ESTABLISHED');
socket.emit('statusBackground', 'green');
socket.emit('allowreplay', config.options.allowreplay)
conn.shell(function(err, stream) {
if (err) return socket.emit('status', 'SSH EXEC ERROR: ' + err.message).emit('statusBackground', 'red');
socket.on('data', function(data) {
stream.write(data);
});
socket.on('control', function(controlData) {
switch(controlData) {
case 'replayCredentials':
stream.write(config.user.password + '\n');
default:
console.log ('controlData: '+ controlData);
};
});
stream.on('data', function(d) {
socket.emit('data', d.toString('binary'));
}).on('close', function() {
conn.end();
});
});
}).on('end', function() {
socket.emit('status', 'SSH CONNECTION CLOSED BY HOST');
socket.emit('statusBackground', 'red');
}).on('close', function() {
socket.emit('status', 'SSH CONNECTION CLOSED');
socket.emit('statusBackground', 'red');
}).on('error', function(error) {
socket.emit('status', 'SSH CONNECTION ERROR - ' + error);
socket.emit('statusBackground', 'red');
}).on('keyboard-interactive', function(name, instructions, instructionsLang, prompts, finish) {
console.log('Connection :: keyboard-interactive');
finish([config.user.password]);
}).connect({
host: config.ssh.host,
port: config.ssh.port,
username: config.user.name,
password: config.user.password,
tryKeyboard: true,
// some cisco routers need the these cipher strings
algorithms: {
'cipher': ['aes128-cbc', '3des-cbc', 'aes256-cbc'],
'hmac': ['hmac-sha1', 'hmac-sha1-96', 'hmac-md5-96']
}
});
});

View file

@ -1,41 +1,6 @@
{ {
"name": "WebSSH2", "dependencies": {},
"version": "0.0.2", "devDependencies": {
"ignore": [ "bun-types": "^1.0.1"
".gitignore"
],
"bin": "./index.js",
"description": "A Websocket to SSH2 gateway using term.js, socket.io, ssh2, and express",
"homepage": "https://github.com/billchurch/WebSSH2",
"keywords": "ssh webssh terminal webterminal",
"license": "SEE LICENSE IN FILE - LICENSE",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/billchurch/WebSSH2.git"
},
"contributors": [
{
"name": "Bill Church",
"email": "wmchurch@gmail.com"
}
],
"engines": {
"node": "0.12.7"
},
"bugs": {
"url" : "https://github.com/billchurch/WebSSH2/issues"
},
"dependencies": {
"basic-auth": "^1.1.0",
"cookie-parser": "^1.4.3",
"express": "^4.14.1",
"read-config": "^1.6.0",
"socket.io": "^1.6.0",
"ssh2": "^0.5.4",
"xterm": "^2.2.3"
},
"scripts": {
"start": "node index"
} }
} }

View file

@ -1,22 +0,0 @@
<html>
<head>
<title>Web SSH</title>
<link rel="stylesheet" href="/src/xterm.css" />
<link rel="stylesheet" href="/style/style.css" />
<script src="/socket.io/socket.io.js"></script>
<script src="/src/xterm.js"></script>
<script src="/addons/fit/fit.js"></script>
<script src="/client.js" defer></script>
</head>
<body>
<div class="box">
<div id="header"></div>
<div id="terminal-container" class="terminal"></div>
<div id="bottomdiv">
<div id="footer"></div>
<div id="status"></div>
<div id="credentials"><a class="credentials" href="" onclick="return false;">CREDENTIALS</a></div>
</div>
</div>
</body>
</html>

View file

@ -1,71 +0,0 @@
var terminalContainer = document.getElementById('terminal-container'),
term = new Terminal({
cursorBlink: true
}),
socket,
termid;
term.open(terminalContainer);
term.fit();
var cols = term.cols,
rows = term.rows;
if (document.location.pathname) {
var parts = document.location.pathname.split('/'),
base = parts.slice(0, parts.length - 1).join('/') + '/',
resource = base.substring(1) + 'socket.io';
socket = io.connect(null, {
resource: resource
});
} else {
socket = io.connect();
}
var credentialReplay = document.getElementById('credentials')
credentialReplay.onclick = replayCredentials;
function replayCredentials() {
socket.emit('control', 'replayCredentials');
//term.writeln('sending credentials');
return true;
}
socket.emit('create', term.cols, term.rows, function(err, data) {
if (err) return self._destroy();
self.pty = data.pty;
self.id = data.id;
termid = self.id;
term.emit('open tab', self);
});
socket.on('connect', function() {
term.on('data', function(data) {
socket.emit('data', data);
});
socket.on('title', function(data) {
document.title = data;
}).on('status', function(data) {
document.getElementById('status').innerHTML = data;
}).on('headerBackground', function(data) {
document.getElementById('header').style.backgroundColor = data;
}).on('header', function(data) {
document.getElementById('header').innerHTML = data;
}).on('footer', function(data) {
document.getElementById('footer').innerHTML = data;
}).on('statusBackground', function(data) {
document.getElementById('status').style.backgroundColor = data;
}).on('allowreplay', function(data) {
console.log ('allowreplay: ' + data);
if (data == 'true') {
document.getElementById('credentials').style.display = 'inline';
console.log ('display: block');
} else {
document.getElementById('credentials').style.display = 'none';
console.log ('display: none');
}
}).on('data', function(data) {
term.write(data);
}).on('disconnect', function() {
document.getElementById('status').style.backgroundColor = 'red';
document.getElementById('status').innerHTML = 'WEBSOCKET SERVER DISCONNECTED';
socket.io.reconnection(false);
}).on('error', function(err) {
document.getElementById('status').style.backgroundColor = 'red';
document.getElementById('status').innerHTML = 'ERROR ' + err;
});
});

View file

@ -1,92 +0,0 @@
body {
font-family: helvetica, sans-serif, arial;
font-size: 1em;
color: #111;
background-color: rgb(0, 0, 0);
color: rgb(240, 240, 240);
height: 100%;
margin: 0;
}
#header {
color: rgb(240, 240, 240);
background-color: rgb(0, 128, 0);
width: 100%;
border-color: white;
border-style: none none solid none;
border-width: 1px;
text-align: center;
flex: 0 1 auto;
z-index: 99;
}
.box {
display: flex;
flex-flow: column;
height: 100%;
}
#terminal-container {
flex: 1 1 auto;
width: 100%;
margin: 0 auto;
padding: 2px;
}
#terminal-container .terminal {
background-color: #000000;
color: #fafafa;
padding: 2px;
}
#terminal-container .terminal:focus .terminal-cursor {
background-color: #fafafa;
}
#bottomdiv {
width: 100%;
background-color: rgb(50, 50, 50);
border-color: white;
border-style: solid none none none;
border-width: 1px;
z-index: 99;
flex: 0 1 30px;
}
#footer {
display: inline-block;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 10px;
padding-right: 10px;
text-align: left;
}
#status {
display: inline-block;
color: rgb(240, 240, 240);
background-color: rgb(50, 50, 50);
padding-left: 10px;
padding-right: 10px;
border-color: white;
border-style: none solid none solid;
border-width: 1px;
text-align: left;
z-index: 100;
}
#credentials {
display: inline-block;
color: rgb(51, 51, 51);
background-color: rgb(255, 127, 0);
padding-left: 10px;
padding-right: 10px;
border-color: white;
border-style: none solid none none;
border-width: 1px;
text-align: left;
z-index: 100;
}
a.credentials {
color: rgb(51, 51, 51);
text-decoration: none;
}

View file

@ -0,0 +1,14 @@
{
"changelogPath": "CHANGELOG.md",
"include-v-in-tags": false,
"prerelease": true,
"packages": {
"app": {
"releaseType": "node",
"draft": false,
"bumpMinorPreMajor": false,
"bumpPatchForMinorPreMajor": false,
"versioning": "default"
}
}
}