The error psql emits is triggered by glewlwyd.postinst feeding it mysql command line options.

With that fixed , I see the following error:

....

/   CREATE INDEX
   CREATE TABLE
   INSERT 0 1
   INSERT 0 1
   INSERT 0 1
   INSERT 0 1
   INSERT 0 1
   INSERT 0 1
   ERROR:  function gen_salt(unknown) does not exist
   LINE 1: ...ser WHERE gu_username='admin'), crypt('password', gen_salt('...
                                                             ^
   HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
   INSERT 0 1
   INSERT 0 1
I   NSERT 0 1
   INSERT 0 1
   Start Glewlwyd service
   Setting up glewlwyd-dbgsym (2.5.2-1) ...
   Processing triggers for man-db (2.9.4-2) ...
   root@msg:/tmp/glewlwyd#
/

I found out that the pgcrypo extension needs to e enabled.

These two changes are attached as pgConfig.diff , which where generated with quilt (debian/patches).


The last hurdle, I hope is this one:

Note: I could build the package with dpkg-buildpackage -uc -us -rfakeroot.  It installed but failed to start.

   root@msg:/tmp/glewlwyd# tail /var/log/daemon.log
   Mar 15 19:49:11 msg systemd[1]: Started Glewlwyd OAuth2 authentication provider (Debian package).
   Mar 15 19:49:11 msg glewlwyd[17604]: Error - database type unknown
   Mar 15 19:49:11 msg glewlwyd[17604]: Error parsing config file


in /etc/glewlwyd/glewlwyd-db.conf the value says:

type = "pgsql"

but glewlwyd needs it to be

type = "postgre"

See also attached glewlwyd-db.diff file, which is simply a before/after diff of that file on the system after installation.


With that changed , glewlwyd starts and I can login as admin with the default password.

So far it is beyond me how change the templating of dbconfig-common to reflect that and since this my first attempt at filing a bug report I am awaiting Your feedback.


psql connect in the format: PGPASSWORD=pass1234 psql -U MyUsername myDatabaseName
enable pgcrypto see: by https://babelouest.github.io/glewlwyd/docs/INSTALL.html#initialise-database
use utf8 encoding when creating database
--- a/debian/glewlwyd.postinst
+++ b/debian/glewlwyd.postinst
@@ -51,6 +51,7 @@
     dbc_generate_include_owner="glewlwyd:root"
     dbc_generate_include_args="-o template_infile=/usr/share/glewlwyd/templates/glewlwyd-db.conf.properties"
     dbc_mysql_createdb_encoding="UTF8"
+    dbc_pgsql_createdb_encoding="UTF8"
     dbc_basepath="/var/cache/glewlwyd"
     dbc_dbfile_owner="glewlwyd:root"
     dbc_dbfile_perms="0660"
@@ -70,7 +71,7 @@
       su - glewlwyd -s /bin/sh -c "gunzip --stdout /usr/share/doc/glewlwyd/database/init.sqlite3.sql.gz | sqlite3 $dbc_basepath/$dbc_dbname"
     else
       sed -i -e "s,_G_DB_TYPE_,pgsql," $CONFIG_DB
-      gunzip --stdout /usr/share/doc/glewlwyd/database/init.postgre.sql.gz | psql -u$dbc_dbuser -p$dbc_dbpass -h$dbc_dbserver $dbc_dbname
+      gunzip --stdout /usr/share/doc/glewlwyd/database/init.postgre.sql.gz | PGPASSWORD=$dbc_dbpass  psql -U$dbc_dbuser -h$dbc_dbserver $dbc_dbname
     fi
     
   else
--- a/debian/glewlwyd.install
+++ b/debian/glewlwyd.install
@@ -16,3 +16,4 @@
 
 debian/glewlwyd-debian.conf.properties usr/share/glewlwyd/templates/
 debian/glewlwyd-db.conf.properties usr/share/glewlwyd/templates/
+debian/pg-enable-crypto/pgsql usr/share/dbconfig-common/data/glewlwyd/install-dbadmin/
--- a/debian/pg-enable-crypto/pgsql
+++ b/debian/pg-enable-crypto/pgsql
@@ -1 +1,2 @@
-create extention if not exists pgcrypto;
+create extension if not exists pgcrypto;
+
--- /etc/glewlwyd/glewlwyd-db.conf	2021-03-15 22:46:14.901779262 +0100
+++ /tmp/glewlwyd-db.conf	2021-03-15 22:44:06.890222063 +0100
@@ -1,7 +1,7 @@
 # Database connection
 database =
 {
-  type = "pgsql"
+  type = "postgre"
 
 # SQLite3 property
   path = "/var/cache/glewlwyd/glewlwyd"

Reply via email to