Setup mail and ldap #1121

Closed
opened 2026-02-04 23:51:17 +03:00 by OVERLORD · 12 comments
Owner

Originally created by @TheDealman on GitHub (Apr 3, 2019).

Hello

I just installed bookstack on ubuntu 16.04 and I used the installation script to do the install for me. I would like to setup the email and LDAP auth but all the documentation references some .env file that needs to be edited. Where is this .env file that I need to edit?

Originally created by @TheDealman on GitHub (Apr 3, 2019). Hello I just installed bookstack on ubuntu 16.04 and I used the installation script to do the install for me. I would like to setup the email and LDAP auth but all the documentation references some .env file that needs to be edited. Where is this .env file that I need to edit?
OVERLORD added the 🐕 Support label 2026-02-04 23:51:17 +03:00
Author
Owner

@cnfw commented on GitHub (Apr 3, 2019):

Hi, there is an example .env file called .env.example in the root directory of the project. You can copy this to a file called .env and update the values as you need. Sometimes it may be hidden, ls -la will show hidden files :)

There's also a file called .env.example.complete with a full list of configurable options, including LDAP options. Head the caution at the top of this file, only use the pieces of configuration you need from it.

@cnfw commented on GitHub (Apr 3, 2019): Hi, there is an example .env file called `.env.example` in the root directory of the project. You can copy this to a file called `.env` and update the values as you need. Sometimes it may be hidden, `ls -la` will show hidden files :) There's also a file called `.env.example.complete` with a full list of configurable options, including LDAP options. Head the caution at the top of this file, only use the pieces of configuration you need from it.
Author
Owner

@ssddanbrown commented on GitHub (Apr 4, 2019):

Thanks @cw1998 for providing some helpful info.

@TheDealman If you're having trouble finding your BookStack install, You'll probably find it at /var/www/bookstack since you installed using the script.

@ssddanbrown commented on GitHub (Apr 4, 2019): Thanks @cw1998 for providing some helpful info. @TheDealman If you're having trouble finding your BookStack install, You'll probably find it at `/var/www/bookstack` since you installed using the script.
Author
Owner

@TheDealman commented on GitHub (Apr 4, 2019):

Thanks @cw1998 for providing some helpful info.

@TheDealman If you're having trouble finding your BookStack install, You'll probably find it at /var/www/bookstack since you installed using the script.

Thanks I found it

@TheDealman commented on GitHub (Apr 4, 2019): > > > Thanks @cw1998 for providing some helpful info. > > @TheDealman If you're having trouble finding your BookStack install, You'll probably find it at `/var/www/bookstack` since you installed using the script. Thanks I found it
Author
Owner

@TheDealman commented on GitHub (Apr 4, 2019):

I will try to get this all working today

@TheDealman commented on GitHub (Apr 4, 2019): I will try to get this all working today
Author
Owner

@TheDealman commented on GitHub (Apr 4, 2019):

Okay i was able to get this working in the .env file that's located /var/www/bookstack

#General auth
AUTH_METHOD=ldap

LDAP authentication configuration

LDAP_SERVER=ip of the AD server:389
LDAP_BASE_DN=OU=name,DC=ADNETBIOS,DC=SUFFIX
LDAP_DN=CN=ACCOUNT,OU=NAME OF OU,ADNETBIOS,DC=SUFFIX
LDAP_PASS=PASSWORD ACCOUNT LISTED ABOVE
LDAP_USER_FILTER=(|(mail=${user})(sAMAccountName=${user}))
LDAP_VERSION=3
LDAP_TLS_INSECURE=false
LDAP_EMAIL_ATTRIBUTE=mail
LDAP_DISPLAY_NAME_ATTRIBUTE=cn
LDAP_FOLLOW_REFERRALS=true

I was able to login using LDAP credentials but i didn't have any user roles so I changed the AUTH_METHOD to standard instead of ldap so i could login with the local admin account. I am able to see the accounts that have logged in via the ldap auth and assign roles but my question is when the ldap auth method is set how do you assign roles?

