chore(constants): remove and move constant paths
- Remove unused paths - Move paths to inline constants if used only once
This commit is contained in:
@@ -4,16 +4,22 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/configuration/settings"
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
)
|
||||
|
||||
const (
|
||||
// OpenVPNClientKeyPath is the OpenVPN client key filepath.
|
||||
OpenVPNClientKeyPath = "/gluetun/client.key"
|
||||
// OpenVPNClientCertificatePath is the OpenVPN client certificate filepath.
|
||||
OpenVPNClientCertificatePath = "/gluetun/client.crt"
|
||||
)
|
||||
|
||||
func (r *Reader) readOpenVPN() (settings settings.OpenVPN, err error) {
|
||||
settings.ClientKey, err = ReadFromFile(constants.ClientKey)
|
||||
settings.ClientKey, err = ReadFromFile(OpenVPNClientKeyPath)
|
||||
if err != nil {
|
||||
return settings, fmt.Errorf("cannot read client key: %w", err)
|
||||
}
|
||||
|
||||
settings.ClientCrt, err = ReadFromFile(constants.ClientCertificate)
|
||||
settings.ClientCrt, err = ReadFromFile(OpenVPNClientCertificatePath)
|
||||
if err != nil {
|
||||
return settings, fmt.Errorf("cannot read client certificate: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user