gns3-server 3.0.2__py3-none-any.whl → 3.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of gns3-server might be problematic. Click here for more details.

Files changed (94) hide show
  1. {gns3_server-3.0.2.dist-info → gns3_server-3.0.4.dist-info}/METADATA +18 -18
  2. {gns3_server-3.0.2.dist-info → gns3_server-3.0.4.dist-info}/RECORD +93 -41
  3. {gns3_server-3.0.2.dist-info → gns3_server-3.0.4.dist-info}/WHEEL +1 -1
  4. gns3server/api/routes/compute/iou_nodes.py +1 -1
  5. gns3server/api/routes/controller/computes.py +1 -1
  6. gns3server/appliances/alpine-cloud.gns3a +56 -0
  7. gns3server/appliances/cisco-asav.gns3a +2 -2
  8. gns3server/appliances/cisco-c8000v.gns3a +15 -2
  9. gns3server/appliances/cisco-cat9k.gns3a +2 -2
  10. gns3server/appliances/cisco-csr1000v.gns3a +3 -3
  11. gns3server/appliances/cisco-iosv.gns3a +22 -7
  12. gns3server/appliances/cisco-iosvl2.gns3a +2 -1
  13. gns3server/appliances/cisco-iosxrv.gns3a +2 -2
  14. gns3server/appliances/cisco-iosxrv9k.gns3a +16 -133
  15. gns3server/appliances/cisco-iou-l2.gns3a +2 -0
  16. gns3server/appliances/cisco-iou-l3.gns3a +2 -0
  17. gns3server/appliances/cisco-nxosv.gns3a +2 -1
  18. gns3server/appliances/cisco-nxosv9k.gns3a +36 -343
  19. gns3server/appliances/fortianalyzer.gns3a +42 -0
  20. gns3server/appliances/fortigate.gns3a +42 -0
  21. gns3server/appliances/fortimanager.gns3a +43 -1
  22. gns3server/appliances/infix.gns3a +75 -0
  23. gns3server/appliances/stormshield-eva.gns3a +50 -0
  24. gns3server/appliances/vyos.gns3a +13 -0
  25. gns3server/compute/virtualbox/virtualbox_vm.py +29 -25
  26. gns3server/compute/vmware/vmware_vm.py +1 -2
  27. gns3server/controller/__init__.py +14 -0
  28. gns3server/crash_report.py +1 -1
  29. gns3server/custom_symbols/6wind.svg +1 -0
  30. gns3server/custom_symbols/alpine-virt-qemu.svg +46 -0
  31. gns3server/custom_symbols/arista_bybaro.svg +24 -0
  32. gns3server/custom_symbols/asterfusion-vAsterNOS.svg +48 -0
  33. gns3server/custom_symbols/cisco-fmcv.svg +498 -0
  34. gns3server/custom_symbols/cisco-ise.svg +244 -0
  35. gns3server/custom_symbols/csr1000v_bybaro.svg +38 -0
  36. gns3server/custom_symbols/cumulus_bybaro.svg +27 -0
  37. gns3server/custom_symbols/firefox.svg +1 -0
  38. gns3server/custom_symbols/fortigate_bybaro.svg +42 -0
  39. gns3server/custom_symbols/fortinet.svg +72 -0
  40. gns3server/custom_symbols/innovaphone-ap-icon.jpg +0 -0
  41. gns3server/custom_symbols/innovaphone-pbx-green.png +0 -0
  42. gns3server/custom_symbols/juniper-vmx.svg +284 -0
  43. gns3server/custom_symbols/juniper-vqfx.svg +324 -0
  44. gns3server/custom_symbols/junos_olive_bybaro.svg +18 -0
  45. gns3server/custom_symbols/linux_guest.svg +1917 -0
  46. gns3server/custom_symbols/loadbalancer.svg +380 -0
  47. gns3server/custom_symbols/loadbalancer_docker.svg +387 -0
  48. gns3server/custom_symbols/mgmt_station.svg +1967 -0
  49. gns3server/custom_symbols/mgmt_station_docker.svg +1996 -0
  50. gns3server/custom_symbols/microsoft.svg +85 -0
  51. gns3server/custom_symbols/multilayer_switch_docker.svg +332 -0
  52. gns3server/custom_symbols/multilayer_switch_green_docker.svg +344 -0
  53. gns3server/custom_symbols/multilayer_switch_red_docker.svg +344 -0
  54. gns3server/custom_symbols/opennac.png +0 -0
  55. gns3server/custom_symbols/opensuse.svg +126 -0
  56. gns3server/custom_symbols/openvswitch_bybaro.svg +26 -0
  57. gns3server/custom_symbols/ostinato-3d-icon.svg +95 -0
  58. gns3server/custom_symbols/packetfence2.png +0 -0
  59. gns3server/custom_symbols/pan-vm-fw.svg +364 -0
  60. gns3server/custom_symbols/parrotlogo.png +0 -0
  61. gns3server/custom_symbols/qemu_guest_win10_bybaro.svg +56 -0
  62. gns3server/custom_symbols/qemu_guest_win7_bybaro.svg +59 -0
  63. gns3server/custom_symbols/qemu_guest_win8_bybaro.svg +56 -0
  64. gns3server/custom_symbols/router_docker.svg +213 -0
  65. gns3server/custom_symbols/router_green.svg +206 -0
  66. gns3server/custom_symbols/router_green_docker.svg +665 -0
  67. gns3server/custom_symbols/router_red.svg +206 -0
  68. gns3server/custom_symbols/router_red_docker.svg +213 -0
  69. gns3server/custom_symbols/rpi.png +0 -0
  70. gns3server/custom_symbols/securityonion-logo.png +0 -0
  71. gns3server/custom_symbols/shieldedtux.png +0 -0
  72. gns3server/custom_symbols/steelhead-vcx.png +0 -0
  73. gns3server/custom_symbols/stormshield.png +0 -0
  74. gns3server/custom_symbols/ubuntu.svg +1750 -0
  75. gns3server/custom_symbols/vRIN.svg +316 -0
  76. gns3server/custom_symbols/vsrx_bybaro.svg +44 -0
  77. gns3server/custom_symbols/vyos.svg +35 -0
  78. gns3server/main.py +40 -2
  79. gns3server/schemas/compute/docker_nodes.py +2 -2
  80. gns3server/schemas/compute/dynamips_nodes.py +5 -5
  81. gns3server/schemas/compute/iou_nodes.py +2 -2
  82. gns3server/schemas/controller/templates/docker_templates.py +2 -2
  83. gns3server/schemas/controller/templates/dynamips_templates.py +19 -19
  84. gns3server/schemas/controller/templates/iou_templates.py +4 -4
  85. gns3server/schemas/controller/templates/qemu_templates.py +1 -1
  86. gns3server/schemas/controller/users.py +3 -3
  87. gns3server/server.py +23 -38
  88. gns3server/static/web-ui/index.html +1 -1
  89. gns3server/static/web-ui/main.87178dd64c9c79ba.js +1 -0
  90. gns3server/version.py +2 -2
  91. gns3server/static/web-ui/main.62c99707e4709a56.js +0 -1
  92. {gns3_server-3.0.2.dist-info → gns3_server-3.0.4.dist-info}/LICENSE +0 -0
  93. {gns3_server-3.0.2.dist-info → gns3_server-3.0.4.dist-info}/entry_points.txt +0 -0
  94. {gns3_server-3.0.2.dist-info → gns3_server-3.0.4.dist-info}/top_level.txt +0 -0
