Skip to content

minimal 0.7.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 03:23
3539ace

Minimal 0.7.0

0.7.0 is the networking release. A session can now have its own address, a name
you can open in a browser, rules for what it may reach, and ports it publishes
while it runs. Around that, setup that needs root moved into one reviewable
command, a machine can run more than one VM, and bug reports can be uploaded
straight from the CLI.

What's new

Choose how a session is connected

min session activate --network <none|host_ip|own_ip> picks the session's
network.

  • host_ip shares your machine's network. It is the default, and it is how
    sessions behaved before.
  • own_ip gives the session its own IP address. This is the mode that supports
    published ports and per-session rules.
  • none gives the session no network at all.

Decide what a session can reach

You can now say which destinations a session is allowed to reach, and Minimal
enforces it.

min session activate --network own_ip --allow-dns-hosts github.com
  • --allow-dns-hosts <host> allows a hostname. The session reaches that host by
    name and nothing else.
  • --allow-subnets <cidr> allows an address range. --deny-subnets <cidr>
    carves a range back out.
  • --allow-protocols <tcp|udp|icmp> limits the protocols.
  • --deny-all-egress states plainly that the session reaches nothing outside
    itself.

An own_ip session with no rules reaches no external address. Activation says so
in one line and shows the flag that opens it up. A host_ip session with no rules
keeps full access, as before.

A task run follows the network and the rules of its session.

min session policy <session> shows the rules a session ended up with, and
min dash shows them in the detail pane.

Reach a session by name

Every session gets a name: <name>.min.internal.

  • On a fresh install it works through a local HTTP proxy. Activation prints the
    proxy address.
  • After min finalize-install, the name also resolves in every program on
    your machine. A browser still opens it through the proxy.
  • Sessions can reach each other by name, subject to both sessions' rules.
  • From inside a session, host.min.internal is your machine.

Publish ports, up front or while you work

  • --ingress <external>:<internal> publishes a port when the session starts.
  • --dynamic-ingress <allow|ask|deny> decides what happens when something in
    the session asks for a port later. allow publishes it, ask prompts you in
    the attached terminal, and deny refuses. --dynamic-range <lo-hi> bounds
    the ports allow will publish.
  • Inside the session, min net expose <port> asks for a port. A server that
    starts listening inside the allowed range is published without a command,
    and withdrawn when it stops.
  • min net forward <session> <local>:<port> puts a session port on
    localhost:<local>. It works in every network mode and needs nothing
    installed in the session.

min session policy lists the ports a session published at runtime. Every
decision to publish or refuse is recorded.

One command for the setup that needs root

The installer never asks for root. Anything that does need it is collected
into min finalize-install, which runs it in one sudo call.

  • min finalize-install --show lists what this machine is still missing and
    runs nothing.
  • min finalize-install --show --script prints the exact script so you can
    read it first.
  • min finalize-install --undo removes everything it installed.

The installer offers to run it when your machine needs it. If you skip it,
Minimal keeps working, and session names open through the proxy.

More than one VM

  • --vm <name> runs a named VM with its own state beside the default one.
    Sessions in different VMs are still addressed by name.
  • VM-backed sessions on Linux (--provider local-minvmd, available since
    0.5.1) get the same networking as macOS: names, rules and published ports,
    enforced outside the VM.

Send a bug report from the CLI

  • min bug --upload collects a diagnostic bundle and uploads it. It prints a
    report link you can share and a command that deletes the bundle.
  • min diag upload <path> uploads a bundle collected earlier.
  • min diag delete <id> <token> removes an uploaded bundle. The upload prints
    this command with the id and token filled in. Bundles expire on their own
    after 7 days.
  • No account or token is needed to upload. Credentials are scrubbed from the
    logs that go into a bundle.

Sessions that are harder to lose

  • A session keeps running when your terminal or connection goes away, and
    a lost exec ends only its own command.
  • min session attach, exec and policy accept a unique prefix of a
    session id as well as a name.
  • When the daemon ends your attach, you get a one-line reason and exit code
    254, not a silent disconnect.
  • min stop --force can stop a VM that has stopped responding.
  • Running a command that does not exist in the session exits 127 with
    command not found.
  • Activation fails up front, with the reason, when a package cannot be
    resolved or the machine cannot create the sandbox.

Everyday polish

  • min add keeps the comments and layout of your minimal.toml, suggests
    close matches for a misspelled package, and shows download progress.
  • min add offers to create a minimal.toml when the project has none.
  • The installer takes --version <version> to install a specific release.
  • Uninstall advice now covers the whole install.
  • Errors, warnings and refusals across min, min ls, min dash and
    activation were rewritten in plain language. Each one states the situation
    or names the next command to run.
  • Session start prints fewer lines.

Breaking changes

These affect anyone upgrading from 0.6.0.

  • [harness] in minimal.toml no longer loads. Rename the table to
    [stack]. The error names the file to edit.
  • min ssh-forward is removed. Use
    min net forward <session> <local>:<port>.
  • The daemon's HTTPS reverse proxy and client certificates are removed.
    min login no longer issues a certificate. Reach a session by its
    <session>.min.internal name or with min net forward.
  • Session names must be valid hostnames. Letters, digits and hyphens
    only. Names are case-insensitive, so Web and web are the same session.
    host, local, localhost and minimald are reserved, and a name shaped
    like a session id is refused. Rename older sessions that do not fit with
    min session rename.

Good to know

  • An own_ip session with no egress flags reaches nothing outside itself. Add
    --allow-dns-hosts or --allow-subnets, or --allow-subnets 0.0.0.0/0 for
    everything.
  • An egress rule that names only hostnames reaches those hosts and no address
    directly.
  • Sessions have no IPv6 path yet.
  • Egress rules are enforced on own_ip sessions. A host_ip session enforces
    only --deny-all-egress. On macOS and on a Linux VM host this works out of
    the box. On a native Linux host it needs min finalize-install; until then
    the session starts with a note that its rules are not enforced. Where
    deny-all is enforced, a host_ip session with a narrower rule is refused.
    Use --network own_ip when the rules matter.
  • The older --network spellings no-net, host-net and own-ip still
    work.

Known issues

  • On macOS and on a Linux VM host, min session exec can hang when you pipe
    a large input into a command that also writes a lot of output. 1 to 5 MB
    through cat works. 10 MB hangs in about half of runs. min task run with
    piped input can stall after a few hundred KB. The hang takes the session's
    connection with it, and the client gives up after about 75 seconds. A fix
    is in review for the next release.

Fixed

  • A stalled client can no longer stall the daemon or other sessions.
  • A burst of min session exec calls fails fast instead of hanging.
  • min task run no longer hangs on an open stdin pipe, and it honours the
    task's arguments and working directory.
  • Hard links survive the project upload.
  • Disk space is returned to the host as sessions free it, and Minimal warns when
    the host is too full to back the VM's disk.
  • The VM shuts down cleanly when it is stopped, and a leftover network
    helper from an earlier run is cleaned up at the next start.
  • Session rename updates the name inside the running session.
  • Piping min output into a command that exits early no longer prints an
    error.