@TheDealman commented on GitHub (Apr 4, 2019): Okay i was able to get this working in the .env file that's located /var/www/bookstack #General auth AUTH_METHOD=ldap # LDAP authentication configuration LDAP_SERVER=ip of the AD server:389 LDAP_BASE_DN=OU=name,DC=ADNETBIOS,DC=SUFFIX LDAP_DN=CN=ACCOUNT,OU=NAME OF OU,ADNETBIOS,DC=SUFFIX LDAP_PASS=PASSWORD ACCOUNT LISTED ABOVE LDAP_USER_FILTER=(|(mail=${user})(sAMAccountName=${user})) LDAP_VERSION=3 LDAP_TLS_INSECURE=false LDAP_EMAIL_ATTRIBUTE=mail LDAP_DISPLAY_NAME_ATTRIBUTE=cn LDAP_FOLLOW_REFERRALS=true I was able to login using LDAP credentials but i didn't have any user roles so I changed the AUTH_METHOD to standard instead of ldap so i could login with the local admin account. I am able to see the accounts that have logged in via the ldap auth and assign roles but my question is when the ldap auth method is set how do you assign roles?
Author
Owner

@TheDealman commented on GitHub (Apr 8, 2019):

Anyone know the answer to the above question?

@TheDealman commented on GitHub (Apr 8, 2019): Anyone know the answer to the above question?
Author
Owner

@ssddanbrown commented on GitHub (Apr 8, 2019):

@TheDealman You can either set LDAP groups manually in the system and/or enable LDAP group syncing which will run when an LDAP user logs-in.

@ssddanbrown commented on GitHub (Apr 8, 2019): @TheDealman You can either set LDAP groups manually in the system and/or enable [LDAP group syncing](https://www.bookstackapp.com/docs/admin/ldap-auth/#ldap-group-sync) which will run when an LDAP user logs-in.
Author
Owner

@TheDealman commented on GitHub (Apr 9, 2019):

@TheDealman You can either set LDAP groups manually in the system and/or enable LDAP group syncing which will run when an LDAP user logs-in.

Yes I setup a LDAP group but my question is I am able to see the accounts that have logged in via the ldap auth but how do you assign roles?

@TheDealman commented on GitHub (Apr 9, 2019): > > > @TheDealman You can either set LDAP groups manually in the system and/or enable [LDAP group syncing](https://www.bookstackapp.com/docs/admin/ldap-auth/#ldap-group-sync) which will run when an LDAP user logs-in. Yes I setup a LDAP group but my question is I am able to see the accounts that have logged in via the ldap auth but how do you assign roles?
Author
Owner

@ssddanbrown commented on GitHub (Apr 9, 2019):

@TheDealman You'd need to assign BookStack roles manually by viewing each user and selecting the roles to assign them. Otherwise you can align the names with LDAP groups to auto-set BookStack roles on login.

@ssddanbrown commented on GitHub (Apr 9, 2019): @TheDealman You'd need to assign BookStack roles manually by viewing each user and selecting the roles to assign them. Otherwise you can align the names with LDAP groups to auto-set BookStack roles on login.
Author
Owner

@TheDealman commented on GitHub (Apr 9, 2019):

@TheDealman You'd need to assign BookStack roles manually by viewing each user and selecting the roles to assign them. Otherwise you can align the names with LDAP groups to auto-set BookStack roles on login.

How do I align the names with LDAP groups to auto-set BookStack roles on login?

@TheDealman commented on GitHub (Apr 9, 2019): > > > @TheDealman You'd need to assign BookStack roles manually by viewing each user and selecting the roles to assign them. Otherwise you can align the names with LDAP groups to auto-set BookStack roles on login. How do I align the names with LDAP groups to auto-set BookStack roles on login?
Author
Owner

@ssddanbrown commented on GitHub (May 18, 2019):

Sorry for my late response @TheDealman.

The process/logic is described in the LDAP group syncing documentation page. Ultimately, you can either configure BookStack role names to align with LDAP group names otherwise use the External Authentication IDs BookStack role option to perform this matching.

@ssddanbrown commented on GitHub (May 18, 2019): Sorry for my late response @TheDealman. The process/logic is described in the [LDAP group syncing documentation page](https://www.bookstackapp.com/docs/admin/ldap-auth/#ldap-group-sync). Ultimately, you can either configure BookStack role names to align with LDAP group names otherwise use the `External Authentication IDs` BookStack role option to perform this matching.
Author
Owner

@ssddanbrown commented on GitHub (Aug 27, 2019):

Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.

@ssddanbrown commented on GitHub (Aug 27, 2019): Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1121