SkateSpots/RELAY_SETUP.md
shakespeare.diy 27e14994b5 Import files from skate-spots project
Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
2026-06-15 20:04:15 +07:00

169 lines
3.5 KiB
Markdown

# SkateSpots Relay Configuration Guide
## Your Relay URL
Once you have your relay running, update this file with your actual relay URL.
**Current relay URL:** `TO_BE_CONFIGURED`
**Options:**
- Tailscale (private): `ws://skatespots-relay:3334`
- Cloudflare (public): `wss://your-tunnel-url.trycloudflare.com`
- Tor (private): `ws://your-onion-address.onion:3334`
- Custom domain: `wss://relay.skatespots.com`
## Updating the App
Once you have your relay URL, update `src/App.tsx`:
```typescript
const defaultConfig: AppConfig = {
relayMetadata: {
relays: [
{ url: 'YOUR-RELAY-URL-HERE', read: true, write: true },
{ url: 'wss://relay.damus.io', read: true, write: true },
{ url: 'wss://nos.lol', read: true, write: true },
],
},
};
```
## Event Kind Policies
Your relay should enforce these policies:
### Zero Friction:
- **Spots (Kind 30818):** Anyone can publish immediately
### Light Friction:
- **Events (Kind 31923):** Require 1+ follower
- **Comments (Kind 1):** Require 1+ follower
- **Reactions (Kind 7):** Require 1+ follower
### Verification Required:
- **Coaches (Kind 35001):** Require NIP-05 OR 3+ followers
- **Shops (Kind 30017):** Require NIP-05
## Testing
Before going live, test that spots can be published:
1. Update relay URL in `src/App.tsx`
2. Clear browser cache
3. Try adding a spot
4. Check relay logs: `docker-compose logs -f`
5. Should see: `Event accepted: kind=30818`
## Sharing Access
### For Tailscale Network:
1. Go to: https://login.tailscale.com/admin/settings/sharing
2. Create shareable invite link
3. Share with your skate crew
4. They install Tailscale, accept invite, done!
### For Public Relay:
Just share the app URL - relay works automatically:
https://skate-spots.shakespeare.wtf
## Monitoring
**Check relay health:**
```bash
# View logs
docker-compose logs -f
# Check database size
du -sh db/
# Count events
sqlite3 db/relay.db "SELECT COUNT(*) FROM events;"
# Count WoT members
sqlite3 db/relay.db "SELECT COUNT(*) FROM wot;"
```
**Relay info page:**
Open browser to: http://YOUR-RELAY-URL (shows stats)
## Backup
**Automatic backup script (run weekly):**
```bash
#!/bin/bash
# backup-relay.sh
DATE=$(date +%Y%m%d)
BACKUP_DIR="$HOME/skatespots-relay-backups"
mkdir -p $BACKUP_DIR
cd $HOME/skatespots-relay
# Stop relay
docker-compose down
# Backup database
tar -czf $BACKUP_DIR/skatespots-relay-$DATE.tar.gz db/
# Start relay
docker-compose up -d
# Keep only last 30 days
find $BACKUP_DIR -name "*.tar.gz" -mtime +30 -delete
echo "Backup complete: skatespots-relay-$DATE.tar.gz"
```
**Run weekly via cron:**
```bash
crontab -e
# Add: 0 3 * * 0 /home/umbrel/backup-relay.sh
```
## Troubleshooting
### Spots not publishing?
1. Check relay is running: `docker ps | grep skatespots-relay`
2. Check relay logs: `docker-compose logs | tail -50`
3. Test connection: `wscat -c YOUR-RELAY-URL`
4. Verify app is using correct URL (check Settings > Nostr Relays)
### Relay using too much resources?
```bash
# Check resource usage
docker stats skatespots-relay
# Adjust limits in docker-compose.yml:
services:
skatespots-relay:
deploy:
resources:
limits:
memory: 1G
cpus: '0.5'
```
### Spam appearing?
```bash
# Tighten WoT settings:
# Edit .env:
MINIMUM_FOLLOWERS=3 # Increase from 1 to 3
# Restart relay:
docker-compose restart
```
## Next Steps
1. ✅ Deploy relay on Umbrel
2. ✅ Choose access method (Tailscale/Cloudflare/Tor)
3. ✅ Update app configuration with relay URL
4. ✅ Test spot creation
5. ✅ Invite your skate crew
6. ✅ Monitor and adjust as needed