11 Commits

Author SHA1 Message Date
pnetlabrepo
5d87b347db Update version 2023-01-27 20:29:07 -03:00
pnetlabrepo
934e4a3b6f Update CHANGELOG.md 2023-01-27 20:26:57 -03:00
pnetlabrepo
f0e44eac89 Update README.md 2023-01-27 20:19:40 -03:00
pnetlabrepo
33a005a668 Update ishare2 2023-01-27 20:17:45 -03:00
pnetlabrepo
34e3e04b28 Add files via upload 2023-01-27 19:48:23 -03:00
pnetlabrepo
0842c81b1f Add files via upload 2023-01-27 19:10:30 -03:00
pnetlabrepo
027998440a Add files via upload 2023-01-26 18:56:51 -03:00
pnetlabrepo
d19f216c96 Delete app.zip 2023-01-26 18:56:41 -03:00
pnetlabrepo
059a95ef96 Add files via upload 2023-01-25 16:55:59 -03:00
pnetlabrepo
f2a5162a71 Add files via upload 2023-01-25 14:51:27 -03:00
pnetlabrepo
2cae70f6d3 Create README.md 2023-01-25 14:51:06 -03:00
7 changed files with 151 additions and 1 deletions

View File

@@ -1,6 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file. You can upgrade ishare2 to the latest version using `ishare2 upgrade` and then selecting `option 1`
## [v1.5.7] - 2023-Jan-27
1) Added: A new feature has been added to ishare2: It is a web app to use ishare2 in browser and it is called `ishare2 GUI`. You can download it by using `ishare2 gui download` and then start it with `ishare2 gui start`. Open your web browser using http://localhost:5000, http://127.0.01:5000 or http://pnetlab_ip_address:5000 to access. Also, it can be stopped by using `ishare2 gui stop` and restarted with `ishare2 gui restart`
## [v1.5.6] - 2023-Jan-25
1) Added: A new option was added to `ishare2 upgrade` > `option 2`: Now, it is possible to upgrade PNETLab from almost any version to v5.3.0 (Not possible for this case: 6.x to 5.3.0)

View File

@@ -33,6 +33,7 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
relicense : Generate a new iourc license for bin images
upgrade : Retrieves a menu that allows users to upgrade ishare2 and PNETLab VM
changelog : Show the latest changes made to ishare2
gui : Web app to use ishare2 in browser
help : Show useful information
param1:
@@ -94,6 +95,12 @@ wget -O /usr/sbin/ishare2 https://raw.githubusercontent.com/pnetlabrepo/ishare2/
- ishare2 mylabs <path> <number>
- ishare2 mylabs <path> all
## 💎 GUI
- ishare2 gui download
- ishare2 gui start
- ishare2 gui stop
- ishare2 gui restart
## 💎 Extras
- ishare2 relicense
- ishare2 upgrade

1
gui/README.md Normal file
View File

@@ -0,0 +1 @@
Complete this README.md

BIN
gui/app.zip Normal file

Binary file not shown.

63
gui/requirements.txt Normal file
View File

@@ -0,0 +1,63 @@
anyio==3.6.2
asgiref==3.4.1
blinker==1.4
certifi==2018.1.18
chardet==3.0.4
click==8.0.4
cloud-init==20.2
colorama==0.3.7
command-not-found==0.3
configobj==5.0.6
constantly==15.1.0
contextlib2==21.6.0
contextvars==2.4
cryptography==2.1.4
dataclasses==0.8
distro-info===0.18ubuntu0.18.04.1
fastapi==0.83.0
h11==0.13.0
httplib2==0.9.2
hyperlink==17.3.1
idna==3.4
immutables==0.19
importlib-metadata==4.8.3
incremental==16.10.1
Jinja2==2.10
jsonpatch==1.16
jsonpointer==1.10
jsonschema==2.6.0
language-selector==0.1
MarkupSafe==1.0
netifaces==0.10.4
oauthlib==2.0.6
PAM==0.4.2
pexpect==4.2.1
pyasn1==0.4.2
pyasn1-modules==0.2.1
pydantic==1.9.2
PyGObject==3.26.1
PyJWT==1.5.3
pyOpenSSL==17.5.0
pyserial==3.4
python-apt==1.6.5+ubuntu0.5
python-debian==0.1.32
PyYAML==3.12
requests==2.18.4
requests-unixsocket==0.1.5
service-identity==16.0.0
six==1.11.0
sniffio==1.2.0
ssh-import-id==5.7
starlette==0.19.1
systemd-python==234
Twisted==17.9.0
typing_extensions==4.1.1
ufw==0.36
unattended-upgrades==0.1
urllib3==1.22
uvicorn==0.16.0
uvloop==0.14.0
watchgod==0.7
websockets==9.1
zipp==3.6.0
zope.interface==4.3.2

