From: Jean-Marc Pigeon (Delson) Date: Mon, 7 Jul 2025 13:34:03 +0000 (-0400) Subject: Adding pgcrypto to postgresql X-Git-Tag: tag-0.13~29 X-Git-Url: https://jmp-git.ovh.safe.ca/?a=commitdiff_plain;h=a0bf3191101fca5da2ed66848b5c877150630f8f;p=jmp%2Fmailleur Adding pgcrypto to postgresql --- diff --git a/mailleur.spec.in b/mailleur.spec.in index 0f3cac8..30e1e36 100644 --- a/mailleur.spec.in +++ b/mailleur.spec.in @@ -141,6 +141,7 @@ Summary : mailleur using postgresql as Data-base Requires : %{name} = %{version}-%{release} Requires : postgresql-server +Requires : postgresql-contrib Requires : dovecot-postgresql Obsoletes : %{name}-mysql <= %{version}-%{release} diff --git a/sql/Makefile b/sql/Makefile index 6352c39..06e7508 100644 --- a/sql/Makefile +++ b/sql/Makefile @@ -55,6 +55,9 @@ dbpostg : mailleur.postg echo "CREATE DATABASE mailleur \ ENCODING='UTF8';" \ ) | psql -q -U postgres template1 + @ ( \ + echo "CREATE EXTENSION pgcrypto;" \ + ) | psql -q mailleur; @ cat mailleur.postg | psql -q mailleur; @ cpp -P -DPOSTGRESQL datatest.sql | psql -q mailleur; @ echo "POSGRESQL database ready" @@ -62,6 +65,7 @@ dbpostg : mailleur.postg ndbpostg: @-( \ echo "drop database mailleur;"; \ + echo "DROP EXTENSION pgcrypto;"; \ echo "DROP ROLE apache;"; \ echo "DROP ROLE dovecot;"; \ ) | psql -q -U postgres template1 diff --git a/sql/mailleur.sql b/sql/mailleur.sql index c4da08f..8af9b8a 100644 --- a/sql/mailleur.sql +++ b/sql/mailleur.sql @@ -55,6 +55,10 @@ CREATE TABLE emails ( email TEXTUNIQUE, //User email password TEXT //User password DFLT '!', + realm TEXT //user realm + DFLT 'MAILLEUR-EMAIL', + hash TEXT //'email:realm:passwor' MD5 + DFLT '0ABCD9', space INTEGER //space used by user email DFLT 0, mxspace INTEGER //Maximun space available diff --git a/support/crdb.sh b/support/crdb.sh index f0f674f..b86e916 100755 --- a/support/crdb.sh +++ b/support/crdb.sh @@ -85,6 +85,7 @@ case "$DB_TYPE" in echo "CREATE ROLE $APPNAME WITH LOGIN CREATEDB SUPERUSER;" echo "CREATE ROLE apache WITH LOGIN;" echo "CREATE ROLE dovecot WITH LOGIN;" + echo "CREATE EXTENSION pgcrypto;" echo "CREATE DATABASE $APPNAME ENCODING='UTF8';" ) | /usr/bin/su - -m postgres -c "$SQL $SQLHOST $SQLPORT template1" >> $LOG echo "data-base is now created" >> $LOG