THE WRITER MUST EAT -> patreon.com/trn1ty <-

| \    |   | blah!
|\ | `\|\  | the rantings and ravings
|/ |(_|| | * of a depraved lunatic

<^>

2024-06-24

I'm sick today. Was pretty sick yesterday. Now pretty sick today. I keep
coughing up weird-colored mucus, not neon green but bits of brown and red and
yellow. Hopefully I'm well by tomorrow because I have a 9-hour shift I don't
wanna miss.

I'm potentially going back to Maine soon. I need to go to get my stuff from my
grandparents, money from Troy, and hugs from M--. It'll suck but it'll be nice
to see M-- especially.

: Contributing to Bonsai

This guide explains how to start committing to Bonsai git repositories. It
walks the reader through setting up its freshly-installed, Bonsai-dedicated
system for cloning Bonsai repositories and committing to them. For a system
already in use it may be necessary for the reader to read the man pages for the
binaries used and use its own discretion with regards to its local setup.

The following binaries are necessary to follow this guide:

- git(1)
- gpg(1)
- ssh-keygen(1)

And on the following systems, can be installed as follows:

+------------------+----------------------------------------+
| System           | Installation command line              |
+------------------+----------------------------------------+
| Alpine           | # apk add     git gnupg openssh        |
| Arch             | # pacman -S   git gnupg openssh        |
| Debian           | # apt install git gnupg openssh-client |
| OpenBSD          | # pkg_add     git gnupg                |
+------------------+----------------------------------------+

## Cloning the git repository

### SSH setup

The following generates an Ed25519 SSH keypair, which will be used to clone,
pull from, and push to the Bonsai git repositories. This is optional. The
alternative is to use HTTPS authentication which is usually self explanatory
(the default if certain git commands are tried without SSH set up).

```
$ ssh-keygen -t ed25519
```

ssh-keygen(1) will tell you where it put the public key; usually, this is
`$HOME/.ssh/id_ed25519.pub`. Open the Tebibyte Media Gitea instance, navigate
to the "SSH / GPG Keys" page in the User Settings, "Add Key" on "Manage SSH
Keys", and paste the contents of that file (it should end with `.pub`!) into
the prompt.

### GPG setup

Bonsai git commits must be signed with a GPG keypair. This generates a GPG
keypair for use with Bonsai.

```
gpg --full-generate-key
```

Generating an **`ECC (sign and encrypt)`** key with the **`Curve 25519`** and
an expiration date of **`1y`** tends to work well.

This example is based on the example from
<https://docs.codeberg.org/security/gpg-key/&rt;, updated with the previous
settings.

```
public and secret key created and signed.

sec   ed25519/3AA5C34371567BD2 2021-06-06 [SC] [expires: 2025-06-25]
      6CD8F2B4F3E2E8F08274B563480F8962730149C7
uid                 [ultimate] knut <knut@codeberg.org&rt;
ssb   cv25519/42B317FD4BA89E7A 2024-06-25 [E] [expires: 2025-06-25]
```

The key ID here is `3AA5C34371567BD2`, the hexadecimal string after the key
type on the line prefixed with "sec". If the video terminal's display has been
cleared or the teletype runoff has been lost, the following command line will
print a list of keys present on the system:

```
gpg --list-secret-keys --keyid-format LONG
```

Given that the ID for the key to be used with Bonsai is `3AA5C34371567BD2`, the
following command line will export the public key for the keypair:

```
gpg --armor --export 3AA5C34371567BD2
```

If the command errors out refer to
<https://wiki.archlinux.org/title
/GnuPG#Configure_pinentry_to_use_the_correct_TTY&rt;

Then paste the public key into the appropriate prompt in the "SSH / GPG Keys"
page on the Gitea user settings.

Now configure git to sign with the GPG key:

```
git config --global user.signingkey 3AA5C34371567BD2
git config --global commit.gpgsign true
```

## All set

Now clone a Bonsai repository, such as harakit:

```
git clone gitea@git.tebibyte.media:bonsai/harakit.git
```

If it works, you're probably all set. Thank you in advance for your
contributions!

<^>

No rights reserved, all rights exercised, rights turned to lefts, left in this
corner of the web.