hotfix(settings): openvpn encrypted key reading from file
This commit is contained in:
@@ -51,7 +51,7 @@ func (s *Source) Get(key string) (value string, isSet bool) {
|
||||
// Special file handling
|
||||
switch key {
|
||||
// TODO timezone from /etc/localtime
|
||||
case "client.crt", "client.key":
|
||||
case "client.crt", "client.key", "openvpn_encrypted_key":
|
||||
value, isSet, err := ReadPEMFile(path)
|
||||
if err != nil {
|
||||
s.warner.Warnf("skipping %s: parsing PEM: %s", path, err)
|
||||
@@ -85,6 +85,8 @@ func (s *Source) KeyTransform(key string) string {
|
||||
return "client.key"
|
||||
case "OPENVPN_CERT":
|
||||
return "client.crt"
|
||||
case "OPENVPN_ENCRYPTED_KEY":
|
||||
return "openvpn_encrypted_key"
|
||||
default:
|
||||
key = strings.ToLower(key) // HTTPROXY_USER -> httpproxy_user
|
||||
return key
|
||||
|
||||
@@ -54,7 +54,7 @@ func (s *Source) Get(key string) (value string, isSet bool) {
|
||||
// Special file parsing
|
||||
switch key {
|
||||
// TODO timezone from /etc/localtime
|
||||
case "openvpn_clientcrt", "openvpn_clientkey":
|
||||
case "openvpn_clientcrt", "openvpn_clientkey", "openvpn_encrypted_key":
|
||||
value, isSet, err := files.ReadPEMFile(path)
|
||||
if err != nil {
|
||||
s.warner.Warnf("skipping %s: parsing PEM: %s", path, err)
|
||||
@@ -97,6 +97,8 @@ func (s *Source) KeyTransform(key string) string {
|
||||
return "openvpn_clientkey"
|
||||
case "OPENVPN_CERT":
|
||||
return "openvpn_clientcrt"
|
||||
case "OPENVPN_ENCRYPTED_KEY":
|
||||
return "openvpn_encrypted_key"
|
||||
default:
|
||||
key = strings.ToLower(key) // HTTPROXY_USER -> httpproxy_user
|
||||
return key
|
||||
|
||||
Reference in New Issue
Block a user