# 04. Server Settings

Treat `Server Settings` as infrastructure and maintenance.

## 1. Web Server Port and Admin Port

### Web Server Port
- Port used by the public radar (`/AircraftList.json`, map frontend).

### Admin Port
- Port used by the admin panel (`/admin`).
- Recommended: use a dedicated admin port, separate from radar.

If `AdminPort = 0` or equals `WebServerPort`, admin endpoints share the same port as public radar, which increases exposure.

## 2. Network Binding

This setting controls whether the server listens on:
1. localhost only,
2. all interfaces (`0.0.0.0`) for LAN/VPN/public routing.

A restart is required after changing binding behavior.

## 3. Radar Visibility

This setting controls radar authentication:
1. `Public` - radar is accessible without login.
2. `Private` - radar requires authentication.

This is independent from `Network Binding`.

## 4. Database and Imports

### Database File Name
- SQLite database file path/name.
- Changing it may require restart.

### Data import options
- OpenSky CSV
- ADS-B Exchange JSON/NDJSON
- Airport CSV (OurAirports-compatible)
- BaseStation SQLite upload (`BaseStation.sqb`, `.sqlite`, `.db`, `.sqlite3`)

BaseStation file import note:
1. Use the file selector in Server Settings (no manual path typing required).
2. `Replace` - swaps the whole DB file and creates a `.bak` backup.
3. `Merge` - keeps current DB file and upserts aircraft records by `ModeS`.

ADSBX note:
1. `basic-ac-db.json.gz` includes native `mil` flag support (military classification).
2. There is no dedicated `government` field in this dataset.

Recommended process:
1. Confirm source URL is valid and in expected format.
2. Run import.
3. Check server logs.
4. Verify results on map/list.

### AircraftDB Editor and custom photos

Dedicated guide:
1. [15. Aircraft DB Editor & Custom Photos](https://docs.vrsx.app/books/vrs-x-operators-handbook/page/15-aircraftdb-editor-custom-photos)

Quick summary:
1. `ModeS` must stay unique (duplicate create/update is blocked),
2. editor provides `Load existing aircraft` path for duplicate ICAO conflicts,
3. custom aircraft photo can be uploaded per ICAO and has priority over PlaneSpotters.

## 5. Configuration Backup

This section provides:
1. settings export,
2. settings import.

After importing configuration:
1. verify ports,
2. verify binding,
3. restart service if required.

## 6. Danger Zone

`Clear Application Data` removes critical data (configuration, users, mappings, database).

Use only when:
1. performing full instance reset,
2. current backups exist,
3. irreversible data loss is accepted.