installation to create the database

If the database does not exist prior to the installation of
authentic2, it will fail because

  /usr/bin/authentic2-manage migrate --noinput

has nothing to work with.

License MIT
This commit is contained in:
Loïc Dachary 2021-06-18 15:37:39 +02:00
parent de673e3616
commit 9d2d1da7c2
No known key found for this signature in database
GPG Key ID: 130A0B53C3EEB5FA
1 changed files with 29 additions and 3 deletions

View File

@ -8,11 +8,37 @@ Installation
$ wget -O - https://deb.entrouvert.org/entrouvert.gpg | apt-key add -
$ echo deb http://deb.entrouvert.org/ buster main >> /etc/apt/sources.list
$ apt update
2. Install the package::
2. Create the database::
$ apt install apg
$ PASSWORD=$(apg -n 1 -M NCL -m 20)
$ apt install postgresql
$ su - postgres -c psql <<EOF
CREATE ROLE authentic2 WITH LOGIN SUPERUSER PASSWORD '$PASSWORD';
ALTER ROLE authentic2 SET client_encoding TO 'utf8';
CREATE DATABASE authentic2;
GRANT ALL PRIVILEGES ON DATABASE authentic2 TO authentic2;
EOF
$ mkdir -p /etc/authentic2/settings.d
$ cat > /etc/authentic2/settings.d/database.py <<EOF
DATABASES = {
"default": {
"ENGINE": "django.db.backends.postgresql",
"NAME": "authentic2",
"USER": "authentic2",
"PASSWORD": "$PASSWORD",
"HOST": "127.0.0.1",
"PORT": "5432",
}
}
EOF
3. Install::
$ apt install authentic2
$ apt-get install authentic2
.. note::
The Debian GNU/Linux packages published at https://deb.entrouvert.org/ follow the `release cycle of Publik <https://dev.entrouvert.org/projects/publik/wiki/Cycle_de_mises_%C3%A0_jour>`__.