1
0
mirror of https://github.com/lxc/incus.git synced 2026-02-05 09:46:19 +01:00

2602 Commits

Author SHA1 Message Date
Stéphane Graber
36ad2cbcbc shared/cliconfig: Don't pass scheme to OCI creds helper
Closes #2876

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2026-02-04 16:24:23 +01:00
Stéphane Graber
5e19938aae shared/util: Fix SingleQuote to actually quote
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2026-01-26 07:00:36 -05:00
Stéphane Graber
a5c1c73b53 shared/util: Add SingleQuote
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Suggested-by: Rory McNamara <rory.mcnamara@snyk.io>
2026-01-17 09:04:48 -05:00
Stéphane Graber
26f45a11ae shared/validate: Don't allow $ in API names
Since some of those names may be passed to a shell either on the client
or server side, let's avoid getting into potential variable expansions.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Reported-by:  Rory McNamara <rory.mcnamara@snyk.io>
2026-01-17 08:35:27 -05:00
baconyao
dd034aa3dd shared/api: add comprehensive unit tests for URL builder
Replace Example test with proper unit tests for all URL builder methods.
Focus on testing our business logic rather than standard library behavior.
Fix Target method comment (checks "none" not "default").

Signed-off-by: baconyao <bacon735392@gmail.com>
2025-12-18 13:49:30 -05:00
John Axel Eriksson
07852cf616 shared/tls: implement Happy Eyeballs (RFC 8305) in RFC3493Dialer
The RFC3493Dialer function, before this, tried addresses sequentially
with a 10-second timeout per address. This causes problems in dual-stack
environments where one address family is unreachable:

- If DNS returns IPv4 addresses first but IPv4 is unreachable (e.g., in
  IPv6-only environments), the dialer would spend 10+ seconds timing out
  on each IPv4 address before trying IPv6.
- This exceeded typical HTTP client timeouts, causing connection failures
  even when IPv6 connectivity was available.

This change implements Happy Eyeballs (RFC 8305):

1. Sort addresses with IPv6 first (RFC 8305 recommends preferring IPv6)
2. Start connection attempts with a 250ms staggered delay (per RFC 8305)
3. Return the first successful connection immediately
4. Finally clean up unused connections

Signed-off-by: John Axel Eriksson <john@insane.se>
2025-12-16 14:07:07 -05:00
Max Asnaashari
46521590e5 shared/tls: Move ACME challenge to shared/tls
Signed-off-by: Max Asnaashari <max.asna@futurfusion.io>
2025-12-10 11:44:58 -08:00
Christian Brauner
8cdafa2034 Merge pull request #2715 from stgraber/main
Fix bad test and crash on background unpack
2025-11-29 16:03:00 +01:00
Stéphane Graber
c049bac24c shared/archive: Fix crash on nil tracker
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-29 09:00:13 -05:00
Lucas Bremgartner
837d477d31 api: Use DevicesMap type for map[string]map[string]string
Signed-off-by: Lucas Bremgartner <lucas.bremgartner@futurfusion.io>
2025-11-29 01:16:32 -05:00
Lucas Bremgartner
612a10de5f api: Add DevicesMap typ to better support unmarshaling
of numbers and bools in map[string]map[string]string devices types

Signed-off-by: Lucas Bremgartner <lucas.bremgartner@futurfusion.io>
2025-11-29 01:16:31 -05:00
Lucas Bremgartner
42056d3eac api: More precise name for test
Signed-off-by: Lucas Bremgartner <lucas.bremgartner@futurfusion.io>
2025-11-29 01:16:30 -05:00
Stéphane Graber
bc28c668ec shared/ioprogress: Cap download speed to file size
Closes #2687

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-28 17:34:06 -05:00
Stéphane Graber
185a340466 shares/resources/usbid: Only load the database once
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-28 02:38:24 -05:00
baconyao
b5905e9bb9 shared/resources: Add test cases for serial device
Signed-off-by: baconyao <bacon735392@gmail.com>
2025-11-28 02:38:22 -05:00
baconyao
69e7e7f94f shared/resources: Add serial device resource support
Initialized GetSerial() function and integrate it into GetResources()
to expose serial devices information through the resources API.

Signed-off-by: baconyao <bacon735392@gmail.com>
2025-11-28 02:38:21 -05:00
baconyao
ace6cb8e8d shared/api: Add Serial device resource types
Add ResourcesSerial and ResourcesSerialDevice types to expose serial
device information in the resources API.

Signed-off-by: baconyao <bacon735392@gmail.com>
2025-11-28 02:38:20 -05:00
Stéphane Graber
9b23183b52 shared/api: Add StorageBucketFull
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-27 18:51:03 -05:00
Stéphane Graber
204b247e79 shared/api: Add StorageVolumeFull
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-27 18:51:02 -05:00
Stéphane Graber
1e2648bc62 shared/api: Add missing CreatedAt on bucket backup
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-27 18:50:58 -05:00
Stéphane Graber
525dcb1f14 shared/api: Remove non-existent field from StoragePoolBucketBackup
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-27 18:50:56 -05:00
Stéphane Graber
20076d9275 shared/resources: Skip broken udev symlinks
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-11-24 21:44:20 -05:00
Mujib Ahasan
93242595f8 incus/list: Add option for raw units in CSV output
Closes #2611