@@ -28,10 +28,10 @@ class IOUTemplate(TemplateBase):
28
28
  default_name_format: Optional[str] = "IOU{0}"
29
29
  symbol: Optional[str] = "multilayer_switch"
30
30
  path: str = Field(..., description="Path of IOU executable")
31
- ethernet_adapters: Optional[int] = Field(2, description="Number of ethernet adapters")
32
- serial_adapters: Optional[int] = Field(2, description="Number of serial adapters")
33
- ram: Optional[int] = Field(256, description="Amount of RAM in MB")
34
- nvram: Optional[int] = Field(128, description="Amount of NVRAM in KB")
31
+ ethernet_adapters: Optional[int] = Field(2, ge=0, description="Number of ethernet adapters")
32
+ serial_adapters: Optional[int] = Field(2, ge=0, description="Number of serial adapters")
33
+ ram: Optional[int] = Field(256, gt=0, description="Amount of RAM in MB")
34
+ nvram: Optional[int] = Field(128, gt=0, description="Amount of NVRAM in KB")
35
35
  use_default_iou_values: Optional[bool] = Field(True, description="Use default IOU values")
36
36
  startup_config: Optional[str] = Field("iou_l3_base_startup-config.txt", description="Startup-config of IOU")
37
37
  private_config: Optional[str] = Field("", description="Private-config of IOU")
