<feed xmlns='http://www.w3.org/2005/Atom'>
<title>dbx, branch next</title>
<subtitle>Containerized development environments</subtitle>
<id>http://src.lordello.net/dbx/atom/?h=next</id>
<link rel='self' href='http://src.lordello.net/dbx/atom/?h=next'/>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/'/>
<updated>2026-11-27T13:59:36Z</updated>
<entry>
<title>Start Next Version of `dbx`</title>
<updated>2026-11-27T13:59:36Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-11-27T13:59:36Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=732bd7137f018e4ad0d114744c92e33c00921d31'/>
<id>urn:sha1:732bd7137f018e4ad0d114744c92e33c00921d31</id>
<content type='text'>
This is the first PR in a fresh branch that refactors `dbx` to a
new agentic development paradigm. The idea is to create a single
development container for each project, and provision it with a
working agent harness.

The development flow is changed to fetching Git refs from the
development box for review and signing on the host. It is meant as
a hardened alternative compared to the previous version (where we
would typically expose a GPG/SSH socket over an `ssh` connection
to the guest, and rely on `pinentry` and `askpass` configuration
to enforce user presence or verification tests for each
authenticated operation.

It is still in the early stages of "ideating" how the final project
would look like, but I already have some idea on how I want it.
</content>
</entry>
<entry>
<title>Use `container` and not `container machine`</title>
<updated>2026-11-17T14:54:24Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-11-17T14:54:24Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=afb81e05605603f15e0bc223b4c5dbc690ad8e49'/>
<id>urn:sha1:afb81e05605603f15e0bc223b4c5dbc690ad8e49</id>
<content type='text'>
Move back to using plain containers, as they have stronger security
guarantees (`container machine` forwards SSH socket for example).
</content>
</entry>
<entry>
<title>Use Passt with Podman+Krun by Default</title>
<updated>2026-09-22T18:08:35Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-22T18:08:35Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=dd4ea030982946b80f0a3537d7b723ac0a1bc53f'/>
<id>urn:sha1:dd4ea030982946b80f0a3537d7b723ac0a1bc53f</id>
<content type='text'>
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).
</content>
</entry>
<entry>
<title>Make Runtime Dir Creation Linux-Only</title>
<updated>2026-09-16T19:35:11Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-16T19:35:11Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=4558ca2fb10c144e1f7ab380329eb577e12851d3'/>
<id>urn:sha1:4558ca2fb10c144e1f7ab380329eb577e12851d3</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Use Basename for Messages</title>
<updated>2026-09-16T19:08:54Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-16T19:08:54Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=cde0c2c3259743ab0f63ff19d1a9b87298df41f3'/>
<id>urn:sha1:cde0c2c3259743ab0f63ff19d1a9b87298df41f3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Simplify Podman+Krun Creation</title>
<updated>2026-09-15T12:49:49Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-15T12:49:49Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=001b21edafd026e8346ec15212469f0d11cd2fb8'/>
<id>urn:sha1:001b21edafd026e8346ec15212469f0d11cd2fb8</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Support Custom Teardown</title>
<updated>2026-09-15T12:05:52Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-15T12:05:52Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=717968007c67fca3067777cffa3dd40582968f4a'/>
<id>urn:sha1:717968007c67fca3067777cffa3dd40582968f4a</id>
<content type='text'>
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).
</content>
</entry>
<entry>
<title>Implement Basic RC System</title>
<updated>2026-09-11T14:16:28Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-11T13:54:00Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=d893a0e08fbf0ae7fc85b62a0814ab31d758169a'/>
<id>urn:sha1:d893a0e08fbf0ae7fc85b62a0814ab31d758169a</id>
<content type='text'>
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 &lt;&lt;EOF &gt;/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"
```
</content>
</entry>
<entry>
<title>Fix SSH User Configuration</title>
<updated>2026-09-10T07:06:35Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-10T07:06:35Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=1c46b80e3a4c2064d1ce8b818463ae7daf08183f'/>
<id>urn:sha1:1c46b80e3a4c2064d1ce8b818463ae7daf08183f</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Slightly Stricter Networking</title>
<updated>2026-09-09T15:29:56Z</updated>
<author>
<name>Nicholas Rodrigues Lordello</name>
<email>n@lordello.net</email>
</author>
<published>2026-09-09T15:29:56Z</published>
<link rel='alternate' type='text/html' href='http://src.lordello.net/dbx/commit/?id=fedf21ce50057d20e431475447fc9e510f32b8ba'/>
<id>urn:sha1:fedf21ce50057d20e431475447fc9e510f32b8ba</id>
<content type='text'>
</content>
</entry>
</feed>
