-
Notifications
You must be signed in to change notification settings - Fork 1
Modular Configuration
VelocityNavigator uses a modular, multi-file TOML configuration system. Each concern lives in its own dedicated file. ConfigManager parses and manages them.
| File | Purpose |
|---|---|
navigator.toml |
Main routing rules, commands, health checks, metrics, core settings |
messages.toml |
Language packs and all player-facing text |
gui.toml |
Java inventory layout and Bedrock form definitions, state styles |
servers.toml |
Lobby entries created by server-management commands |
storage.toml or db.toml
|
Database provider, credentials, JDBC URL, connection pool limits, migration settings |
auth.toml |
Player authentication, password hashing, holding server, and sessions; 2FA fields are reserved |
geo.toml |
GeoIP reader settings (MaxMind GeoLite2 database path, IP-API fallback) |
player_affinity.json |
Unexpired sticky-lobby records when the file storage provider is active |
navigator.toml acts as the entry point. It references server lists, commands, and routing rules that other files refine:
-
navigator.tomldefines the server list and routing paths. Server entries created or modified by/vnmanagement commands persist toservers.toml.navigator.tomlloads this file at runtime. -
messages.tomlsupplies player-facing text. GUI layouts ingui.tomlreference message keys instead of hardcoding text. Changing a language file updates UIs without altering layout definitions. -
gui.tomldescribes inventory slot mappings, item models, click actions, and Bedrock form JSON. It references message keys for display names and lore. It uses server keys fromnavigator.toml/servers.tomlfor connect actions. -
storage.toml(ordb.toml) supplies the storage layer. If set toFILE, persistence uses local JSON files. If set toMYSQLorPOSTGRESQL, the plugin uses the JDBC settings. -
auth.tomlandgeo.tomlare independent modules. A flag innavigator.tomlenables the authentication subsystem. The plugin uses GeoIP for region-based routing when configured. -
player_affinity.jsonis a runtime file. Administrators do not edit it. It stores unexpired sticky-lobby assignments when file storage is active.
When VelocityNavigator starts, ConfigManager.load() reads each file's config-version key. If the stored version is older than the current plugin version, the plugin migrates it:
- Backup - The plugin copies the file to a timestamped backup before modifying it.
- Patch - The plugin adds missing keys with documented defaults. Migration rules rename or remove older keys.
-
Version bump - The plugin updates the
config-versionkey. - Normalization - The plugin corrects structural inconsistencies like duplicate keys or incorrect nesting.
The ConfigLoadResult record returned by load() exposes the outcome:
public record ConfigLoadResult(
Config config,
List<String> warnings,
boolean createdDefault,
boolean migrated,
Integer previousVersion,
Path backupPath,
boolean normalized
) {}-
migratedistruewhen the plugin upgrades a file. -
previousVersionrecords the old version number. -
backupPathpoints to the backup directory. -
warningscontains non-fatal issues like deprecated keys or approximate matches.
TOML files include inline comments explaining key purposes, values, and defaults. When ConfigManager creates a default file or adds keys during migration, it writes these comments inline. Administrators do not need external documentation for basic configuration.
Keys added by ensureAdvancedSections() receive comments describing their role in party systems, queue management, Redis integration, backend state tracking, and server management.
ConfigValidator checks every TOML key against the known schema. When it finds an unrecognized key, the validator calculates the Levenshtein distance between the unknown key and valid keys.
- If it finds a close match, it emits a warning with a suggestion via
getSuggestion(). - If no close match exists, it flags the key as completely unknown.
ConfigLoadResult.warnings collects these warnings and logs them at startup. Administrators catch typos before they cause errors.
The /vn reload command reloads all configuration files:
- Re-reads every TOML file from disk.
- Re-runs validation and migration checks.
- Applies changes to the running instance without a server restart.
- Reports warnings or errors to the executing player.
The active storage provider remains the source of truth for sticky-lobby records during reload.
Before migration or destructive write operations, ConfigManager creates a backup:
- Backups sit in a timestamped subdirectory under the plugin's data folder.
- Backups preserve the file state before modification.
- The
backupPathfield inConfigLoadResultidentifies the backup location.
Administrators can restore previous configurations manually or by copying the backup file back into place.
Validation occurs in two phases:
- Structural validation - Ensures required sections and keys exist, types are correct (string, integer, boolean, list), and nested structures match the schema.
-
Semantic validation - Checks value ranges (e.g., pool sizes are positive, ports are valid) and cross-references between files (e.g., a server key in
gui.tomlexists inservers.toml).
Validation errors block configuration loading and log context to identify the file, line, and key. Warnings (like typo suggestions) are non-fatal and allow loading to proceed.
-
Edit files via
/vncommands when possible. Management commands (/vn addserver,/vn setmessage) write correctly formatted TOML with comments, avoiding manual errors. -
Run
/vn reloadafter manual edits. This validates changes and applies them immediately. - Check startup logs for warnings. Typo detection warnings and migration notices appear in the log. Address them early.
- Keep backups. The migration system creates backups automatically. Consider making a manual copy before major upgrades.
-
Do not edit
player_affinity.jsondirectly. The file storage provider manages and overwrites it. -
Use one storage backend. Do not mix
storage.tomlanddb.tomlconfigurations. Choose one and configure it fully. -
Review migration output. Check
ConfigLoadResultwarnings after version upgrades to confirm settings migrated correctly.
Home · Quick Start · Configuration · Operations · FAQ
Website · GitHub · Support / Discord · Report a Bug
VelocityNavigator v4.5.0 · by DemonZ Development
![]()
Getting Started
Routing
- Routing Algorithms
- Algorithm Visualizations
- Initial Join Balancing
- Contextual Routing Guide
- Player Affinity
- Health & Circuit Breakers
- Retries & Fallbacks
- Geo Routing
Player Experience
- Java & Bedrock Selectors
- Selector Customization
- Backend NPCs
- Backend YAML Menus
- Language Packs
- Party System
- Capacity Queue
Configuration
- Configuration Guide
- Modular Configuration
- MOTD Configuration
- Authentication & Security
- Backend Bridge Configuration
- Migration Guide v3 → v4
- Migration Guide v4.4 → 4.5
Network & Operations
- Advanced Proxy Systems
- Redis & Multi-Proxy
- Common Core Architecture
- NavigatorAPI
- Storage & Databases
- Server Management
- Backend Lifecycle States
- Maintenance Mode
- HTML Dashboard
- Operations Runbook
- Prometheus & Grafana Setup
- Troubleshooting Guide
- FAQ
VelocityNavigator 4.5.0