99 lines
2.7 KiB
Markdown
99 lines
2.7 KiB
Markdown
|
|
# SkyView Database Management
|
||
|
|
|
||
|
|
SkyView includes a comprehensive database management system for enriching aircraft callsigns with airline and airport information.
|
||
|
|
|
||
|
|
## Quick Start
|
||
|
|
|
||
|
|
### 1. Check Current Status
|
||
|
|
```bash
|
||
|
|
skyview-data status
|
||
|
|
```
|
||
|
|
|
||
|
|
### 2. Import Safe Data (Recommended)
|
||
|
|
```bash
|
||
|
|
# Import public domain sources automatically
|
||
|
|
skyview-data update
|
||
|
|
```
|
||
|
|
|
||
|
|
### 3. Enable Automatic Updates (Optional)
|
||
|
|
```bash
|
||
|
|
# Weekly updates on Sunday at 3 AM
|
||
|
|
sudo systemctl enable --now skyview-database-update.timer
|
||
|
|
```
|
||
|
|
|
||
|
|
## Available Data Sources
|
||
|
|
|
||
|
|
### Safe Sources (Public Domain)
|
||
|
|
These sources are imported automatically with `skyview-data update`:
|
||
|
|
- **OurAirports**: Comprehensive airport database (public domain)
|
||
|
|
- **FAA Registry**: US aircraft registration data (public domain)
|
||
|
|
|
||
|
|
### License-Required Sources
|
||
|
|
These require explicit acceptance:
|
||
|
|
- **OpenFlights**: Airline and airport data (AGPL-3.0 license)
|
||
|
|
|
||
|
|
## Commands
|
||
|
|
|
||
|
|
### Basic Operations
|
||
|
|
```bash
|
||
|
|
skyview-data list # Show available sources
|
||
|
|
skyview-data status # Show database status
|
||
|
|
skyview-data update # Update safe sources
|
||
|
|
skyview-data import openflights # Import licensed source
|
||
|
|
skyview-data clear <source> # Remove source data
|
||
|
|
```
|
||
|
|
|
||
|
|
### Systemd Timer Management
|
||
|
|
```bash
|
||
|
|
# Enable weekly automatic updates
|
||
|
|
systemctl enable skyview-database-update.timer
|
||
|
|
systemctl start skyview-database-update.timer
|
||
|
|
|
||
|
|
# Check timer status
|
||
|
|
systemctl status skyview-database-update.timer
|
||
|
|
|
||
|
|
# View update logs
|
||
|
|
journalctl -u skyview-database-update.service
|
||
|
|
|
||
|
|
# Disable automatic updates
|
||
|
|
systemctl disable skyview-database-update.timer
|
||
|
|
```
|
||
|
|
|
||
|
|
## License Compliance
|
||
|
|
|
||
|
|
SkyView maintains strict license separation:
|
||
|
|
- **SkyView binary**: Contains no external data (stays MIT licensed)
|
||
|
|
- **Runtime import**: Users choose which sources to import
|
||
|
|
- **Safe defaults**: Only public domain sources updated automatically
|
||
|
|
- **User choice**: Each person decides their own license compatibility
|
||
|
|
|
||
|
|
## Troubleshooting
|
||
|
|
|
||
|
|
### Check Service Status
|
||
|
|
```bash
|
||
|
|
systemctl status skyview-database-update.timer
|
||
|
|
journalctl -u skyview-database-update.service -f
|
||
|
|
```
|
||
|
|
|
||
|
|
### Manual Database Reset
|
||
|
|
```bash
|
||
|
|
systemctl stop skyview-database-update.timer
|
||
|
|
skyview-data reset --force
|
||
|
|
skyview-data update
|
||
|
|
systemctl start skyview-database-update.timer
|
||
|
|
```
|
||
|
|
|
||
|
|
### Permissions Issues
|
||
|
|
```bash
|
||
|
|
sudo chown skyview:skyview /var/lib/skyview/
|
||
|
|
sudo chmod 755 /var/lib/skyview/
|
||
|
|
```
|
||
|
|
|
||
|
|
## Files and Directories
|
||
|
|
|
||
|
|
- `/usr/bin/skyview-data` - Database management command
|
||
|
|
- `/var/lib/skyview/skyview.db` - Database file
|
||
|
|
- `/usr/share/skyview/scripts/update-database.sh` - Cron helper script
|
||
|
|
- `/lib/systemd/system/skyview-database-update.*` - Systemd timer files
|
||
|
|
|
||
|
|
For detailed information, see `man skyview-data`.
|