-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
defaults.go
85 lines (82 loc) · 1.8 KB
/
defaults.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package config
import (
"log/slog"
"net/url"
"text/template"
"time"
"github.com/jkroepke/openvpn-auth-oauth2/internal/ui"
"golang.org/x/oauth2"
)
//nolint:gochecknoglobals
var Defaults = Config{
Debug: Debug{
Listen: ":9001",
},
Log: Log{
Format: "console",
Level: slog.LevelInfo,
VPNClientIP: true,
},
HTTP: HTTP{
BaseURL: &url.URL{
Scheme: "http",
Host: "localhost:9000",
},
Listen: ":9000",
TLS: false,
Check: HTTPCheck{
IPAddr: false,
},
CallbackTemplate: template.Must(template.New("index.gohtml").ParseFS(ui.Template, "index.gohtml")),
},
OpenVpn: OpenVpn{
Addr: &url.URL{
Scheme: "unix",
Path: "/run/openvpn/server.sock",
OmitHost: true,
},
AuthTokenUser: true,
AuthPendingTimeout: 3 * time.Minute,
CommonName: OpenVPNCommonName{
EnvironmentVariableName: "common_name",
Mode: CommonNameModePlain,
},
Bypass: OpenVpnBypass{
CommonNames: make([]string, 0),
},
Passthrough: OpenVPNPassthrough{
Enabled: false,
Address: &url.URL{
Scheme: "unix",
Path: "/run/openvpn-auth-oauth2/server.sock",
OmitHost: true,
},
SocketMode: 660,
SocketGroup: "",
},
},
OAuth2: OAuth2{
AuthStyle: OAuth2AuthStyle(oauth2.AuthStyleInParams),
Client: OAuth2Client{},
Endpoints: OAuth2Endpoints{
Auth: &url.URL{Scheme: "", Host: ""},
Discovery: &url.URL{Scheme: "", Host: ""},
Token: &url.URL{Scheme: "", Host: ""},
},
Issuer: &url.URL{Scheme: "", Host: ""},
Nonce: true,
PKCE: true,
Provider: "generic",
Refresh: OAuth2Refresh{
Expires: time.Hour * 8,
ValidateUser: true,
},
Scopes: []string{},
Validate: OAuth2Validate{
Groups: make([]string, 0),
IPAddr: false,
Issuer: true,
Roles: make([]string, 0),
},
},
}