2021-08-19 13:31:12 +00:00
|
|
|
package openvpn
|
2020-02-06 20:42:46 -05:00
|
|
|
|
|
|
|
|
import (
|
2022-05-07 19:17:10 +00:00
|
|
|
"github.com/qdm12/gluetun/internal/constants/openvpn"
|
2020-02-06 20:42:46 -05:00
|
|
|
"github.com/qdm12/golibs/command"
|
|
|
|
|
)
|
|
|
|
|
|
2021-08-18 20:28:42 +00:00
|
|
|
type Configurator struct {
|
2021-09-23 16:58:21 +00:00
|
|
|
logger Infoer
|
2021-07-24 17:59:22 +00:00
|
|
|
cmder command.RunStarter
|
2021-08-18 15:35:07 +00:00
|
|
|
configPath string
|
2021-07-23 16:06:19 +00:00
|
|
|
authFilePath string
|
2022-08-15 19:54:58 -04:00
|
|
|
askPassPath string
|
2021-08-18 15:44:58 +00:00
|
|
|
puid, pgid int
|
2020-02-06 20:42:46 -05:00
|
|
|
}
|
|
|
|
|
|
2021-09-23 16:58:21 +00:00
|
|
|
func New(logger Infoer, cmder command.RunStarter,
|
|
|
|
|
puid, pgid int) *Configurator {
|
2021-08-18 20:28:42 +00:00
|
|
|
return &Configurator{
|
2021-07-23 16:06:19 +00:00
|
|
|
logger: logger,
|
2021-07-24 17:59:22 +00:00
|
|
|
cmder: cmder,
|
2022-01-29 15:34:59 +00:00
|
|
|
configPath: configPath,
|
2022-05-07 19:17:10 +00:00
|
|
|
authFilePath: openvpn.AuthConf,
|
2022-08-15 19:54:58 -04:00
|
|
|
askPassPath: openvpn.AskPassPath,
|
2021-08-18 15:44:58 +00:00
|
|
|
puid: puid,
|
|
|
|
|
pgid: pgid,
|
2020-02-06 20:42:46 -05:00
|
|
|
}
|
|
|
|
|
}
|