mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-13 14:31:15 +00:00
* Improved Makefile * Multiarch Docker build (amd64, arm64 and armv7) * closes #104
This commit is contained in:
@@ -29,7 +29,7 @@ type Config struct {
|
||||
SyncFilter string `yaml:"syncFilter" envconfig:"LDAP_SYNC_FILTER"`
|
||||
AdminLdapGroup string `yaml:"adminGroup" envconfig:"LDAP_ADMIN_GROUP"` // Members of this group receive admin rights in WG-Portal
|
||||
AdminLdapGroup_ *gldap.DN `yaml:"-"`
|
||||
EveryoneAdmin bool `yaml:"everyoneAdmin" envconfig:"LDAP_EVERYONE_ADMIN"`
|
||||
EveryoneAdmin bool `yaml:"everyoneAdmin" envconfig:"LDAP_EVERYONE_ADMIN"`
|
||||
LdapCertConn bool `yaml:"ldapCertConn" envconfig:"LDAP_CERT_CONN"`
|
||||
LdapTlsCert string `yaml:"ldapTlsCert" envconfig:"LDAPTLS_CERT"`
|
||||
LdapTlsKey string `yaml:"ldapTlsKey" envconfig:"LDAPTLS_KEY"`
|
||||
|
@@ -135,16 +135,16 @@ func (s *Server) GetUserIndex(c *gin.Context) {
|
||||
peers := s.peers.GetSortedPeersForEmail(currentSession.SortedBy["userpeers"], currentSession.SortDirection["userpeers"], currentSession.Email)
|
||||
|
||||
c.HTML(http.StatusOK, "user_index.html", gin.H{
|
||||
"Route": c.Request.URL.Path,
|
||||
"Alerts": GetFlashes(c),
|
||||
"Session": currentSession,
|
||||
"Static": s.getStaticData(),
|
||||
"Peers": peers,
|
||||
"TotalPeers": len(peers),
|
||||
"Users": []users.User{*s.users.GetUser(currentSession.Email)},
|
||||
"Device": s.peers.GetDevice(currentSession.DeviceName),
|
||||
"DeviceNames": s.GetDeviceNames(),
|
||||
"UserManagePeers": s.config.WG.UserManagePeers,
|
||||
"Route": c.Request.URL.Path,
|
||||
"Alerts": GetFlashes(c),
|
||||
"Session": currentSession,
|
||||
"Static": s.getStaticData(),
|
||||
"Peers": peers,
|
||||
"TotalPeers": len(peers),
|
||||
"Users": []users.User{*s.users.GetUser(currentSession.Email)},
|
||||
"Device": s.peers.GetDevice(currentSession.DeviceName),
|
||||
"DeviceNames": s.GetDeviceNames(),
|
||||
"UserManagePeers": s.config.WG.UserManagePeers,
|
||||
})
|
||||
}
|
||||
|
||||
|
@@ -3,11 +3,11 @@ package wireguard
|
||||
import "github.com/h44z/wg-portal/internal/common"
|
||||
|
||||
type Config struct {
|
||||
DeviceNames []string `yaml:"devices" envconfig:"WG_DEVICES"` // managed devices
|
||||
DefaultDeviceName string `yaml:"defaultDevice" envconfig:"WG_DEFAULT_DEVICE"` // this device is used for auto-created peers, use GetDefaultDeviceName() to access this field
|
||||
ConfigDirectoryPath string `yaml:"configDirectory" envconfig:"WG_CONFIG_PATH"` // optional, if set, updates will be written to this path, filename: <devicename>.conf
|
||||
ManageIPAddresses bool `yaml:"manageIPAddresses" envconfig:"MANAGE_IPS"` // handle ip-address setup of interface
|
||||
UserManagePeers bool `yaml:"userManagePeers" envconfig:"USER_MANAGE_PEERS"` // user can manage own peers
|
||||
DeviceNames []string `yaml:"devices" envconfig:"WG_DEVICES"` // managed devices
|
||||
DefaultDeviceName string `yaml:"defaultDevice" envconfig:"WG_DEFAULT_DEVICE"` // this device is used for auto-created peers, use GetDefaultDeviceName() to access this field
|
||||
ConfigDirectoryPath string `yaml:"configDirectory" envconfig:"WG_CONFIG_PATH"` // optional, if set, updates will be written to this path, filename: <devicename>.conf
|
||||
ManageIPAddresses bool `yaml:"manageIPAddresses" envconfig:"MANAGE_IPS"` // handle ip-address setup of interface
|
||||
UserManagePeers bool `yaml:"userManagePeers" envconfig:"USER_MANAGE_PEERS"` // user can manage own peers
|
||||
}
|
||||
|
||||
func (c Config) GetDefaultDeviceName() string {
|
||||
|
@@ -302,7 +302,7 @@ type Device struct {
|
||||
Peers []Peer `gorm:"foreignKey:DeviceName" binding:"-" json:"-"` // linked WireGuard peers
|
||||
|
||||
Type DeviceType `form:"devicetype" binding:"required,oneof=client server"`
|
||||
DeviceName string `form:"device" gorm:"primaryKey" binding:"required" validator:"regexp=[0-9a-zA-Z\-]+"`
|
||||
DeviceName string `form:"device" gorm:"primaryKey" binding:"required" validator:"regexp=[0-9a-zA-Z\\-]+"`
|
||||
DisplayName string `form:"displayname" binding:"omitempty,max=200"`
|
||||
|
||||
// Core WireGuard Settings (Interface section)
|
||||
|
Reference in New Issue
Block a user