Crivaledaz / Mattermost-LDAP

This module provides an external LDAP authentication in Mattermost for the Team Edition (free).
MIT License
357 stars 71 forks source link

init_postgres.sh : use $db_host #73

Open azimut2000 opened 3 years ago

azimut2000 commented 3 years ago

Describe the bug The script init_postgres.sh can not connect on other server than localhost

Expected behavior create DB on another server

Project (please complete the following information): In the script, you should write "psql -U $db_user -h $db_host -d $db_name -c..." than "psql -U $db_user -d $db_name -c..." It's the same problem when we use MySQL...

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

Crivaledaz commented 3 years ago

Hi,

Thank you for using Mattermost-LDAP and for your feedback.

Actually, database scripts were designed for a local use. If the database is located on another server, you should move the scripts to the database server before executing them locally.

However, I agree with you, it would be nice if those scripts could be used remotely from the server where you have cloned the Mattermost-LDAP repository. I will try to adapt the scripts to allow this.

This change will certainly imply to adapt the login process to execute psql and mysql commands. Particularly, I see there is no password used for psql commands, because local connections are trusted, and that must not work for remote connection except with important security issues.

I hope I will find some free time, in the next days/weeks, to work on this. I will update this issue then.

Regards