mirror of
				https://github.com/h44z/wg-portal.git
				synced 2025-11-03 23:56:18 +00:00 
			
		
		
		
	keep original admin group behaviour
This commit is contained in:
		@@ -132,7 +132,7 @@ For example: `CONFIG_FILE=/home/test/config.yml ./wg-portal-amd64`.
 | 
			
		||||
The following configuration options are available:
 | 
			
		||||
 | 
			
		||||
| environment                | yaml                    | yaml_parent | default_value                                                                                                   | description                                                                                                                                             |
 | 
			
		||||
|----------------------------|-------------------------|-------------|-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|
 | 
			
		||||
|----------------------------|-------------------------|-------------|-----------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
 | 
			
		||||
| LISTENING_ADDRESS          | listeningAddress        | core        | :8123                                                                                                           | The address on which the web server is listening. Optional IP address and port, e.g.: 127.0.0.1:8080.                                                   |
 | 
			
		||||
| EXTERNAL_URL               | externalUrl             | core        | http://localhost:8123                                                                                           | The external URL where the web server is reachable. This link is used in emails that are created by the WireGuard Portal.                               |
 | 
			
		||||
| WEBSITE_TITLE              | title                   | core        | WireGuard VPN                                                                                                   | The website title.                                                                                                                                      |
 | 
			
		||||
@@ -176,7 +176,7 @@ The following configuration options are available:
 | 
			
		||||
| LDAP_PASSWORD              | pass                    | ldap        | SuperSecret                                                                                                     | The bind password.                                                                                                                                      |
 | 
			
		||||
| LDAP_LOGIN_FILTER          | loginFilter             | ldap        | (&(objectClass=organizationalPerson)(mail={{login_identifier}})(!userAccountControl:1.2.840.113556.1.4.803:=2)) | {{login_identifier}} will be replaced with the login email address.                                                                                     |
 | 
			
		||||
| LDAP_SYNC_FILTER           | syncFilter              | ldap        | (&(objectClass=organizationalPerson)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*))                    | The filter string for the LDAP synchronization service. Users matching this filter will be synchronized with the WireGuard Portal database.             |
 | 
			
		||||
| LDAP_SYNC_GROUP_FILTER     | syncGroupFilter         | ldap        | (&(objectClass=group))                                                                                          | The filter string for the LDAP groups. The groups are used to recursively check for admin group member ship of users.                             |
 | 
			
		||||
| LDAP_SYNC_GROUP_FILTER     | syncGroupFilter         | ldap        |                                                                                                                 | The filter string for the LDAP groups, for example: (objectClass=group). The groups are used to recursively check for admin group member ship of users. |
 | 
			
		||||
| LDAP_ADMIN_GROUP           | adminGroup              | ldap        | CN=WireGuardAdmins,OU=_O_IT,DC=COMPANY,DC=LOCAL                                                                 | Users in this group are marked as administrators.                                                                                                       |
 | 
			
		||||
| LDAP_ATTR_EMAIL            | attrEmail               | ldap        | mail                                                                                                            | User email attribute.                                                                                                                                   |
 | 
			
		||||
| LDAP_ATTR_FIRSTNAME        | attrFirstname           | ldap        | givenName                                                                                                       | User firstname attribute.                                                                                                                               |
 | 
			
		||||
 
 | 
			
		||||
@@ -97,6 +97,9 @@ func FindAllObjects(cfg *Config, objType ObjectType) ([]RawLdapData, error) {
 | 
			
		||||
			cfg.SyncFilter, attrs, nil,
 | 
			
		||||
		)
 | 
			
		||||
	case Groups:
 | 
			
		||||
		if cfg.SyncGroupFilter == "" {
 | 
			
		||||
			return nil, nil // no groups
 | 
			
		||||
		}
 | 
			
		||||
		// Search all groups
 | 
			
		||||
		attrs = []string{"dn", cfg.GroupMemberAttribute}
 | 
			
		||||
		searchRequest = ldap.NewSearchRequest(
 | 
			
		||||
 
 | 
			
		||||
@@ -114,7 +114,7 @@ func NewConfig() *Config {
 | 
			
		||||
	cfg.LDAP.AdminLdapGroup = "CN=WireGuardAdmins,OU=_O_IT,DC=COMPANY,DC=LOCAL"
 | 
			
		||||
	cfg.LDAP.LoginFilter = "(&(objectClass=organizationalPerson)(mail={{login_identifier}})(!userAccountControl:1.2.840.113556.1.4.803:=2))"
 | 
			
		||||
	cfg.LDAP.SyncFilter = "(&(objectClass=organizationalPerson)(!userAccountControl:1.2.840.113556.1.4.803:=2)(mail=*))"
 | 
			
		||||
	cfg.LDAP.SyncGroupFilter = "(&(objectClass=group))"
 | 
			
		||||
	cfg.LDAP.SyncGroupFilter = ""
 | 
			
		||||
 | 
			
		||||
	cfg.WG.DeviceNames = []string{"wg0"}
 | 
			
		||||
	cfg.WG.DefaultDeviceName = "wg0"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user