Note: All of the following config options can be set in
/etc/simp/simp-console.yml
Without any configuration, SIMP Console stores its settings in a SQLite database located in /var/db/simp/simp-console.db
. While this is sufficient for small sites or demonstration purposes it is recommended to use PostgreSQL for larger sites.
Make sure the SIMP Console user has read and write access to the file and its containing directory. Specify a full URL to the database you want to connect to, and the username and password to authenticate.
main.database: 'sqlite:///path/to/location/simp-console.db'
Follow the instructions below to configure a PostgreSQL database on the same host as the simp-console service.
Install PostgreSQL.
yum -y install postgresql-server
Initialize the database.
postgresql-setup initdb
Enable password authentication for localhost.
sed -i \
-e '/^host\s*all\s*all\s*[0-9:./]*\s*ident$/ s|ident|md5|' \
/var/lib/pgsql/data/pg_hba.conf
Enable and start the database service.
systemctl enable postgresql
systemctl start postgresql
Set up the database for simp-console. (In the example below, we’re using simp_console
for both the database name and the user name. Replace the string REPLACE_ME
below with a password generated for the simp_console
database user.)
runuser -l postgres -c "psql" <<END
create database simp_console;
create user simp_console with encrypted password 'REPLACE_ME';
grant all privileges on database simp_console to simp_console;
END
Configure simp-console to use the database we just created. (Again, replace the string REPLACE_ME
with the password used in the previous step.)
echo "main.database: 'postgres://simp_console:REPLACE_ME@localhost/simp_console'" >> /etc/simp/simp-console.yml
To migrate a SQLite database to PostgreSQL, use the simp-console-migrate
command.
By default, the SIMP Console configures a table prefix for all database tables it manages. This allows admins the capability to run multiple SIMP Console instances using the same underlying database. For example, one could have tables with the names production
, staging
, and dev
all within the same database.
The default prefix is production, but it can be changed. For example, this creates all database tables with dev_ in front of them.
main.database_table_prefix: dev