Skip to content

Commit cf30d25

Browse files
author
supertarto
committed
LDAP auth
1 parent de972cf commit cf30d25

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,24 @@ bookstack_smtp_username: "null"
4242
bookstack_smtp_password: "null"
4343
bookstack_smtp_encryption: "null"
4444
```
45-
45+
Information about your LDAP.
46+
```yml
47+
bookstack_use_ldap_auth: false
48+
bookstack_ldap_server: "ldaps://example.com:636"
49+
bookstack_ldap_base_dn: "People,dc=example,dc=com"
50+
bookstack_ldap_bind_dn: "false"
51+
bookstack_ldap_bind_pw: "false"
52+
bookstack_ldap_user_filter: "(&(uid=${user}))"
53+
bookstack_ldap_version: "3"
54+
bookstack_ldap_id_attribute: "uid"
55+
bookstack_ldap_mail_attribute: "mail"
56+
bookstack_ldap_dn_attribute: "cn"
57+
bookstack_ldap_tls_force: "false"
58+
```
59+
Default locale
60+
```yml
61+
bookstack_lang: en
62+
```
4663
## Examples
4764
```yml
4865
- hosts: all

defaults/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ bookstack_git_url: https://github.com/BookStackApp/BookStack.git
99
############
1010
# ENV FILE
1111
############
12+
bookstack_lang: en
13+
1214
bookstack_host: localhost
1315
bookstack_db_name: bookstackdb
1416
bookstack_db_user: bookstackuser
@@ -23,3 +25,15 @@ bookstack_smtp_port: "1025"
2325
bookstack_smtp_username: "null"
2426
bookstack_smtp_password: "null"
2527
bookstack_smtp_encryption: "null"
28+
29+
bookstack_use_ldap_auth: false
30+
bookstack_ldap_server: "ldaps://example.com:636"
31+
bookstack_ldap_base_dn: "People,dc=example,dc=com"
32+
bookstack_ldap_bind_dn: "false"
33+
bookstack_ldap_bind_pw: "false"
34+
bookstack_ldap_user_filter: "(&(uid=${user}))"
35+
bookstack_ldap_version: "3"
36+
bookstack_ldap_id_attribute: "uid"
37+
bookstack_ldap_mail_attribute: "mail"
38+
bookstack_ldap_dn_attribute: "cn"
39+
bookstack_ldap_tls_force: "false"

templates/env.j2

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Used for encryption where needed.
33
# Run `php artisan key:generate` to generate a valid key.
44
APP_KEY=SomeKey
5+
APP_LANG={{ bookstack_lang }}
56

67
# Application URL
78
# Remove the hash below and set a URL if using BookStack behind
@@ -31,5 +32,25 @@ MAIL_USERNAME={{ bookstack_smtp_username }}
3132
MAIL_PASSWORD={{ bookstack_smtp_password }}
3233
MAIL_ENCRYPTION={{ bookstack_smtp_encryption }}
3334

35+
{% if bookstack_use_ldap_auth is true %}
36+
AUTH_METHOD=ldap
37+
LDAP_SERVER={{ bookstack_ldap_server }}
38+
LDAP_BASE_DN=ou={{ bookstack_ldap_base_dn }}
39+
LDAP_DN={{ bookstack_ldap_bind_dn }}
40+
LDAP_PASS=false{{ bookstack_ldap_bind_pw }}
3441

35-
# A full list of options can be found in the '.env.example.complete' file.
42+
LDAP_USER_FILTER={{ bookstack_ldap_user_filter }}
43+
LDAP_VERSION={{ bookstack_ldap_version }}
44+
45+
LDAP_ID_ATTRIBUTE={{ bookstack_ldap_id_attribute }}
46+
LDAP_EMAIL_ATTRIBUTE={{ bookstack_ldap_mail_attribute }}
47+
48+
# Set the property to use for a user's display name. Defaults to 'cn'
49+
LDAP_DISPLAY_NAME_ATTRIBUTE={{ bookstack_ldap_dn_attribute }}
50+
51+
# Force TLS to be used for LDAP communication.
52+
# Use this if you can but your LDAP support will need to support it and
53+
# you may need to import your certificate to the BookStack host machine.
54+
# Defaults to 'false'.
55+
LDAP_START_TLS={{ bookstack_ldap_tls_force }}
56+
{% endif %}

0 commit comments

Comments
 (0)