Wren Linux

wren-linux / CONTRIBUTING.md (as plain text)

Working on Wren Linux

Wren Linux is shell scripts that turn a bare Debian 13 install into a small, careful desktop. If you can read bash, you can read all of it, and help is welcome: a typo, a test, a new extra, or a page that explains something better.

Found a security hole? Don't open a public issue. SECURITY.md says how to report it.

Get a copy and run the tests

git clone https://wrenlinux.org/git/wren-linux.git
cd wren-linux
sudo apt install shellcheck gnupg gpgv acl sway foot rsync nftables xclip cage socat keepassxc lintian python3 wget
PATH=$PATH:/usr/sbin bash test.sh --offline

That takes about 10 minutes. It installs nothing, and the tests work in temp folders with a pretend sudo, apt and the like. A few could reach the real sudo, so a throwaway VM is the safest place for them. Use Debian 13 if you can, since that's what Wren Linux is written for. On another system some checks can fail for reasons that have nothing to do with your change.

While you work, run only the test for what you changed:

bash tools/test-w3m.sh

Don't start two test runs at once, or edit files while one runs: some tests depend on timing, and all of them copy your folder.

To try a change for real, use a computer or VM you can throw away. The scripts change system files: that's their job.

Find your way around

docs/architecture.md shows how the pieces fit together, in about five minutes. In short:

FolderWhat's in it
parts/the base install, one script per piece
extras/optional programs, one script each
bin/the small commands those scripts install
lib/shared helpers
data/settings and files the scripts put in place
docs/extras/one page per extra
tools/tests and build tools
pins.shevery signing key Wren Linux trusts

What a good change looks like

Some code needs extra care: firewall rules, sudo rules, sshd settings, signature checks and anything that downloads. These changes are welcome, but expect slower review and more questions. A new outside key goes in pins.sh with the date you checked it and where.

Add an extra

An extra is one script in extras/. extras/w3m.sh is a short one to copy. It needs:

#!/bin/bash
# What it is, and why it's set up this way. Comments here are for the person
# deciding whether to run it.
# Usage: bash NAME.sh [--remove | --manual]
# summary: One line for the install list, 52 characters at most
# security: some
# status: apt:PACKAGE bin:COMMAND
. "$(dirname -- "${BASH_SOURCE[0]}")/../lib.sh"
if [ "${1:-}" = --manual ]; then print_manual; exit; fi
need_user

if [ "${1:-}" = --remove ]; then
    apt_purge PACKAGE
    exit
fi

say "Installing NAME"
apt_install PACKAGE

To drop an extra, don't delete it at once: add # retired: WHY under its first line. It leaves the install list, and update.sh offers its --remove to anyone who still has it. The file goes a release or two later.

Add a test

A test is a script in tools/ named test-NAME.sh, added to test.sh with a line like:

dev_test w3m "w3m keeps cookies only while it is open (bin/w3m), with a pretend w3m" "w3m checks"

tools/test-w3m.sh is a small one to copy. Tests work in a temp folder and put pretend programs first on the PATH. Some replace sleep with one that returns at once, so use /bin/sleep where a test must really wait.

Send your change

  1. Fork the repository, and make a branch.
  2. Run bash test.sh --offline, and say what it shows, including any failures you think aren't yours.
  3. Open a pull request saying what changed, why, and what you tested.

Everything reaches main the same way, whoever wrote it. Wren Linux's computers take an update only if its newest commit is signed by the project's key, so the maintainer reads each change, then signs on top. That signature vouches for every line below it, so review takes as long as it takes, and small changes get in faster.

The project is under the MIT license, and so is what you send.

Places to start

Some things that would help, none of them urgent:

If you want to take on something bigger, open an issue first, so nobody's work is wasted.