Signed-off-by: Mujib Ahasan <ahasanmujib8@gmail.com>
2025-11-08 20:18:32 -05:00
Benjamin Somers
73f02021eb shared/validate: Add IsMACPattern
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
2025-10-28 15:08:29 +00:00
Serge Hallyn
89eb691314 Merge pull request #2585 from stgraber/main
shared/osarch: Add aliases for the various x86_64 versions
2025-10-24 20:59:44 -05:00
Stéphane Graber
34f3340133 shared/osarch: Add aliases for the various x86_64 versions
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-10-24 17:44:48 -04:00
Piotr Resztak
a2a042473e shared/api: Add lifecycle events for storage volume files management
Signed-off-by: Piotr Resztak <piotr.resztak@futurfusion.io>
2025-10-24 13:50:06 +02:00
Gwendolyn
3fedc02652 incusd/main_forkbpf: Create forkbpf helper for bpf token delegation.
The forkbpf helper creates a socket pair and forks, the child process then enters the user and mount namespaces of the container.
The child process creates a filesystem configuration context and passes it to the parent process via the socketpair.
The parent process configures the token delegation options and creates a mount file descriptor and passes that back to the child.
The child process then attaches the mount to the desired path.

Signed-off-by: Gwendolyn <me@gwendolyn.dev>
2025-10-19 11:54:03 -04:00
Piotr Resztak
530bc95061 api: Add cluster_group_usedby extension
Signed-off-by: Piotr Resztak <piotr.resztak@futurfusion.io>
2025-10-19 13:04:02 +02:00
Piotr Resztak
d561b5db81 shared/api: Add 'UsedBy' field to 'ClusterGroup' struct
Signed-off-by: Piotr Resztak <piotr.resztak@futurfusion.io>
2025-10-19 12:17:02 +02:00
Stéphane Graber
cfc75ba5c5 shared/cmd: Add TextEditor
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-10-16 17:06:15 -04:00
Stéphane Graber
a61cdbc597 shared/cmd: Add Usage
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-10-16 14:15:29 -04:00
Stéphane Graber
fc614e0d71 shared/cmd: Add CheckArgs
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-10-16 14:13:49 -04:00
Stéphane Graber
b531b08882 shared/cmd: Move from internal/cmd
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-10-16 14:04:58 -04:00
Serge Hallyn
5768e8e289 Merge pull request #2551 from stgraber/main
shared/resources: Fix caching mechanism
2025-10-09 17:13:52 -05:00
Benjamin Somers
2b25f5d437 shared/validate: Add IsBase64
Signed-off-by: Benjamin Somers <benjamin.somers@imt-atlantique.fr>
2025-10-09 16:48:59 -04:00
Stéphane Graber
5ed516ab3f shared/resources: Fix caching mechanism
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-10-09 12:40:17 -04:00
Stéphane Graber
51503cc852 Merge pull request #2496 from breml/config-map
Replace map[string]string with ConfigMap for more user friendly handling of bool and numbers (with defaults)
2025-09-25 22:06:34 -04:00
Stéphane Graber
105e72ff34 shared/api: Add support for cluster group preseeding
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-09-25 15:34:12 -04:00
Stéphane Graber
8f3918ebae shared/api: Add missing YAML tag
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-09-25 15:29:15 -04:00
Stéphane Graber
f0e60843f0 shared/idmap: Skip xattrs on EINVAL
When parsing extended attributes, we may be getting EINVAL when run on ZFS.

This appears to be when dealing with ZFS namespaced xattrs and despite
being real root with all capabilities, there appears to be no way to
read or even clear those attributes.

So instead of crashing mid-shift, let's just log them and move on.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
Sponsored-by: https://webdock.io
2025-09-24 02:20:17 -04:00
Lucas Bremgartner
e78e22fb2a api: Handle pre initialized targed ConfigMap (default values)
Signed-off-by: Lucas Bremgartner <lucas.bremgartner@futurfusion.io>
2025-09-22 11:18:46 +02:00
Lucas Bremgartner
055396ccdd api: Use ConfigMap type for map[string]string
Signed-off-by: Lucas Bremgartner <lucas.bremgartner@futurfusion.io>
2025-09-22 11:18:45 +02:00
Lucas Bremgartner
fff3f9832e api: Add ConfigMap type to better support unmarshaling numbers and bools to map[string]string
Signed-off-by: Lucas Bremgartner <lucas.bremgartner@futurfusion.io>
2025-09-22 11:18:44 +02:00
Ruihua Wen
bbc5c2a485 incusd/instance/validate: Add OOM priority validation
Signed-off-by: Ruihua Wen <spiffyeight77@gmail.com>
2025-09-16 15:06:22 -04:00
Max Asnaashari
a783aed5bb shared/tls: Remove tls.Config.Time override
We added this to allow bypass expired cert verification errors, but it
causes issues with cert chains and pre-existing, older certs.

Signed-off-by: Max Asnaashari <max.asna@futurfusion.io>
2025-09-08 06:52:43 -07:00
Stéphane Graber
722076723c shared/api: Add missing Description field to InstanceSnapshots
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-08-28 16:55:43 -04:00
Stéphane Graber
f5ef7a8402 shared/resources: Restrict to Linux
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-08-12 15:57:04 -04:00
Stéphane Graber
00855673b1 incusd: Move resources package to shared package
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-08-12 15:50:42 -04:00
Mahesh Punjabi
22f8e7aaa9 incus/console: Add default console command in configuration file
Closes #2054

Signed-off-by: Mahesh Punjabi <mahesh.punjabi86@gmail.com>
2025-08-09 23:34:23 -04:00