InspIRCd v4 is still early in development!

If you use this branch you may experience crashes, weird behaviour, and unannounced breaking changes.

You probably want to use InspIRCd v3 instead.

The "sqloper" Module (v4)

Description

This module allows server operators to be authenticated against an SQL table.

Configuration

To load this module use the following <module> tag:

<module name="sqloper">

<sqloper>

The <sqloper> tag defines settings about how the sqloper module should behave. This tag can only be defined once.

Name Type Default Value Description
dbid Text None Required! The name of the database connection to execute the query against.
query Text SELECT * FROM ircd_opers WHERE active=1 The SQL query to retrieve the server operators with.

The following hashing modules are included with InspIRCd:

Algorithm Module(s) Description
argon2d argon2 Hashes using the Argon2d algorithm.
argon2i argon2 Hashes using the Argon2i algorithm.
argon2id argon2 Hashes using the Argon2id algorithm.
bcrypt bcrypt Hashes using the bcrypt algorithm.
hmac-md5 password_hash, md5 Hashes using the MD5 and HMAC algorithms.
hmac-sha1 password_hash, sha1 Hashes using the SHA-1 and HMAC algorithms.
hmac-sha224 password_hash, sha2 Hashes using the SHA-224 and HMAC algorithms.
hmac-sha256 password_hash, sha2 Hashes using the SHA-256 and HMAC algorithms.
hmac-sha384 password_hash, sha2 Hashes using the SHA-384 and HMAC algorithms.
hmac-sha512 password_hash, sha2 Hashes using the SHA-512 and HMAC algorithms.
md5 md5 Hashes using the MD5 algorithm.
pbkdf2-hmac-md5 pbkdf2, md5 Hashes using the MD5 and PBKDF2 algorithms.
pbkdf2-hmac-sha1 pbkdf2, sha1 Hashes using the SHA-1 and PBKDF2 algorithms.
pbkdf2-hmac-sha224 pbkdf2, sha2 Hashes using the SHA-224 and PBKDF2 algorithms.
pbkdf2-hmac-sha256 pbkdf2, sha2 Hashes using the SHA-256 and PBKDF2 algorithms.
pbkdf2-hmac-sha384 pbkdf2, sha2 Hashes using the SHA-384 and PBKDF2 algorithms.
pbkdf2-hmac-sha512 pbkdf2, sha2 Hashes using the SHA-512 and PBKDF2 algorithms.
sha1 sha1 Hashes using the SHA-1 algorithm.
sha224 sha2 Hashes using the SHA-224 algorithm.
sha256 sha2 Hashes using the SHA-256 algorithm.
sha384 sha2 Hashes using the SHA-384 algorithm.
sha512 sha2 Hashes using the SHA-512 algorithm.
Example Usage
<sqloper dbid="sqloper"
         query="SELECT * FROM ircd_opers WHERE active=1">
<sqloper dbid="sqloper"
         query="SELECT username as name, '*' as host, oper_class as type, sha256_password as password, 'sha256' as hash FROM users WHERE oper_class IS NOT NULL">

For each row an will be defined using the field values returned. See the core <oper> tag for column names, default values and required columns.

Special Notes

The following SQL modules are included with InspIRCd:

Engine Module Description
mysql mysql Queries a MySQL database.
pgsql pgsql Queries a PostgreSQL database.
sqlite3 sqlite3 Queries an SQLite database.

Example schemas for the server operator database are available in the sql subdirectory of the InspIRCd configuration directory. You can define your own schema as long as your query returns the required columns.