mirror of
https://github.com/h44z/wg-portal.git
synced 2025-12-15 02:56:17 +00:00
ldap - compare DNs using DN.Equal (#60)
* ldap - compare DNs using DN.Equal * ldap/isAdmin- restructure & remove code duplication Co-authored-by: Markus Koetter <koetter@cispa.de>
This commit is contained in:
@@ -12,6 +12,8 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
gldap "github.com/go-ldap/ldap/v3"
|
||||
)
|
||||
|
||||
var ErrInvalidSpecification = errors.New("specification must be a struct pointer")
|
||||
@@ -130,6 +132,10 @@ func NewConfig() *Config {
|
||||
if err != nil {
|
||||
logrus.Warnf("unable to load environment config: %v", err)
|
||||
}
|
||||
cfg.LDAP.AdminLdapGroup_, err = gldap.ParseDN(cfg.LDAP.AdminLdapGroup)
|
||||
if err != nil {
|
||||
logrus.Warnf("Parsing AdminLDAPGroup failed: %v", err)
|
||||
}
|
||||
|
||||
if cfg.WG.ManageIPAddresses && runtime.GOOS != "linux" {
|
||||
logrus.Warnf("managing IP addresses only works on linux, feature disabled...")
|
||||
|
||||
Reference in New Issue
Block a user