chaotic-aur / toolbox

Unified kit with all the scripts required for maintaining the repository 🧰
https://aur.chaotic.cx
GNU Affero General Public License v3.0
81 stars 11 forks source link
archlinux aur automation continuous-deployment pkgbuild repository-management

Chaotic AUR

CLI

Involved directories

Dependencies

pacman -S --needed base-devel git arch-install-scripts repoctl fuse-overlayfs rsync python-telegram-send openssh

One needs an active mirror or a setting (in /etc/chaotic.conf) like this:

export CAUR_URL='https://builds.garudalinux.org/repos/chaotic-aur/x86_64'
export REPOCTL_CONFIG='/etc/chaotic/repoctl.conf'
export CAUR_REPOCTL_DB_URL="${CAUR_URL}/chaotic-aur.db.tar.zst"
export CAUR_REPOCTL_DB_FILE="/tmp/chaotic/db.tar.zst"

To create a gpg key for the root user refer to this ArchWiki article for more information. If you find problems when using "sudo", read the "su" subsection. Then generate a ssh keypair for the root user.

sudo ssh-keygen

The ssh public key (cat /root/.ssh/id_rsa.pub) then needs to be added to the primary servers' root authorized keys (/root/.ssh/authorized_keys). After that follow these instructions to export the gpg public key. This key will have to be uploaded to keyserver.ubuntu.com in order for the key to be verified. Then, configure it as follows in /etc/chaotic.conf, like this:

export CAUR_DEPLOY_PKGS="/var/www/chaotic-aur/x86_64"
export CAUR_URL="http://localhost:8080/chaotic-aur/x86_64"
export CAUR_SIGN_KEY='8A9E14A07010F7E3'
export CAUR_TYPE='cluster'
export REPOCTL_CONFIG='/etc/chaotic/repoctl.toml'

You'll find more options in src/chaotic first lines.

Supported type values are primary, cluster, and dev.

Furthermore, a valid .gitconfig needs to be supplied in /root/.gitconfig to allow bumping packages via chaotic bump with a meaningful email and name supplied:

[user]
email = "team@chaotic.cx"
name = "Chaotic Dragon (Node) ☭"

To allow pushing to the interfere repo, a fitting ssh key also needs to be added to authenticate the node.

To have clean logs & less bandwidth usage /etc/pacman.conf settings need to be adjusted:

To deploy faster replace openssh with openssh-hpn on all nodes (adds performance-related patches). It should be noted that openssh-hpn recently changed its configuration and behavior and therefore doesn't provide a 1:1 replacement for openssh anymore.

Installation

Install dependencies, then:

sudo groupadd chaotic_op
sudo usermod -aG chaotic_op $(whoami)

make build && sudo make install

Lint

pacman -S --needed yarn shellcheck
yarn install
yarn run lint