Commit Graph
1886 Commits
Author SHA1 Message Date
Luca Di Maio 38da4b5e89 fix(list): scope distrobox detection to known label keys
IsDistrobox matched any label key OR value containing "distrobox", so
unrelated containers carrying a path or project tag that happened to
include the substring (e.g. a workdir under a "distrobox" directory)
leaked into `distrobox list` — and into the rm/upgrade/stop pipelines
that filter through the same call.

Label values are never authoritative; only `manager=distrobox` and the
`distrobox.*` key namespace are ever set by us. Check those directly,
keeping 24b31ed8 working for manager-overridden boxes (apx).

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-29 13:12:43 +02:00
Luca Di Maio 2fa1339409 Merge pull request #2136 from 89luca89/dependabot/go_modules/gopkg.in/ini.v1-1.67.3
chore(deps): bump gopkg.in/ini.v1 from 1.67.0 to 1.67.3
2026-06-25 16:06:40 +02:00
Luca Di Maio 7d67bdb3d2 Merge branch 'main' into dependabot/go_modules/gopkg.in/ini.v1-1.67.3 2026-06-25 16:06:31 +02:00
Luca Di Maio 566b07d738 Merge pull request #2138 from 89luca89/dependabot/github_actions/golangci/golangci-lint-action-9.2.1
chore(deps): bump golangci/golangci-lint-action from 9.2.0 to 9.2.1
2026-06-25 16:05:44 +02:00
Luca Di Maio 2350c8599f Merge pull request #2137 from 89luca89/dependabot/github_actions/actions/checkout-7.0.0
chore(deps): bump actions/checkout from 6.0.2 to 7.0.0
2026-06-25 16:05:31 +02:00
Luca Di Maio bd8666847b Merge pull request #2135 from 89luca89/dependabot/go_modules/github.com/urfave/cli/v3-3.10.0
chore(deps): bump github.com/urfave/cli/v3 from 3.5.0 to 3.10.0
2026-06-25 16:05:13 +02:00
dependabot[bot] 7aabef8280 chore(deps): bump golangci/golangci-lint-action from 9.2.0 to 9.2.1
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 9.2.0 to 9.2.1.
- [Release notes](https://github.com/golangci/golangci-lint-action/releases)
- [Commits](https://github.com/golangci/golangci-lint-action/compare/1e7e51e771db61008b38414a730f564565cf7c20...82606bf257cbaff209d206a39f5134f0cfbfd2ee)

---
updated-dependencies:
- dependency-name: golangci/golangci-lint-action
  dependency-version: 9.2.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:21 +00:00
dependabot[bot] 614014e48d chore(deps): bump actions/checkout from 6.0.2 to 7.0.0
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 7.0.0.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:05 +00:00
dependabot[bot] f4e9b862a8 chore(deps): bump gopkg.in/ini.v1 from 1.67.0 to 1.67.3
Bumps gopkg.in/ini.v1 from 1.67.0 to 1.67.3.

---
updated-dependencies:
- dependency-name: gopkg.in/ini.v1
  dependency-version: 1.67.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:04 +00:00
distrobox-docs-bot a193355609 Automatic Man Page Update
Signed-off-by: distrobox-docs-bot <distrobox-docs-bot@users.noreply.github.com>
2026-06-25 13:55:02 +00:00
dependabot[bot] 44e598c3a5 chore(deps): bump github.com/urfave/cli/v3 from 3.5.0 to 3.10.0
Bumps [github.com/urfave/cli/v3](https://github.com/urfave/cli) from 3.5.0 to 3.10.0.
- [Release notes](https://github.com/urfave/cli/releases)
- [Changelog](https://github.com/urfave/cli/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/urfave/cli/compare/v3.5.0...v3.10.0)

---
updated-dependencies:
- dependency-name: github.com/urfave/cli/v3
  dependency-version: 3.10.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-25 13:55:02 +00:00
Luca Di Maio 7fe1539076 Merge pull request #2122 from 89luca89/next
feat: distrobox v2.0
2026-06-25 15:54:13 +02:00
Alessio Biancalana c7478fdf5f fix: forbidigo on completion stdout writes 2026-06-25 14:27:15 +02:00
Luca Di Maio 8d96cce479 docs: switch usage and man pages to v2 subcommand syntax
Rewrite distrobox-*.md to `distrobox <cmd>`, reconcile flag tables with
internal/cli, refresh README+useful_tips, regenerate man/man1/*.1.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio a4d2217a57 feat(install): make install/uninstall scripts work with v2
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio 4acf784a7d feat(completion): add bash and zsh shell completion
Wrappers in completions/ call --generate-shell-completion; a Go
ShellComplete callback emits flag names so urfave's default response
(subcommands only) is replaced with the full candidate set.

This replaces old hard-coded way to auto-complete using shell script's
parsing.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio c71075124b chore(commands): tidy error paths and drop v1-comparability code
Fix "contaiers" typo (list, rm), route the upgrade error through the
printer, and simplify joinHooks now that tests/compare.sh is gone.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio b31ea49e91 chore(cleanup): remove v1 file leftovers
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 13:39:47 +02:00
Luca Di Maio c574800e72 refactor(create): align flag Value with displayed default
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:26 +02:00
Luca Di Maio bdc2576f2c refactor(config): centralize DBX_* env-var resolution
Env vars were read in three layers — cli.EnvVars on flags, os.Getenv
in CLI actions, and the podman provider — leaving library users no
single override point. Funnelling every DBX_* through pkg/config gives
consumers one injection point, lets the container manager receive its
configuration instead of sniffing for it, and fixes the create flags
whose Usage advertised a default the env-set value was already
shadowing.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:25 +02:00
Luca Di Maio 9ab96ee1e0 refactor(rm): route command-layer prints through ui.Printer
Replace four fmt.Print*/Fprintf calls in pkg/commands/rm.go with a
printer field on RmCommand, converting warnUnknownContainers and
findExportedDesktopApps to methods. cli/rm, assemble, and ephemeral
propagate the new constructor arg so library users can control output.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:25 +02:00
Luca Di Maio 9a3b768385 chore(lint): clear golangci-lint findings
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:25 +02:00
Luca Di Maio b9b46b685a fix(test): mock the manager in generate-entry single-mode tests
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:25 +02:00
Luca Di Maio 3a4fc6a89e fix(rm): wire DBX_CONTAINER_RM_CUSTOM_HOME into --rm-home
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:25 +02:00
Luca Di Maio bdc86bbdb9 fix(rm): print 'Cannot find container' for unknown explicit names
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:25 +02:00
Luca Di Maio d0bc6af01b fix(stop): honor DBX_CONTAINER_NAME when no positional given
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:25 +02:00
Luca Di Maio cd2021d247 fix(create): word-split --volume values for shell parity
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:24 +02:00
Luca Di Maio 00514a8ef0 fix(create): strip trailing slashes from --home
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:24 +02:00
Luca Di Maio f89b8dc8d7 fix(create): show the host's hostname in --hostname Usage
Shell distrobox-create:204 prints `default: $(uname -n)`. Compute it
via os.Hostname() at command-build time so --help mirrors the shell.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:24 +02:00
Luca Di Maio a1037e6094 fix(create): drop --image Value default so the empty-check survives
Value: cfg.DefaultContainerImage made cmd.String("image") never empty,
which killed the `containerImage == ""` branch in makeContainerImage
and spuriously triggered the `name == default` fallback for `--name foo`
alone. The Usage string already shows the default.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:24 +02:00
Luca Di Maio ecd155afb1 fix(test): align test with new enter behaviour
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:24 +02:00
Luca Di Maio 333e28ae56 chore(enter): fix gofmt alignment
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:24 +02:00
Luca Di Maio 699a6eba75 fix(rm): use Container.IsRunning() for the force prompt
strings.Contains(container.Status, "Up") missed podman's lowercase
"running" status, leaving the force prompt unreachable under podman.
IsRunning() matches both docker ("Up …") and podman ("running").

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:24 +02:00
Luca Di Maio 556c8bb2ec fix(create): honor positional container_name argument
`distrobox create --image alpine my-box` silently ignored the
positional; only --name was read. Override ContainerName from
cmd.Args().First() to match the shell (distrobox-create:453-461).

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:23 +02:00
Luca Di Maio 07df5ad96b fix(assemble): skip rm step in dry-run mode
dryRun was misrouted into RmOptions.NoTTY, so `assemble rm --dry-run`
and `assemble create --replace --dry-run` actually deleted containers.
Match the shell which skips rm entirely (distrobox-assemble:316-319).

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:23 +02:00
Luca Di Maio 9860650b3d chore(lint): tweak golangci-lint
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:23 +02:00
Luca Di Maio 662edb4d49 fix(upgrade): print a per-container 'Upgrading <name>...' banner
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:23 +02:00
Luca Di Maio 9872c58ab9 fix(create): honor DBX_USERNS_NOLIMIT to drop the keep-id size cap
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:23 +02:00
Luca Di Maio c30b4589b1 fix(create): drop rslave bind propagation on macOS
Centralize in bindPropagation()/roBindPropagation(); Linux output unchanged.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:23 +02:00
Luca Di Maio bc26dfcd35 fix(enter): build --dry-run command without a live container
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:22 +02:00
Luca Di Maio cc11c2d48b fix(generate-entry): refuse a container that does not exist
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:22 +02:00
Luca Di Maio 348b79050f fix(enter): set PWD=<workdir> and stop forwarding the host PWD
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:22 +02:00
Luca Di Maio 8f22547e2b fix(entry): reuse local icons if present, before attempting downloads
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:22 +02:00
Luca Di Maio b7b0537b5b fix(create): request icon auto-detection so entries aren't icon-less
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:22 +02:00
Luca Di Maio cba73c8f04 fix(generate-entry): detect distro from the image, not the box name
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:22 +02:00
Luca Di Maio ca404a285d fix(enter): reorder PATH so /usr/local/{s,}bin precede /usr/{s,}bin
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:22 +02:00
Luca Di Maio 5a3c65bb62 fix(rm): fix(rm): confirm deletions once and default the prompts to yes, match shell behaviour
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:21 +02:00
Luca Di Maio 6388503959 fix(upgrade): match shell prompting
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:21 +02:00
Luca Di Maio 7ccdd55cf6 fix(assemble): an existing box is not an error, it should be simpl skipped
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:21 +02:00
Luca Di Maio 8c5b5658b9 fix(enter): support noworkdir flag
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-25 09:07:21 +02:00