
- Add runit service files for spotify-tracker daemon - Include log service configuration with svlogd - Create automated deploy.sh script for server setup - Add comprehensive deployment documentation - Service runs as dedicated spotify-tracker user - Includes service management commands and troubleshooting guide
60 lines
1.5 KiB
Markdown
60 lines
1.5 KiB
Markdown
# Spotify Tracker Deployment Guide
|
|
|
|
## Quick Setup
|
|
|
|
1. **Clone and deploy:**
|
|
```bash
|
|
git clone <your-repo-url>
|
|
cd spotify-tracker
|
|
chmod +x deploy.sh
|
|
sudo ./deploy.sh
|
|
```
|
|
|
|
2. **Configure Caddy:**
|
|
```
|
|
spotify.tougie.live {
|
|
reverse_proxy localhost:8888
|
|
}
|
|
```
|
|
|
|
3. **Update Spotify App Settings:**
|
|
- Go to https://developer.spotify.com/dashboard
|
|
- Set redirect URI to: `https://spotify.tougie.live`
|
|
|
|
## Service Management
|
|
|
|
```bash
|
|
# Check service status
|
|
sv status spotify-tracker
|
|
|
|
# Start/stop/restart service
|
|
sv start spotify-tracker
|
|
sv stop spotify-tracker
|
|
sv restart spotify-tracker
|
|
|
|
# View logs
|
|
tail -f /var/log/spotify-tracker/current
|
|
```
|
|
|
|
## API Endpoints
|
|
|
|
After deployment, these endpoints will be available:
|
|
|
|
- `https://spotify.tougie.live/auth` - OAuth setup page
|
|
- `https://spotify.tougie.live/current` - Current track (JSON)
|
|
- `https://spotify.tougie.live/phantombot` - Current track (text for PhantomBot)
|
|
- `https://spotify.tougie.live/health` - Health check
|
|
|
|
## Configuration
|
|
|
|
The service runs as user `spotify-tracker` and stores:
|
|
- Config: `/home/spotify-tracker/.config/spotify-tracker/`
|
|
- Logs: `/var/log/spotify-tracker/`
|
|
- Binary: `/opt/spotify-tracker/target/release/spotify-tracker`
|
|
|
|
## Troubleshooting
|
|
|
|
1. **Check service status:** `sv status spotify-tracker`
|
|
2. **View logs:** `tail -f /var/log/spotify-tracker/current`
|
|
3. **Restart service:** `sv restart spotify-tracker`
|
|
4. **Check permissions:** Ensure `spotify-tracker` user owns `/opt/spotify-tracker` |