1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-28 11:18:11 +00:00

Merge branch '3.0' into image-management-refactoring

This commit is contained in:
Jeremy Grossmann 2021-08-10 05:46:22 -07:00 committed by GitHub
commit f13b4e89b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 1067 additions and 843 deletions

View File

@ -1,5 +1,27 @@
# Change Log
## 2.2.23 05/08/2021
* Release web UI 2.2.23
* Fix hostname inconsistencies during script execution
* Add option `--without-kvm`
* Add a `reload` server endpoint. Fixes #1926
* Handle -no-kvm param deprecated in Qemu >= v5.2
* Fix binary websocket access to the console
* Change how to generate random MAC addresses
* setup.py: prevent installing tests directory
* Support cloning of encrypted qcow2 base image files
* Fix VMware VM support on Linux and Windows. Fixes #1919
## 2.2.22 10/06/2021
* Fix VMware support on macOS BigSur
* Link style support. Fixes https://github.com/GNS3/gns3-gui/issues/2461
* Release web UI version 2.2.22
* Preserve auto_start/auto_open/auto_close when restoring snapshot
* Fix uBridge errors for cloud nodes not visible in logs. Fixes #1895
* Prevent directory traversal. Fixes #1894
## 2.2.21 10/05/2021
* Release Web-Ui v2.2.21

View File

