fix(bootstrap): safe uninstall, add license, CI, and docs

- Fix uninstall to only remove own files (farmer/sprout can coexist)
- Add systemctl daemon-reload after removing unit files
- Suppress userdel error if user doesn't exist
- Add 0BSD LICENSE (matches gogrlx/grlx)
- Add GitHub Actions CI workflow (shellcheck)
- Expand README: non-interactive install, uninstall docs, arch list, badges
This commit is contained in:
2026-03-06 09:02:16 +00:00
parent e53869dc3d
commit dc0a27291e
5 changed files with 106 additions and 6 deletions

17
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,17 @@
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install shellcheck
run: sudo apt-get install -y shellcheck
- name: Lint latest scripts
run: shellcheck latest/farmer latest/sprout

12
LICENSE Normal file
View File

@@ -0,0 +1,12 @@
Copyright (C) 2023 by the grlx contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.

View File

@@ -1,10 +1,17 @@
# grlx Quickstart # grlx Quickstart
## <p align="center"><img src="docs/grlx-speed.jpg" width="300"></p> ## <p align="center"><img src="docs/grlx-speed.jpg" width="300"></p>
[![CI](https://github.com/gogrlx/bootstrap.grlx.dev/actions/workflows/ci.yml/badge.svg)](https://github.com/gogrlx/bootstrap.grlx.dev/actions/workflows/ci.yml)
[![License: 0BSD](https://img.shields.io/badge/License-0BSD-green.svg)](https://opensource.org/licenses/0BSD)
Want to get up and running as quickly as possible to see what all the fuss is about? Want to get up and running as quickly as possible to see what all the fuss is about?
Use our bootstrap scripts! Use our bootstrap scripts!
Note that only Linux `sprout`s and `farmer`s are supported, but you can use the Note that only Linux `sprout`s and `farmer`s are supported, but you can use the
CLI from macOS as well. CLI from macOS as well.
## Install
1. Download and initialize the command line utility from our releases to your dev machine. 1. Download and initialize the command line utility from our releases to your dev machine.
```bash ```bash
# replace 'linux' with darwin if you're on macOS # replace 'linux' with darwin if you're on macOS
@@ -17,6 +24,7 @@ Once configured, the CLI prints out your administrator public key, which you'll
*It's recommended you now add `grlx` somewhere in your `$PATH`.* *It's recommended you now add `grlx` somewhere in your `$PATH`.*
![grlx install](docs/grlx-install.gif) ![grlx install](docs/grlx-install.gif)
2. On your control server, you'll need to install the `farmer`. This script may also be run as `root` instead of using sudo. 2. On your control server, you'll need to install the `farmer`. This script may also be run as `root` instead of using sudo.
```bash ```bash
curl -L https://bootstrap.grlx.dev/latest/farmer | sudo bash curl -L https://bootstrap.grlx.dev/latest/farmer | sudo bash
@@ -27,6 +35,7 @@ You'll be prompted for an admin public key, which you should have gotten from th
Make sure the certificate host name matches the external-facing interface (a domain or IP address) as it will be used for TLS validation! Make sure the certificate host name matches the external-facing interface (a domain or IP address) as it will be used for TLS validation!
![farmer install](docs/farmer-install.gif) ![farmer install](docs/farmer-install.gif)
3. On all of your fleet nodes, you'll need to install the `sprout`. 3. On all of your fleet nodes, you'll need to install the `sprout`.
```bash ```bash
# Set FARMERINTERFACE to your farmer's domain name. FARMERBUSPORT and FARMERAPIPORT # Set FARMERINTERFACE to your farmer's domain name. FARMERBUSPORT and FARMERAPIPORT
@@ -47,3 +56,53 @@ grlx -T \* cmd run --out json -- uname -a
``` ```
![running commands](docs/grlx-cmd.gif) ![running commands](docs/grlx-cmd.gif)
## Non-Interactive Install
Both scripts support environment variables for unattended installation:
**Farmer:**
```bash
curl -L https://bootstrap.grlx.dev/latest/farmer | \
FARMERINTERFACE=0.0.0.0 \
FARMERAPIPORT=5405 \
FARMERBUSPORT=5406 \
FARMERORGANIZATION="My Org" \
ADMIN_PUBKEYS="ABC25HBCYNHYMIFTN372NCKASUQPJCTBA66GLKXFYM3QGRP42IC5BYYF" \
CERT_HOSTS="farmer.example.com" \
sudo -E bash
```
**Sprout:**
```bash
curl -L https://bootstrap.grlx.dev/latest/sprout | \
FARMERINTERFACE=farmer.example.com \
FARMERAPIPORT=5405 \
FARMERBUSPORT=5406 \
sudo -E bash
```
## Uninstall
To uninstall either component, set the `UNINSTALL` environment variable:
```bash
# Uninstall farmer
curl -L https://bootstrap.grlx.dev/latest/farmer | UNINSTALL=1 sudo -E bash
# Uninstall sprout
curl -L https://bootstrap.grlx.dev/latest/sprout | UNINSTALL=1 sudo -E bash
```
Each uninstall only removes its own files — running both components on the same host is safe.
## Supported Architectures
- x86_64 (amd64)
- i686/i386 (386)
- aarch64/arm64 (arm64)
- armv7l (arm)
## License
[0BSD](LICENSE)

View File

@@ -150,11 +150,16 @@ EOF
systemctl enable --now grlx-farmer systemctl enable --now grlx-farmer
else else
systemctl disable --now grlx-farmer systemctl disable --now grlx-farmer
userdel farmer userdel farmer 2>/dev/null || true
rm -f /usr/local/bin/gum rm -f /usr/local/bin/gum
rm -f /etc/systemd/system/grlx-farmer.service rm -f /etc/systemd/system/grlx-farmer.service
systemctl daemon-reload
rm -f /usr/local/bin/grlx-farmer rm -f /usr/local/bin/grlx-farmer
rm -rf /etc/grlx rm -f /etc/grlx/farmer
rm -rf /srv/grlx rm -rf /etc/grlx/pki/farmer
rm -rf /var/cache/grlx # Only remove /etc/grlx if empty (sprout config may still exist)
rmdir /etc/grlx/pki 2>/dev/null || true
rmdir /etc/grlx 2>/dev/null || true
rm -rf /srv/grlx
rm -rf /var/cache/grlx/farmer
fi fi

View File

@@ -72,7 +72,14 @@ EOF
else else
systemctl disable --now grlx-sprout systemctl disable --now grlx-sprout
rm -f /etc/systemd/system/grlx-sprout.service rm -f /etc/systemd/system/grlx-sprout.service
systemctl daemon-reload
rm -f /usr/local/bin/grlx-sprout rm -f /usr/local/bin/grlx-sprout
rm -rf /etc/grlx rm -f /etc/grlx/sprout
rm -rf /var/cache/grlx rm -rf /etc/grlx/pki/sprout
# Only remove /etc/grlx if empty (farmer config may still exist)
rmdir /etc/grlx/pki 2>/dev/null || true
rmdir /etc/grlx 2>/dev/null || true
rm -rf /var/cache/grlx/sprout
# Only remove /var/cache/grlx if empty
rmdir /var/cache/grlx 2>/dev/null || true
fi fi