76
ishare2
View File

@@ -25,6 +25,8 @@ function set_url_constants() {
URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_8=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.2.8/upgrade.sh
URL_UPGRADE_PNETLAB_FROM_any_TO_5_2_9=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.2.9/upgrade.sh
URL_UPGRADE_PNETLAB_FROM_any_TO_5_3_0=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/upgrades/from_any_to_5.3.0/upgrade.sh
URL_GUI_APP_ZIP=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/gui/app.zip
URL_REQUIREMENTS_GUI_APP=https://raw.githubusercontent.com/pnetlabrepo/ishare2/main/gui/requirements.txt
}
function check_user_is_root() {
@@ -1053,6 +1055,49 @@ function show_changelog() {
rm $FILE
}
function ishare2_gui_download() {
rm -rf /root/app
wget -q $URL_GUI_APP_ZIP -P /root
unzip /root/app.zip -d /root > /dev/null 2>&1
rm /root/app.zip
curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o /root/get-pip.py > /dev/null 2>&1
python3 /root/get-pip.py > /dev/null 2>&1
rm /root/get-pip.py
wget -q $URL_REQUIREMENTS_GUI_APP -P /root
pip install -r /root/requirements.txt > /dev/null 2>&1
rm /root/requirements.txt
echo -e "${GREEN}GUI has been downloaded and installed. Now, you can start it by using: ishare2 gui start${NO_COLOR}"
}
function ishare2_gui_start() {
DIR="/root/app/"
if ! [[ -d "$DIR" ]]; then
ishare2 gui download
fi
ip_address="$(ip route get 1.2.3.4 | awk '{print $7}')"
echo -e "Use http://$ip_address:5000\n"
cd /root/app && python3 /root/app/main.py &
}
function ishare2_gui_stop() {
array_of_pids="$(ps -a | grep python3 | awk '{ print $1 }')"
for i in "${array_of_pids[@]}"
do
kill -9 $i > /dev/null 2>&1
done
}
function ishare2_gui_restart() {
ishare2 gui stop
ishare2 gui start
}
function general_available_list() {
TYPE=$1
FILENAME=$2
@@ -1376,6 +1421,7 @@ action:
relicense : Generate a new iourc license for bin images
upgrade : Retrieves a menu that allows users to upgrade ishare2 and PNETLab VM
changelog : Show the latest changes made to ishare2
gui : Web app to use ishare2 in browser
help : Show useful information
param1:
@@ -1428,6 +1474,11 @@ Examples:
- ishare2 mylabs <path> <number>
- ishare2 mylabs <path> all
- ishare2 gui download
- ishare2 gui start
- ishare2 gui stop
- ishare2 gui restart
- ishare2 relicense
- ishare2 upgrade
- ishare2 changelog
@@ -2165,6 +2216,31 @@ function selector() {
menu_ishare2_upgrade
elif [[ "$1" = "changelog" ]]; then # ishare2 changelog
show_changelog
elif [[ "$1" = "gui" ]]; then # ishare2 gui
if [[ "$2" ]]; then
if [[ "$2" == "download" ]]; then # ishare2 gui download
ishare2_gui_download
elif [[ "$2" == "start" ]]; then # ishare2 gui start
ishare2_gui_start
elif [[ "$2" == "stop" ]]; then # ishare2 gui stop
ishare2_gui_stop
elif [[ "$2" == "restart" ]]; then # ishare2 gui restart
ishare2_gui_restart
else
echo -e "${RED}Bad last argument${NO_COLOR}"
echo -e "Syntax:\n\nishare2 gui <option>\n"
echo "ishare2 gui download"
echo -e "ishare2 gui start"
echo -e "ishare2 gui stop"
echo -e "ishare2 gui restart"
fi
else
echo -e "Syntax:\n\nishare2 gui <option>\n"
echo "ishare2 gui download"
echo -e "ishare2 gui start"
echo -e "ishare2 gui stop"
echo -e "ishare2 gui restart"
fi
elif [[ "$1" = "help" ]]; then # ishare2 help
show_help_info
else # when no args are passed to ishare2

View File

@@ -1 +1 @@
v1.5.6
v1.5.7