@@ -39,7 +39,7 @@ class QemuTemplate(TemplateBase):
39
39
  qemu_path: Optional[str] = Field("", description="Qemu executable path")
40
40
  platform: Optional[QemuPlatform] = Field(QemuPlatform.x86_64, description="Platform to emulate")
41
41
  linked_clone: Optional[bool] = Field(True, description="Whether the VM is a linked clone or not")
42
- ram: Optional[int] = Field(256, description="Amount of RAM in MB")
42
+ ram: Optional[int] = Field(256, gt=0, description="Amount of RAM in MB")
43
43
  cpus: Optional[int] = Field(1, ge=1, le=255, description="Number of vCPUs")
44
44
  maxcpus: Optional[int] = Field(1, ge=1, le=255, description="Maximum number of hotpluggable vCPUs")
45
45
  adapters: Optional[int] = Field(1, ge=0, le=275, description="Number of adapters")
@@ -39,7 +39,7 @@ class UserCreate(UserBase):
39
39
  """
40
40
 
41
41
  username: str = Field(..., min_length=3, pattern="[a-zA-Z0-9_-]+$")
42
- password: SecretStr = Field(..., min_length=6, max_length=100)
42
+ password: SecretStr = Field(..., min_length=8, max_length=100)
43
43
 
44
44
 
45
45
  class UserUpdate(UserBase):
@@ -47,7 +47,7 @@ class UserUpdate(UserBase):
47
47
  Properties to update a user.
48
48
  """
49
49
 
50
- password: Optional[SecretStr] = Field(None, min_length=6, max_length=100)
50
+ password: Optional[SecretStr] = Field(None, min_length=8, max_length=100)
51
51
 
52
52
 
53
53
  class LoggedInUserUpdate(BaseModel):
@@ -55,7 +55,7 @@ class LoggedInUserUpdate(BaseModel):
55
55
  Properties to update a logged-in user.
56
56
  """
57
57
 
58
- password: Optional[SecretStr] = Field(None, min_length=6, max_length=100)
58
+ password: Optional[SecretStr] = Field(None, min_length=8, max_length=100)
59
59
  email: Optional[EmailStr] = None
60
60
  full_name: Optional[str] = None
61
61
 
gns3server/server.py CHANGED
@@ -23,7 +23,6 @@ Start the program. Use main.py to load it.
23
23
  import os
24
24
  import datetime
25
25
  import locale
26
- import argparse
27
26
  import psutil
28
27
  import sys
29
28
  import asyncio
@@ -33,13 +32,10 @@ import uvicorn
33
32
  import secrets
34
33
  import string
35
34
 
36
- from gns3server.controller import Controller
37
- from gns3server.compute.port_manager import PortManager
38
35
  from gns3server.logger import init_logger
39
36
  from gns3server.version import __version__
40
37
  from gns3server.config import Config
41
38
  from gns3server.crash_report import CrashReport
42
- from gns3server.api.server import app
43
39
  from pydantic import ValidationError, SecretStr
44
40
 
45
41
  import logging
@@ -90,40 +86,13 @@ class Server:
90
86
  else:
91
87
  log.info(f"Current locale is {language}.{encoding}")
92
88
 
93
- def _parse_arguments(self, argv):
89
+ def _setup_logging(self, args):
94
90
  """
95
- Parse command line arguments and override local configuration
91
+ Setup logging.
96
92
 
