How to set DB Server - dapucita/haxbotron GitHub Wiki

Language : English, Korean(한국어)


How to set DB Server

You can configure some initial settings for db server.

You don't have to build(compile) again after configure, so it is very convenient.

How to set

First create .env file into the directory where db server is located.

After create the file, open and edit by text editor and save it.

You don't have to build(compile) again after configure, but you need to restart your bot application for reflect some changes.

Refer to .env.sample file if you feels difficult to set up.

Cautions

Do not share .env file with other people.

Especially it is recommended to be careful not to leak it out if important information is contained.

If the bot makes some errors after configure .env file, you'd better to check again the correct format.


Control server access

Port Number

You can manually set the port number of the db server by setting SERVER_PORT. (default 13001)

SERVER_PORT = 13001

IP Address Whitelist

You can set SERVER_WHITELIST_IP to specify the IP addresses to allow access to the db server.

SERVER_WHITELIST_IP = "::ffff:127.0.0.1,127.0.0.1"

The IP addresses are separated by comma (,). The clients not on this list cannot access the db server.


Connect Database

Set database

You can set DB_DIALECT, DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE, and DB_OPERATORS_ALIASES for fit to your environment.

DB_DIALECT = "sqlite"
DB_HOST = "haxbotron.sqlite.db"
DB_USERNAME = ""
DB_PASSWORD = ""
DB_DATABASE = ""
DB_OPERATORS_ALIASES = false

In version 0.4.0, these settings are not actually applied yet.