Commit Graph
1793 Commits
Author SHA1 Message Date
Yiming Sun 1981ca41e7 fix(enter): propagate errors when entering containers (#2070)
* fix(providers): propagate container start errors before enter

* fix(providers): return errors from enter command execution

* fix(providers): improve setup and inspect error reporting

* test(providers): cover enter error propagation paths
2026-06-14 13:04:28 +02:00
Emanuele De Cupis b581ace4c7 fix: passing root correctly to create and generate-entry command (#2068)
* fix(create): handle root correctly

The `root` flag is handled in the root cli command. if we re-declare the
flag here we shadow it, resulting in a contaner manager initializated as
non-root.

Before this commit, these two commands produce respectively one root and
one non-root execution
```
distrobox --root create # root
distrobox create --root # non-root
```

* fix(generate-entry): handle root correctly

The `root` flag is handled in the root cli command. if we re-declare the
flag here we shadow it, resulting in a contaner manager initializated as
non-root.

Before this commit, these two commands produce respectively one root and
one non-root execution
```
distrobox --root generate-entry # root
distrobox generate-entry --root # non-root
```
2026-06-14 13:04:28 +02:00
Fabrizio Sestito debec7e5a2 ci: add commitlint
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Yiming Sun 73c48517ef fix(enter): unshare_groups su args and tty handling (#2063)
* enter(next): fix unshare_groups su args and tty handling

* test(docker): fix noTTY semantics in buildCommandArgs cases

* cli(enter): fix no-tty help text
2026-06-14 13:04:28 +02:00
Fabrizio Sestito 637725affe refactor: tests with testify (#2057)
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Fabrizio Sestito ffeba2b78b fix(providers): Name now returns podman or podman-launcher
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Fabrizio Sestito 603f41e58a fix(cli): add podman-laucher to invalid container manager message
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Fabrizio Sestito 270384f994 test(providers): add podman command selection test
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Fabrizio Sestito 730ca303a1 fix(providers): execute correct binary for podman-launcher provider
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Simon Westlin Green 26e5d907b5 fix: remove breaking spaces exported desktop files (#2051) 2026-06-14 13:04:28 +02:00
Fabrizio Sestito cc05d828c7 feat(cli): wire-up autodetect
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Fabrizio Sestito 6f9b0685cb test(containermanager): add autodetect constructor tests
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
Fabrizio Sestito 168d92f834 feat(containermanager): add autodetect provider constructor
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
2026-06-14 13:04:28 +02:00
balanza 83f270db38 refactor(config): remove unused file 2026-06-14 13:04:28 +02:00
balanza b63fc88a89 refactor(config): move XDG_DATA_HOME read into userenv 2026-06-14 13:04:28 +02:00
balanza db4b1b2a67 refactor(config): read executable path from std library without wrapper 2026-06-14 13:04:28 +02:00
balanza f311f760df refactor(config): remove unused dependency 2026-06-14 13:04:28 +02:00
balanza ec99b5d884 fix(config): read container image and name from config 2026-06-14 13:04:28 +02:00
balanza d9e4ffc57d refactor(config): trickle down config values to commands 2026-06-14 13:04:28 +02:00
balanza 48075ebc51 refactor(config): root cli command to read config from new package 2026-06-14 13:04:28 +02:00
balanza e626b63bf2 refactor(config): read config into struct
The current implementation uses dotenv to load the configuration into
the environment, and then delegate the cli layer to handle the
configuration coming from the DBX_ variables.
With this new implementation, defaults, config files and environment
variables are handled in a single point and treated as values.
2026-06-14 13:04:28 +02:00
balanza 4b22fa130d refactor(config): expose default config values 2026-06-14 13:04:28 +02:00
balanza 03a87ada77 refactor(config): public ConfigValue struct type 2026-06-14 13:04:28 +02:00
Mirko Brombin c31f0e9c71 fix: various bug fixes and code improvements (#2047)
* fix(containermanager): fix typos in ContanerID and ContanerManagerType

* fix(rm): pass ContainerHome to RmOptions when removing container

* fix(containermanager): handle empty names slice in podman container list

* fix(create): initialize prompter in NewCreateCommand to prevent nil dereference

* fix(userenv): trim trailing newline from uid and gid command output

* refactor(containermanager): move shared types and constants to providers common file

* fix(containermanager): skip /dev/shm volume mount if EvalSymlinks fails

* fix(containermanager): rename ContainerManagerType to ManagerType to avoid stutter

* restore: ManagerType -> ContainerManagerType

* test(containermanager): add empty names fallback test for parsePodmanContainerList

* fix(containermanager): suppress revive stutter lint for ContainerManagerType

* fix(containermanager): use empty string fallback when podman container has no name

* fix(commands): pass real prompter to create command in assemble and ephemeral

* Revert "refactor(containermanager): move shared types and constants to providers common file"

This reverts commit 59faeb71f8.
2026-06-14 13:04:28 +02:00
Alessio Biancalana 9d4955a23e docs: strip references to install scripts, add references to Makefile (#2029)
Signed-off-by: Alessio Biancalana <alessio@dottorblaster.it>
2026-06-14 13:04:28 +02:00
Alessio Biancalana 5f2827231a chore: strip install and uninstall scripts (#2027)
Since `install` and `uninstall` don't work on the new setup, we're just
stripping them for the moment.

Signed-off-by: Alessio Biancalana <alessio@dottorblaster.it>
2026-06-14 13:04:28 +02:00
Alessio Biancalana 631e3155c5 ci: enable CI worklows when PRs are opened against the next branch (#2028)
Signed-off-by: Alessio Biancalana <alessio@dottorblaster.it>
2026-06-14 13:04:28 +02:00
balanza d1a9d97ec0 fix(containermanager): use correct enter command path on exported bins 2026-06-14 13:04:28 +02:00
balanza 120c614137 fix(containermanager): conditionally use size attribute on podman 2026-06-14 13:04:28 +02:00
balanza 64f32d53b0 fix(test): expect SELinux volumes only of they exist 2026-06-14 13:04:28 +02:00
balanza fc1eec4177 fix(containermanager): handle podman empty list 2026-06-14 13:04:28 +02:00
balanza 4a15717400 refactor(containermanager): use string argument instead of pointer 2026-06-14 13:04:28 +02:00
balanza e01f942ae1 fix(containermanager): prevent nil pointer exception 2026-06-14 13:04:28 +02:00
balanza 492b81a9b8 chore(ci): fix test CI command 2026-06-14 13:04:28 +02:00
Emanuele De Cupis 5a9649e6ee chore(repo): make the go rewrite the root project (#60)
* chore(repo): remove shell implementation

* chore(repo): remove bash completion for sub-commands

There is no need for separate files as there will be no dedicated binary
for sub-commands

* chore(repo): remove zsh completion for sub-commands

There is no need for separate files as there will be no dedicated binary
for sub-commands

* chore(repo): delete RFC

We are not using RFC at the moment

* chore(repo): move golang project to the root

* chore(ci): move golang project to the root

* chore(repo): use standard .gitignore for golang projects

source: https://github.com/github/gitignore/blob/main/Go.gitignore

* chore(ci): compatibility CI to handle a golang project

* refactor(ci): run shell script checks against the inside-distrobox files

* refactor(ci): merge ci.yml workflow into main.yml
2026-06-14 13:04:28 +02:00
Emanuele De Cupis 2631fb48f5 feat(rm): cleanup container desktop resources (#59)
* feat(rm): cleanup exported apps and bins

* feat(rm): remove desktop entry
2026-06-14 13:04:28 +02:00
Emanuele De Cupis 8c0408396e feat(assemble): exported apps and bins (#58)
* fix(assemble): start container only if the flag is provided

* test(containermanager): define mock

* feat(assemble): export apps

* test(assemble): fail on invalid app name

* feat(assemble): exported bins

* test(assemble): fail on invalid bin name
2026-06-14 13:04:28 +02:00
Emanuele De Cupis 9c2de1e996 feat(create): pull on create (#39)
* feat(containermanager): add ExistsImage function

* feat(containermanager): add PullImage function

* feat(containermanager): pipe command output to stdout and stderr

* feat(create): allow image pull on distrobox create

* feat(ephemeral): allow image pulling

* feat(assemble): allow image pulling

* refactor(manifest): use AlwaysPull instead of Pull to explicit intent
2026-06-14 13:04:27 +02:00
dependabot[bot]anddependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> 0eceb5a316 build(deps): bump actions/setup-go from 6.2.0 to 6.3.0 (#55)
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 6.2.0 to 6.3.0.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](https://github.com/actions/setup-go/compare/7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5...4b73464bb391d4059bd26b0524d20df3927bd417)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-version: 6.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-14 13:04:27 +02:00
Emanuele De Cupis 78ff32fe03 fix(containermanager): handle enter custom command (#57) 2026-06-14 13:04:27 +02:00
Emanuele De Cupis 18b6743402 feat(assemble): handle start_now field in manifest (#56) 2026-06-14 13:04:27 +02:00
Alessio Biancalana fe1e9d56de feat(upgrade): go porting (#54)
* feat(upgrade): port to go

* chore: adjust linting config
2026-06-14 13:04:27 +02:00
8dfb3ad2f7 test(rewrite): add shell-vs-Go compatibility test suite (#44)
* test(rewrite): add shell-vs-Go compatibility test suite

Compares command generation and flag parity between shell distrobox and
the Go rewrite. Uses a single image (alpine:3.21) since all tests
operate at the command-generation level, not runtime.

Shell output is always the reference — if Go differs it's a failure,
not a skip. Go stderr is captured for diagnostics on flag rejections.
Container targeting is per-name only (no --all) to avoid interfering
with existing distroboxes.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* fix add more tests

* fix add more tests

* fix add more tests

* fix(tests): fix malformed test cases in compare.sh

Three value-flag tests were broken by word splitting on unquoted
${flags} expansion — multi-word values caused trailing tokens to
clobber the container name:
- --additional-flags "--ulimit nofile=4096:4096" → --memory=512m
- --init-hooks "echo test-init-hook" → true
- --pre-init-hooks "echo test-pre-init-hook" → true

Also fix flag_slug computation (tr ' -' → tr ' -/:') in all four
loop sites so paths containing / or : don't create bogus filenames,
which silently broke the -H /tmp/dbx-test-home short-flag test.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* fix: test refinement

remove version checks
remove ephemeral until we fix upstream
add test that surfaces go vs shell difference

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* fix: exclude SHLVL from checks, reduce noise

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* fix(test): remove some noise from env vars

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>

* chore: rename output file so that are grouped by operation

* chore(tests): fix linting issues and port comparison tests to POSIX sh

* chore(tests): apply shfmt

---------

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Co-authored-by: balanza <emanuele@decup.is>
Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
2026-06-14 13:04:27 +02:00
Alessio Biancalana 1522c75eaa chore(rm): format go code (#53) 2026-06-14 13:04:27 +02:00
Alessio Biancalana 0b543d194d feat(rm): aliases for flags 2026-06-14 13:04:27 +02:00
Emanuele De Cupis 02fd08ab89 fix(containermanager): handle podman+runc scenario (#51)
When using Podman on a system that uses runc, we must manually add root
mounts to ensure they are mounted as read only volumes
2026-06-14 13:04:27 +02:00
Alessio Biancalana b7e48d7069 chore(list): ls alias (#50) 2026-06-14 13:04:27 +02:00
Alessio Biancalana 16c438d581 fix(create): dry run doesn't fail if container exists (#49) 2026-06-14 13:04:27 +02:00
Luca Di Maio 3c0a2f3036 fix: sync with shell upstream (#48)
Go rewrite emitted --userns keep-id without :size=65536 and
--platform <val> instead of --platform=<val>, diverging from the
shell reference implementation.

Sync assets internal shell with current upstream

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
2026-06-14 13:04:27 +02:00
Luca Di Maio 83aecc269f feat(enter): support custom commands, fix TTY detection and flag parsing (#47) 2026-06-14 13:04:27 +02:00