@ -20,7 +20,7 @@ API routes for ATM switch nodes.
import os
from fastapi import APIRouter, Depends, Body, Path, status
from fastapi import APIRouter, Depends, Body, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -109,42 +109,43 @@ async def update_atm_switch(
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_atm_switch_node(node: ATMSwitch = Depends(dep_node)) -> None:
async def delete_atm_switch_node(node: ATMSwitch = Depends(dep_node)) -> Response:
"""
Delete an ATM switch node.
"""
await Dynamips.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
def start_atm_switch(node: ATMSwitch = Depends(dep_node)):
def start_atm_switch(node: ATMSwitch = Depends(dep_node)) -> Response:
"""
Start an ATM switch node.
This endpoint results in no action since ATM switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
def stop_atm_switch(node: ATMSwitch = Depends(dep_node)) -> None:
def stop_atm_switch(node: ATMSwitch = Depends(dep_node)) -> Response:
"""
Stop an ATM switch node.
This endpoint results in no action since ATM switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
def suspend_atm_switch(node: ATMSwitch = Depends(dep_node)) -> None:
def suspend_atm_switch(node: ATMSwitch = Depends(dep_node)) -> Response:
"""
Suspend an ATM switch node.
This endpoint results in no action since ATM switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -170,7 +171,7 @@ async def create_nio(
@router.delete("/{node_id}/adapters/{adapter_number}/ports/{port_number}/nio", status_code=status.HTTP_204_NO_CONTENT)
async def delete_nio(adapter_number: int, port_number: int, node: ATMSwitch = Depends(dep_node)) -> None:
async def delete_nio(adapter_number: int, port_number: int, node: ATMSwitch = Depends(dep_node)) -> Response:
"""
Remove a NIO (Network Input/Output) from the node.
The adapter number on the switch is always 0.
@ -178,6 +179,7 @@ async def delete_nio(adapter_number: int, port_number: int, node: ATMSwitch = De
nio = await node.remove_nio(port_number)
await nio.delete()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -207,13 +209,14 @@ async def stop_capture(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: ATMSwitch = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The adapter number on the switch is always 0.
"""
await node.stop_capture(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")

View File

@ -20,7 +20,7 @@ API routes for cloud nodes.
import os
from fastapi import APIRouter, Depends, Path, status
from fastapi import APIRouter, Depends, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from typing import Union
@ -99,41 +99,43 @@ def update_cloud(node_data: schemas.CloudUpdate, node: Cloud = Depends(dep_node)
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_cloud(node: Cloud = Depends(dep_node)) -> None:
async def delete_cloud(node: Cloud = Depends(dep_node)) -> Response:
"""
Delete a cloud node.
"""
await Builtin.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_cloud(node: Cloud = Depends(dep_node)) -> None:
async def start_cloud(node: Cloud = Depends(dep_node)) -> Response:
"""
Start a cloud node.
"""
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_cloud(node: Cloud = Depends(dep_node)) -> None:
async def stop_cloud(node: Cloud = Depends(dep_node)) -> Response:
"""
Stop a cloud node.
This endpoint results in no action since cloud nodes cannot be stopped.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_cloud(node: Cloud = Depends(dep_node)) -> None:
async def suspend_cloud(node: Cloud = Depends(dep_node)) -> Response:
"""
Suspend a cloud node.
This endpoint results in no action since cloud nodes cannot be suspended.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -188,13 +190,14 @@ async def delete_cloud_nio(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: Cloud = Depends(dep_node)
) -> None:
) -> Response:
"""
Remove a NIO (Network Input/Output) from the node.
The adapter number on the cloud is always 0.
"""
await node.remove_nio(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -223,13 +226,14 @@ async def stop_cloud_capture(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: Cloud = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The adapter number on the cloud is always 0.
"""
await node.stop_capture(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/pcap")

View File

@ -34,7 +34,7 @@ from gns3server.compute.virtualbox import VirtualBox
from gns3server.compute.vmware import VMware
from gns3server import schemas
from fastapi import APIRouter, HTTPException, Body, status
from fastapi import APIRouter, HTTPException, Body, Response, status
from fastapi.encoders import jsonable_encoder
from uuid import UUID
from typing import Optional, List
@ -150,7 +150,7 @@ async def get_qemu_capabilities() -> dict:
status_code=status.HTTP_204_NO_CONTENT,
responses={403: {"model": schemas.ErrorMessage, "description": "Forbidden to create Qemu image"}},
)
async def create_qemu_image(image_data: schemas.QemuImageCreate) -> None:
async def create_qemu_image(image_data: schemas.QemuImageCreate) -> Response:
"""
Create a Qemu image.
"""
@ -163,13 +163,15 @@ async def create_qemu_image(image_data: schemas.QemuImageCreate) -> None:
image_data.qemu_img, image_data.path, jsonable_encoder(image_data, exclude_unset=True)
)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.put(
"/qemu/img",
status_code=status.HTTP_204_NO_CONTENT,
responses={403: {"model": schemas.ErrorMessage, "description": "Forbidden to update Qemu image"}},
)
async def update_qemu_image(image_data: schemas.QemuImageUpdate) -> None:
async def update_qemu_image(image_data: schemas.QemuImageUpdate) -> Response:
"""
Update a Qemu image.
"""
@ -181,6 +183,8 @@ async def update_qemu_image(image_data: schemas.QemuImageUpdate) -> None:
if image_data.extend:
await Qemu.instance().resize_disk(image_data.qemu_img, image_data.path, image_data.extend)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/virtualbox/vms", response_model=List[dict])
async def get_virtualbox_vms() -> List[dict]:

View File

@ -20,7 +20,7 @@ API routes for Docker nodes.
import os
from fastapi import APIRouter, WebSocket, Depends, Body, status
from fastapi import APIRouter, WebSocket, Depends, Body, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -132,66 +132,73 @@ async def update_docker_node(node_data: schemas.DockerUpdate, node: DockerVM = D
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_docker_node(node: DockerVM = Depends(dep_node)) -> None:
async def start_docker_node(node: DockerVM = Depends(dep_node)) -> Response:
"""
Start a Docker node.
"""
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_docker_node(node: DockerVM = Depends(dep_node)) -> None:
async def stop_docker_node(node: DockerVM = Depends(dep_node)) -> Response:
"""
Stop a Docker node.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_docker_node(node: DockerVM = Depends(dep_node)) -> None:
async def suspend_docker_node(node: DockerVM = Depends(dep_node)) -> Response:
"""
Suspend a Docker node.
"""
await node.pause()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_docker_node(node: DockerVM = Depends(dep_node)) -> None:
async def reload_docker_node(node: DockerVM = Depends(dep_node)) -> Response:
"""
Reload a Docker node.
"""
await node.restart()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/pause", status_code=status.HTTP_204_NO_CONTENT)
async def pause_docker_node(node: DockerVM = Depends(dep_node)) -> None:
async def pause_docker_node(node: DockerVM = Depends(dep_node)) -> Response:
"""
Pause a Docker node.
"""
await node.pause()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/unpause", status_code=status.HTTP_204_NO_CONTENT)
async def unpause_docker_node(node: DockerVM = Depends(dep_node)) -> None:
async def unpause_docker_node(node: DockerVM = Depends(dep_node)) -> Response:
"""
Unpause a Docker node.
"""
await node.unpause()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_docker_node(node: DockerVM = Depends(dep_node)) -> None:
async def delete_docker_node(node: DockerVM = Depends(dep_node)) -> Response:
"""
Delete a Docker node.
"""
await node.delete()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/duplicate", response_model=schemas.Docker, status_code=status.HTTP_201_CREATED)
@ -250,13 +257,14 @@ async def delete_docker_node_nio(
adapter_number: int,
port_number: int,
node: DockerVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
The port number on the Docker node is always 0.
"""
await node.adapter_remove_nio_binding(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -284,13 +292,14 @@ async def stop_docker_node_capture(
adapter_number: int,
port_number: int,
node: DockerVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The port number on the Docker node is always 0.
"""
await node.stop_capture(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")
@ -319,6 +328,7 @@ async def console_ws(websocket: WebSocket, node: DockerVM = Depends(dep_node)) -
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console(node: DockerVM = Depends(dep_node)) -> None:
async def reset_console(node: DockerVM = Depends(dep_node)) -> Response:
await node.reset_console()
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -21,7 +21,7 @@ API routes for Dynamips nodes.
import os
import sys
from fastapi import APIRouter, WebSocket, Depends, status
from fastapi import APIRouter, WebSocket, Depends, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from typing import List
@ -105,16 +105,17 @@ async def update_router(node_data: schemas.DynamipsUpdate, node: Router = Depend
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_router(node: Router = Depends(dep_node)) -> None:
async def delete_router(node: Router = Depends(dep_node)) -> Response:
"""
Delete a Dynamips router.
"""
await Dynamips.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_router(node: Router = Depends(dep_node)) -> None:
async def start_router(node: Router = Depends(dep_node)) -> Response:
"""
Start a Dynamips router.
"""
@ -124,39 +125,44 @@ async def start_router(node: Router = Depends(dep_node)) -> None:
except GeneratorExit:
pass
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_router(node: Router = Depends(dep_node)) -> None:
async def stop_router(node: Router = Depends(dep_node)) -> Response:
"""
Stop a Dynamips router.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_router(node: Router = Depends(dep_node)) -> None:
async def suspend_router(node: Router = Depends(dep_node)) -> Response:
await node.suspend()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT)
async def resume_router(node: Router = Depends(dep_node)) -> None:
async def resume_router(node: Router = Depends(dep_node)) -> Response:
"""
Resume a suspended Dynamips router.
"""
await node.resume()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_router(node: Router = Depends(dep_node)) -> None:
async def reload_router(node: Router = Depends(dep_node)) -> Response:
"""
Reload a suspended Dynamips router.
"""
await node.reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -202,13 +208,14 @@ async def update_nio(
@router.delete("/{node_id}/adapters/{adapter_number}/ports/{port_number}/nio", status_code=status.HTTP_204_NO_CONTENT)
async def delete_nio(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> None:
async def delete_nio(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
"""
nio = await node.slot_remove_nio_binding(adapter_number, port_number)
await nio.delete()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -240,12 +247,13 @@ async def start_capture(
@router.post(
"/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stop", status_code=status.HTTP_204_NO_CONTENT
)
async def stop_capture(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> None:
async def stop_capture(adapter_number: int, port_number: int, node: Router = Depends(dep_node)) -> Response:
"""
Stop a packet capture on the node.
"""
await node.stop_capture(adapter_number, port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")
@ -303,6 +311,7 @@ async def console_ws(websocket: WebSocket, node: Router = Depends(dep_node)) ->
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console(node: Router = Depends(dep_node)) -> None:
async def reset_console(node: Router = Depends(dep_node)) -> Response:
await node.reset_console()
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -20,7 +20,7 @@ API routes for Ethernet hub nodes.
import os
from fastapi import APIRouter, Depends, Body, Path, status
from fastapi import APIRouter, Depends, Body, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -108,42 +108,43 @@ async def update_ethernet_hub(
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None:
async def delete_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response:
"""
Delete an Ethernet hub.
"""
await Dynamips.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
def start_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None:
def start_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response:
"""
Start an Ethernet hub.
This endpoint results in no action since Ethernet hub nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
def stop_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None:
def stop_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response:
"""
Stop an Ethernet hub.
This endpoint results in no action since Ethernet hub nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
def suspend_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> None:
def suspend_ethernet_hub(node: EthernetHub = Depends(dep_node)) -> Response:
"""
Suspend an Ethernet hub.
This endpoint results in no action since Ethernet hub nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -174,7 +175,7 @@ async def delete_nio(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: EthernetHub = Depends(dep_node)
) -> None:
) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
The adapter number on the hub is always 0.
@ -182,6 +183,7 @@ async def delete_nio(
nio = await node.remove_nio(port_number)
await nio.delete()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -210,13 +212,14 @@ async def stop_capture(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: EthernetHub = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The adapter number on the hub is always 0.
"""
await node.stop_capture(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")

View File

@ -20,7 +20,7 @@ API routes for Ethernet switch nodes.
import os
from fastapi import APIRouter, Depends, Body, Path, status
from fastapi import APIRouter, Depends, Body, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -112,42 +112,43 @@ async def update_ethernet_switch(
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None:
async def delete_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response:
"""
Delete an Ethernet switch.
"""
await Dynamips.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
def start_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None:
def start_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response:
"""
Start an Ethernet switch.
This endpoint results in no action since Ethernet switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
def stop_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None:
def stop_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response:
"""
Stop an Ethernet switch.
This endpoint results in no action since Ethernet switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
def suspend_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> None:
def suspend_ethernet_switch(node: EthernetSwitch = Depends(dep_node)) -> Response:
"""
Suspend an Ethernet switch.
This endpoint results in no action since Ethernet switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -174,7 +175,7 @@ async def delete_nio(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: EthernetSwitch = Depends(dep_node)
) -> None:
) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
The adapter number on the switch is always 0.
@ -182,6 +183,7 @@ async def delete_nio(
nio = await node.remove_nio(port_number)
await nio.delete()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -210,13 +212,14 @@ async def stop_capture(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: EthernetSwitch = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The adapter number on the switch is always 0.
"""
await node.stop_capture(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")

View File

@ -20,7 +20,7 @@ API routes for Frame Relay switch nodes.
import os
from fastapi import APIRouter, Depends, Body, Path, status
from fastapi import APIRouter, Depends, Body, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -112,42 +112,43 @@ async def update_frame_relay_switch(
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None:
async def delete_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response:
"""
Delete a Frame Relay switch node.
"""
await Dynamips.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
def start_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None:
def start_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response:
"""
Start a Frame Relay switch node.
This endpoint results in no action since Frame Relay switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
def stop_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None:
def stop_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response:
"""
Stop a Frame Relay switch node.
This endpoint results in no action since Frame Relay switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
def suspend_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> None:
def suspend_frame_relay_switch(node: FrameRelaySwitch = Depends(dep_node)) -> Response:
"""
Suspend a Frame Relay switch node.
This endpoint results in no action since Frame Relay switch nodes are always on.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -178,7 +179,7 @@ async def delete_nio(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: FrameRelaySwitch = Depends(dep_node)
) -> None:
) -> Response:
"""
Remove a NIO (Network Input/Output) from the node.
The adapter number on the switch is always 0.
@ -186,6 +187,7 @@ async def delete_nio(
nio = await node.remove_nio(port_number)
await nio.delete()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -214,13 +216,14 @@ async def stop_capture(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: FrameRelaySwitch = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The adapter number on the switch is always 0.
"""
await node.stop_capture(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")

View File

@ -21,7 +21,7 @@ API routes for images.
import os
import urllib.parse
from fastapi import APIRouter, Request, status, HTTPException
from fastapi import APIRouter, Request, status, Response, HTTPException
from fastapi.responses import FileResponse
from typing import List
@ -54,13 +54,14 @@ async def get_dynamips_images() -> List[str]:
@router.post("/dynamips/images/{filename:path}", status_code=status.HTTP_204_NO_CONTENT)
async def upload_dynamips_image(filename: str, request: Request) -> None:
async def upload_dynamips_image(filename: str, request: Request) -> Response:
"""
Upload a Dynamips IOS image.
"""
dynamips_manager = Dynamips.instance()
await dynamips_manager.write_image(urllib.parse.unquote(filename), request.stream())
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/dynamips/images/{filename:path}")
@ -95,13 +96,14 @@ async def get_iou_images() -> List[str]:
@router.post("/iou/images/{filename:path}", status_code=status.HTTP_204_NO_CONTENT)
async def upload_iou_image(filename: str, request: Request) -> None:
async def upload_iou_image(filename: str, request: Request) -> Response:
"""
Upload an IOU image.
"""
iou_manager = IOU.instance()
await iou_manager.write_image(urllib.parse.unquote(filename), request.stream())
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/iou/images/{filename:path}")
@ -132,10 +134,11 @@ async def get_qemu_images() -> List[str]:
@router.post("/qemu/images/{filename:path}", status_code=status.HTTP_204_NO_CONTENT)
async def upload_qemu_image(filename: str, request: Request) -> None:
async def upload_qemu_image(filename: str, request: Request) -> Response:
qemu_manager = Qemu.instance()
await qemu_manager.write_image(urllib.parse.unquote(filename), request.stream())
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/qemu/images/{filename:path}")

View File

@ -20,7 +20,7 @@ API routes for IOU nodes.
import os
from fastapi import APIRouter, WebSocket, Depends, Body, status
from fastapi import APIRouter, WebSocket, Depends, Body, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from typing import Union
@ -113,12 +113,13 @@ async def update_iou_node(node_data: schemas.IOUUpdate, node: IOUVM = Depends(de
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_iou_node(node: IOUVM = Depends(dep_node)) -> None:
async def delete_iou_node(node: IOUVM = Depends(dep_node)) -> Response:
"""
Delete an IOU node.
"""
await IOU.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/duplicate", response_model=schemas.IOU, status_code=status.HTTP_201_CREATED)
@ -135,7 +136,7 @@ async def duplicate_iou_node(
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_iou_node(start_data: schemas.IOUStart, node: IOUVM = Depends(dep_node)) -> None:
async def start_iou_node(start_data: schemas.IOUStart, node: IOUVM = Depends(dep_node)) -> Response:
"""
Start an IOU node.
"""
@ -146,35 +147,37 @@ async def start_iou_node(start_data: schemas.IOUStart, node: IOUVM = Depends(dep
setattr(node, name, value)
await node.start()
return node.asdict()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_iou_node(node: IOUVM = Depends(dep_node)) -> None:
async def stop_iou_node(node: IOUVM = Depends(dep_node)) -> Response:
"""
Stop an IOU node.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
def suspend_iou_node(node: IOUVM = Depends(dep_node)) -> None:
def suspend_iou_node(node: IOUVM = Depends(dep_node)) -> Response:
"""
Suspend an IOU node.
Does nothing since IOU doesn't support being suspended.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_iou_node(node: IOUVM = Depends(dep_node)) -> None:
async def reload_iou_node(node: IOUVM = Depends(dep_node)) -> Response:
"""
Reload an IOU node.
"""
await node.reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -220,12 +223,13 @@ async def update_iou_node_nio(
@router.delete("/{node_id}/adapters/{adapter_number}/ports/{port_number}/nio", status_code=status.HTTP_204_NO_CONTENT)
async def delete_iou_node_nio(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> None:
async def delete_iou_node_nio(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
"""
await node.adapter_remove_nio_binding(adapter_number, port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -247,12 +251,13 @@ async def start_iou_node_capture(
@router.post(
"/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stop", status_code=status.HTTP_204_NO_CONTENT
)
async def stop_iou_node_capture(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> None:
async def stop_iou_node_capture(adapter_number: int, port_number: int, node: IOUVM = Depends(dep_node)) -> Response:
"""
Stop a packet capture on the node.
"""
await node.stop_capture(adapter_number, port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")
@ -280,6 +285,7 @@ async def console_ws(websocket: WebSocket, node: IOUVM = Depends(dep_node)) -> N
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console(node: IOUVM = Depends(dep_node)) -> None:
async def reset_console(node: IOUVM = Depends(dep_node)) -> Response:
await node.reset_console()
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -20,7 +20,7 @@ API routes for NAT nodes.
import os
from fastapi import APIRouter, Depends, Path, status
from fastapi import APIRouter, Depends, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from typing import Union
@ -94,41 +94,43 @@ def update_nat_node(node_data: schemas.NATUpdate, node: Nat = Depends(dep_node))
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_nat_node(node: Nat = Depends(dep_node)) -> None:
async def delete_nat_node(node: Nat = Depends(dep_node)) -> Response:
"""
Delete a cloud node.
"""
await Builtin.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_nat_node(node: Nat = Depends(dep_node)) -> None:
async def start_nat_node(node: Nat = Depends(dep_node)) -> Response:
"""
Start a NAT node.
"""
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_nat_node(node: Nat = Depends(dep_node)) -> None:
async def stop_nat_node(node: Nat = Depends(dep_node)) -> Response:
"""
Stop a NAT node.
This endpoint results in no action since cloud nodes cannot be stopped.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_nat_node(node: Nat = Depends(dep_node)) -> None:
async def suspend_nat_node(node: Nat = Depends(dep_node)) -> Response:
"""
Suspend a NAT node.
This endpoint results in no action since NAT nodes cannot be suspended.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -183,13 +185,14 @@ async def delete_nat_node_nio(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: Nat = Depends(dep_node)
) -> None:
) -> Response:
"""
Remove a NIO (Network Input/Output) from the node.
The adapter number on the cloud is always 0.
"""
await node.remove_nio(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -218,13 +221,14 @@ async def stop_nat_node_capture(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: Nat = Depends(dep_node)
):
) -> Response:
"""
Stop a packet capture on the node.
The adapter number on the cloud is always 0.
"""
await node.stop_capture(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")

View File

@ -25,7 +25,7 @@ import logging
log = logging.getLogger()
from fastapi import APIRouter, Depends, HTTPException, Request, status
from fastapi import APIRouter, Depends, HTTPException, Request, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import FileResponse
from typing import List
@ -103,7 +103,7 @@ def get_compute_project(project: Project = Depends(dep_project)) -> schemas.Proj
@router.post("/projects/{project_id}/close", status_code=status.HTTP_204_NO_CONTENT)
async def close_compute_project(project: Project = Depends(dep_project)) -> None:
async def close_compute_project(project: Project = Depends(dep_project)) -> Response:
"""
Close a project on the compute.
"""
@ -118,17 +118,18 @@ async def close_compute_project(project: Project = Depends(dep_project)) -> None
pass
else:
log.warning("Skip project closing, another client is listening for project notifications")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.delete("/projects/{project_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_compute_project(project: Project = Depends(dep_project)) -> None:
async def delete_compute_project(project: Project = Depends(dep_project)) -> Response:
"""
Delete project from the compute.
"""
await project.delete()
ProjectManager.instance().remove_project(project.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
# @Route.get(
# r"/projects/{project_id}/notifications",
@ -214,7 +215,11 @@ async def get_compute_project_file(file_path: str, project: Project = Depends(de
@router.post("/projects/{project_id}/files/{file_path:path}", status_code=status.HTTP_204_NO_CONTENT)
async def write_compute_project_file(file_path: str, request: Request, project: Project = Depends(dep_project)) -> None:
async def write_compute_project_file(
file_path: str,
request: Request,
project: Project = Depends(dep_project)
) -> Response:
file_path = urllib.parse.unquote(file_path)
path = os.path.normpath(file_path)
@ -238,3 +243,5 @@ async def write_compute_project_file(file_path: str, request: Request, project:
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND)
except PermissionError:
raise HTTPException(status_code=status.HTTP_403_FORBIDDEN)
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -20,7 +20,7 @@ API routes for Qemu nodes.
import os
from fastapi import APIRouter, WebSocket, Depends, Body, Path, status
from fastapi import APIRouter, WebSocket, Depends, Body, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -104,12 +104,13 @@ async def update_qemu_node(node_data: schemas.QemuUpdate, node: QemuVM = Depends
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_qemu_node(node: QemuVM = Depends(dep_node)) -> None:
async def delete_qemu_node(node: QemuVM = Depends(dep_node)) -> Response:
"""
Delete a Qemu node.
"""
await Qemu.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/duplicate", response_model=schemas.Qemu, status_code=status.HTTP_201_CREATED)
@ -126,61 +127,67 @@ async def duplicate_qemu_node(
@router.post("/{node_id}/resize_disk", status_code=status.HTTP_204_NO_CONTENT)
async def resize_qemu_node_disk(node_data: schemas.QemuDiskResize, node: QemuVM = Depends(dep_node)) -> None:
async def resize_qemu_node_disk(node_data: schemas.QemuDiskResize, node: QemuVM = Depends(dep_node)) -> Response:
await node.resize_disk(node_data.drive_name, node_data.extend)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_qemu_node(node: QemuVM = Depends(dep_node)) -> None:
async def start_qemu_node(node: QemuVM = Depends(dep_node)) -> Response:
"""
Start a Qemu node.
"""
qemu_manager = Qemu.instance()
hardware_accel = qemu_manager.config.settings.Qemu.enable_hardware_acceleration
if hardware_accel and "-no-kvm" not in node.options and "-no-hax" not in node.options:
if hardware_accel and "-machine accel=tcg" not in node.options:
pm = ProjectManager.instance()
if pm.check_hardware_virtualization(node) is False:
pass # FIXME: check this
# raise ComputeError("Cannot start VM with hardware acceleration (KVM/HAX) enabled because hardware virtualization (VT-x/AMD-V) is already used by another software like VMware or VirtualBox")
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_qemu_node(node: QemuVM = Depends(dep_node)) -> None:
async def stop_qemu_node(node: QemuVM = Depends(dep_node)) -> Response:
"""
Stop a Qemu node.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_qemu_node(node: QemuVM = Depends(dep_node)) -> None:
async def reload_qemu_node(node: QemuVM = Depends(dep_node)) -> Response:
"""
Reload a Qemu node.
"""
await node.reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_qemu_node(node: QemuVM = Depends(dep_node)) -> None:
async def suspend_qemu_node(node: QemuVM = Depends(dep_node)) -> Response:
"""
Suspend a Qemu node.
"""
await node.suspend()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT)
async def resume_qemu_node(node: QemuVM = Depends(dep_node)) -> None:
async def resume_qemu_node(node: QemuVM = Depends(dep_node)) -> Response:
"""
Resume a Qemu node.
"""
await node.resume()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -236,13 +243,14 @@ async def delete_qemu_node_nio(
adapter_number: int,
port_number: int = Path(..., ge=0, le=0),
node: QemuVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
The port number on the Qemu node is always 0.
"""
await node.adapter_remove_nio_binding(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -270,13 +278,14 @@ async def stop_qemu_node_capture(
adapter_number: int,
port_number: int = Path(..., ge=0, le=0),
node: QemuVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The port number on the Qemu node is always 0.
"""
await node.stop_capture(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")
@ -304,6 +313,7 @@ async def console_ws(websocket: WebSocket, node: QemuVM = Depends(dep_node)) ->
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console(node: QemuVM = Depends(dep_node)) -> None:
async def reset_console(node: QemuVM = Depends(dep_node)) -> Response:
await node.reset_console()
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -20,7 +20,7 @@ API routes for VirtualBox nodes.
import os
from fastapi import APIRouter, WebSocket, Depends, Path, status
from fastapi import APIRouter, WebSocket, Depends, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -137,57 +137,63 @@ async def update_virtualbox_node(
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None:
async def delete_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response:
"""
Delete a VirtualBox node.
"""
await VirtualBox.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None:
async def start_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response:
"""
Start a VirtualBox node.
"""
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None:
async def stop_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response:
"""
Stop a VirtualBox node.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None:
async def suspend_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response:
"""
Suspend a VirtualBox node.
"""
await node.suspend()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT)
async def resume_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None:
async def resume_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response:
"""
Resume a VirtualBox node.
"""
await node.resume()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> None:
async def reload_virtualbox_node(node: VirtualBoxVM = Depends(dep_node)) -> Response:
"""
Reload a VirtualBox node.
"""
await node.reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -243,13 +249,14 @@ async def delete_virtualbox_node_nio(
adapter_number: int,
port_number: int = Path(..., ge=0, le=0),
node: VirtualBoxVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
The port number on the VirtualBox node is always 0.
"""
await node.adapter_remove_nio_binding(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -277,13 +284,14 @@ async def stop_virtualbox_node_capture(
adapter_number: int,
port_number: int = Path(..., ge=0, le=0),
node: VirtualBoxVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The port number on the VirtualBox node is always 0.
"""
await node.stop_capture(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")
@ -312,6 +320,7 @@ async def console_ws(websocket: WebSocket, node: VirtualBoxVM = Depends(dep_node
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console(node: VirtualBoxVM = Depends(dep_node)) -> None:
async def reset_console(node: VirtualBoxVM = Depends(dep_node)) -> Response:
await node.reset_console()
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -20,7 +20,7 @@ API routes for VMware nodes.
import os
from fastapi import APIRouter, WebSocket, Depends, Path, status
from fastapi import APIRouter, WebSocket, Depends, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -103,57 +103,63 @@ def update_vmware_node(node_data: schemas.VMwareUpdate, node: VMwareVM = Depends
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_vmware_node(node: VMwareVM = Depends(dep_node)) -> None:
async def delete_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response:
"""
Delete a VMware node.
"""
await VMware.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_vmware_node(node: VMwareVM = Depends(dep_node)) -> None:
async def start_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response:
"""
Start a VMware node.
"""
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_vmware_node(node: VMwareVM = Depends(dep_node)) -> None:
async def stop_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response:
"""
Stop a VMware node.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_vmware_node(node: VMwareVM = Depends(dep_node)) -> None:
async def suspend_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response:
"""
Suspend a VMware node.
"""
await node.suspend()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/resume", status_code=status.HTTP_204_NO_CONTENT)
async def resume_vmware_node(node: VMwareVM = Depends(dep_node)) -> None:
async def resume_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response:
"""
Resume a VMware node.
"""
await node.resume()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_vmware_node(node: VMwareVM = Depends(dep_node)) -> None:
async def reload_vmware_node(node: VMwareVM = Depends(dep_node)) -> Response:
"""
Reload a VMware node.
"""
await node.reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -207,13 +213,14 @@ async def delete_vmware_node_nio(
adapter_number: int,
port_number: int = Path(..., ge=0, le=0),
node: VMwareVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
The port number on the VMware node is always 0.
"""
await node.adapter_remove_nio_binding(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -241,13 +248,14 @@ async def stop_vmware_node_capture(
adapter_number: int,
port_number: int = Path(..., ge=0, le=0),
node: VMwareVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The port number on the VMware node is always 0.
"""
await node.stop_capture(adapter_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")
@ -289,6 +297,7 @@ async def console_ws(websocket: WebSocket, node: VMwareVM = Depends(dep_node)) -
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console(node: VMwareVM = Depends(dep_node)) -> None:
async def reset_console(node: VMwareVM = Depends(dep_node)) -> Response:
await node.reset_console()
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -20,7 +20,7 @@ API routes for VPCS nodes.
import os
from fastapi import APIRouter, WebSocket, Depends, Body, Path, status
from fastapi import APIRouter, WebSocket, Depends, Body, Path, Response, status
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse
from uuid import UUID
@ -93,12 +93,13 @@ def update_vpcs_node(node_data: schemas.VPCSUpdate, node: VPCSVM = Depends(dep_n
@router.delete("/{node_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None:
async def delete_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response:
"""
Delete a VPCS node.
"""
await VPCS.instance().delete_node(node.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/duplicate", response_model=schemas.VPCS, status_code=status.HTTP_201_CREATED)
@ -114,40 +115,43 @@ async def duplicate_vpcs_node(
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None:
async def start_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response:
"""
Start a VPCS node.
"""
await node.start()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None:
async def stop_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response:
"""
Stop a VPCS node.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None:
async def suspend_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response:
"""
Suspend a VPCS node.
Does nothing, suspend is not supported by VPCS.
"""
pass
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_vpcs_node(node: VPCSVM = Depends(dep_node)) -> None:
async def reload_vpcs_node(node: VPCSVM = Depends(dep_node)) -> Response:
"""
Reload a VPCS node.
"""
await node.reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -202,13 +206,14 @@ async def delete_vpcs_node_nio(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: VPCSVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Delete a NIO (Network Input/Output) from the node.
The adapter number on the VPCS node is always 0.
"""
await node.port_remove_nio_binding(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/start")
@ -237,19 +242,21 @@ async def stop_vpcs_node_capture(
adapter_number: int = Path(..., ge=0, le=0),
port_number: int,
node: VPCSVM = Depends(dep_node)
) -> None:
) -> Response:
"""
Stop a packet capture on the node.
The adapter number on the VPCS node is always 0.
"""
await node.stop_capture(port_number)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console(node: VPCSVM = Depends(dep_node)) -> None:
async def reset_console(node: VPCSVM = Depends(dep_node)) -> Response:
await node.reset_console()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/adapters/{adapter_number}/ports/{port_number}/capture/stream")

View File

@ -104,7 +104,6 @@ router.include_router(
router.include_router(
symbols.router,
dependencies=[Depends(get_current_active_user)],
prefix="/symbols", tags=["Symbols"]
)

View File

@ -18,7 +18,7 @@
API routes for computes.
"""
from fastapi import APIRouter, Depends, status
from fastapi import APIRouter, Depends, Response, status
from typing import List, Union
from uuid import UUID
@ -93,12 +93,13 @@ async def update_compute(
@router.delete("/{compute_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_compute(
compute_id: Union[str, UUID], computes_repo: ComputesRepository = Depends(get_repository(ComputesRepository))
) -> None:
) -> Response:
"""
Delete a compute from the controller.
"""
await ComputesService(computes_repo).delete_compute(compute_id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{compute_id}/{emulator}/images")

View File

@ -18,7 +18,7 @@ import asyncio
import signal
import os
from fastapi import APIRouter, Depends, status
from fastapi import APIRouter, Depends, Response, status
from fastapi.encoders import jsonable_encoder
from typing import List
@ -72,12 +72,13 @@ def check_version(version: schemas.Version) -> dict:
dependencies=[Depends(get_current_active_user)],
status_code=status.HTTP_204_NO_CONTENT,
)
async def reload() -> None:
async def reload() -> Response:
"""
Reload the controller
"""
await Controller.instance().reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -86,7 +87,7 @@ async def reload() -> None:
status_code=status.HTTP_204_NO_CONTENT,
responses={403: {"model": schemas.ErrorMessage, "description": "Server shutdown not allowed"}},
)
async def shutdown() -> None:
async def shutdown() -> Response:
"""
Shutdown the server
"""
@ -114,6 +115,7 @@ async def shutdown() -> None:
# then shutdown the server itself
os.kill(os.getpid(), signal.SIGTERM)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get(

View File

@ -18,7 +18,7 @@
API routes for drawings.
"""
from fastapi import APIRouter, status
from fastapi import APIRouter, Response, status
from fastapi.encoders import jsonable_encoder
from typing import List
from uuid import UUID
@ -76,10 +76,11 @@ async def update_drawing(project_id: UUID, drawing_id: UUID, drawing_data: schem
@router.delete("/{drawing_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_drawing(project_id: UUID, drawing_id: UUID) -> None:
async def delete_drawing(project_id: UUID, drawing_id: UUID) -> Response:
"""
Delete a drawing.
"""
project = await Controller.instance().get_loaded_project(str(project_id))
await project.delete_drawing(str(drawing_id))
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -19,7 +19,7 @@
API routes for user groups.
"""
from fastapi import APIRouter, Depends, status
from fastapi import APIRouter, Depends, Response, status
from uuid import UUID
from typing import List
@ -113,7 +113,7 @@ async def update_user_group(
async def delete_user_group(
user_group_id: UUID,
users_repo: UsersRepository = Depends(get_repository(UsersRepository)),
) -> None:
) -> Response:
"""
Delete an user group
"""
@ -129,6 +129,8 @@ async def delete_user_group(
if not success:
raise ControllerError(f"User group '{user_group_id}' could not be deleted")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{user_group_id}/members", response_model=List[schemas.User])
async def get_user_group_members(
@ -150,7 +152,7 @@ async def add_member_to_group(
user_group_id: UUID,
user_id: UUID,
users_repo: UsersRepository = Depends(get_repository(UsersRepository))
) -> None:
) -> Response:
"""
Add member to an user group.
"""
@ -163,6 +165,8 @@ async def add_member_to_group(
if not user_group:
raise ControllerNotFoundError(f"User group '{user_group_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.delete(
"/{user_group_id}/members/{user_id}",
@ -172,7 +176,7 @@ async def remove_member_from_group(
user_group_id: UUID,
user_id: UUID,
users_repo: UsersRepository = Depends(get_repository(UsersRepository)),
) -> None:
) -> Response:
"""
Remove member from an user group.
"""
@ -185,6 +189,8 @@ async def remove_member_from_group(
if not user_group:
raise ControllerNotFoundError(f"User group '{user_group_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{user_group_id}/roles", response_model=List[schemas.Role])
async def get_user_group_roles(
@ -207,7 +213,7 @@ async def add_role_to_group(
role_id: UUID,
users_repo: UsersRepository = Depends(get_repository(UsersRepository)),
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository))
) -> None:
) -> Response:
"""
Add role to an user group.
"""
@ -220,6 +226,8 @@ async def add_role_to_group(
if not user_group:
raise ControllerNotFoundError(f"User group '{user_group_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.delete(
"/{user_group_id}/roles/{role_id}",
@ -230,7 +238,7 @@ async def remove_role_from_group(
role_id: UUID,
users_repo: UsersRepository = Depends(get_repository(UsersRepository)),
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository))
) -> None:
) -> Response:
"""
Remove role from an user group.
"""
@ -242,3 +250,5 @@ async def remove_role_from_group(
user_group = await users_repo.remove_role_from_user_group(user_group_id, role)
if not user_group:
raise ControllerNotFoundError(f"User group '{user_group_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -21,7 +21,7 @@ API routes for links.
import multidict
import aiohttp
from fastapi import APIRouter, Depends, Request, status
from fastapi import APIRouter, Depends, Request, Response, status
from fastapi.responses import StreamingResponse
from fastapi.encoders import jsonable_encoder
from typing import List
@ -81,6 +81,8 @@ async def create_link(project_id: UUID, link_data: schemas.LinkCreate) -> schema
link_data = jsonable_encoder(link_data, exclude_unset=True)
if "filters" in link_data:
await link.update_filters(link_data["filters"])
if "link_style" in link_data:
await link.update_link_style(link_data["link_style"])
if "suspend" in link_data:
await link.update_suspend(link_data["suspend"])
try:
@ -124,6 +126,8 @@ async def update_link(link_data: schemas.LinkUpdate, link: Link = Depends(dep_li
link_data = jsonable_encoder(link_data, exclude_unset=True)
if "filters" in link_data:
await link.update_filters(link_data["filters"])
if "link_style" in link_data:
await link.update_link_style(link_data["link_style"])
if "suspend" in link_data:
await link.update_suspend(link_data["suspend"])
if "nodes" in link_data:
@ -132,13 +136,14 @@ async def update_link(link_data: schemas.LinkUpdate, link: Link = Depends(dep_li
@router.delete("/{link_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_link(project_id: UUID, link: Link = Depends(dep_link)) -> None:
async def delete_link(project_id: UUID, link: Link = Depends(dep_link)) -> Response:
"""
Delete a link.
"""
project = await Controller.instance().get_loaded_project(str(project_id))
await project.delete_link(link.id)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{link_id}/reset", response_model=schemas.Link)
@ -165,12 +170,13 @@ async def start_capture(capture_data: dict, link: Link = Depends(dep_link)) -> s
@router.post("/{link_id}/capture/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_capture(link: Link = Depends(dep_link)) -> None:
async def stop_capture(link: Link = Depends(dep_link)) -> Response:
"""
Stop packet capture on the link.
"""
await link.stop_capture()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{link_id}/capture/stream")

View File

@ -130,40 +130,44 @@ async def get_nodes(project: Project = Depends(dep_project)) -> List[schemas.Nod
@router.post("/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_all_nodes(project: Project = Depends(dep_project)) -> None:
async def start_all_nodes(project: Project = Depends(dep_project)) -> Response:
"""
Start all nodes belonging to a given project.
"""
await project.start_all()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_all_nodes(project: Project = Depends(dep_project)) -> None:
async def stop_all_nodes(project: Project = Depends(dep_project)) -> Response:
"""
Stop all nodes belonging to a given project.
"""
await project.stop_all()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_all_nodes(project: Project = Depends(dep_project)) -> None:
async def suspend_all_nodes(project: Project = Depends(dep_project)) -> Response:
"""
Suspend all nodes belonging to a given project.
"""
await project.suspend_all()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_all_nodes(project: Project = Depends(dep_project)) -> None:
async def reload_all_nodes(project: Project = Depends(dep_project)) -> Response:
"""
Reload all nodes belonging to a given project.
"""
await project.stop_all()
await project.start_all()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}", response_model=schemas.Node)
@ -197,12 +201,13 @@ async def update_node(node_data: schemas.NodeUpdate, node: Node = Depends(dep_no
status_code=status.HTTP_204_NO_CONTENT,
responses={**responses, 409: {"model": schemas.ErrorMessage, "description": "Cannot delete node"}},
)
async def delete_node(node_id: UUID, project: Project = Depends(dep_project)) -> None:
async def delete_node(node_id: UUID, project: Project = Depends(dep_project)) -> Response:
"""
Delete a node from a project.
"""
await project.delete_node(str(node_id))
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/duplicate", response_model=schemas.Node, status_code=status.HTTP_201_CREATED)
@ -216,39 +221,43 @@ async def duplicate_node(duplicate_data: schemas.NodeDuplicate, node: Node = Dep
@router.post("/{node_id}/start", status_code=status.HTTP_204_NO_CONTENT)
async def start_node(start_data: dict, node: Node = Depends(dep_node)) -> None:
async def start_node(start_data: dict, node: Node = Depends(dep_node)) -> Response:
"""
Start a node.
"""
await node.start(data=start_data)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/stop", status_code=status.HTTP_204_NO_CONTENT)
async def stop_node(node: Node = Depends(dep_node)) -> None:
async def stop_node(node: Node = Depends(dep_node)) -> Response:
"""
Stop a node.
"""
await node.stop()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/suspend", status_code=status.HTTP_204_NO_CONTENT)
async def suspend_node(node: Node = Depends(dep_node)) -> None:
async def suspend_node(node: Node = Depends(dep_node)) -> Response:
"""
Suspend a node.
"""
await node.suspend()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/reload", status_code=status.HTTP_204_NO_CONTENT)
async def reload_node(node: Node = Depends(dep_node)) -> None:
async def reload_node(node: Node = Depends(dep_node)) -> Response:
"""
Reload a node.
"""
await node.reload()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/links", response_model=List[schemas.Link], response_model_exclude_unset=True)
@ -282,11 +291,13 @@ async def idlepc_proposals(node: Node = Depends(dep_node)) -> List[str]:
@router.post("/{node_id}/resize_disk", status_code=status.HTTP_204_NO_CONTENT)
async def resize_disk(resize_data: dict, node: Node = Depends(dep_node)) -> None:
async def resize_disk(resize_data: dict, node: Node = Depends(dep_node)) -> Response:
"""
Resize a disk image.
"""
await node.post("/resize_disk", **resize_data)
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{node_id}/files/{file_path:path}")
@ -377,15 +388,17 @@ async def ws_console(websocket: WebSocket, node: Node = Depends(dep_node)) -> No
@router.post("/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def reset_console_all_nodes(project: Project = Depends(dep_project)) -> None:
async def reset_console_all_nodes(project: Project = Depends(dep_project)) -> Response:
"""
Reset console for all nodes belonging to the project.
"""
await project.reset_console_all()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{node_id}/console/reset", status_code=status.HTTP_204_NO_CONTENT)
async def console_reset(node: Node = Depends(dep_node)) -> None:
async def console_reset(node: Node = Depends(dep_node)) -> Response:
await node.post("/console/reset") # , request.json)
await node.post("/console/reset")
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -19,7 +19,7 @@
API routes for permissions.
"""
from fastapi import APIRouter, Depends, status
from fastapi import APIRouter, Depends, Response, status
from uuid import UUID
from typing import List
@ -104,7 +104,7 @@ async def update_permission(
async def delete_permission(
permission_id: UUID,
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)),
) -> None:
) -> Response:
"""
Delete a permission.
"""
@ -116,3 +116,6 @@ async def delete_permission(
success = await rbac_repo.delete_permission(permission_id)
if not success:
raise ControllerError(f"Permission '{permission_id}' could not be deleted")
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -30,7 +30,7 @@ import logging
log = logging.getLogger()
from fastapi import APIRouter, Depends, Request, Body, HTTPException, status, WebSocket, WebSocketDisconnect
from fastapi import APIRouter, Depends, Request, Response, Body, HTTPException, status, WebSocket, WebSocketDisconnect
from fastapi.encoders import jsonable_encoder
from fastapi.responses import StreamingResponse, FileResponse
from websockets.exceptions import ConnectionClosed, WebSocketException
@ -141,7 +141,7 @@ async def update_project(
async def delete_project(
project: Project = Depends(dep_project),
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository))
) -> None:
) -> Response:
"""
Delete a project.
"""
@ -150,6 +150,7 @@ async def delete_project(
await project.delete()
controller.remove_project(project)
await rbac_repo.delete_all_permissions_with_path(f"/projects/{project.id}")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{project_id}/stats")
@ -166,12 +167,13 @@ def get_project_stats(project: Project = Depends(dep_project)) -> dict:
status_code=status.HTTP_204_NO_CONTENT,
responses={**responses, 409: {"model": schemas.ErrorMessage, "description": "Could not close project"}},
)
async def close_project(project: Project = Depends(dep_project)) -> None:
async def close_project(project: Project = Depends(dep_project)) -> Response:
"""
Close a project.
"""
await project.close()
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
@ -415,7 +417,7 @@ async def get_file(file_path: str, project: Project = Depends(dep_project)) -> F
@router.post("/{project_id}/files/{file_path:path}", status_code=status.HTTP_204_NO_CONTENT)
async def write_file(file_path: str, request: Request, project: Project = Depends(dep_project)) -> None:
async def write_file(file_path: str, request: Request, project: Project = Depends(dep_project)) -> Response:
"""
Write a file from a project.
"""
@ -440,6 +442,8 @@ async def write_file(file_path: str, request: Request, project: Project = Depend
except OSError as e:
raise ControllerError(str(e))
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post(
"/{project_id}/templates/{template_id}",

View File

@ -19,7 +19,7 @@
API routes for roles.
"""
from fastapi import APIRouter, Depends, status
from fastapi import APIRouter, Depends, Response, status
from uuid import UUID
from typing import List
@ -106,7 +106,7 @@ async def update_role(
async def delete_role(
role_id: UUID,
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)),
) -> None:
) -> Response:
"""
Delete a role.
"""
@ -122,6 +122,8 @@ async def delete_role(
if not success:
raise ControllerError(f"Role '{role_id}' could not be deleted")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("/{role_id}/permissions", response_model=List[schemas.Permission])
async def get_role_permissions(
@ -143,7 +145,7 @@ async def add_permission_to_role(
role_id: UUID,
permission_id: UUID,
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository))
) -> None:
) -> Response:
"""
Add a permission to a role.
"""
@ -156,6 +158,8 @@ async def add_permission_to_role(
if not role:
raise ControllerNotFoundError(f"Role '{role_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.delete(
"/{role_id}/permissions/{permission_id}",
@ -165,7 +169,7 @@ async def remove_permission_from_role(
role_id: UUID,
permission_id: UUID,
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)),
) -> None:
) -> Response:
"""
Remove member from an user group.
"""
@ -177,3 +181,5 @@ async def remove_permission_from_role(
role = await rbac_repo.remove_permission_from_role(role_id, permission)
if not role:
raise ControllerNotFoundError(f"Role '{role_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -23,7 +23,7 @@ import logging
log = logging.getLogger()
from fastapi import APIRouter, Depends, status
from fastapi import APIRouter, Depends, Response, status
from typing import List
from uuid import UUID
@ -69,12 +69,13 @@ def get_snapshots(project: Project = Depends(dep_project)) -> List[schemas.Snaps
@router.delete("/{snapshot_id}", status_code=status.HTTP_204_NO_CONTENT)
async def delete_snapshot(snapshot_id: UUID, project: Project = Depends(dep_project)) -> None:
async def delete_snapshot(snapshot_id: UUID, project: Project = Depends(dep_project)) -> Response:
"""
Delete a snapshot.
"""
await project.delete_snapshot(str(snapshot_id))
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.post("/{snapshot_id}/restore", status_code=status.HTTP_201_CREATED, response_model=schemas.Project)

View File

@ -21,7 +21,7 @@ API routes for symbols.
import os
from fastapi import APIRouter, Request, status
from fastapi import APIRouter, Request, Depends, Response, status
from fastapi.responses import FileResponse
from typing import List
@ -29,6 +29,8 @@ from gns3server.controller import Controller
from gns3server import schemas
from gns3server.controller.controller_error import ControllerError, ControllerNotFoundError
from .dependencies.authentication import get_current_active_user
import logging
log = logging.getLogger(__name__)
@ -57,7 +59,7 @@ async def get_symbol(symbol_id: str) -> FileResponse:
symbol = controller.symbols.get_path(symbol_id)
return FileResponse(symbol)
except (KeyError, OSError) as e:
return ControllerNotFoundError(f"Could not get symbol file: {e}")
raise ControllerNotFoundError(f"Could not get symbol file: {e}")
@router.get(
@ -75,11 +77,25 @@ async def get_symbol_dimensions(symbol_id: str) -> dict:
symbol_dimensions = {"width": width, "height": height}
return symbol_dimensions
except (KeyError, OSError, ValueError) as e:
return ControllerNotFoundError(f"Could not get symbol file: {e}")
raise ControllerNotFoundError(f"Could not get symbol file: {e}")
@router.post("/{symbol_id:path}/raw", status_code=status.HTTP_204_NO_CONTENT)
async def upload_symbol(symbol_id: str, request: Request) -> None:
@router.get("/default_symbols")
def get_default_symbols() -> dict:
"""
Return all default symbols.
"""
controller = Controller.instance()
return controller.symbols.default_symbols()
@router.post(
"/{symbol_id:path}/raw",
dependencies=[Depends(get_current_active_user)],
status_code=status.HTTP_204_NO_CONTENT
)
async def upload_symbol(symbol_id: str, request: Request) -> Response:
"""
Upload a symbol file.
"""
@ -96,12 +112,4 @@ async def upload_symbol(symbol_id: str, request: Request) -> None:
# Reset the symbol list
controller.symbols.list()
@router.get("/default_symbols")
def get_default_symbols() -> dict:
"""
Return all default symbols.
"""
controller = Controller.instance()
return controller.symbols.default_symbols()
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -25,7 +25,7 @@ import logging
log = logging.getLogger(__name__)
from fastapi import APIRouter, Request, Response, HTTPException, Depends, status
from fastapi import APIRouter, Request, Response, HTTPException, Depends, Response, status
from typing import List
from uuid import UUID
@ -99,13 +99,14 @@ async def delete_template(
template_id: UUID,
templates_repo: TemplatesRepository = Depends(get_repository(TemplatesRepository)),
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository))
) -> None:
) -> Response:
"""
Delete a template.
"""
await TemplatesService(templates_repo).delete_template(template_id)
await rbac_repo.delete_all_permissions_with_path(f"/templates/{template_id}")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get("", response_model=List[schemas.Template], response_model_exclude_unset=True)

View File

@ -19,7 +19,7 @@
API routes for users.
"""
from fastapi import APIRouter, Depends, HTTPException, status
from fastapi import APIRouter, Depends, HTTPException, Response, status
from fastapi.security import OAuth2PasswordRequestForm
from uuid import UUID
from typing import List
@ -99,13 +99,20 @@ async def get_logged_in_user(current_user: schemas.User = Depends(get_current_ac
return current_user
@router.get("/me", response_model=schemas.User)
async def get_logged_in_user(current_user: schemas.User = Depends(get_current_active_user)) -> schemas.User:
@router.put("/me", response_model=schemas.User)
async def update_logged_in_user(
user_update: schemas.LoggedInUserUpdate,
current_user: schemas.User = Depends(get_current_active_user),
users_repo: UsersRepository = Depends(get_repository(UsersRepository))
) -> schemas.User:
"""
Get the current active user.
Update the current active user.
"""
return current_user
if user_update.email and await users_repo.get_user_by_email(user_update.email):
raise ControllerBadRequestError(f"Email '{user_update.email}' is already registered")
return await users_repo.update_user(current_user.user_id, user_update)
@router.get("", response_model=List[schemas.User], dependencies=[Depends(get_current_active_user)])
@ -167,6 +174,12 @@ async def update_user(
Update an user.
"""
if user_update.username and await users_repo.get_user_by_username(user_update.username):
raise ControllerBadRequestError(f"Username '{user_update.username}' is already registered")
if user_update.email and await users_repo.get_user_by_email(user_update.email):
raise ControllerBadRequestError(f"Email '{user_update.email}' is already registered")
user = await users_repo.update_user(user_id, user_update)
if not user:
raise ControllerNotFoundError(f"User '{user_id}' not found")
@ -181,7 +194,7 @@ async def update_user(
async def delete_user(
user_id: UUID,
users_repo: UsersRepository = Depends(get_repository(UsersRepository)),
) -> None:
) -> Response:
"""
Delete an user.
"""
@ -197,6 +210,8 @@ async def delete_user(
if not success:
raise ControllerError(f"User '{user_id}' could not be deleted")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.get(
"/{user_id}/groups",
@ -239,7 +254,7 @@ async def add_permission_to_user(
user_id: UUID,
permission_id: UUID,
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository))
) -> None:
) -> Response:
"""
Add a permission to an user.
"""
@ -252,6 +267,8 @@ async def add_permission_to_user(
if not user:
raise ControllerNotFoundError(f"User '{user_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)
@router.delete(
"/{user_id}/permissions/{permission_id}",
@ -262,7 +279,7 @@ async def remove_permission_from_user(
user_id: UUID,
permission_id: UUID,
rbac_repo: RbacRepository = Depends(get_repository(RbacRepository)),
) -> None:
) -> Response:
"""
Remove permission from an user.
"""
@ -274,3 +291,5 @@ async def remove_permission_from_user(
user = await rbac_repo.remove_permission_from_user(user_id, permission)
if not user:
raise ControllerNotFoundError(f"User '{user_id}' not found")
return Response(status_code=status.HTTP_204_NO_CONTENT)

View File

@ -0,0 +1,46 @@
{
"name": "6WIND Turbo Router",
"category": "router",
"description": "6WIND Turbo Router is a high performance, ready-to-use software virtual router. It can be deployed bare metal or in virtual machines on commercial-off-the-shelf (COTS) servers. It is a carrier-grade solution for Service Prodivers aiming at using white boxes to deploy network functions. Typical use-cases are transit/peering router, IPsec VPN gateway and CGNAT.",
"vendor_name": "6WIND",
"vendor_url": "https://www.6wind.com/",
"documentation_url": "https://doc.6wind.com/turbo-router-3/latest/turbo-router/",
"product_name": "6WIND Turbo Router",
"product_url": "https://www.6wind.com/vrouter-solutions/turbo-router/",
"registry_version": 4,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"usage": "Default username / password is admin / admin.",
"symbol": "6wind.svg",
"port_name_format": "eth{0}",
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 8,
"ram": 4096,
"cpus": 4,
"hda_disk_interface": "virtio",
"arch": "x86_64",
"console_type": "telnet",
"boot_priority": "c",
"kvm": "require",
"options": "-cpu host"
},
"images": [
{
"filename": "6wind-vrouter-tr-ae-x86_64-v3.1.4.m1.qcow2",
"version": "3.1.4.m1",
"md5sum": "bc84b81fba4f2f01eda6a338469e37a5",
"filesize": 693829632,
"download_url": "https://portal.6wind.com/register.php?utm_campaign=GNS3-2021-EVAL"
}
],
"versions": [
{
"name": "3.1.4.m1",
"images": {
"hda_disk_image": "6wind-vrouter-tr-ae-x86_64-v3.1.4.m1.qcow2"
}
}
]
}

View File

@ -29,7 +29,6 @@
"process_priority": "normal"
},
"images": [
{
"filename": "arubaoscx-disk-image-genericx86-p4-20201110192651.vmdk",
"version": "10.06.0001",

View File

@ -5,8 +5,8 @@
"vendor_name": "HPE Aruba",
"vendor_url": "arubanetworks.com",
"documentation_url": "https://asp.arubanetworks.com/downloads;products=Aruba%20SD-WAN",
"product_url": "https://www.arubanetworks.com/products/networking/gateways-and-controllers/",
"product_name": "Aruba SD-WAN Virtual Gateway",
"product_url": "https://www.arubanetworks.com/products/networking/gateways-and-controllers/",
"registry_version": 4,
"status": "stable",
"availability": "service-contract",

View File

@ -22,7 +22,7 @@
"console_type": "telnet",
"kernel_command_line": "ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536 ide1=noprobe no-hlt",
"kvm": "disable",
"options": "-no-kvm -icount auto -hdachs 980,16,32",
"options": "-machine accel=tcg -icount auto -hdachs 980,16,32",
"cpu_throttling": 80,
"process_priority": "low"
},

View File

@ -25,6 +25,20 @@
"kvm": "require"
},
"images": [
{
"filename": "asav9-15-1.qcow2",
"version": "9.15.1",
"md5sum": "4e8747667f52e9046979f126128a61d1",
"filesize": 252444672,
"download_url": "https://software.cisco.com/download/home/286119613/type/280775065/release/9.15.1"
},
{
"filename": "asav9-14-1.qcow2",
"version": "9.14.1",
"md5sum": "03d89e18e7f8ad00fe8e979c4790587d",
"filesize": 211877888,
"download_url": "https://software.cisco.com/download/home/286119613/type/280775065/release/9.14.1"
},
{
"filename": "asav9-12-2-9.qcow2",
"version": "9.12.2-9",
@ -90,6 +104,18 @@
}
],
"versions": [
{
"name": "9.15.1",
"images": {
"hda_disk_image": "asav9-15-1.qcow2"
}
},
{
"name": "9.14.1",
"images": {
"hda_disk_image": "asav9-14-1.qcow2"
}
},
{
"name": "9.12.2-9",
"images": {

View File

@ -31,6 +31,13 @@
"download_url": "https://sourceforge.net/projects/gns-3/files",
"direct_download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/IOSv_startup_config.img/download"
},
{
"filename": "vios-adventerprisek9-m.spa.159-3.m3.qcow2",
"version": "15.9(3)M3",
"md5sum": "12893843af18e4c62f13d07266755653",
"filesize": 57296384,
"download_url": "https://learningnetworkstore.cisco.com/myaccount"
},
{
"filename": "vios-adventerprisek9-m.spa.159-3.m2.qcow2",
"version": "15.9(3)M2",
@ -75,6 +82,13 @@
}
],
"versions": [
{
"name": "15.9(3)M3",
"images": {
"hda_disk_image": "vios-adventerprisek9-m.spa.159-3.m3.qcow2",
"hdb_disk_image": "IOSv_startup_config.img"
}
},
{
"name": "15.9(3)M2",
"images": {

View File

@ -23,6 +23,13 @@
"kvm": "require"
},
"images": [
{
"filename": "vios_l2-adventerprisek9-m.ssa.high_iron_20200929.qcow2",
"version": "15.2(20200924:215240)",
"md5sum": "99ecab32de12410c533e6abd4e9710aa",
"filesize": 90409984,
"download_url": "https://learningnetworkstore.cisco.com/myaccount"
},
{
"filename": "vios_l2-adventerprisek9-m.ssa.high_iron_20190423.qcow2",
"version": "15.2(6.0.81)E",
@ -53,6 +60,12 @@
}
],
"versions": [
{
"name": "15.2(20200924:215240)",
"images": {
"hda_disk_image": "vios_l2-adventerprisek9-m.ssa.high_iron_20200929.qcow2"
}
},
{
"name": "15.2(6.0.81)E",
"images": {

View File

@ -26,6 +26,13 @@
"options": "-nographic"
},
"images": [
{
"filename": "VOSSGNS3.8.4.0.0.qcow2",
"version": "v8.4.0.0",
"md5sum": "f457e7da3c1dec50670624c421333ef3",
"filesize": 386203648,
"direct_download_url": "https://akamai-ep.extremenetworks.com/Extreme_P/github-en/Virtual_VOSS/VOSSGNS3.8.4.0.0.qcow2"
},
{
"filename": "VOSSGNS3.8.3.0.0.qcow2",
"version": "v8.3.0.0",
@ -70,6 +77,12 @@
}
],
"versions": [
{
"name": "v8.4.0.0",
"images": {
"hda_disk_image": "VOSSGNS3.8.4.0.0.qcow2"
}
},
{
"name": "v8.3.0.0",
"images": {

View File

@ -21,6 +21,14 @@
"kvm": "allow"
},
"images": [
{
"filename": "frr-7.5.1.qcow2",
"version": "7.5.1",
"md5sum": "4b3ca0932a396b282ba35f102be1ed3b",
"filesize": 51169280,
"download_url": "https://sourceforge.net/projects/gns-3/files/Qemu%20Appliances/",
"direct_download_url": "http://downloads.sourceforge.net/project/gns-3/Qemu%20Appliances/frr-7.5.1.qcow2"
},
{
"filename": "frr-7.3.1.qcow2",
"version": "7.3.1",
@ -31,6 +39,12 @@
}
],
"versions": [
{
"name": "7.5.1",
"images": {
"hda_disk_image": "frr-7.5.1.qcow2"
}
},
{
"name": "7.3.1",
"images": {

View File

@ -6,7 +6,7 @@
"vendor_url": "https://www.huawei.com",
"product_name": "HuaWei AR1000v",
"product_url": "https://support.huawei.com/enterprise/en/routers/ar1000v-pid-21768212",
"registry_version": 5,
"registry_version": 4,
"status": "experimental",
"availability": "service-contract",
"maintainer": "none",

View File

@ -5,7 +5,7 @@
"vendor_name": "HuaWei",
"vendor_url": "https://www.huawei.com",
"product_name": "HuaWei CE12800",
"registry_version": 5,
"registry_version": 4,
"status": "experimental",
"availability": "service-contract",
"maintainer": "none",
@ -33,10 +33,10 @@
],
"versions": [
{
"name": "V200R005C10SPC607B607",
"images": {
"hda_disk_image": "ce12800-V200R005C10SPC607B607.qcow2"
},
"name": "V200R005C10SPC607B607"
}
}
]
}

View File

@ -6,7 +6,7 @@
"vendor_url": "https://www.huawei.com",
"product_name": "HuaWei NE40E",
"product_url": "https://e.huawei.com/en/products/enterprise-networking/routers/ne/ne40e",
"registry_version": 5,
"registry_version": 4,
"status": "experimental",
"availability": "service-contract",
"maintainer": "none",
@ -35,10 +35,10 @@
],
"versions": [
{
"name": "V800R011C00SPC607B607",
"images": {
"hda_disk_image": "ne40e-V800R011C00SPC607B607.qcow2"
},
"name": "V800R011C00SPC607B607"
}
}
]
}

View File

@ -6,7 +6,7 @@
"vendor_url": "https://www.huawei.com",
"product_name": "HuaWei USG6000v",
"product_url": "https://e.huawei.com/en/products/enterprise-networking/security/firewall-gateway/usg6000v",
"registry_version": 5,
"registry_version": 4,
"status": "experimental",
"availability": "service-contract",
"maintainer": "none",

View File

@ -23,6 +23,14 @@
"kvm": "require"
},
"images": [
{
"filename": "kali-linux-2021.1-live-amd64.iso",
"version": "2021.1",
"md5sum": "3a3716fef866e5c29a1c1ccfc94264b5",
"filesize": 3591385088,
"download_url": "http://cdimage.kali.org/kali-2021.1/",
"direct_download_url": "http://cdimage.kali.org/kali-2021.1/kali-linux-2021.1-live-amd64.iso"
},
{
"filename": "kali-linux-2019.3-amd64.iso",
"version": "2019.3",
@ -137,6 +145,13 @@
}
],
"versions": [
{
"name": "2021.1",
"images": {
"hda_disk_image": "kali-linux-persistence-1gb.qcow2",
"cdrom_image": "kali-linux-2021.1-live-amd64.iso"
}
},
{
"name": "2019.3",
"images": {

View File

@ -3,16 +3,18 @@
"category": "guest",
"description": "ntopng is the next generation version of the original ntop, a network traffic probe that shows the network usage, similar to what the popular top Unix command does. ntopng is based on libpcap and it has been written in a portable way in order to virtually run on every Unix platform, MacOSX and on Windows as well. ntopng users can use a a web browser to navigate through ntop (that acts as a web server) traffic information and get a dump of the network status. In the latter case, ntopng can be seen as a simple RMON-like agent with an embedded web interface.",
"vendor_name": "ntop",
"vendor_url": "http://www.ntop.org/",
"vendor_url": "https://www.ntop.org/",
"documentation_url": "https://www.ntop.org/guides/ntopng/",
"product_name": "ntopng",
"registry_version": 3,
"status": "stable",
"maintainer": "GNS3 Team",
"maintainer_email": "developers@gns3.net",
"usage": "In the web interface login as admin/admin",
"usage": "In the web interface login as admin/admin\n\nPersistent configuration:\n- Add \"/var/lib/redis\" as an additional persistent directory.\n- Use \"redis-cli save\" in an auxiliary console to save the configuration.",
"docker": {
"adapters": 1,
"image": "lucaderi/ntopng-docker:latest",
"image": "ntop/ntopng:stable",
"start_command": "--dns-mode 2 --interface eth0",
"console_type": "http",
"console_http_port": 3000,
"console_http_path": "/"

View File

@ -7,7 +7,7 @@
"documentation_url": "https://access.redhat.com/solutions/641193",
"product_name": "Red Hat Enterprise Linux KVM Guest Image",
"product_url": "https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux",
"registry_version": 5,
"registry_version": 4,
"status": "stable",
"availability": "service-contract",
"maintainer": "Neyder Achahuanco",
@ -56,25 +56,25 @@
],
"versions": [
{
"name": "8.3",
"images": {
"hda_disk_image": "rhel-8.3-x86_64-kvm.qcow2",
"cdrom_image": "rhel-cloud-init.iso"
},
"name": "8.3"
}
},
{
"name": "7.9",
"images": {
"hda_disk_image": "rhel-server-7.9-x86_64-kvm.qcow2",
"cdrom_image": "rhel-cloud-init.iso"
},
"name": "7.9"
}
},
{
"name": "6.10",
"images": {
"hda_disk_image": "rhel-server-6.10-update-11-x86_64-kvm.qcow2",
"cdrom_image": "rhel-cloud-init.iso"
},
"name": "6.10"
}
}
]
}

View File

@ -0,0 +1,45 @@
{
"name": "RockyLinux",
"category": "guest",
"description": "Rocky Linux is a community enterprise operating system designed to be 100% bug-for-bug compatible with Red Hat Enterprise Linux (RHEL).",
"vendor_name": "Rocky Enterprise Software Foundation",
"vendor_url": "https://rockylinux.org",
"documentation_url": "https://docs.rockylinux.org",
"product_name": "Rocky Linux",
"registry_version": 4,
"status": "experimental",
"maintainer": "Bernhard Ehlers",
"maintainer_email": "none@b-ehlers.de",
"usage": "Username:\trockylinux\nPassword:\trockylinux\nTo become root, use \"sudo su\".\n\nTo improve performance, increase RAM and vCPUs in the VM settings.",
"symbol": "linux_guest.svg",
"port_name_format": "ens{port4}",
"qemu": {
"adapter_type": "virtio-net-pci",
"adapters": 1,
"ram": 1536,
"hda_disk_interface": "sata",
"arch": "x86_64",
"console_type": "vnc",
"kvm": "require",
"options": "-usbdevice tablet"
},
"images": [
{
"filename": "RockyLinux_8.4_VMG_LinuxVMImages.COM.vmdk",
"version": "8.4",
"md5sum": "3452d5b0fbb4cdcf3ac6fe8de8d0ac08",
"filesize": 5273878528,
"download_url": "https://www.linuxvmimages.com/images/rockylinux-8",
"direct_download_url": "https://sourceforge.net/projects/linuxvmimages/files/VMware/R/rockylinux/8/RockyLinux_8.4_VMM.7z/download",
"compression": "7z"
}
],
"versions": [
{
"name": "8.4",
"images": {
"hda_disk_image": "RockyLinux_8.4_VMG_LinuxVMImages.COM.vmdk"
}
}
]
}

View File

@ -26,12 +26,19 @@
},
"images": [
{
"filename": "vyos-1.3-rolling-202101-qemu.qcow2",
"version": "1.3-snapshot-202101",
"md5sum": "b05a1f8a879c42342ea90f65ebe62f05",
"filesize": 315359232,
"download_url": "https://vyos.net/get/snapshots/",
"direct_download_url": "https://s3.amazonaws.com/s3-us.vyos.io/snapshot/vyos-1.3-rolling-202101/qemu/vyos-1.3-rolling-202101-qemu.qcow2"
"filename": "vyos-1.3.0-rc5-amd64.qcow2",
"version": "1.3.0-rc5",
"md5sum": "dd704f59afc0fccdf601cc750bf2c438",
"filesize": 361955328,
"download_url": "https://www.b-ehlers.de/GNS3/images/",
"direct_download_url": "https://www.b-ehlers.de/GNS3/images/vyos-1.3.0-rc5-amd64.qcow2"
},
{
"filename": "vyos-1.2.8-amd64.iso",
"version": "1.2.8",
"md5sum": "0ad879db903efdbf1c39dc945e165931",
"filesize": 429916160,
"download_url": "https://support.vyos.io/en/downloads/files/vyos-1-2-8-generic-iso-image"
},
{
"filename": "vyos-1.2.7-amd64.iso",
@ -59,9 +66,16 @@
],
"versions": [
{
"name": "1.3-snapshot-202101",
"name": "1.3.0-rc5",
"images": {
"hda_disk_image": "vyos-1.3-rolling-202101-qemu.qcow2"
"hda_disk_image": "vyos-1.3.0-rc5-amd64.qcow2"
}
},
{
"name": "1.2.8",
"images": {
"hda_disk_image": "empty8G.qcow2",
"cdrom_image": "vyos-1.2.8-amd64.iso"
}
},
{

View File

@ -430,6 +430,7 @@ class Cloud(BaseNode):
await self._add_ubridge_connection(nio, port_number)
self._nios[port_number] = nio
except (NodeError, UbridgeError) as e:
log.error('Cannot add NIO on cloud "{name}": {error}'.format(name=self._name, error=e))
await self._stop_ubridge()
self.status = "stopped"
self._nios[port_number] = nio

View File

@ -669,7 +669,7 @@ class QemuVM(BaseNode):
if not mac_address:
# use the node UUID to generate a random MAC address
self._mac_address = f"0c:{self.project.id[-4:-2]}:{self.project.id[-2:]}:{self.id[-4:-2]}:{self.id[-2:]}:00"
self._mac_address = f"0c:{self.id[2:4]}:{self.id[4:6]}:{self.id[6:8]}:00:00"
else:
self._mac_address = mac_address
@ -912,20 +912,26 @@ class QemuVM(BaseNode):
)
)
if not sys.platform.startswith("linux"):
# "-no-kvm" and "-no-hax' are deprecated since Qemu v5.2
if "-no-kvm" in options:
options = options.replace("-no-kvm", "")
options = options.replace("-no-kvm", "-machine accel=tcg")
if "-no-hax" in options:
options = options.replace("-no-hax", "-machine accel=tcg")
if "-enable-kvm" in options:
if not sys.platform.startswith("linux"):
# KVM can only be enabled on Linux
options = options.replace("-enable-kvm", "")
else:
if "-no-hax" in options:
options = options.replace("-no-hax", "")
options = options.replace("-enable-kvm", "-machine accel=kvm")
if "-enable-hax" in options:
if not sys.platform.startswith("win"):
# HAXM is only available on Windows
options = options.replace("-enable-hax", "")
if "-icount" in options and ("-no-kvm" not in options):
# automatically add the -no-kvm option if -icount is detected
# to help with the migration of ASA VMs created before version 1.4
options = "-no-kvm " + options
else:
options = options.replace("-enable-hax", "-machine accel=hax")
self._options = options.strip()
@property
@ -1862,6 +1868,24 @@ class QemuVM(BaseNode):
try:
qemu_img_path = self._get_qemu_img()
command = [qemu_img_path, "create", "-o", f"backing_file={disk_image}", "-f", "qcow2", disk]
try:
base_qcow2 = Qcow2(disk_image)
if base_qcow2.crypt_method:
# Workaround for https://gitlab.com/qemu-project/qemu/-/issues/441
# Also embed a secret name so it doesn't have to be passed to qemu -drive ...
options = {
"encrypt.key-secret": os.path.basename(disk_image),
"driver": "qcow2",
"file": {
"driver": "file",
"filename": disk_image,
},
}
command = [qemu_img_path, "create", "-b", "json:"+json.dumps(options, separators=(',', ':')),
"-f", "qcow2", "-u", disk, str(base_qcow2.size)]
except Qcow2Error:
pass # non-qcow2 base images are acceptable (e.g. vmdk, raw image)
retcode = await self._qemu_img_exec(command)
if retcode:
stdout = self.read_qemu_img_stdout()
@ -2070,7 +2094,7 @@ class QemuVM(BaseNode):
# The disk exists we check if the clone works
try:
qcow2 = Qcow2(disk)
await qcow2.rebase(qemu_img_path, disk_image)
await qcow2.validate(qemu_img_path)
except (Qcow2Error, OSError) as e:
raise QemuError(f"Could not use qcow2 disk image '{disk_image}' for {disk_name} {e}")
@ -2310,7 +2334,7 @@ class QemuVM(BaseNode):
enable_hardware_accel = self.manager.config.settings.Qemu.enable_hardware_acceleration
require_hardware_accel = self.manager.config.settings.Qemu.require_hardware_acceleration
if enable_hardware_accel and "-no-kvm" not in options and "-no-hax" not in options:
if enable_hardware_accel and "-machine accel=tcg" not in options:
# Turn OFF hardware acceleration for non x86 architectures
if sys.platform.startswith("win"):
supported_binaries = [

View File

@ -58,13 +58,12 @@ class Qcow2:
# uint64_t snapshots_offset;
# } QCowHeader;
struct_format = ">IIQi"
with open(self._path, "rb") as f:
struct_format = ">IIQiiQi"
with open(self._path, 'rb') as f:
content = f.read(struct.calcsize(struct_format))
try:
self.magic, self.version, self.backing_file_offset, self.backing_file_size = struct.unpack_from(
struct_format, content
)
(self.magic, self.version, self.backing_file_offset, self.backing_file_size,
self.cluster_bits, self.size, self.crypt_method) = struct.unpack_from(struct_format, content)
except struct.error:
raise Qcow2Error(f"Invalid file header for {self._path}")
@ -105,3 +104,15 @@ class Qcow2:
if retcode != 0:
raise Qcow2Error("Could not rebase the image")
self._reload()
async def validate(self, qemu_img):
"""
Run qemu-img info to validate the file and its backing images
:param qemu_img: Path to the qemu-img binary
"""
command = [qemu_img, "info", "--backing-chain", self._path]
process = await asyncio.create_subprocess_exec(*command)
retcode = await process.wait()
if retcode != 0:
raise Qcow2Error("Could not validate the image")

View File

@ -26,6 +26,7 @@ import asyncio
import subprocess
import logging
import codecs
import ipaddress
from collections import OrderedDict
from gns3server.utils.interfaces import interfaces
@ -50,6 +51,7 @@ class VMware(BaseManager):
self._vmrun_path = None
self._host_type = None
self._vmnets = []
self._vmnets_info = {}
self._vmnet_start_range = 2
if sys.platform.startswith("win"):
self._vmnet_end_range = 19
@ -277,7 +279,7 @@ class VMware(BaseManager):
else:
# location on Linux
vmware_networking_file = "/etc/vmware/networking"
vmnet_interfaces = []
vmnet_interfaces = {}
try:
with open(vmware_networking_file, encoding="utf-8") as f:
for line in f.read().splitlines():
@ -285,7 +287,20 @@ class VMware(BaseManager):
if match:
vmnet = f"vmnet{match.group(1)}"
if vmnet not in ("vmnet0", "vmnet1", "vmnet8"):
vmnet_interfaces.append(vmnet)
vmnet_interfaces[vmnet] = {}
with open(vmware_networking_file, "r", encoding="utf-8") as f:
for line in f.read().splitlines():
match = re.search(r"VNET_([0-9]+)_HOSTONLY_SUBNET\s+(.*)", line)
if match:
vmnet = "vmnet{}".format(match.group(1))
if vmnet in vmnet_interfaces.keys():
vmnet_interfaces[vmnet]["subnet"] = match.group(2)
match = re.search(r"VNET_([0-9]+)_HOSTONLY_NETMASK\s+(.*)", line)
if match:
vmnet = "vmnet{}".format(match.group(1))
if vmnet in vmnet_interfaces.keys():
vmnet_interfaces[vmnet]["netmask"] = match.group(2)
except OSError as e:
raise VMwareError(f"Cannot open {vmware_networking_file}: {e}")
return vmnet_interfaces
@ -330,6 +345,25 @@ class VMware(BaseManager):
)
return self._vmnets.pop(0)
def find_bridge_interface(self, vmnet_interface):
"""
Find the bridge interface that is used for the vmnet interface in VMware.
"""
if vmnet_interface in self._vmnets_info.keys():
subnet = self._vmnets_info[vmnet_interface].get("subnet", None)
netmask = self._vmnets_info[vmnet_interface].get("netmask", None)
if subnet and netmask:
for interface in interfaces():
try:
network = ipaddress.ip_network(f"{subnet}/{netmask}")
ip = ipaddress.ip_address(interface["ip_address"])
except ValueError:
continue
if ip in network:
return interface["name"]
return None
def refresh_vmnet_list(self, ubridge=True):
if ubridge:
@ -337,6 +371,8 @@ class VMware(BaseManager):
vmnet_interfaces = self._get_vmnet_interfaces_ubridge()
else:
vmnet_interfaces = self._get_vmnet_interfaces()
vmnet_interfaces = list(vmnet_interfaces.keys())
self._vmnets_info = vmnet_interfaces.copy()
# remove vmnets already in use
for vmware_vm in self._nodes.values():
@ -754,5 +790,4 @@ class VMware(BaseManager):
if __name__ == "__main__":
loop = asyncio.get_event_loop()
vmware = VMware.instance()
print("=> Check version")
loop.run_until_complete(asyncio.ensure_future(vmware.check_vmware_version()))

View File

@ -22,9 +22,11 @@ import sys
import os
import asyncio
import tempfile
import platform
from gns3server.utils.asyncio.telnet_server import AsyncioTelnetServer
from gns3server.utils.asyncio.serial import asyncio_open_serial
from gns3server.utils import parse_version
from gns3server.utils.asyncio import locking
from collections import OrderedDict
from .vmware_error import VMwareError
@ -260,8 +262,13 @@ class VMwareVM(BaseNode):
if self._get_vmx_setting(connected):
del self._vmx_pairs[connected]
use_ubridge = True
# use alternative method to find vmnet interfaces on macOS >= 11.0 (BigSur)
# because "bridge" interfaces are used instead and they are only created on the VM starts
if sys.platform.startswith("darwin") and parse_version(platform.mac_ver()[0]) >= parse_version("11.0.0"):
use_ubridge = False
self.manager.refresh_vmnet_list(ubridge=use_ubridge)
# then configure VMware network adapters
self.manager.refresh_vmnet_list()
for adapter_number in range(0, self._adapters):
custom_adapter = self._get_custom_adapter_settings(adapter_number)
@ -347,8 +354,17 @@ class VMwareVM(BaseNode):
vmnet_interface = os.path.basename(self._vmx_pairs[vnet])
if sys.platform.startswith("darwin"):
# special case on OSX, we cannot bind VMnet interfaces using the libpcap
await self._ubridge_send(f'bridge add_nio_fusion_vmnet {vnet} "{vmnet_interface}"')
if parse_version(platform.mac_ver()[0]) >= parse_version("11.0.0"):
# a bridge interface (bridge100, bridge101 etc.) is used instead of a vmnet interface
# on macOS >= 11.0 (Big Sur)
vmnet_interface = self.manager.find_bridge_interface(vmnet_interface)
if not vmnet_interface:
raise VMwareError(f"Could not find bridge interface linked with {vmnet_interface}")
block_host_traffic = self.manager.config.get_section_config("VMware").getboolean("block_host_traffic", False)
await self._add_ubridge_ethernet_connection(vnet, vmnet_interface, block_host_traffic)
else:
# special case on macOS, we cannot bind VMnet interfaces using the libpcap
await self._ubridge_send('bridge add_nio_fusion_vmnet {name} "{interface}"'.format(name=vnet, interface=vmnet_interface))
else:
block_host_traffic = self.manager.config.VMware.block_host_traffic
await self._add_ubridge_ethernet_connection(vnet, vmnet_interface, block_host_traffic)

View File

@ -39,7 +39,8 @@ Handle the import of project from a .gns3project
"""
async def import_project(controller, project_id, stream, location=None, name=None, keep_compute_id=False):
async def import_project(controller, project_id, stream, location=None, name=None, keep_compute_id=False,
auto_start=False, auto_open=False, auto_close=True):
"""
Import a project contain in a zip file
@ -99,9 +100,9 @@ async def import_project(controller, project_id, stream, location=None, name=Non
topology = load_topology(os.path.join(path, "project.gns3"))
topology["name"] = project_name
# To avoid unexpected behavior (project start without manual operations just after import)
topology["auto_start"] = False
topology["auto_open"] = False
topology["auto_close"] = True
topology["auto_start"] = auto_start
topology["auto_open"] = auto_open
topology["auto_close"] = auto_close
# Generate a new node id
node_old_to_new = {}

View File

@ -85,6 +85,7 @@ class Link:
self._link_type = "ethernet"
self._suspended = False
self._filters = {}
self._link_style = {}
@property
def filters(self):
@ -170,6 +171,13 @@ class Link:
self._project.emit_notification("link.updated", self.asdict())
self._project.dump()
async def update_link_style(self, link_style):
if link_style != self._link_style:
self._link_style = link_style
await self.update()
self._project.emit_notification("link.updated", self.asdict())
self._project.dump()
@property
def created(self):
"""
@ -432,7 +440,13 @@ class Link:
}
)
if topology_dump:
return {"nodes": res, "link_id": self._id, "filters": self._filters, "suspend": self._suspended}
return {
"nodes": res,
"link_id": self._id,
"filters": self._filters,
"link_style": self._link_style,
"suspend": self._suspended,
}
return {
"nodes": res,
"link_id": self._id,
@ -444,4 +458,5 @@ class Link:
"link_type": self._link_type,
"filters": self._filters,
"suspend": self._suspended,
"link_style": self._link_style,
}

View File

@ -966,6 +966,8 @@ class Project:
link = await self.add_link(link_id=link_data["link_id"])
if "filters" in link_data:
await link.update_filters(link_data["filters"])
if "link_style" in link_data:
await link.update_link_style(link_data["link_style"])
for node_link in link_data.get("nodes", []):
node = self.get_node(node_link["node_id"])
port = node.get_port(node_link["adapter_number"], node_link["port_number"])

View File

@ -127,9 +127,9 @@ class Snapshot:
if os.path.exists(project_files_path):
await wait_run_in_executor(shutil.rmtree, project_files_path)
with open(self._path, "rb") as f:
project = await import_project(
self._project.controller, self._project.id, f, location=self._project.path
)
project = await import_project(self._project.controller, self._project.id, f, location=self._project.path,
auto_start=self._project.auto_start, auto_open=self._project.auto_open,
auto_close=self._project.auto_close)
except (OSError, PermissionError) as e:
raise ControllerError(str(e))
await project.open()

View File

@ -59,7 +59,7 @@ class CrashReport:
Report crash to a third party service
"""
DSN = "https://ccd9829f1391432c900aa835e7eb1050:83d10f4d74654e2b8428129a62cf31cf@o19455.ingest.sentry.io/38482"
DSN = "https://aefc1e0e41e94957936f8773071aebf9:056b5247d4854b81ac9162d9ccc5a503@o19455.ingest.sentry.io/38482"
_instance = None
def __init__(self):

View File

@ -28,7 +28,7 @@ from .controller.drawings import Drawing
from .controller.gns3vm import GNS3VM
from .controller.nodes import NodeCreate, NodeUpdate, NodeDuplicate, NodeCapture, Node
from .controller.projects import ProjectCreate, ProjectUpdate, ProjectDuplicate, Project, ProjectFile
from .controller.users import UserCreate, UserUpdate, User, Credentials, UserGroupCreate, UserGroupUpdate, UserGroup
from .controller.users import UserCreate, UserUpdate, LoggedInUserUpdate, User, Credentials, UserGroupCreate, UserGroupUpdate, UserGroup
from .controller.rbac import RoleCreate, RoleUpdate, Role, PermissionCreate, PermissionUpdate, Permission
from .controller.tokens import Token
from .controller.snapshots import SnapshotCreate, Snapshot

View File

@ -42,6 +42,13 @@ class LinkType(str, Enum):
serial = "serial"
class LinkStyle(BaseModel):
color: Optional[str] = None
width: Optional[int] = None
type: Optional[int] = None
class LinkBase(BaseModel):
"""
Link data.
@ -49,6 +56,7 @@ class LinkBase(BaseModel):
nodes: Optional[List[LinkNode]] = Field(None, min_items=0, max_items=2)
suspend: Optional[bool] = None
link_style: Optional[LinkStyle] = None
filters: Optional[dict] = None

View File

@ -28,6 +28,7 @@ class UserBase(BaseModel):
"""
username: Optional[str] = Field(None, min_length=3, regex="[a-zA-Z0-9_-]+$")
is_active: bool = True
email: Optional[EmailStr]
full_name: Optional[str]
@ -49,11 +50,20 @@ class UserUpdate(UserBase):
password: Optional[SecretStr] = Field(None, min_length=6, max_length=100)
class LoggedInUserUpdate(BaseModel):
"""
Properties to update a logged in user.
"""
password: Optional[SecretStr] = Field(None, min_length=6, max_length=100)
email: Optional[EmailStr]
full_name: Optional[str]
class User(DateTimeModelMixin, UserBase):
user_id: UUID
last_login: Optional[datetime] = None
is_active: bool = True
is_superadmin: bool = False
class Config:

View File

File diff suppressed because one or more lines are too long

View File

@ -23,9 +23,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@angular-react/core
MIT
@angular/animations
MIT
@ -371,31 +368,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
angular-persistence
MIT
MIT License
Copyright (c) 2017 Scott O'Bryan
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.
angular-resizable-element
MIT
The MIT License (MIT)
@ -421,30 +393,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
angular2-indexeddb
MIT
The MIT License (MIT)
Copyright (c) 2016 Gil Fink and contributors
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.
bootstrap
MIT
The MIT License (MIT)
@ -471,31 +419,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
classnames
MIT
The MIT License (MIT)
Copyright (c) 2017 Jed Watson
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.
core-js
MIT
Copyright (c) 2014-2021 Denis Pushkarev
@ -519,31 +442,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
css-to-style
MIT
The MIT License (MIT)
Copyright (c) 2020 Jacob Buck
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.
css-tree
MIT
Copyright (C) 2016-2019 by Roman Dvornov
@ -567,25 +465,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
d
ISC
ISC License
Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
d3-array
BSD-3-Clause
Copyright 2010-2016 Mike Bostock
@ -1663,88 +1542,124 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dom-helpers
MIT
The MIT License (MIT)
mdn-data
CC0-1.0
CC0 1.0 Universal
Copyright (c) 2015 Jason Quense
Statement of Purpose
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 laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later
claims of infringement build upon, modify, incorporate in other works, reuse
and redistribute as freely as possible in any form whatsoever and for any
purposes, including without limitation commercial purposes. These owners may
contribute to the Commons to promote the ideal of a free culture and the
further production of creative, cultural and scientific works, or to gain
reputation or greater distribution for their Work in part through the use and
efforts of others.
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.
For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with a
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
eev
MIT
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not limited
to, the following:
es5-ext
ISC
ISC License
i. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
Copyright (c) 2011-2019, Mariusz Nowak, @medikoo, medikoo.com
ii. moral rights retained by the original author(s) and/or performer(s);
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
iii. publicity and privacy rights pertaining to a person's image or likeness
depicted in a Work;
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
iv. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(a), below;
v. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
es6-symbol
ISC
ISC License
vi. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
Copyright (c) 2013-2019, Mariusz Nowak, @medikoo, medikoo.com
vii. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations thereof.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
is so judged Affirmer hereby grants to each affected person a royalty-free,
non transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related Rights in
the Work (i) in all territories worldwide, (ii) for the maximum duration
provided by applicable law or treaty (including future time extensions), (iii)
in any current or future medium and for any number of copies, and (iv) for any
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.
4. Limitations and Disclaimers.
ext
ISC
ISC License
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
Copyright (c) 2011-2019, Mariusz Nowak, @medikoo, medikoo.com
b. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or otherwise,
including without limitation warranties of title, merchantability, fitness
for a particular purpose, non infringement, or the absence of latent or
other defects, accuracy, or the present or absence of errors, whether or not
discoverable, all to the greatest extent permissible under applicable law.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without limitation
any person's Copyright and Related Rights in the Work. Further, Affirmer
disclaims responsibility for obtaining any necessary consents, permissions
or other rights required for any use of the Work.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
<http://creativecommons.org/publicdomain/zero/1.0/>
mousetrap
@ -1953,6 +1868,7 @@ ngx-childprocess
MIT
ngx-device-detector
MIT
ngx-electron
MIT
@ -2163,157 +2079,6 @@ Apache-2.0
limitations under the License.
object-assign
MIT
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.
prop-types
MIT
MIT License
Copyright (c) 2013-present, Facebook, Inc.
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.
prop-types-extra
MIT
The MIT License (MIT)
Copyright (c) 2015 react-bootstrap
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.
react
MIT
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
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.
react-bootstrap
MIT
The MIT License (MIT)
Copyright (c) 2014-present Stephen J. Collings, Matthew Honnibal, Pieter Vanderwerff
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.
react-dom
MIT
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
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.
regenerator-runtime
MIT
MIT License
@ -2777,31 +2542,6 @@ THE SOFTWARE.
scheduler
MIT
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
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.
source-map
BSD-3-Clause
@ -2851,31 +2591,6 @@ WTFPL
0. You just DO WHAT THE FUCK YOU WANT TO.
stylenames
MIT
MIT License
Copyright (c) 2016 Kevin
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.
svg-crowbar
MIT
Copyright (c) 2013 The New York Times
@ -2902,97 +2617,17 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
type
ISC
ISC License
Copyright (c) 2019, Mariusz Nowak, @medikoo, medikoo.com
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2016 Robert Kieffer and other contributors
Copyright (c) 2010-2020 Robert Kieffer and other contributors
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:
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 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.
warning
MIT
MIT License
Copyright (c) 2013-present, Facebook, Inc.
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.
webpack
MIT
Copyright JS Foundation and other contributors
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.
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.
xterm

View File

@ -1,6 +1,6 @@
GNS3 WebUI is web implementation of user interface for GNS3 software.
Current version: 2.2.19
Current version: 2.2.22
Current version: 2020.4.0-beta.1

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +0,0 @@
!function(e){function r(r){for(var n,l,f=r[0],i=r[1],p=r[2],c=0,s=[];c<f.length;c++)l=f[c],Object.prototype.hasOwnProperty.call(o,l)&&o[l]&&s.push(o[l][0]),o[l]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(a&&a(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,f=1;f<t.length;f++)0!==o[t[f]]&&(n=!1);n&&(u.splice(r--,1),e=l(l.s=t[0]))}return e}var n={},o={0:0},u=[];function l(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,l),t.l=!0,t.exports}l.m=e,l.c=n,l.d=function(e,r,t){l.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},l.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.t=function(e,r){if(1&r&&(e=l(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(l.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)l.d(t,n,(function(r){return e[r]}).bind(null,n));return t},l.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(r,"a",r),r},l.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},l.p="";var f=window.webpackJsonp=window.webpackJsonp||[],i=f.push.bind(f);f.push=r,f=f.slice();for(var p=0;p<f.length;p++)r(f[p]);var a=i;t()}([]);

View File

@ -0,0 +1 @@
!function(){"use strict";var e,t,r,n,o={},u={};function i(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={id:e,loaded:!1,exports:{}};return o[e](r,r.exports,i),r.loaded=!0,r.exports}i.m=o,e=[],i.O=function(t,r,n,o){if(!r){var u=1/0;for(d=0;d<e.length;d++){r=e[d][0],n=e[d][1],o=e[d][2];for(var a=!0,c=0;c<r.length;c++)(!1&o||u>=o)&&Object.keys(i.O).every(function(e){return i.O[e](r[c])})?r.splice(c--,1):(a=!1,o<u&&(u=o));a&&(e.splice(d--,1),t=n())}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[r,n,o]},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var r in t)i.o(t,r)&&!i.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},i.f={},i.e=function(e){return Promise.all(Object.keys(i.f).reduce(function(t,r){return i.f[r](e,t),t},[]))},i.u=function(e){return e+".a7470e50128ddf7860c4.js"},i.miniCssF=function(e){return"styles.c514ad565d1e615b86db.css"},i.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t={},r="gns3-web-ui:",i.l=function(e,n,o,u){if(t[e])t[e].push(n);else{var a,c;if(void 0!==o)for(var d=document.getElementsByTagName("script"),f=0;f<d.length;f++){var s=d[f];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==r+o){a=s;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.setAttribute("data-webpack",r+o),a.src=i.tu(e)),t[e]=[n];var l=function(r,n){a.onerror=a.onload=null,clearTimeout(p);var o=t[e];if(delete t[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(e){return e(n)}),r)return r(n)},p=setTimeout(l.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=l.bind(null,a.onerror),a.onload=l.bind(null,a.onload),c&&document.head.appendChild(a)}},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.tu=function(e){return void 0===n&&(n={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(n=trustedTypes.createPolicy("angular#bundler",n))),n.createScriptURL(e)},i.p="",function(){var e={666:0};i.f.j=function(t,r){var n=i.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else if(666!=t){var o=new Promise(function(r,o){n=e[t]=[r,o]});r.push(n[2]=o);var u=i.p+i.u(t),a=new Error;i.l(u,function(r){if(i.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+o+": "+u+")",a.name="ChunkLoadError",a.type=o,a.request=u,n[1](a)}},"chunk-"+t,t)}else e[t]=0},i.O.j=function(t){return 0===e[t]};var t=function(t,r){var n,o,u=r[0],a=r[1],c=r[2],d=0;for(n in a)i.o(a,n)&&(i.m[n]=a[n]);if(c)var f=c(i);for(t&&t(r);d<u.length;d++)i.o(e,o=u[d])&&e[o]&&e[o][0](),e[u[d]]=0;return i.O(f)},r=self.webpackChunkgns3_web_ui=self.webpackChunkgns3_web_ui||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}()}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
uvicorn==0.14.0
fastapi==0.65.1
fastapi==0.65.2
websockets==9.1
python-multipart==0.0.5
aiohttp==3.7.4.post0
@ -10,10 +10,10 @@ psutil==5.8.0
async-timeout==3.0.1
distro==1.5.0
py-cpuinfo==8.0.0
sqlalchemy==1.4.17
sqlalchemy==1.4.18
aiosqlite===0.17.0
passlib[bcrypt]==1.7.4
python-jose==3.2.0
python-jose==3.3.0
email-validator==1.1.2
async-exit-stack==1.0.1 ; python_version < "3.7"
async-generator==1.10 ; python_version < "3.7"

View File

@ -26,6 +26,7 @@ function help {
echo "--with-openvpn: Install OpenVPN" >&2
echo "--with-iou: Install IOU" >&2
echo "--with-i386-repository: Add the i386 repositories required by IOU if they are not already available on the system. Warning: this will replace your source.list in order to use the official Ubuntu mirror" >&2
echo "--without-kvm: Disable KVM, required if system do not support it (limitation in some hypervisors and cloud providers). Warning: only disable KVM if strictly necessary as this will degrade performance" >&2
echo "--unstable: Use the GNS3 unstable repository"
echo "--help: This help" >&2
}
@ -45,9 +46,10 @@ fi
USE_VPN=0
USE_IOU=0
I386_REPO=0
DISABLE_KVM=0
UNSTABLE=0
TEMP=`getopt -o h --long with-openvpn,with-iou,with-i386-repository,unstable,help -n 'gns3-remote-install.sh' -- "$@"`
TEMP=`getopt -o h --long with-openvpn,with-iou,with-i386-repository,without-kvm,unstable,help -n 'gns3-remote-install.sh' -- "$@"`
if [ $? != 0 ]
then
help
@ -70,6 +72,10 @@ while true ; do
I386_REPO=1
shift
;;
--without-kvm)
DISABLE_KVM=1
shift
;;
--unstable)
UNSTABLE=1
shift
@ -171,7 +177,7 @@ usermod -aG docker gns3
if [ $USE_IOU == 1 ]
then
log "IOU setup"
log "Setup IOU"
dpkg --add-architecture i386
apt-get update
@ -179,6 +185,8 @@ then
# Force the host name to gns3vm
echo gns3vm > /etc/hostname
hostname gns3vm
HOSTNAME=$(hostname)
# Force hostid for IOU
dd if=/dev/zero bs=4 count=1 of=/etc/hostid
@ -204,10 +212,16 @@ configs_path = /opt/gns3/configs
report_errors = True
[Qemu]
enable_kvm = True
require_kvm = True
enable_hardware_acceleration = True
require_hardware_acceleration = True
EOFC
if [ $DISABLE_KVM == 1 ]
then
log "Disable KVM support"
sed -i 's/hardware_acceleration = True/hardware_acceleration = False/g' /etc/gns3/gns3_server.conf
fi
chown -R gns3:gns3 /etc/gns3
chmod -R 700 /etc/gns3
@ -286,18 +300,9 @@ if [ $USE_VPN == 1 ]
then
log "Setup VPN"
cat <<EOFSERVER > /etc/gns3/gns3_server.conf
[Server]
host = 172.16.253.1
port = 3080
images_path = /opt/gns3/images
projects_path = /opt/gns3/projects
report_errors = True
log "Change GNS3 to listen on VPN interface"
[Qemu]
enable_kvm = True
require_kvm = True
EOFSERVER
sed -i 's/host = 0.0.0.0/host = 172.16.253.1/' /etc/gns3/gns3_server.conf
log "Install packages for OpenVPN"
@ -329,7 +334,6 @@ echo "And remove this file with rm /etc/update-motd.d/70-openvpn"
EOFMOTD
chmod 755 /etc/update-motd.d/70-openvpn
mkdir -p /etc/openvpn/
[ -d /dev/net ] || mkdir -p /dev/net
@ -385,7 +389,7 @@ status openvpn-status-1194.log
log-append /var/log/openvpn-udp1194.log
EOFUDP
echo "Setup HTTP server for serving client certificate"
log "Setup HTTP server for serving client certificate"
mkdir -p /usr/share/nginx/openvpn/$UUID
cp /root/client.ovpn /usr/share/nginx/openvpn/$UUID/$HOSTNAME.ovpn
touch /usr/share/nginx/openvpn/$UUID/index.html
@ -402,11 +406,13 @@ EOFNGINX
service nginx stop
service nginx start
log "Restart OpenVPN"
log "Restart OpenVPN and GNS3"
set +e
service openvpn stop
service openvpn start
service gns3 stop
service gns3 start
log "Download http://$MY_IP_ADDR:8003/$UUID/$HOSTNAME.ovpn to setup your OpenVPN client after rebooting the server"

View File

@ -57,7 +57,7 @@ setup(
"gns3loopback = gns3server.utils.windows_loopback:main"
]
},
packages=find_packages(".", exclude=["docs", "tests"]),
packages=find_packages(".", exclude=["docs", "tests*"]),
include_package_data=True,
zip_safe=False,
platforms="any",

View File

@ -97,6 +97,38 @@ class TestUserRoutes:
response = await client.post(app.url_path_for("create_user"), json=new_user)
assert response.status_code == status_code
@pytest.mark.parametrize(
"attr, value, status_code",
(
("email", "user@email.com", status.HTTP_200_OK),
("email", "user@email.com", status.HTTP_400_BAD_REQUEST),
("username", "user2", status.HTTP_400_BAD_REQUEST),
("email", "invalid_email@one@two.io", status.HTTP_422_UNPROCESSABLE_ENTITY),
("password", "short", status.HTTP_422_UNPROCESSABLE_ENTITY),
("username", "user2@#$%^<>", status.HTTP_422_UNPROCESSABLE_ENTITY),
("username", "ab", status.HTTP_422_UNPROCESSABLE_ENTITY),
("full_name", "John Doe", status.HTTP_200_OK),
("password", "password123", status.HTTP_200_OK),
("is_active", True, status.HTTP_200_OK),
)
)
async def test_update_user(
self,
app: FastAPI,
client: AsyncClient,
db_session: AsyncSession,
attr: str,
value: str,
status_code: int,
) -> None:
user_repo = UsersRepository(db_session)
user_in_db = await user_repo.get_user_by_username("user2")
update_user = {}
update_user[attr] = value
response = await client.put(app.url_path_for("update_user", user_id=user_in_db.user_id), json=update_user)
assert response.status_code == status_code
async def test_users_saved_password_is_hashed(
self,
app: FastAPI,
@ -285,6 +317,46 @@ class TestUserMe:
response = await unauthorized_client.get(app.url_path_for("get_logged_in_user"))
assert response.status_code == status.HTTP_401_UNAUTHORIZED
async def test_authenticated_user_can_update_own_data(
self,
app: FastAPI,
authorized_client: AsyncClient,
test_user: User,
) -> None:
response = await authorized_client.get(app.url_path_for("get_logged_in_user"))
assert response.status_code == status.HTTP_200_OK
user = User(**response.json())
assert user.username == test_user.username
assert user.email == test_user.email
assert user.user_id == test_user.user_id
# logged in users can only change their email, full name and password
@pytest.mark.parametrize(
"attr, value, status_code",
(
("email", "user42@email.com", status.HTTP_200_OK),
("email", "user42@email.com", status.HTTP_400_BAD_REQUEST),
("full_name", "John Doe", status.HTTP_200_OK),
("password", "password123", status.HTTP_200_OK),
)
)
async def test_authenticated_user_can_update_own_data(
self,
app: FastAPI,
authorized_client: AsyncClient,
attr: str,
value: str,
status_code: int,
) -> None:
update_user = {}
update_user[attr] = value
response = await authorized_client.put(
app.url_path_for("update_logged_in_user"),
json=update_user
)
assert response.status_code == status_code
class TestSuperAdmin:

View File

@ -855,21 +855,15 @@ def test_options(linux_platform, vm):
assert vm.kvm is False
vm.options = "-no-kvm"
assert vm.options == "-no-kvm"
assert vm.options == "-machine accel=tcg"
vm.options = "-enable-kvm"
assert vm.options == "-enable-kvm"
vm.options = "-icount 12"
assert vm.options == "-no-kvm -icount 12"
vm.options = "-icount 12 -no-kvm"
assert vm.options == "-icount 12 -no-kvm"
assert vm.options == "-machine accel=kvm"
def test_options_windows(windows_platform, vm):
vm.options = "-no-kvm"
assert vm.options == ""
assert vm.options == "-machine accel=tcg"
vm.options = "-enable-kvm"
assert vm.options == ""
@ -919,7 +913,7 @@ async def test_run_with_kvm_linux_options_no_kvm(linux_platform, vm):
with patch("os.path.exists", return_value=True) as os_path:
vm.manager.config.settings.Qemu.enable_hardware_acceleration = True
assert await vm._run_with_hardware_acceleration("qemu-system-x86_64", "-no-kvm") is False
assert await vm._run_with_hardware_acceleration("qemu-system-x86_64", "-machine accel=tcg") is False
@pytest.mark.asyncio

View File

@ -221,6 +221,7 @@ async def test_json(project, compute):
}
],
"filters": {},
"link_style": {},
"suspend": False,
"link_type": "ethernet",
"capturing": False,
@ -250,6 +251,7 @@ async def test_json(project, compute):
}
}
],
"link_style": {},
"filters": {},
"suspend": False
}

View File

@ -1,4 +1,4 @@
-r requirements.txt
pywin32==300
pywin32==301
wmi==1.5.1