Skip to content

Configuration

The main configuration file is shiva.config.lua in your server root. Each module also has its own config.lua inside the module directory.

shiva.config.lua

lua
Shiva = {}

-- Database connection
Shiva.db = {
    host     = '127.0.0.1',  -- string — database hostname
    port     = 3306,          -- number — database port (default: 3306)
    user     = 'shiva',       -- string — database user
    password = '',            -- string — database password
    database = 'shiva',       -- string — database name
}

-- Framework-wide locale
Shiva.locale = 'en'           -- string — default language ('en', 'es', 'de', ...)

-- Developer mode — enables verbose logging and hot reload
Shiva.devMode = false         -- boolean — default: false

-- Maximum players (must match server.cfg)
Shiva.maxPlayers = 64         -- number — default: 64

Module Config

Each module lives at resources/[shiva]/<module-name>/config.lua. Below are the keys common to all modules.

KeyTypeDefaultDescription
Config.enabledbooleantrueWhether the module is loaded
Config.debugbooleanfalseEnable verbose logging for this module
Config.localestringinheritsOverride locale for this module

Disabling a Module

Set Config.enabled = false in the module's config or comment it out of server.cfg:

ini
# ensure shiva-economy   <-- disabled
ensure shiva-player

Environment Variables

Sensitive values (passwords, API keys) can be loaded from environment variables instead of committed to config files:

lua
Shiva.db = {
    password = GetConvar('SHIVA_DB_PASSWORD', ''),
}

In server.cfg:

ini
set SHIVA_DB_PASSWORD "your-secure-password"

Hot Reload (Dev Mode)

With Shiva.devMode = true, config files are watched for changes. Most config changes apply without a full server restart. Use shiva reload <module-name> from the CLI.

Next Steps

Released under the MIT License.