Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help ldap2pg.yml throwing errors. #573

Closed
maliktafheem opened this issue Oct 18, 2023 · 2 comments
Closed

Help ldap2pg.yml throwing errors. #573

maliktafheem opened this issue Oct 18, 2023 · 2 comments
Labels

Comments

@maliktafheem
Copy link

maliktafheem commented Oct 18, 2023

hello. I'm a novice in LDAP sync. I was setting up ldap2pg on my pc. I have a different vurtual machine for postgre server (ldappostgresubuntu.hopto.org:5432) and a different virtual machine for ldap server (ldapserverubuntu.hopto.org:389). Now i'm on a third virtual machine say 'client'. I can access the ldapserver as well as the postgreserver through this VM directly in terminal e.g. I can run ldapsearch -x -b dc=hopto,dc=org successfully as well as psql -h ldappostgres.hopto.org -p 5432 -d postgres -U edbuser i can get into my postgre server database. but when i try to set up ldap2pg using the ldap2pg.yml it shows me an error "ERROR Fatal error. err="session: failed to connect to host=/var/run/postgresql user=root database=: server error (FATAL: role "root" does not exist (SQLSTATE 28000))""

my ldap2pg.yml looks like the below:

version: 6
postgres:
  dsn: postgres://edbuser:password@ldappostgresubuntu.hopto.org:5432/postgres
ldap:
  uri: ldap://ldapserverubuntu.hopto.org
  binddn: cn=hopto,dc=org
  user: edbuser
  password: password
rules:
  - ldapsearch:
      base: dc=hopto,dc=org

My overall goal is to run ldap2pg and run a few queries on the database as well as run ldapsearch successfully. please help.

@pneun87
Copy link

pneun87 commented Jan 19, 2024

Hello.
When looking at the changelog: https://ldap2pg.readthedocs.io/en/latest/changelog/
you can see that the dsn-clause in the yaml file is not used for the connection parameters to PostgreSQL.
You have to set the environment variables like PGHOST, PGUSER etc.

@bersace
Copy link
Member

bersace commented Apr 9, 2024

@pneun87 is right. We plan to support .env and DSN as CLI argument. But we don't want secrets in yml.

@bersace bersace closed this as completed Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants