aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-11-17Use `container` and not `container machine`HEADmainNicholas Rodrigues Lordello
Move back to using plain containers, as they have stronger security guarantees (`container machine` forwards SSH socket for example).
2026-09-22Use Passt with Podman+Krun by DefaultNicholas Rodrigues Lordello
TSI has some known limitations (such as mapping `:0` ports on the guest incorrectly). For this to work, some additional `passt` configuration was needed: - Enable `passt` in the `krun` configuration - `passt` cannot bind to service ports, so an additional sysctl in the container to remove all ports from the service port range. This does not affect the user in the guest - Additional `pasta` flags to make connections from the guest to the host not look like local ones on loopback (doesn't prevent access to the host over the network, but makes it look like another system on the local network). In general network isolation is still lacking and needs to be generally improved (but I lack understanding to make it work).
2026-09-16Make Runtime Dir Creation Linux-OnlyNicholas Rodrigues Lordello
The `XDG_RUNTIME_DIR` is a Linux-only thing, and there is no established equivalent on macOS, so just don't create the directory. Also cleaned up some "if unset" expansions in the script.
2026-09-16Use Basename for MessagesNicholas Rodrigues Lordello
2026-09-15Simplify Podman+Krun CreationNicholas Rodrigues Lordello
Two options weren't actually needed but still hanging around: - the KRUN_INIT_PID1 caused more issues than it solved, as it prevented the proper reporting of exit codes (among other things) to `crun`. Now that we have an `/sbin/stop` script, and the init script correctly forces `tini` to be a subreaper, this is no longer needed. - the `network` flag, specifically adding the `--map-guest-addr none` flags wasn't actually doing anything for security.
2026-09-15Support Custom TeardownNicholas Rodrigues Lordello
Similar to how we added an "RC" system to the init script, we now have a custom tear-down script (which can do things like unmount loop devices). Furthermore, we make sure that an `$XDG_RUNTIME_DIR/dbx` exists for things like SSH control sockets (so they can go somewhere where an application has R/W access to, while only keeping RO access to the configurations).
2026-09-11Implement Basic RC SystemNicholas Rodrigues Lordello
We added a basic RC system (that runs executable scripts from a directory in the container) for greater customization. Additionally, the post-installation script now runs as root (as it alwasy should have) to allow for additional customization of the enviroment before dropping to the user. This allows for some more complicated devbox provisioning such as: - Making /dev/net/tun accessible to the developement user for pasta - Support setting up XDG runtime dirs if required In particular, this supports a case for running `podman` within the `krun` container: `podman`'s overlay storage driver does not work on `virtiofs` file systems, this allows you to create a loop-mount for `podman` storage to work around this issue. ```sh truncate -s 32G /var/lib/user.img mkfs.ext4 /var/lib/user.img mkdir -p /var/lib/user USER="$1" UID="$(id -u "$USER")" GID="$(id -g "$USER")" cat <<EOF >/etc/dbx/rc.d/user-dirs.sh mountpoint -q /var/lib/user || mount -o loop /var/lib/user.img /var/lib/user install -d -m 0755 -o '$UID' -g '$GID' '/var/lib/user/$UID' install -d -m 0700 -o '$UID' -g '$GID' '/run/user/$UID' EOF ``` For obvious reasons, you do not want the 32GB image to be included in the devbox image. This allows ths user to use `/var/lib/user/1000/...` as `podman` graphroot storage: ```toml [storage] driver = "overlay" graphroot = "/var/lib/user/1000/containers/storage" ```
2026-09-10Fix SSH User ConfigurationNicholas Rodrigues Lordello
While `User=%u` does work in practice, it has some negative side effects. In paricular, `Match` configurations in the user-supplied `.config/dbx/$NAME.ssh_config` use the literal %u instead of the expanded value. Get the user name manually with `id -un` and use that instead of relying on %u expansion.
2026-09-09Slightly Stricter NetworkingNicholas Rodrigues Lordello
2026-09-09Expand Creation SupportNicholas Rodrigues Lordello
We now support a `skel` directory, and **no longer specify the host bind port**. This has a nice side-effect that we don't have to worry about devbox port collisions manually - the `ssh_config` gets updated automatically with the same machinery used for updating the IP address that was used by the `container` engine runtime. Some additional fixes were also added.
2026-09-09Implement Podman+Krun EngineNicholas Rodrigues Lordello
We also did a general "hardening" pass on the setup: - Use `printf` for no weird behaviour with `-` prefixed user-text - More defensive validation of user-specified parameters - No more root access in the `devbox`, but instead a -R flag - Stricter SSH configuration
2026-09-08Small Script ImprovementsNicholas Rodrigues Lordello
First of all, we just use Bash instead of POSIX `sh` - there are some goodies that make it more robust (like `pipefail` and array expansion). This also allows us to make a few more checks on the parameters (such as denying invalid host specifies for `scp`). Added an option for regenerating the SSH configuration
2026-09-08Formatting and StyleNicholas Rodrigues Lordello
2026-09-08Add Autostart OptionNicholas Rodrigues Lordello
2026-09-08Back to ShellNicholas Rodrigues Lordello
I ended up fighting with C for no benefit. We are back to a Shell script, but this time we use (mostly) POSIX shell (we use `local` because it is so convenient, although it is technically not POSIX). Additionally, this time we create a monolithic script, and already add hooks to allow for multiple contianer engines to work with the script (for now, just `container` is implemented and `podman krun` is stubbed).
2026-09-07Start Refactoring Sub-Process LibraryNicholas Rodrigues Lordello
We stopped in the middle, as I realized that I am spending WAY to much time just to do basic things in C instead of actually focusing on implementing the tool.
2026-09-07Adapt Path Utilities to Return ErrorsNicholas Rodrigues Lordello
2026-09-07Add File System UtilitiesNicholas Rodrigues Lordello
We take a slightly different API approach where we return an error number and other values are "returned" through pointers that are passed into the function. Other functions will be adapted to use this pattern going forward.
2026-09-06Implemented Devbox CreationNicholas Rodrigues Lordello
We are now able to create devboxes :tada:. It supports the post install script, and added support for custom SSH configuration options (through `~/.config/dbx/$NAME.ssh_config` file).
2026-09-04Started Implementing Container CreationNicholas Rodrigues Lordello
We setup a single-use SSH key and can generate an SSH configuration. Additionally, we support user SSH settings in `~/.config/dbx/$NAME.ssh_config`. This still doesn't quite work (there are some left-over TODOs). In particular: 1. We need to get the generated SSH public key to the authorized keys list on the devbox 2. We need to SCP and run the optional post-installation script
2026-09-04Implement Engine Search RoutineNicholas Rodrigues Lordello
We now search `PATH` for the engine executable (`container` or `podman`) and use non-`p` variands of `posix_spawn` and `execv`. This allows us to implement engine initialization as "find the path to the engine command, and fail if you cannot find it". It also avoids searching the path on each engine invocation.
2026-09-03Add Utility for Spawning ProcessesNicholas Rodrigues Lordello
2026-09-01CLI Interface ImplementationNicholas Rodrigues Lordello
2026-08-29Refactoring to a C BinaryNicholas Rodrigues Lordello
2026-07-03Improve Locale SupportNicholas Rodrigues Lordello
Previously, the devbox user would default to the `POSIX` locale which meant that a lot of minor things around UTF-8 would not work. We now update the locale to use one with UTF-8 support; note that we just use the minimal C locale instead of building one. Users can (if they chose) use something like `dpkg-reconfigure locales` and `update-locale` in order to modify their default locale if they want something else specific. Additionally, get rid of the annoying known hosts warning, by keeping a devbox specific known hosts file.
2026-07-01Port `dbx` To Use `container machine`Nicholas Rodrigues Lordello
With `container` v1, a new `machine` subcommand was introduced in order to support long-lived machines. Port the `dbx` utility to use `container machine` instead of using regular containers. The main motivation for this is: - `container machine`s are more elastic; when they are stopped their containers are removed entirely (which is different to a container that is stopped, but not removed) - `container machine`s can modify settings (such as CPU and memory limits) after creation, allowing for the machine to change over time as needed Overall, the structure stays largely the same as before; the main difference being how initialization is done (since `container machine` has built-in support for initializing a user with passwordless `sudo`). Note we explicitly set `--home-mount=none` in order to keep the same filesystem isolation guarantees that existed before (files can be copied with `scp`; there is no `container cp` analogy for machines). One notable difference is network management. `container machine`s are assigned their own virtual network device and get a completely separate IP to the host (which is different than before where container ports were being published to the host). I do not know which one is more secure...
2026-05-18Quieter OutputNicholas Rodrigues Lordello
2026-05-15Create Beefier DevboxNicholas Rodrigues Lordello
2026-05-15Fix Image and DBX CommandsmacosNicholas Rodrigues Lordello
2026-05-15Added ContainerfileNicholas Rodrigues Lordello
2026-05-14Started Adapting for Apple ContainersNicholas Rodrigues Lordello
2026-03-24standardize tini invokationlegacyNicholas Rodrigues Lordello
2026-03-23Add LicenseNicholas Rodrigues Lordello
2026-03-23Cleanup and LicenseNicholas Rodrigues Lordello
License code for publishing under GPL, and cleanup a bit (in particular, add a `Makefile` for building the Go `dbx-proxy` executable).
2026-03-23Link Devbox Commands and Proxy TCP ConnectionsNicholas Rodrigues Lordello
Improve DX by adding a utility to create linked executables that run in a devbox (for example, editors can natively run LSP servers) and proxy container TCP connections to the host. The proxying works over stdin and stdout, so it does not require the container to publish ports (and know what ports need to be published beforehand). It was written in Go (since writing this in Bash was too unruly). I want to port the whole project to OCaml once I have time :)
2026-03-22Use `tini` InitNicholas Rodrigues Lordello
In order to correctly handle signals.
2026-03-22Enter and Run in a DevboxNicholas Rodrigues Lordello
You can now enter and run commands in a devbox.
2026-03-21Initial Container CreationNicholas Rodrigues Lordello
We can now create and initialize a `dbx` container!