Skip to content

Commit 3c037d8

Browse files
committed
updated installation script
1 parent 18288ad commit 3c037d8

File tree

5 files changed

+329
-165
lines changed

5 files changed

+329
-165
lines changed

Install.txt

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ OPTION A: AUTOMATIC INSTALLATION (Recommended)
2626
================================================================================
2727

2828
The easiest way to install YABB is using the automatic installer script.
29-
This downloads the latest release, verifies checksums, and installs to /opt/yabb.
29+
This downloads the latest release, verifies checksums, and installs:
30+
- Binary and scripts to /opt/yabb/
31+
- Configuration to /etc/yabb.toml (if not already present)
32+
- Shell completions to system locations (bash, zsh, fish)
33+
- Systemd service files to /etc/systemd/system/
34+
35+
The installer is CONSERVATIVE: it never overwrites existing files.
3036

3137
1. Run the installer:
3238

@@ -38,9 +44,8 @@ This downloads the latest release, verifies checksums, and installs to /opt/yabb
3844
less install.sh # Review the script
3945
sudo bash install.sh
4046

41-
2. Create your configuration file:
47+
2. Edit your configuration file:
4248

43-
sudo cp /opt/yabb/yabb.conf /etc/yabb.toml
4449
sudo nano /etc/yabb.toml # or your preferred editor
4550

4651
Update the [paths] section with your actual directories:
@@ -52,12 +57,16 @@ This downloads the latest release, verifies checksums, and installs to /opt/yabb
5257

5358
/opt/yabb/yabb --help
5459

60+
4. Enable automated backups and updates:
61+
62+
sudo systemctl enable --now yabb.timer yabb-update.timer
63+
5564

5665
UPDATING YABB
5766
-------------
5867
To update to the latest version:
5968

60-
sudo /opt/yabb/install.sh --force
69+
sudo /opt/yabb/scripts/install.sh --force
6170

6271
Or use the systemd timer for automatic weekly updates (see SYSTEMD section below).
6372

@@ -66,11 +75,11 @@ UNINSTALLING YABB
6675
-----------------
6776
Remove YABB but keep configuration:
6877

69-
sudo /opt/yabb/install.sh --remove
78+
sudo /opt/yabb/scripts/install.sh --remove
7079

7180
Remove YABB and all configuration:
7281

73-
sudo /opt/yabb/install.sh --purge
82+
sudo /opt/yabb/scripts/install.sh --remove --purge --force
7483

7584

7685
================================================================================
@@ -248,35 +257,23 @@ SYSTEMD AUTOMATION (Recommended)
248257
YABB includes hardened systemd service files for automated backups and updates.
249258
These use modern systemd 257 features for security hardening.
250259

251-
INSTALLING THE SERVICE FILES
252-
----------------------------
253-
If you used the automatic installer (Option A), the service files are already
254-
in /opt/yabb/. Copy them to systemd:
260+
ENABLING THE TIMERS
261+
-------------------
262+
If you used the automatic installer (Option A), the systemd service files are
263+
ALREADY installed to /etc/systemd/system/. Just enable the timers:
255264

256-
sudo cp /opt/yabb/yabb.service /etc/systemd/system/
257-
sudo cp /opt/yabb/yabb.timer /etc/systemd/system/
258-
sudo cp /opt/yabb/yabb-update.service /etc/systemd/system/
259-
sudo cp /opt/yabb/yabb-update.timer /etc/systemd/system/
265+
sudo systemctl enable --now yabb.timer yabb-update.timer
260266

261-
# Optional: create update config directory
262-
sudo mkdir -p /etc/yabb
263-
sudo cp /opt/yabb/yabb-update.conf /etc/yabb/update.conf
264-
265-
If you installed from tarball (Option B/C), the service files are in the
266-
scripts/ directory of the extracted archive:
267+
If you installed from tarball (Option B/C), copy the service files first:
267268