97
- :params args: Array of command line arguments
93
+ :param args: command line arguments
98
94
  """
99
95
 
100
- parser = argparse.ArgumentParser(description=f"GNS3 server version {__version__}")
101
- parser.add_argument("-v", "--version", help="show the version", action="version", version=__version__)
102
- parser.add_argument("--host", help="run on the given host/IP address")
103
- parser.add_argument("--port", help="run on the given port", type=int)
104
- parser.add_argument("--ssl", action="store_true", help="run in SSL mode")
105
- parser.add_argument("--config", help="Configuration file")
106
- parser.add_argument("--certfile", help="SSL cert file")
107
- parser.add_argument("--certkey", help="SSL key file")
108
- parser.add_argument("-L", "--local", action="store_true", help="local mode (allows some insecure operations)")
109
- parser.add_argument(
110
- "-A", "--allow", action="store_true", help="allow remote connections to local console ports"
111
- )
112
- parser.add_argument("-q", "--quiet", default=False, action="store_true", help="do not show logs on stdout")
113
- parser.add_argument("-d", "--debug", default=False, action="store_true", help="show debug logs")
114
- parser.add_argument("--logfile", "--log", help="send output to logfile instead of console")
115
- parser.add_argument("--logmaxsize", default=10000000, help="maximum logfile size in bytes (default is 10MB)")
116
- parser.add_argument(
117
- "--logbackupcount", default=10, help="number of historical log files to keep (default is 10)"
118
- )
119
- parser.add_argument(
120
- "--logcompression", default=False, action="store_true", help="compress inactive (historical) logs"
121
- )
122
- parser.add_argument("--daemon", action="store_true", help="start as a daemon")
123
- parser.add_argument("--pid", help="store process pid")
124
- parser.add_argument("--profile", help="Settings profile (blank will use default settings files)")
125
-
126
- args = parser.parse_args(argv)
127
96
  level = logging.INFO
128
97
  if args.debug:
129
98
  level = logging.DEBUG
@@ -137,6 +106,15 @@ class Server:
137
106
  quiet=args.quiet,
138
107
  )
139
108
 
109
+ @staticmethod
110
+ def _load_config_and_set_defaults(parser, args, argv=None):
111
+ """
112
+ Parse command line arguments and override local configuration
113
+
114
+ :param parser: ArgumentParser instance
115
+ :param args: command line arguments
116
+ """
117
+
140
118
  try:
141
119
  if args.config:
142
120
  Config.instance(files=[args.config], profile=args.profile)
@@ -157,7 +135,10 @@ class Server:
157
135
  }
158
136
 
159
137
  parser.set_defaults(**defaults)
160
- return parser.parse_args(argv)
138
+ if argv is None:
139
+ argv = sys.argv[1:]
140
+ args = parser.parse_args(argv)
141
+ return args
161
142
 
162
143
  @staticmethod
163
144
  def _set_config_defaults_from_command_line(args):
@@ -174,6 +155,8 @@ class Server:
174
155
  config.Server.enable_ssl = args.ssl
175
156
 
176
157
  def _signal_handling(self):
158
+
159
+ from gns3server.controller import Controller
177
160
  def signal_handler(signame, *args):
178
161
 
179
162
  try:
@@ -239,9 +222,10 @@ class Server:
239
222
  log.critical("Can't write pid file %s: %s", path, str(e))
240
223
  sys.exit(1)
241
224
 
242
- async def run(self):
225
+ async def run(self, parser, args):
243
226
 
244
- args = self._parse_arguments(sys.argv[1:])
227
+ self._setup_logging(args)
228
+ args = self._load_config_and_set_defaults(parser, args)
245
229
 
246
230
  if args.pid:
247
231
  self._pid_lock(args.pid)
@@ -256,7 +240,6 @@ class Server:
256
240
 
257
241
  self._set_config_defaults_from_command_line(args)
258
242
  config = Config.instance().settings
259
-
260
243
  if not config.Server.compute_password.get_secret_value():
261
244
  alphabet = string.ascii_letters + string.digits + string.punctuation
262
245
  generated_password = ''.join(secrets.choice(alphabet) for _ in range(16))
@@ -297,11 +280,13 @@ class Server:
297
280
  host = config.Server.host
298
281
  port = config.Server.port
299
282
 
283
+ from gns3server.compute.port_manager import PortManager
300
284
  PortManager.instance().console_host = host
301
285
  self._signal_handling()
302
286
 
303
287
  try:
304
288
  log.info(f"Starting server on {host}:{port}")
289
+ from gns3server.api.server import app
305
290
 
306
291
  # only show uvicorn access logs in debug mode
307
292
  access_log = False
@@ -46,6 +46,6 @@
46
46
 
47
47
  gtag('config', 'G-0BT7QQV1W1');
48
48
  </script>
49
- <script src="runtime.24fa95b7061d7056.js" type="module"></script><script src="polyfills.319c79dd175e50d0.js" type="module"></script><script src="main.62c99707e4709a56.js" type="module"></script>
49
+ <script src="runtime.24fa95b7061d7056.js" type="module"></script><script src="polyfills.319c79dd175e50d0.js" type="module"></script><script src="main.87178dd64c9c79ba.js" type="module"></script>
50
50
 
51
51
  </body></html>