Add sanitize script for distributable Pi images
- rpi/sanitize-for-image.sh: Removes personal data before imaging - Clears WiFi credentials - Removes SSH keys - Clears Stegasoo auth database - Removes logs, history, temp files - Updated rpi/README.md with full image building workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -97,3 +97,81 @@ rm -rf ~/stegasoo
|
||||
## Pre-built Images
|
||||
|
||||
Check [GitHub Releases](https://github.com/adlee-was-taken/stegasoo/releases) for pre-built SD card images.
|
||||
|
||||
---
|
||||
|
||||
## Building Your Own Image
|
||||
|
||||
To create a distributable SD card image:
|
||||
|
||||
### 1. Flash Fresh Raspberry Pi OS
|
||||
|
||||
Use rpi-imager to flash Raspberry Pi OS (64-bit) to an SD card.
|
||||
|
||||
In advanced settings, set:
|
||||
- Hostname: `stegasoo`
|
||||
- Enable SSH (password auth for initial setup)
|
||||
- Username/password (temporary, will work for any user)
|
||||
- Skip WiFi for distributable image
|
||||
|
||||
### 2. Boot and Run Setup
|
||||
|
||||
```bash
|
||||
# SSH into the Pi
|
||||
ssh pi@stegasoo.local
|
||||
|
||||
# Run the setup script
|
||||
curl -sSL https://raw.githubusercontent.com/adlee-was-taken/stegasoo/main/rpi/setup.sh | bash
|
||||
```
|
||||
|
||||
### 3. Test It Works
|
||||
|
||||
```bash
|
||||
sudo systemctl start stegasoo
|
||||
curl -k https://localhost:5000 # Should return HTML
|
||||
```
|
||||
|
||||
### 4. Sanitize for Distribution
|
||||
|
||||
```bash
|
||||
# Download and run sanitize script
|
||||
curl -sSL https://raw.githubusercontent.com/adlee-was-taken/stegasoo/main/rpi/sanitize-for-image.sh | sudo bash
|
||||
```
|
||||
|
||||
This removes:
|
||||
- WiFi credentials
|
||||
- SSH authorized keys
|
||||
- Bash history
|
||||
- Stegasoo auth database (users create their own admin)
|
||||
- Logs and temp files
|
||||
|
||||
### 5. Create the Image
|
||||
|
||||
After Pi shuts down, remove SD card and on another Linux machine:
|
||||
|
||||
```bash
|
||||
# Find SD card device (BE CAREFUL - wrong device = data loss!)
|
||||
lsblk
|
||||
|
||||
# Copy (replace sdX with your SD card)
|
||||
sudo dd if=/dev/sdX of=stegasoo-rpi-$(date +%Y%m%d).img bs=4M status=progress
|
||||
|
||||
# Shrink the image (optional but recommended)
|
||||
wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
|
||||
chmod +x pishrink.sh
|
||||
sudo ./pishrink.sh stegasoo-rpi-*.img
|
||||
|
||||
# Compress
|
||||
xz -9 -T0 stegasoo-rpi-*.img
|
||||
```
|
||||
|
||||
### 6. Distribute
|
||||
|
||||
Upload the `.img.xz` file to GitHub Releases.
|
||||
|
||||
Users flash with:
|
||||
```bash
|
||||
xzcat stegasoo-rpi-*.img.xz | sudo dd of=/dev/sdX bs=4M status=progress
|
||||
```
|
||||
|
||||
Or use rpi-imager's "Use custom" option.
|
||||
|
||||
Reference in New Issue
Block a user