268269
sudo cp yabb-*/scripts/yabb.service /etc/systemd/system/
269270
sudo cp yabb-*/scripts/yabb.timer /etc/systemd/system/
270271
sudo cp yabb-*/scripts/yabb-update.service /etc/systemd/system/
271272
sudo cp yabb-*/scripts/yabb-update.timer /etc/systemd/system/
272273
sudo mkdir -p /etc/yabb
273274
sudo cp yabb-*/scripts/yabb-update.conf /etc/yabb/update.conf
274-
275-
Reload systemd and enable the timers:
276-
277275
sudo systemctl daemon-reload
278-
sudo systemctl enable --now yabb.timer
279-
sudo systemctl enable --now yabb-update.timer
276+
sudo systemctl enable --now yabb.timer yabb-update.timer
280277

281278

282279
WHAT THE SERVICES DO

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ because the tools above aren't good.
5757

5858
```bash
5959
curl -fsSL --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/aryonoco/yabb/main/scripts/install.sh | sudo bash
60-
sudo cp /opt/yabb/yabb.conf /etc/yabb.toml
61-
# Edit /etc/yabb.toml with your paths
60+
# Edit /etc/yabb.toml with your paths (installed automatically)
61+
sudo systemctl enable --now yabb.timer yabb-update.timer
6262
```
6363

64-
To update: `sudo /opt/yabb/install.sh --force`
64+
The installer automatically installs config, shell completions, and systemd files to their proper system locations. It never overwrites existing files.
6565

66-
To uninstall: `sudo /opt/yabb/install.sh --remove`
66+
To update: `sudo /opt/yabb/scripts/install.sh --force`
67+
68+
To uninstall: `sudo /opt/yabb/scripts/install.sh --remove`
6769

6870
### Build from source
6971

@@ -135,19 +137,16 @@ yabb optimize
135137

136138
### Automation
137139

138-
YABB includes hardened systemd service files with security sandboxing:
140+
YABB includes hardened systemd service files with security sandboxing.
141+
The installer automatically installs these to `/etc/systemd/system/`.
139142

140143
```bash
141-
# If installed via install.sh, service files are in /opt/yabb/
142-
sudo cp /opt/yabb/yabb.service /opt/yabb/yabb.timer /etc/systemd/system/
143-
sudo cp /opt/yabb/yabb-update.service /opt/yabb/yabb-update.timer /etc/systemd/system/
144-
145-
# Configure paths for your setup
144+
# Configure paths for your setup (required)
146145
sudo mkdir -p /etc/systemd/system/yabb.service.d
147146
echo -e '[Service]\nReadWritePaths=/data /backup /snapshots' | sudo tee /etc/systemd/system/yabb.service.d/paths.conf
147+
sudo systemctl daemon-reload
148148

149149
# Enable daily backups and weekly updates
150-
sudo systemctl daemon-reload
151150
sudo systemctl enable --now yabb.timer yabb-update.timer
152151
```
153152

@@ -171,14 +170,17 @@ Check status: `systemctl list-timers yabb*`
171170

172171
## Shell completions
173172

174-
```bash
175-
# Bash
176-
sudo cp completions/yabb.bash /etc/bash_completion.d/
173+
The installer automatically installs shell completions to system locations:
174+
- Bash: `/etc/bash_completion.d/yabb`
175+
- Zsh: `/usr/local/share/zsh/site-functions/_yabb`
176+
- Fish: `/usr/share/fish/vendor_completions.d/yabb.fish`
177177

178-
# Zsh
179-
sudo cp completions/yabb.zsh /usr/share/zsh/site-functions/_yabb
178+
Restart your shell to enable completions.
180179

181-
# Fish
180+
If building from source, install manually:
181+
```bash
182+
sudo cp completions/yabb.bash /etc/bash_completion.d/yabb
183+
sudo cp completions/yabb.zsh /usr/local/share/zsh/site-functions/_yabb
182184
sudo cp completions/yabb.fish /usr/share/fish/vendor_completions.d/
183185
```
184186

0 commit comments

Comments
 (0)