Maint: rework OpenVPN custom configuration code

- Refactor code and errors returned
- Add unit tests
- Make custom config code independent from loop
This commit is contained in:
Quentin McGaw (desktop)
2021-08-18 20:12:26 +00:00
parent c515603d2f
commit f17a4eae3e
4 changed files with 546 additions and 91 deletions

View File

@@ -36,7 +36,7 @@ func (l *Loop) Run(ctx context.Context, done chan<- struct{}) {
lines = providerConf.BuildConf(connection, openVPNSettings)
}
} else {
lines, connection, err = l.processCustomConfig(openVPNSettings)
lines, connection, err = processCustomConfig(openVPNSettings)
}
if err != nil {
l.crashed(ctx, err)