Add WebSSH Client

This commit is contained in:
Taylor Helsper 2019-11-22 22:27:35 -06:00
parent ed7a7a5422
commit 84cdcd3a79
4 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,24 @@
# WebSSH2 service
# /etc/systemd/system/webssh2.service
[Unit]
Description=WebSSH2
Wants=www.service
After=www.service
[Service]
WorkingDirectory=/opt/mynode/webssh2
ExecStart=/usr/bin/docker run --rm --name webssh2 -p 2222:2222 webssh2
User=root
Group=root
Type=simple
TimeoutSec=240
Restart=always
RestartSec=60
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=webssh2
[Install]
WantedBy=multi-user.target

View File

@ -17,6 +17,7 @@ ufw allow 10080 comment 'allow Lightning REST RPC'
ufw allow 9735 comment 'allow Lightning'
ufw allow 8333 comment 'allow Bitcoin mainnet'
ufw allow 18333 comment 'allow Bitcoin testnet'
ufw allow 2222 comment 'allow WebSSH2'
ufw allow 3000 comment 'allow LndHub'
ufw allow 3002 comment 'allow BTC RPC Explorer'
#ufw allow 3004 comment 'allow LND Admin'

View File

@ -179,7 +179,7 @@ if [ $IS_PREMIUM -eq 1 ]; then
python setupall.py --client-bitcoin
deactivate
#echo $JOINMARKET_VERSION > $JOINMARKET_VERSION_FILE
echo $JOINMARKET_VERSION > $JOINMARKET_VERSION_FILE
fi
fi
@ -227,6 +227,28 @@ if [ "$CURRENT" != "$BTCRPCEXPLORER_UPGRADE_URL" ]; then
echo $BTCRPCEXPLORER_UPGRADE_URL > $BTCRPCEXPLORER_UPGRADE_URL_FILE
fi
# Upgrade WebSSH2
WEBSSH2_UPGRADE_URL=https://github.com/billchurch/webssh2/archive/v0.2.10-0.tar.gz
WEBSSH2_UPGRADE_URL_FILE=/home/bitcoin/.mynode/.webssh2_url
CURRENT=""
if [ -f WEBSSH2_UPGRADE_URL_FILE ]; then
CURRENT=$(cat $WEBSSH2_UPGRADE_URL_FILE)
fi
if [ "$CURRENT" != "$WEBSSH2_UPGRADE_URL" ]; then
cd /opt/mynode
rm -rf webssh2
wget $WEBSSH2_UPGRADE_URL -O webssh2.tar.gz
tar -xvf webssh2.tar.gz
rm webssh2.tar.gz
mv webssh2-* webssh2
cd webssh2
mv app/config.json.sample app/config.json
docker build -t webssh2 .
echo $WEBSSH2_UPGRADE_URL > $WEBSSH2_UPGRADE_URL_FILE
fi
# Install ngrok for debugging
if [ ! -f /usr/bin/ngrok ]; then
cd /tmp
@ -247,6 +269,7 @@ systemctl enable usb_driver_check
systemctl enable https
systemctl enable glances
systemctl enable netdata
systemctl enable webssh2
# Disable any old services
sudo systemctl disable hitch

View File

@ -237,6 +237,11 @@
window.open(url,'_blank');
})
$("#linux_terminal").on("click", function() {
url = 'http://'+location.hostname+':2222/ssh/host/'+location.hostname
window.open(url,'_blank');
})
$( function() {
var downloadHandle = $( "#download-handle" );
var uploadHandle = $( "#upload-handle" );
@ -371,6 +376,12 @@
<a id="glances" class="ui-button ui-widget ui-corner-all settings_button_small" href="#">Open Glances</a>
</td>
</tr>
<tr>
<td>Manage</td>
<td style="padding-left: 20px;">
<a id="linux_terminal" class="ui-button ui-widget ui-corner-all settings_button_small" href="#">Linux Terminal</a>
</td>
</tr>
<tr>
<td>Disk Usage</td>
<td style="padding-left: 20px;">{{drive_usage}}</td>