diff --git a/docs/admin/02_psql.rst b/docs/admin/02_psql.rst new file mode 100644 index 0000000000000000000000000000000000000000..0a9491a0d7553e75d57c3aeec0b707eae229f92c --- /dev/null +++ b/docs/admin/02_psql.rst @@ -0,0 +1,42 @@ +Installing BiscuIT with PostgreSQL backend +========================================= + +PostgreSQL is the preferred database backend for BiscuIT. You should use it +in every production setup and use SQLite only for testing. + + +Install the PostgreSQL server +----------------------------- + +On Debian, install the postgresql server package with:: + + sudo apt install postgresql + + +Create a database and user +-------------------------- + +On Debian, you can use the following commands to create the database and a +user who owns it:: + + sudo -u postgres createuser -D -P -R -S biscuit + sudo -u postgres createdb -E UTF-8 -O biscuit -T template0 -l C.UTF-8 biscuit + +When asked for the database user password, choose a secure, preferrably +random, password. You can generate one using the pwgen utility if you like:: + + pwgen 16 1 + + +Configure BiscuIT to use PostgreSQL +----------------------------------- + +Fill in the configuration under `/etc/biscuit/*.toml`:: + + [default.database] + engine = "django.db.backends.postgresql" + name = "biscuit" + username = "biscuit" + password = "Y0urV3ryR4nd0mP4ssw0rd" + +Don't forget to run the migrations, like described in the basic setup guide. diff --git a/docs/admin/02_psql.txt b/docs/admin/02_psql.txt deleted file mode 100644 index 8af64680bd7ba3d238941141215d02a5e392d9ca..0000000000000000000000000000000000000000 --- a/docs/admin/02_psql.txt +++ /dev/null @@ -1,29 +0,0 @@ -Instaling BiscuIT with PostgreSQL backend -───────────────────────────────────────── - -• Install PostgreSQL, for example with: - - sudo apt install postgresql-contrib - -• Create a database role with login permissions: - - sudo -u postgres createuser -D -P -R -S biscuit - <username>─────────────────────────────────────┘ - - This step asks interactively for the password to set. - -• Create a database belonging to the new user: - - sudo -u postgres createdb -E UTF-8 -O biscuit -T template0 -l C.UTF-8 biscuit - <username>───────────────────────────────────┘ │ - <databasename>───────────────────────────────────────────────────────────────┘ - -• Fill in the configuration under /etc/biscuit/*.toml: - - [default.database] - engine = "django.db.backends.postgresql" - name = "biscuit" - username = "biscuit" - password = "biscuit" - -• Run the migrations.