mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-04 22:41:12 +02:00
Merge branch '2.2' into 3.0
# Conflicts: # CHANGELOG # docs/api/notifications/link.updated.json # docs/api/notifications/log.warning.json # docs/api/v2/compute/ethernet_switch/projectsprojectidethernetswitchnodes.rst # docs/api/v2/compute/ethernet_switch/projectsprojectidethernetswitchnodesnodeid.rst # docs/api/v2/compute/iou/projectsprojectidiounodes.rst # docs/api/v2/compute/project/projects.rst # docs/api/v2/compute/qemu/projectsprojectidqemunodes.rst # docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeid.rst # docs/api/v2/compute/qemu/projectsprojectidqemunodesnodeidstart.rst # docs/api/v2/controller/link/projectsprojectidlinks.rst # docs/api/v2/controller/link/projectsprojectidlinkslinkid.rst # docs/api/v2/controller/link/projectsprojectidlinkslinkidstartcapture.rst # docs/api/v2/controller/project/projects.rst # docs/api/v2/controller/project/projectsprojectidduplicate.rst # docs/controller_notifications.rst # docs/curl.rst # docs/gns3_file.json # docs/project_notifications.rst # gns3server/compute/qemu/qemu_vm.py # gns3server/controller/project.py # gns3server/crash_report.py # gns3server/schemas/ethernet_hub.py # gns3server/schemas/ethernet_switch.py # gns3server/static/web-ui/3rdpartylicenses.txt # gns3server/static/web-ui/index.html # gns3server/utils/asyncio/telnet_server.py # gns3server/version.py # gns3server/web/web_server.py # requirements.txt # tests/controller/test_project.py # tests/controller/test_topology.py # tests/handlers/api/controller/test_project.py
This commit is contained in:
34 files changed
+483
-168
No files matched your search
@@ -163,9 +163,9 @@ log "Install GNS3 packages"
|
||||
apt-get install -y gns3-server
|
||||
|
||||
log "Create user GNS3 with /opt/gns3 as home directory"
|
||||
if [ ! -d "/opt/gns3/" ]
|
||||
if [ ! -d "/opt/gns3" ]
|
||||
then
|
||||
useradd -m -d /opt/gns3/ gns3
|
||||
useradd -m -d /opt/gns3 gns3
|
||||
fi
|
||||
|
||||
|
||||
@@ -304,6 +304,11 @@ log "GNS3 installed with success"
|
||||
|
||||
if [ $WELCOME_SETUP == 1 ]
|
||||
then
|
||||
cat <<EOFI > /etc/sudoers.d/gns3
|
||||
gns3 ALL = (ALL) NOPASSWD: /usr/bin/apt-key
|
||||
gns3 ALL = (ALL) NOPASSWD: /usr/bin/apt-get
|
||||
gns3 ALL = (ALL) NOPASSWD: /usr/sbin/reboot
|
||||
EOFI
|
||||
NEEDRESTART_MODE=a apt-get install -y net-tools
|
||||
NEEDRESTART_MODE=a apt-get install -y python3-pip
|
||||
NEEDRESTART_MODE=a apt-get install -y dialog
|
||||
@@ -462,4 +467,4 @@ NEEDRESTART_MODE=a apt-get upgrade
|
||||
python3 -c 'import sys; sys.path.append("/usr/local/bin/"); import welcome; ws = welcome.Welcome_dialog(); ws.repair_remote_install()'
|
||||
cd /opt/gns3
|
||||
su gns3
|
||||
fi
|
||||
fi
|
||||
+32
-12
@@ -163,19 +163,38 @@ class Welcome_dialog:
|
||||
|
||||
def update(self, force=False):
|
||||
if not force:
|
||||
if self.display.yesno("PLEASE SNAPSHOT THE VM BEFORE RUNNING THE UPGRADE IN CASE OF FAILURE. The server will reboot at the end of the upgrade process. Continue?") != self.display.OK:
|
||||
if self.display.yesno("It is recommended to ensure all Nodes are shutdown before upgrading. Continue?") != self.display.OK:
|
||||
return
|
||||
release = self.get_release()
|
||||
if release == "2.2":
|
||||
if self.display.yesno("It is recommended to run GNS3 version 2.2 with lastest GNS3 VM based on Ubuntu 18.04 LTS, please download this VM from our website or continue at your own risk!") != self.display.OK:
|
||||
code, option = self.display.menu("Select an option",
|
||||
choices=[("Upgrade GNS3", "Upgrades only the GNS3 pakage and dependences."),
|
||||
("Upgrade All", "Upgrades all avaiable packages"),
|
||||
("Dist Upgrade", "Upgrades all avaiable packages and the Linux Kernel. Requires a reboot.")])
|
||||
if code == Dialog.OK:
|
||||
if option == "Upgrade GNS3":
|
||||
ret = os.system(
|
||||
"sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A2E3EF7B \
|
||||
&& sudo apt-get update \
|
||||
&& sudo apt-get install -y --only-upgrade gns3-server"
|
||||
)
|
||||
elif option == "Upgrade All":
|
||||
ret = os.system(
|
||||
'sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com \
|
||||
&& sudo apt-get update \
|
||||
&& sudo apt-get upgrade --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
|
||||
)
|
||||
elif option == "Dist Upgrade":
|
||||
ret = os.system(
|
||||
'sudo apt-key adv --refresh-keys --keyserver keyserver.ubuntu.com \
|
||||
&& sudo apt-get update \
|
||||
&& sudo apt-get dist-upgrade --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold"'
|
||||
)
|
||||
if ret != 0:
|
||||
print("ERROR DURING UPGRADE PROCESS PLEASE TAKE A SCREENSHOT IF YOU NEED SUPPORT")
|
||||
time.sleep(15)
|
||||
return
|
||||
if release.endswith("dev"):
|
||||
ret = os.system("curl -Lk https://raw.githubusercontent.com/GNS3/gns3-vm/unstable/scripts/update_{}.sh > /tmp/update.sh && bash -x /tmp/update.sh".format(release))
|
||||
else:
|
||||
ret = os.system("curl -Lk https://raw.githubusercontent.com/GNS3/gns3-vm/master/scripts/update_{}.sh > /tmp/update.sh && bash -x /tmp/update.sh".format(release))
|
||||
if ret != 0:
|
||||
print("ERROR DURING UPGRADE PROCESS PLEASE TAKE A SCREENSHOT IF YOU NEED SUPPORT")
|
||||
time.sleep(15)
|
||||
if option == "Dist Upgrade":
|
||||
if self.display.yesno("Reboot now?") == self.display.OK:
|
||||
os.system("sudo reboot now")
|
||||
|
||||
|
||||
def migrate(self):
|
||||
@@ -438,7 +457,8 @@ Images and projects are located in /opt/gns3
|
||||
self.display.clear()
|
||||
if code == Dialog.OK:
|
||||
if tag == "Shell":
|
||||
os.execvp("bash", ['/bin/bash'])
|
||||
print("Type: 'welcome.py' to get back to the dialog menu.")
|
||||
sys.exit(0)
|
||||
elif tag == "Version":
|
||||
self.mode()
|
||||
elif tag == "Restore":
|
||||
|
||||
Reference in new issue
Block a user