- Better settings tree structure logged using `qdm12/gotree` - Read settings from environment variables, then files, then secret files - Settings methods to default them, merge them and override them - `DNS_PLAINTEXT_ADDRESS` default changed to `127.0.0.1` to use DoT. Warning added if set to something else. - `HTTPPROXY_LISTENING_ADDRESS` instead of `HTTPPROXY_PORT` (with retro-compatibility)
26 lines
505 B
Go
26 lines
505 B
Go
package helpers
|
|
|
|
func ObfuscateWireguardKey(fullKey string) (obfuscatedKey string) {
|
|
const minKeyLength = 10
|
|
if len(fullKey) < minKeyLength {
|
|
return "(too short)"
|
|
}
|
|
|
|
lastIndex := len(fullKey) - 1
|
|
return fullKey[0:2] + "..." + fullKey[lastIndex-2:]
|
|
}
|
|
|
|
func ObfuscatePassword(password string) (obfuscatedPassword string) {
|
|
if password != "" {
|
|
return "[set]"
|
|
}
|
|
return "[not set]"
|
|
}
|
|
|
|
func ObfuscateData(data string) (obfuscated string) {
|
|
if data != "" {
|
|
return "[set]"
|
|
}
|
|
return "[not set]"
|
|
}
|