diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | lib/config.js | 6 | ||||
-rw-r--r-- | public/views/signin-modal.ejs | 2 |
3 files changed, 7 insertions, 2 deletions
@@ -148,6 +148,7 @@ Environment variables (will overwrite other server configs) | HMD_LDAP_SEARCHFILTER | (uid={{username}}) | LDAP filter to search with | | HMD_LDAP_SEARCHATTRIBUTES | no example | LDAP attributes to search with | | HMD_LDAP_TLS_CA | no example | Root CA for LDAP TLS in PEM format | +| HMD_LDAP_PROVIDERNAME | My institution | Optional name to be displayed at login form indicating the LDAP provider | | HMD_IMGUR_CLIENTID | no example | Imgur API client id | | HMD_EMAIL | `true` or `false` | set to allow email register and signin | | HMD_IMAGE_UPLOAD_TYPE | `imgur`, `s3` or `filesystem` | Where to upload image. For S3, see our [S3 Image Upload Guide](docs/guides/s3-image-upload.md) | diff --git a/lib/config.js b/lib/config.js index 2f6792b7..6b2ba0b6 100644 --- a/lib/config.js +++ b/lib/config.js @@ -102,7 +102,8 @@ var ldap = config.ldap || ( process.env.HMD_LDAP_TOKENSECRET || process.env.HMD_LDAP_SEARCHBASE || process.env.HMD_LDAP_SEARCHFILTER || - process.env.HMD_LDAP_SEARCHATTRIBUTES + process.env.HMD_LDAP_SEARCHATTRIBUTES || + process.env.HMD_LDAP_PROVIDERNAME ) || false; if (ldap == true) ldap = {}; @@ -126,6 +127,9 @@ if (process.env.HMD_LDAP_TLS_CA) { } ldap.tlsOptions = ldap.tlsOptions ? Object.assign(ldap.tlsOptions, ca) : ca } +if (process.env.HMD_LDAP_PROVIDERNAME) { + ldap.providerName = process.env.HMD_LDAP_PROVIDERNAME; +} var imgur = process.env.HMD_IMGUR_CLIENTID || config.imgur || false; var email = process.env.HMD_EMAIL ? (process.env.HMD_EMAIL === 'true') : !!config.email; diff --git a/public/views/signin-modal.ejs b/public/views/signin-modal.ejs index 7c52e0f3..e9c54b33 100644 --- a/public/views/signin-modal.ejs +++ b/public/views/signin-modal.ejs @@ -42,7 +42,7 @@ <hr> <% }%> <% if(ldap) { %> - <h4>Via LDAP</h4> + <h4>Via <% if (ldap.providerName) { %> <%- ldap.providerName %> (LDAP) <% } else { %> LDAP <% } %></h4> <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded"> <div class="form-group"> <div class="col-sm-12"> |