8070 Commits

Author SHA1 Message Date
grossmj
437f68961b
chore: clean up Windows specific code 2026-10-20 11:51:29 +07:00
Jeremy Grossmann
9e9f1316aa
Merge pull request #3009 from markparonyan/3.1
refactor(gns3server,tests): ruff fixes
2026-10-19 18:49:33 +02:00
grossmj
569b46d272
refactor: fix lint issues 2026-10-19 23:28:49 +07:00
Jeremy Grossmann
68b5e89bfa
Merge branch '3.1' into 3.1 2026-10-19 18:11:29 +02:00
Jeremy Grossmann
b956bba917
Merge pull request #3013 from cristian-ciobanu/feat-#2496
feat(cloud): attach TAP interfaces to existing Linux bridges
2026-10-19 17:34:34 +02:00
Cristi
53aa7ab0d9 fix(cloud): keep ports_mapping getter and setter adjacent 2026-10-19 16:02:39 +03:00
Cristi
a9f5306f16 feat(cloud): attach TAP interfaces to existing Linux bridges 2026-10-19 15:42:18 +03:00
Jeremy Grossmann
e57acfb7b1
Merge pull request #3011 from cristian-ciobanu/feat-#3049
feat(qemu): support two CD/DVD images and consistent ISO handling
2026-10-19 04:42:18 +02:00
Cristi
58e5591935 feat(qemu): support SATA CD-ROM interfaces
- Add per-drive IDE/SATA selection with backward-compatible IDE defaults
- Persist interfaces in nodes, templates, and appliance imports
- Add database migration support for versioned and unversioned databases
- Prevent partial updates when rejecting live interface changes
- Validate interfaces and support SATA media changes through the monitor
2026-10-18 22:07:37 +03:00
Jeremy Grossmann
a1e483b894
Merge pull request #3012 from yueguobin/fix/marker-replay-remote-computes
fix: fetch remote-compute marker pcaps in tag replay
2026-10-18 14:06:25 +02:00
YueGuobin
33b28a3b5f
fix: fetch remote-compute marker pcaps in tag replay
Marker pcaps are written by uBridge on the compute that hosts the capture
node. The tag replay only looked in the project folder on the controller.
So a source from a remote compute showed count 0 and no frames, with no
error. Its frame detail returned 404 and said nothing ever matched (#3010).

Each source now gets its pcap through the compute of its capture node.
Local files are read as before. Remote files are fetched over HTTP on
every acquire into a small cache (32 idle files, cleared at shutdown).
A file is replaced only when its bytes changed. This keeps the old mtime,
so the sharkd session for that file stays alive.

When a compute cannot be reached, its source now shows an error message
in the timeline instead of just showing nothing. The detail endpoint now
returns an error instead of 404.
2026-10-18 16:36:11 +08:00
Cristi
84b4c05b9f feat(qemu): support two CD/DVD images and consistent ISO handling 2026-10-17 23:08:11 +03:00
Jeremy Grossmann
d047ca0a5f
Merge pull request #3006 from yueguobin/feat/vxlan-cross-compute
feat: cross-compute VXLAN kernel datapath
2026-10-17 13:39:13 +02:00
Mark Paronyan
4c311baabf
refactor(gns3server,tests): StrEnum, ASYNC109 and others 2026-10-17 12:02:53 +03:00
Mark Paronyan
b7e6c02647
refactor: ruff autofixes 2026-10-17 11:43:36 +03:00
Mark Paronyan
54139dced2
chore(ruff): target version to py311 2026-10-17 11:43:20 +03:00
YueGuobin
0d91d9252b
feat: default vxlan_dstport to the IANA VXLAN port 4789
The custom 14789 was picked to keep our demux socket off the ports other
VXLAN software listens on, but a private default surprises operators and
blocks interop with gear that pins the standard port. Default to the
IANA-assigned 4789 instead; the gns3_server.conf override is unchanged
for computes where swarm overlay/flannel-style VXLAN already owns 4789.

Mixed-version deployments must pin the port on every compute until they
all run the new default, or the two tunnel ends will disagree.
2026-10-17 14:11:00 +08:00
YueGuobin
6679774de7
docs: spell out how the VXLAN lower device is chosen
Per tunnel, not a host setting: a connected UDP socket runs the
kernel's route lookup for the peer, the chosen source address is
matched back to its owning interface, and that interface becomes
the dev= (and with it the derived MTU and the outer source
address). Different peers may ride different lower devices with
independently derived MTUs; an unresolvable peer is a wiring error
that degrades the link to the relay. Re-creation re-resolves too,
so route changes ride the same node-start / link-recreation paths
as MTU changes.
2026-10-17 14:11:00 +08:00
YueGuobin
577be9b94e
docs: pin down the VXLAN MTU derivation and its re-derivation paths
Verified against the running kernel's sources (7.2.6): the 50-byte
headroom is 20 outer IPv4 + 8 UDP + 8 VXLAN + 14 inner Ethernet
header (vxlan_headroom(), include/net/vxlan.h); the vxlan driver has
no NETDEV_CHANGEMTU handler so a live tunnel never follows its lower
device, while the bridge does follow its ports at runtime
(NETDEV_CHANGEMTU -> br_mtu_auto_adjust). Document the operational
consequence: the wiring path re-creates the device on every node
start and link (re)creation, so raising the underlay MTU on both
computes and stop/start-ing the nodes is the fix — no manual
ip link needed.
2026-10-17 14:11:00 +08:00
YueGuobin
ca31031fdc
test: drop the cross-compute VXLAN e2e scenario
The scenario needed root for its network namespace and its fabric subnet
turned out host-specific: policy routing (a proxy's table consulted
before main) sends any non-RFC1918 destination out the default route, so
the peer compute was unreachable behind the veth — unfixable by picking
another subnet, and the failure paths leaked namespaces and processes.
Too environment-coupled to keep in the suite.

Unit coverage is unchanged (selection matrix, tunnel spec derivation,
VNI retry/degrade/self-heal, device lifecycle, capability probe); the
feature doc's Verification section now carries the manual two-compute
checklist instead of the e2e reference.
2026-10-17 14:11:00 +08:00
YueGuobin
21b866aeed
feat: cross-compute VXLAN kernel datapath
Cross-compute links can ride kernel VXLAN tunnels instead of the uBridge
UDP relay: each endpoint creates one VXLAN device (uBridge's rtnetlink
vxlan module) enslaved into the same per-link Linux bridge the same-host
datapath uses, so filters, markers, capture and suspend keep running on
the anchor unchanged. Opt-in (Server.enable_vxlan_cross_compute, default
off) because the tunnel caps the usable MTU at the underlay minus the
outer headers; the relay stays the default and the fallback.

The controller derives what the pair must agree on: one VNI per link
(upper VNI space, per-link random salt) and deterministic device names
(gvl{link}{node}) that make crashed-run leftovers claimable
(show -> delete -> create). Same-host compute pairs, switch endpoints
and serial/unix-socket containers stay on the relay.

A VNI the kernel refuses self-heals on every path it can surface:
interactive create retries a fresh salt then degrades to the relay;
project open re-dispatches refused batch entries the same way; node
start recognises the refused device, stops the half-started node,
re-wires both ends on a fresh VNI (or degrades the link) and retries
the start. The device MTU is derived from the lower device (dev=) and
the per-link bridge inherits it - no configuration. The capability
probe (ubridge_vxlan in /capabilities) runs one scratch create/delete
on a scratch port that never equals the configured dstport.

The e2e scenario runs two computes on one machine (a network namespace
joined by a veth pair as the fabric) and needs root.
2026-10-17 14:11:00 +08:00
Jeremy Grossmann
5514b2e929
Merge pull request #3008 from yueguobin/fix/mypy-2-4-username-mapped
Fix mypy 2.4 type error on User.username and bump mypy to 2.4.0
2026-10-17 08:09:26 +02:00
YueGuobin
c557324bcb
chore: bump mypy to 2.4.0
Supersedes the dependabot bump in #2998; the tree is mypy 2.4-clean after
the previous commit.
2026-10-17 14:00:23 +08:00
YueGuobin
9887e3d5d7
fix: type User.username as str via Mapped-style column
mypy 2.4 (native parser by default) flags _jwt_username_var.set(user.username)
in agent/mcp/__init__.py: with the legacy `username = Column(String)`
declaration, instance access is typed Column[str], not str. Migrate the
column to the Mapped/mapped_column style already used by token_version and
last_login in the same table, with an explicit nullable=True so the schema
stays identical to the former Column(String) declaration.
2026-10-17 14:00:23 +08:00
Jeremy Grossmann
344a342924
Merge pull request #3004 from Xeriioo/fix/docker-vnc-display-race
fix(docker): give each VNC node its own X display
2026-10-16 12:57:38 +02:00
Jeremy Grossmann
8801e5fd4b
Merge pull request #3005 from yueguobin/fix/node-update-while-running
fix: refuse Docker node updates that would recreate a running container
2026-10-16 12:17:57 +02:00
Guobin Yue
03c1564482
Merge branch '3.1' into fix/node-update-while-running 2026-10-16 17:07:39 +08:00
Jeremy Grossmann
ddaf4b9376
Merge pull request #2999 from GNS3/dependabot/pip/3.1/nornir-utils-gte-0.3.0
Update nornir-utils requirement from >=0.2.0 to >=0.3.0
2026-10-16 11:03:08 +02:00
Guobin Yue
d2b851f148
Merge branch '3.1' into fix/node-update-while-running 2026-10-16 16:56:40 +08:00
Jeremy Grossmann
7b8bb7140f
Merge branch '3.1' into dependabot/pip/3.1/nornir-utils-gte-0.3.0 2026-10-16 10:54:32 +02:00
Jeremy Grossmann
d20bcab40b
Merge pull request #2997 from GNS3/dependabot/pip/3.1/pyjwt-gte-2.15.1
Update pyjwt requirement from >=2.10.1 to >=2.15.1
2026-10-16 10:53:12 +02:00
Jeremy Grossmann
642dd976a8
Merge pull request #2996 from GNS3/dependabot/pip/3.1/langsmith-gte-0.14.7
Update langsmith requirement from >=0.7.7 to >=0.14.7
2026-10-16 10:52:55 +02:00
Jeremy Grossmann
ae3739e2b2
Merge pull request #2995 from GNS3/dependabot/pip/3.1/tiktoken-gte-0.14.0
Update tiktoken requirement from >=0.8.0 to >=0.14.0
2026-10-16 10:52:34 +02:00
Jeremy Grossmann
57f2a687de
Merge pull request #2977 from GNS3/python-3.15-support
Python 3.15 support
2026-10-16 10:51:54 +02:00
Jeremy Grossmann
578dbdceeb
Merge pull request #3003 from yueguobin/fix/mcp-device-config-remote-compute
Fix MCP device tools for nodes on remote computes
2026-10-16 10:49:56 +02:00
YueGuobin
1090a32bbb
fix: refuse Docker node updates that recreate a running container
Updating any Docker node property destroys and recreates the container
(the route calls DockerVM.update() as soon as the property diff is
non-empty), so it discards everything written inside it. On a running
node that happened silently, as a side effect of an unrelated edit: the
user only saw the node restart.

Refuse the update while the container is up and say what stopping it is
for, like QEMU, IOU, Dynamips, VPCS, VirtualBox and VMware already do
for their own restart-requiring settings. The check runs before anything
is applied — a refused update leaves the node untouched — and only when
the PUT really changes a property, since Web clients send the whole node
back on every edit.

is_running() is not reusable for the question: it reports a paused
container as not running and stops crashed containers as a side effect,
so DockerVM gains is_up() for "running or paused".
2026-10-16 16:49:11 +08:00
YueGuobin
290c542afe
fix: roll back a node update the compute refused
A compute 409 (for instance "must be stopped to change the console type
to vnc") left every value that had already been applied locally on the
controller node, because the update loop sets them before the PUT.
Nothing was dumped at that point, but project.dump() serializes the
whole topology: the next successful change anywhere in the project wrote
the refused values to disk, and the next project open recreated the node
with them — this time accepted by a stopped node. A refused change
silently landed later.

Restore the applied properties, the node properties, custom adapters,
missing images and the derived ports before re-raising, the way the
degraded-image create() path already cleans up after its own failure.
2026-10-16 16:49:06 +08:00
Jeremy Grossmann
2821fbd42a
Merge branch '3.1' into python-3.15-support 2026-10-16 10:39:56 +02:00
Clem
c736d5863b fix(docker): give each VNC node its own X display
When a project is opened, Docker nodes are created in parallel. The free
display was found by checking whether /tmp/.X11-unix/X<n> exists, but that
socket only appears once Xvnc has started, so several nodes got the same
display. Only the first Xvnc started; the others exited with "Server is
already active for display N" ("The vnc process has stopped with return
code 1"), and their containers drew on the screen of another node.

- reserve the displays given to the nodes of this server, and also skip a
  display whose lock file belongs to a live process
- restart a crashed Xvnc on the display the container was created with,
  after removing its stale socket, instead of picking a new display the
  container cannot reach (black screen)
- on close, only remove the X socket of our own Xvnc, never the socket of
  the node that owns the display

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 09:29:19 +02:00
Jeremy Grossmann
638a8be180
Merge pull request #3000 from yueguobin/feat/compute-auto-connect
Auto-connect flag and disconnect endpoint for computes
2026-10-16 07:08:07 +02:00
YueGuobin
f47cb56495
fix: dial per-node console hosts in MCP device config tools
The device tools (device_config_send / device_show_run / vpcs_config_set)
built their Nornir inventory with only the console port and inherited the
group hostname, which is always the controller host. Console ports of
nodes on remote computes are bound on the compute's own host, so those
nodes were unreachable from the MCP tools - only local-compute nodes
worked.

Pass the per-node console_host through the project inventory and inject
it as a host-level Nornir hostname (which overrides the group's
controller-wide default). Missing or wildcard (0.0.0.0/::) values keep
the group inheritance, so single-machine setups behave exactly as
before. VPCS builds its own host entries, so it carries the hostname
over explicitly.
2026-10-16 10:29:19 +08:00
Guobin Yue
0130048baa
Merge branch '3.1' into feat/compute-auto-connect 2026-10-15 23:04:52 +08:00
YueGuobin
7737630cb4
fix(tests): derive head revision in the migration round-trip test
The round-trip test builds its catalog from the models (which already
carry the head schema), then stamps the revision that was newest when the
test was written and replays everything above it. Any migration landing
on top therefore ran its DDL against a schema it had not rolled back -
the new computes.auto_connect migration failed with "duplicate column
name: auto_connect".

Stamp the current head instead and let the downgrade roll back every
revision above the inventory one before the upgrade replays them.
2026-10-15 23:02:53 +08:00
Jeremy Grossmann
b79dcaa49d
Merge pull request #3001 from yueguobin/chore/pre-commit-hooks
chore: add pre-commit hook running ruff and mypy checks on staged files
2026-10-15 16:52:47 +02:00
YueGuobin
6734d2d666
feat: add auto_connect flag and disconnect endpoint for computes
Computes can now be flagged auto_connect in the database. The controller
connects to flagged computes in the background at startup (reusing the
one-second delayed fire-and-forget mechanism), and enabling the flag via
PUT /computes/{id} triggers a background connection without the request
ever waiting for it. Disabling the flag does not drop an existing
connection.

Add POST /computes/{id}/disconnect to tear a compute down manually: the
notification stream and HTTP session are closed and every reconnection
path (retry backoff, notification stream reconnect, lazy connection in
http_query) is blocked until connect() is called again or the controller
restarts with auto_connect enabled. Disconnecting a compute used by an
opened project is rejected with 409 unless force=true; forcing only
drops the controller-side control channel, nodes keep running unmanaged.
The local compute cannot be disconnected.

Also make test_compute_list create its own compute (it relied on rows
from earlier tests and failed under reordering), and stop scheduling the
delayed add_compute connection during tests: the timer leaked real
connection attempts into other tests' event loops.
2026-10-15 22:50:22 +08:00
YueGuobin
fa3dd827f9
chore: add pre-commit hook running ruff and mypy checks on staged files
Mirrors the fast static checks from CI (justfile lint + type-check):
ruff check, ruff format --check and mypy (gns3server package only,
matching the files = ["gns3server"] scope in pyproject.toml). Only
staged Python files are checked; pytest and pip check are left to CI.

Enable with: just install-hooks
2026-10-15 22:44:24 +08:00
dependabot[bot]
35a2d54740
Update nornir-utils requirement from >=0.2.0 to >=0.3.0
Updates the requirements on [nornir-utils](https://github.com/nornir-automation/nornir-utils) to permit the latest version.
- [Release notes](https://github.com/nornir-automation/nornir-utils/releases)
- [Changelog](https://github.com/nornir-automation/nornir-utils/blob/main/CHANGELOG.md)
- [Commits](https://github.com/nornir-automation/nornir-utils/compare/v0.2.0...v0.3.0)

---
updated-dependencies:
- dependency-name: nornir-utils
  dependency-version: 0.3.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-15 11:22:59 +00:00
dependabot[bot]
c9a367a32f
Update pyjwt requirement from >=2.10.1 to >=2.15.1
Updates the requirements on [pyjwt](https://github.com/jpadilla/pyjwt) to permit the latest version.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/jpadilla/pyjwt/compare/2.10.1...2.15.1)

---
updated-dependencies:
- dependency-name: pyjwt
  dependency-version: 2.15.1
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-15 11:22:50 +00:00
dependabot[bot]
cf75aeeac0
Update langsmith requirement from >=0.7.7 to >=0.14.7
Updates the requirements on [langsmith](https://github.com/langchain-ai/langsmith-sdk) to permit the latest version.
- [Release notes](https://github.com/langchain-ai/langsmith-sdk/releases)
- [Commits](https://github.com/langchain-ai/langsmith-sdk/compare/v0.7.7...v0.14.7)

---
updated-dependencies:
- dependency-name: langsmith
  dependency-version: 0.14.7
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-15 11:22:45 +00:00
dependabot[bot]
a27c135840
Update tiktoken requirement from >=0.8.0 to >=0.14.0
Updates the requirements on [tiktoken](https://github.com/openai/tiktoken) to permit the latest version.
- [Release notes](https://github.com/openai/tiktoken/releases)
- [Changelog](https://github.com/openai/tiktoken/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openai/tiktoken/compare/0.8.0...0.14.0)

---
updated-dependencies:
- dependency-name: tiktoken
  dependency-version: 0.14.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-10-15 11:22:35 +00:00