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

39 Commits

Author SHA1 Message Date
Marcos Guillermo
eb0b2f5d9b cmd/incus-user: Don't reset setup if user has access
Currently, incus-user might reset a user's setup if the project name
doesn't match the expected format. This change checks if the user
already has a valid certificate and access to at least one project
before attempting a reset.

Fixes #2524

Signed-off-by: Marcos Guillermo <marcos.cosson@ccc.ufcg.edu.br>

cmd/incus-user: Don't reset setup if user has access

Currently, incus-user might reset a user's setup if the project name
doesn't match the expected format. This change checks if the user
already has a valid certificate and access to at least one project
before attempting a reset.

Fixes #2524

Signed-off-by: Marcos Guillermo <marcos.cosson@ccc.ufcg.edu.br>
2025-12-22 16:40:22 -03:00
Olivier Lechevalier
e3f36b1c7d cmd/incus-user: refactor to not use os.Exit and instead close listener
In order to test did the following:

`systemd-socket-activate -l /run/incus-user.sock $PWD/incus-user -d -v 2>&1`

in separate terminal connect and disconnect to the socket:

`nc -U /run/my_app.sock`

Wait and obtained following shutdown log:

```
INFO   [2025-11-24T12:33:45+09:00] Starting up the server
INFO   [2025-11-24T12:34:20+09:00] Daemon has been inactive, shutting down
```

Signed-off-by: Olivier Lechevalier <olivier.lechevalier@gmail.com>
2025-11-24 12:41:11 +09:00
Nathan Chase
a738dd4c2c incus-user: Don't needlessly use format string functions
Signed-off-by: Nathan Chase <ntc477@utexas.edu>
2025-05-23 01:41:29 -04:00
karo
80d4806a9c incus-user: Use errors.Is instead of direct error comparison
Replace direct error comparison with errors.Is checks to avoid potential bugs with wrapped errors.

Signed-off-by: karo <karolin.kostial@gmail.com>
2025-04-27 12:54:55 +02:00
karo
ba9acae39b incus-user: Rename reverters from revert to reverter
Signed-off-by: karo <karolin.kostial@gmail.com>
2025-04-27 04:27:38 -04:00
Stéphane Graber
fc7344a1d7 incus-user: Update for change to shared/idmap
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-04-02 21:58:37 -04:00
Colin Watson
13a7e285a2 cmd: Fix spelling errors found by codespell
Signed-off-by: Colin Watson <cjwatson@debian.org>
2025-03-18 14:51:46 -04:00
Stéphane Graber
3b6ef77757 incus-user: Fix gofumpt
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2025-03-17 18:02:52 -04:00
Maciek Borzecki
01b70f2651 cmd/incus-user: unify logging, support --verbose and --debug
Refactor logging setup so that it matches the rest of the code base. Add
support for --verbose and --debug, similarly to other commands.

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2025-01-27 13:30:36 -05:00
Maciek Borzecki
576f7cf4d0 cmd/incus-user: keep track of socket path used to connect to the server
The logic used to figure out the correct Unix socket path for access to
 the demon in `client.ConnectIncusUnix()` was fixed in in
 d8b78d5007 to account for use of
 /run/incus/unix.socket as an alternative socket location. However, the
 proxying code of incus-user was not updated when the fix was
 introduced. As a result, even if initial connection to the server and
 the configuration queries were successful, the actual attempt to proxy
 a client request would fail while trying to connect to
 /var/lib/incus/unix.socket regardless of prior findings.

Signed-off-by: Maciek Borzecki <maciek.borzecki@gmail.com>
2025-01-25 17:29:39 +01:00
Stéphane Graber
6a0bcd76ec global: Initial goimports run
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-11-19 17:32:18 +00:00
Mathias Gibbens
1d8f4e73ab shared: Update import path for "revert" library
Signed-off-by: Mathias Gibbens <mathias.gibbens@futurfusion.io>
2024-10-21 13:45:08 -06:00
Stéphane Graber
fda9ad59c1 incus-user: Handle existing network
Closes https://github.com/zabbly/incus/issues/56

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-09-21 19:17:11 +01:00
Stéphane Graber
89ed2bf6c6 incus-user: Handle deleted projects
Add logic to keep track of the available projects and if the user's
project is missing, re-create it automatically.

Closes #1149

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-09-05 19:10:37 -04:00
Stéphane Graber
177e1601c5 incus-user: Use shorter interrface name for long UIDs
Closes #972

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-07-10 01:43:07 -04:00
Stéphane Graber
d6efc8c729 incus-user: Don't needlessly update the default profile
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-06-03 00:26:58 -04:00
Kees Bakker
2e9085648d cmd/incus-user: Avoid double user-user- in network description
Signed-off-by: Kees Bakker <kees@ijzerbout.nl>
2024-06-01 23:24:55 +02:00
Stéphane Graber
09dc3e60bc global: Update Go package to v6
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-04-05 11:11:11 -04:00
Thomas Hipp
16095c9721 Replace util.ValueInSlice with slices.Contains
Signed-off-by: Thomas Hipp <thomashipp@gmail.com>
2024-02-23 22:28:37 +01:00
Stéphane Graber
5a5e37879f incus-user: Don't set raw.idmap when uid/gid aren't in system map
Closes #329

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2024-01-06 09:26:02 -05:00
Stéphane Graber
0ff2943924 incus-user: Fix bad path
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-10-09 01:08:50 -04:00
Stéphane Graber
7d8d6abf14 incus-user: Use users directory under main storage
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-10-06 11:44:30 -04:00
Stéphane Graber
f405c2ecb8 incus-user: Add --group option
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-10-05 01:54:15 -04:00
Stéphane Graber
5791b41c9f incus-user: Require root user
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-10-05 01:45:38 -04:00
Stéphane Graber
848254fb40 incus-user: Change unix socket path
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-10-05 01:45:37 -04:00
Stéphane Graber
24b884442b cmd/incus-user: Update for internal/linux
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-29 16:30:06 -04:00
Stéphane Graber
edf560f75d cmd/incus-user: Update for internal/linux
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-29 16:30:03 -04:00
Stéphane Graber
eca6f7e32b cmd/incus-user: Eliminate use of shared package
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-28 05:03:19 -04:00
Thomas Hipp
72d9c88e3d Replace shared.StringInSlice with shared.ValueInSlice
Signed-off-by: Thomas Hipp <thomashipp@gmail.com>
2023-09-26 20:39:20 +02:00
Stéphane Graber
ab8611fe89 incus-user: Update for internal/linux
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-14 20:35:59 -04:00
Stéphane Graber
be4ae59402 incus-user: Update for internal/util
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-14 20:32:19 -04:00
Stéphane Graber
ae8a1c1c30 global: Update for shared/cert
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-08 10:36:05 -04:00
Stéphane Graber
9f0dae0eaf global: Update usage of shared/subprocess
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-08 10:36:00 -04:00
Stéphane Graber
4c73aa85ed global: Update for internal/version
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-09-07 15:40:30 -04:00
Stéphane Graber
8b704f2355 cmd/incus-user: Remove LXD mentions
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-08-30 00:46:08 -04:00
Stéphane Graber
0ba51f6e68 cmd/incus-user: Update for client change
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-08-14 16:13:34 -04:00
Stéphane Graber
ae105058ab cmd: Update for incus -> incusd
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-08-09 01:52:30 -04:00
Stéphane Graber
2d416ad44c cmd: Update for lxc/incus
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-08-08 23:35:45 -04:00
Stéphane Graber
29dd530013 incus-user: Move to cmd/incus-user
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
2023-08-04 08:27:16 -05:00