Skip to content

feat: Implement "Remove" action on exported apps to delete them#2061

Open
iTrooz wants to merge 133 commits into
89luca89:nextfrom
iTrooz:next_del_exported_app
Open

feat: Implement "Remove" action on exported apps to delete them#2061
iTrooz wants to merge 133 commits into
89luca89:nextfrom
iTrooz:next_del_exported_app

Conversation

@iTrooz

@iTrooz iTrooz commented Apr 20, 2026

Copy link
Copy Markdown

See #2059
Same feature but targeting next branch

fabriziosestito and others added 30 commits March 28, 2026 15:13
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
* build(deps): add urfave/cli

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* chore: add gitignore

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* ci: add golangci configuration

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* build(Makefile): add Makefile

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add main package and distrobox cmd

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
* feat: add containermanager package and docker provider

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add list command

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add root command

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: add list command

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat: wire-up root command in main

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* refactor(docker): use format json

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
* chore: disable mdlint (89luca89#6)

* resolve lint issues

Some issues where detected by the CI once run:
* use of `fmt.Printf` forbidden by pattern `^(fmt\.Print(|f|ln)|print|println)$` (forbidigo)
* File is not properly formatted (goimports)
* Magic number: 12, in <condition> detected (mnd)
* error-format: fmt.Errorf can be replaced with errors.New (perfsprint)

---------

Co-authored-by: Alessio Biancalana <alessio@dottorblaster.it>
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](actions/checkout@v5...v6)

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

Signed-off-by: dependabot[bot] <support@github.com>
* feat(cli): validate sudo (sudo -v) in beforeCommand if --root is set

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat(docker): add root and sudoCommand and execute commands with sudo if root is set

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* feat(cli): add --root description and -r alias

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
* add GenerateEntryCommand package

The package mimics the actual distrobox-generate-entry shell command
that installs a desktop entry file so that the host's desktop
environment can render the appropriate application icon.
This first implementantion scaffolds the command package and implements
the simplest scenario for a single container.

* delete entry

If the `delete` flag is provided, the command remove the desktop entry
if present.
Deleting a non-existing item does not raise an error.

* generate entries for all containers

With `opts.All` we implement an abstraction over the
`GenerateEntryCommand` that iterates across all the containers to
generate or delete the relative desktop entries.
`ListCommand` is used to fetch the list of containers.

* mount the generate-entry cli command

Mount the command so that is reachable from the CLI. Define parameters
with type and basic validation.
Depending on the flag `--all`, the appropriate set of options is provided
to the `GenerateEntryCommand.Execute()` method.
If `--all` is set, `container-name` and `icon` arguments will be ignored.
* embed shell scripts to execute inside the distrobox

The command init, export and host-exec must be accessible from inside
the distrobox container.
When needed, the embedded scripts will be written to a host directory
and then mounted as volume on the created container.
The host directory is determined by configuration and environment
variables.
The script will be not converted to GO to keep then
architecture-agnostic.

* add Create to the Docker container manager

The function will compose argument string to append to the `docker`
command.
If `DryRun=true`, the command is just printed on screen and not
executed.

* add Create command package

* mount cli command
* feat: add config

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* build(deps): add testify

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

* test(config): add config loading test

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>

---------

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
* feat(enter): rewrite in go

* chore: make InspectContainer public

* chore: use userenv package for user's environment

* chore: export InspectResult type for convenience

* fix: rename containerInspect to inpectOutput

* fix: use userenv inside generateEnterCommand

* fix(enter): more userenv

* chore: add some unit tests for buildContainerPath and buildCommandArgs
* read desktop entry directory and distrobox path from the global config

* implement entry generation requested from user
* remove unused ID field

* add a test for include order
* scaffold assemble command

* mount assemble command

* implement create item
Manifest can either be file or remote URLs. In the latter case, the content is fetched into a temporary file; then the parsing follows as usual.

Note that the HTTP fetch has no constraint on protocol to use nor an allowed list of URLs, just like in the original `assemble` command. https://github.com/89luca89/distrobox/blob/main/distrobox-assemble#L240

```
if command -v curl > /dev/null 2>&1; then
	download="curl --connect-timeout 3 --retry 1 -sLo"
elif command -v wget > /dev/null 2>&1; then
	download="wget --timeout=3 --tries=1 -qO"
```

The only difference with the original implementation is that the file input is checked to be a valid URL.
* feat: rewrite rm in go

* fix: declare yes and no as string slices
* move the Propter under screen package

* add color formatters

* add progress

This module allows for printing a sequence of lines with check marks.
Useful to show progress on a long running action (example: container
init).

* implement progess on create

* implement progress on assemble

* implement progress on enter

* implement color

* move internal/screen to pkg/ui

* add printer

* implement printer

* fix progress finalize method

* fix progress implementation for enter command
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
Replace helper functions (lastString, lastBool, allStrings, splitString)
with a single loop that fetches ValueWithShadows() once per key. This
avoids repeated calls to the ini library for each field.

Signed-off-by: Fabrizio Sestito <fabrizio.sestito@suse.com>
arungeorgesaji and others added 20 commits April 28, 2026 10:58
* feat: make listing alphabetical

* docs: added a comment about the rationale of the sorting
…manager interface

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
CustomCommand was joined into a string and re-split on whitespace,
collapsing quoted args — `sh -c "echo a || echo b"` lost its script
body, and any value passed by upgrade/assemble with embedded spaces
or quotes got mangled. Pass argv through as []string end-to-end.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Some flags are shared to many commands but not to all (example: `--root`). By composing decorators, each command can be configured so that is assigned only to the flags that matters.
`assemble` command cannot be executed as root. Instead, each item can
either be processed by a rootful or rootless container manager.
Previously, the CLI hardcoded "1.0.0" as the version string in two places (the root command and the generate-entry subcommand).

Introduce pkg/version, a minimal package that exposes a single variable Version, defaulting to "dev". The root command now references such a value; generate-entry does not need it al all

The Makefile computes the version at build time by running:

git describe --tags --always
This produces the exact tag name when HEAD is tagged, or --g when it is not, giving a precise description of the build relative to the nearest ancestor tag. If git is unavailable, the value falls back to "dev".

The resulting string is injected into the binary via:

-ldflags "-X github.com/89luca89/distrobox/pkg/version.Version=<value>" so that distrobox --version and distrobox generate-entry --version both report the exact version of the build.
`Interactive: !NoTTY` routed stdio to discarded buffers whenever
--no-tty was set, breaking ptyxis. --no-tty only governs whether
`--tty` is appended to the exec args, not stdio plumbing.

Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iTrooz iTrooz force-pushed the next_del_exported_app branch from 1d99b75 to 3e166b0 Compare May 5, 2026 12:11
@iTrooz

iTrooz commented May 5, 2026

Copy link
Copy Markdown
Author

Just resolved the conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.