chore(constants): remove and move constant paths
- Remove unused paths - Move paths to inline constants if used only once
This commit is contained in:
@@ -26,7 +26,7 @@ func New(logger Infoer, cmder command.RunStarter,
|
||||
return &Configurator{
|
||||
logger: logger,
|
||||
cmder: cmder,
|
||||
configPath: constants.OpenVPNConf,
|
||||
configPath: configPath,
|
||||
authFilePath: constants.OpenVPNAuthConf,
|
||||
puid: puid,
|
||||
pgid: pgid,
|
||||
|
||||
3
internal/openvpn/paths.go
Normal file
3
internal/openvpn/paths.go
Normal file
@@ -0,0 +1,3 @@
|
||||
package openvpn
|
||||
|
||||
const configPath = "/etc/openvpn/target.ovpn"
|
||||
@@ -30,7 +30,7 @@ func start(ctx context.Context, starter command.Starter, version string, flags [
|
||||
return nil, nil, nil, fmt.Errorf("%w: %s", ErrVersionUnknown, version)
|
||||
}
|
||||
|
||||
args := []string{"--config", constants.OpenVPNConf}
|
||||
args := []string{"--config", configPath}
|
||||
args = append(args, flags...)
|
||||
cmd := exec.CommandContext(ctx, bin, args...)
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
|
||||
|
||||
Reference in New Issue
Block a user