Configuration

Table of Contents


Introduction

This document provides a comprehensive reference for all configuration options available in NexAuth. Use this as a reference when setting up or customizing your NexAuth installation.

Configuration Types

NexAuth uses HOCON (Human-Optimized Config Object Notation) format for configuration files. HOCON is:

  • Human-readable

  • Supports comments

  • Allows comments on same line

  • Supports includes and substitutions

Key Features

  • Type-safe: Values are validated against expected types

  • Default values: Sensible defaults for all options

  • Validation: Configuration is validated on load

  • Reloadable: Can be reloaded without restart (/nexauth reload)


Configuration File Location

The configuration file location depends on your setup:

Velocity Proxy

BungeeCord/Waterfall Proxy

Paper Backend Server

Custom Location

You can specify a custom location using system property:


Configuration Format

Basic Syntax

String Values

Arrays and Lists

Includes

Substitutions


Complete Configuration Reference

Here's the complete structure of the NexAuth configuration file:


Database Configuration

MySQL

Pool Settings Explained:

  • maximumPoolSize: Maximum number of connections in pool

  • minimumIdle: Minimum number of idle connections

  • connectionTimeout: Timeout when getting connection (ms)

  • idleTimeout: Close connections after idle time (ms)

  • maxLifetime: Maximum connection lifetime (ms)

  • leakDetectionThreshold: Detect connection leaks (ms)

PostgreSQL

SQLite

SQLite Recommendations:

  • Best for small to medium servers (< 1000 users)

  • WAL mode improves concurrency

  • Regular backups (just copy the .db file)


Authentication Configuration

Security Recommendations:

  • Set min-login-attempts to 5 or lower

  • Use temp-ban-duration of at least 5 minutes

  • Set minimum-password-length to at least 8

  • Use require-password-confirmation to prevent typos


Server Configuration

Setup Instructions:

  1. Create Limbo Server:

    • Install NexLimbo

    • Or create a minimal server with just NexAuth

    • Name it "limbo" (or update config to match)

  2. Create Lobby Server:

    • Create your main game server

    • Name it "lobby" (or update config to match)

    • Players will be sent here after authentication

  3. Update Server Names:

    • If your servers have different names, update limbo and lobby arrays

    • Example: limbo = ["auth-server"]


Crypto Configuration

Choosing an Algorithm

Algorithm
Security
Speed
Recommendation

Argon2ID

⭐⭐⭐⭐⭐

Medium

RECOMMENDED - Best for new installations

BCrypt2A

⭐⭐⭐⭐

Slow

Good alternative to Argon2ID

SHA-256

Fast

NOT RECOMMENDED - Only for migration

Argon2ID Tuning

Memory Usage: Argon2ID will use approximately memory KB per hash. With default settings (64 MB), NexAuth can use 64 MB per concurrent authentication.


2FA Configuration

Options Explained:

  • issuer: Name shown in authenticator app (e.g., "MyMinecraftServer")

  • code-length: Usually 6 digits

  • time-window: Seconds of time drift allowed (30 is standard)

  • recovery-codes-count: How many recovery codes to generate (default: 10)

  • enforce: Require ALL users to use 2FA (dangerous!)

Supported Authenticator Apps:

  • Google Authenticator

  • Microsoft Authenticator

  • Authy

  • 1Password

  • LastPass Authenticator


Email Configuration

Gmail Setup

  1. Enable 2-Factor Authentication on your Google account

  2. Generate an App Password:

    • Go to Google Account settings

    • Security > 2-Step Verification

    • App passwords > Generate

    • Copy the generated password

  3. Use the app password in password field (NOT your regular password)

Other SMTP Providers

Outlook/Hotmail:

Yahoo:

Custom SMTP Server:


Logging Configuration

Log Levels:

  • OFF: Disable logging

  • ERROR: Only errors

  • WARN: Warnings and errors

  • INFO: General information, warnings, and errors

  • DEBUG: Detailed debug information

  • TRACE: Extremely detailed (usually not needed)

Debug Mode: Enable for troubleshooting. Remember to disable in production!


Advanced Configuration

MultiProxy Setup

Requirements:

  1. Same shared secret on all proxies

  2. Unique proxy-id for each proxy

  3. NexAuth installed on all proxies

BungeeGuard Integration

Session Management

Performance Tuning


Environment Variables

You can use environment variables in your configuration:

Setting Environment Variables:

Linux/macOS:

Windows:

Systemd:

Docker:


Configuration Migration

From LibreLogin

NexAuth automatically migrates LibreLogin configuration on first startup.

Migration Process:

  1. NexAuth detects existing LibreLogin config

  2. Migrates configuration values

  3. Logs migration status

  4. Creates new config with migrated values

Manual Migration

If automatic migration fails, manually copy settings:

Config Versioning

NexAuth tracks configuration versions:

When upgrading NexAuth:

  1. Old config is backed up

  2. New default config is created

  3. Your settings are migrated if possible


Validation Rules

NexAuth validates configuration on load:

Database Validation

Validation Checks:

  • Type must be a valid provider

  • Host must not be empty

  • Port must be valid (1-65535)

  • Database name must not be empty

  • Username must not be empty

Authentication Validation

Validation Checks:

  • Login attempts: 1-20

  • Timeouts: > 0 milliseconds

  • Password length: 4-128 characters

  • Max length >= Min length

Server Validation

Validation Checks:

  • Limbo list must not be empty

  • Lobby root must not be empty

  • Server names must be valid

Crypto Validation

Validation Checks:

  • Provider must be registered

  • Iterations: 1-10

  • Memory: 1024-1048576 KB

  • Parallelism: 1-4


Troubleshooting

Common Configuration Errors

Error: "Database type doesn't exist"

Cause: Invalid database type in database.type

Solution:

Error: "Invalid port number"

Cause: Port outside valid range

Solution:

Error: "Memory must be between 1024 and 1048576"

Cause: Argon2ID memory setting invalid

Solution:

Error: "Lobby server is also a limbo server"

Cause: Server listed in both limbo and lobby

Solution:

Checking Configuration

Verify Config Syntax

Run NexAuth and check logs for validation errors:

Test Database Connection

Validate Configuration

Use /nexauth reload to reload and validate config:

Debugging Configuration

Enable Debug Logging

This will show:

  • Configuration loading process

  • Database connection attempts

  • Validation errors

  • Each config value being applied

Check Loaded Configuration

Logs show config values:

Resetting Configuration

To reset to defaults:

  1. Stop your server

  2. Delete config.conf

  3. Start server (creates new default config)

  4. Edit with your settings

Using Includes

Split large config into multiple files:

config.conf:

database.conf (external file):

Then set environment variables:


Best Practices

1. Use Environment Variables for Secrets

2. Keep Config Version Controlled

3. Document Custom Settings

4. Use Includes for Modular Config

5. Validate Before Production

  1. Test config with debug logging

  2. Check all required fields

  3. Verify database connection

  4. Test authentication flow

  5. Disable debug logging in production

6. Backup Before Changes


Quick Reference

Essential Settings

Performance Settings

Security Settings


Support

Getting Help

Providing Configuration Help

When asking for configuration help, include:

  1. Full configuration (hide sensitive data)

  2. Server platform: Velocity/Bungee/Paper

  3. Database type: MySQL/PostgreSQL/SQLite

  4. Full error logs

  5. What you're trying to achieve


Version: 0.0.1-beta3 Last Updated: 2025-10-30

For more help, visit: https://github.com/xreatlabs/NexAuth

Last updated