mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-11 17:53:58 +03:00
Resolves conflicts
This commit is contained in:
commit
5abb066df5
5 changed files with 25 additions and 12 deletions
|
@ -21,4 +21,6 @@ const (
|
|||
DefaultMTU = 1450
|
||||
DefaultPersistentKeepalive = 15
|
||||
DefaultConfigFilePath = "/etc/wireguard/wg0.conf"
|
||||
UsernameEnvVar = "WGUI_USERNAME"
|
||||
PasswordEnvVar = "WGUI_PASSWORD"
|
||||
)
|
||||
|
|
|
@ -368,3 +368,11 @@ func WriteWireGuardServerConfig(tmplBox *rice.Box, serverConfig model.Server, cl
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetCredVar reads value from environment variable or returns fallback
|
||||
func GetCredVar(key, fallback string) string {
|
||||
if value, ok := os.LookupEnv(key); ok {
|
||||
return value
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue