phone/README.md
2025-11-17 10:54:37 -08:00

54 lines
1.4 KiB
Markdown

# Deployment Script
This directory contains a deployment script for the Yellow Phone project to a Raspberry Pi.
## File: deploy.ts
A Bun-based deployment script that automates copying files to a Raspberry Pi and managing systemd services.
### Configuration
- **Target Host**: `yellow-phone.local`
- **Target Directory**: `/home/corey/yellow-phone`
### What It Does
1. **Creates directory** on the Pi at the configured path
2. **Copies files** from local `pi/` directory to the Pi
3. **Sets permissions** to make all TypeScript files executable
4. **Bootstrap (optional)**: If `--bootstrap` flag is passed, runs `bootstrap.ts` on the Pi with sudo
5. **Service management**:
- Checks if `phone-ap.service` and `phone-web.service` exist
- If they exist, restarts both services
- If they don't exist and bootstrap wasn't run, warns the user
### Usage
**Standard deployment** (just copy files and restart services):
```bash
bun deploy.ts
```
**First-time deployment** (copy files + run bootstrap):
```bash
bun deploy.ts --bootstrap
```
### Services
The script manages two systemd services:
- `phone-ap.service` - Access point service
- `phone-web.service` - Web interface service
### Access
After deployment, the Pi is accessible at:
- **Web URL**: http://yellow-phone.local
- **WiFi Network**: yellow-phone-setup
### Requirements
- Bun runtime
- SSH access to `yellow-phone.local`
- Local `pi/` directory with files to deploy