You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Configuration.md
+30-16Lines changed: 30 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Take a look at the [FAQ](./FAQ) section, for common questions, issues and soluti
11
11
openvpn-auth-oauth2 supports configuration via a YAML file. The file can be passed via the `--config` flag.
12
12
13
13
<details>
14
-
<summary>Example</summary>
14
+
<summary>Example config.yaml</summary>
15
15
16
16
```yaml
17
17
debug:
@@ -79,6 +79,10 @@ openvpn:
79
79
# - "test"
80
80
# - "test2"
81
81
override-username: false
82
+
ccd:
83
+
enabled: false
84
+
token-claim: ""
85
+
path: "/etc/openvpn-auth-oauth2/client-config/"
82
86
common-name:
83
87
environment-variable-name: common_name
84
88
mode: plain
@@ -106,30 +110,30 @@ Usage of openvpn-auth-oauth2:
106
110
listen address for go profiling endpoint (env: CONFIG_DEBUG_LISTEN) (default ":9001")
107
111
--debug.pprof
108
112
Enables go profiling endpoint. This should be never exposed. (env: CONFIG_DEBUG_PPROF)
109
-
--http.assets-path string
113
+
--http.assets-path value
110
114
Custom path to the assets directory. Files in this directory will be served under /assets/ and having an higher priority than the embedded assets. (env: CONFIG_HTTP_ASSETS__PATH)
111
-
--http.baseurl string
112
-
listen addr for client listener (env: CONFIG_HTTP_BASEURL) (default "http://localhost:9000")
115
+
--http.baseurl value
116
+
listen addr for client listener (env: CONFIG_HTTP_BASEURL) (default http://localhost:9000)
113
117
--http.cert string
114
-
Path to tls server certificate (env: CONFIG_HTTP_CERT)
118
+
Path to tls server certificate used for TLS listener. (env: CONFIG_HTTP_CERT)
115
119
--http.check.ipaddr
116
120
Check if client IP in http and VPN is equal (env: CONFIG_HTTP_CHECK_IPADDR)
117
121
--http.enable-proxy-headers
118
122
Use X-Forward-For http header for client ips (env: CONFIG_HTTP_ENABLE__PROXY__HEADERS)
119
123
--http.key string
120
-
Path to tls server key (env: CONFIG_HTTP_KEY)
124
+
Path to tls server key used for TLS listener. (env: CONFIG_HTTP_KEY)
121
125
--http.listen string
122
126
listen addr for client listener (env: CONFIG_HTTP_LISTEN) (default ":9000")
123
127
--http.secret value
124
128
Random generated secret for cookie encryption. Must be 16, 24 or 32 characters. If argument starts with file:// it reads the secret from a file. (env: CONFIG_HTTP_SECRET)
125
-
--http.template string
129
+
--http.template value
126
130
Path to a HTML file which is displayed at the end of the screen. See https://github.com/jkroepke/openvpn-auth-oauth2/wiki/Layout-Customization for more information. (env: CONFIG_HTTP_TEMPLATE)
127
131
--http.tls
128
132
enable TLS listener (env: CONFIG_HTTP_TLS)
129
133
--log.format string
130
134
log format. json or console (env: CONFIG_LOG_FORMAT) (default "console")
131
135
--log.level value
132
-
log level (env: CONFIG_LOG_LEVEL) (default INFO)
136
+
log level. Can be one of: debug, info, warn, error (env: CONFIG_LOG_LEVEL) (default INFO)
133
137
--log.vpn-client-ip
134
138
log IP of VPN client. Useful to have an identifier between OpenVPN and openvpn-auth-oauth2. (env: CONFIG_LOG_VPN__CLIENT__IP) (default true)
135
139
--oauth2.auth-style value
@@ -144,13 +148,13 @@ Usage of openvpn-auth-oauth2:
144
148
oauth2 client private key id. If specified, JWT assertions will be generated with the specific kid header. (env: CONFIG_OAUTH2_CLIENT_PRIVATE__KEY__ID)
145
149
--oauth2.client.secret value
146
150
oauth2 client secret. If argument starts with file:// it reads the secret from a file. (env: CONFIG_OAUTH2_CLIENT_SECRET)
147
-
--oauth2.endpoint.auth string
151
+
--oauth2.endpoint.auth value
148
152
The flag is used to specify a custom OAuth2 authorization endpoint. (env: CONFIG_OAUTH2_ENDPOINT_AUTH)
149
-
--oauth2.endpoint.discovery string
153
+
--oauth2.endpoint.discovery value
150
154
The flag is used to set a custom OAuth2 discovery URL. This URL retrieves the provider's configuration details. (env: CONFIG_OAUTH2_ENDPOINT_DISCOVERY)
151
-
--oauth2.endpoint.token string
155
+
--oauth2.endpoint.token value
152
156
The flag is used to specify a custom OAuth2 token endpoint. (env: CONFIG_OAUTH2_ENDPOINT_TOKEN)
153
-
--oauth2.issuer string
157
+
--oauth2.issuer value
154
158
oauth2 issuer (env: CONFIG_OAUTH2_ISSUER)
155
159
--oauth2.nonce
156
160
If true, a nonce will be defined on the auth URL which is expected inside the token. (env: CONFIG_OAUTH2_NONCE) (default true)
@@ -184,22 +188,28 @@ Usage of openvpn-auth-oauth2:
184
188
validate issuer from oidc discovery (env: CONFIG_OAUTH2_VALIDATE_ISSUER) (default true)
185
189
--oauth2.validate.roles value
186
190
oauth2 required user roles. If multiple role are configured, the user needs to be least in one role. Comma separated list. Example: role1,role2,role3 (env: CONFIG_OAUTH2_VALIDATE_ROLES)
187
-
--openvpn.addr string
188
-
openvpn management interface addr. Must start with unix:// or tcp:// (env: CONFIG_OPENVPN_ADDR) (default "unix:/run/openvpn/server.sock")
191
+
--openvpn.addr value
192
+
openvpn management interface addr. Must start with unix:// or tcp:// (env: CONFIG_OPENVPN_ADDR) (default unix:/run/openvpn/server.sock)
189
193
--openvpn.auth-pending-timeout duration
190
194
How long OpenVPN server wait until user is authenticated (env: CONFIG_OPENVPN_AUTH__PENDING__TIMEOUT) (default 3m0s)
191
195
--openvpn.auth-token-user
192
196
Override the username of a session with the username from the token by using auth-token-user, if the client username is empty (env: CONFIG_OPENVPN_AUTH__TOKEN__USER) (default true)
193
197
--openvpn.bypass.common-names value
194
198
bypass oauth authentication for CNs. Comma separated list. (env: CONFIG_OPENVPN_BYPASS_COMMON__NAMES)
199
+
--openvpn.client-config.enabled
200
+
If true, openvpn-auth-oauth2 will read the CCD directory for additional configuration. This function mimic the client-config-dir directive in OpenVPN. (env: CONFIG_OPENVPN_CLIENT__CONFIG_ENABLED)
201
+
--openvpn.client-config.path value
202
+
Path to the CCD directory. openvpn-auth-oauth2 will look for an file with an .conf suffix and returns the content back. (env: CONFIG_OPENVPN_CLIENT__CONFIG_PATH)
203
+
--openvpn.client-config.token-claim string
204
+
If non-empty, the value of the token claim is used to lookup the configuration file in the CCD directory. If empty, the common name is used. (env: CONFIG_OPENVPN_CLIENT__CONFIG_TOKEN__CLAIM)
Name of the environment variable in the OpenVPN management interface which contains the common name. If username-as-common-name is enabled, this should be set to 'username' to use the username as common name. Other values like 'X509_0_emailAddress' are supported. See https://openvpn.net/community-resources/reference-manual-for-openvpn-2-6/#environmental-variables for more information. (env: CONFIG_OPENVPN_COMMON__NAME_ENVIRONMENT__VARIABLE__NAME) (default "common_name")
197
207
--openvpn.common-name.mode value
198
208
If common names are too long, use md5/sha1 to hash them or omit to skip them. If omit, oauth2.validate.common-name does not work anymore. Values: [plain,omit] (env: CONFIG_OPENVPN_COMMON__NAME_MODE) (default plain)
199
209
--openvpn.override-username
200
210
Requires OpenVPN Server 2.7! If true, openvpn-auth-oauth2 use the override-username command to set the username in OpenVPN connection. This is useful to use real usernames in OpenVPN statistics. The username will be set after client configs are read. Read openvpn man page for limitations of the override-username. (env: CONFIG_OPENVPN_OVERRIDE__USERNAME)
201
-
--openvpn.pass-through.address string
202
-
The address of the pass-through socket. Must start with unix:// or tcp:// (env: CONFIG_OPENVPN_PASS__THROUGH_ADDRESS) (default "unix:/run/openvpn-auth-oauth2/server.sock")
211
+
--openvpn.pass-through.address value
212
+
The address of the pass-through socket. Must start with unix:// or tcp:// (env: CONFIG_OPENVPN_PASS__THROUGH_ADDRESS) (default unix:/run/openvpn-auth-oauth2/server.sock)
203
213
--openvpn.pass-through.enabled
204
214
If true, openvpn-auth-oauth2 will setup a pass-through socket for the OpenVPN management interface. (env: CONFIG_OPENVPN_PASS__THROUGH_ENABLED)
205
215
--openvpn.pass-through.password value
@@ -325,3 +335,7 @@ See [Layout Customization](Layout%20Customization) for more information
325
335
## Non-interactive session refresh
326
336
327
337
See [Non-interactive session refresh](Non-interactive%20session%20refresh) for more information.
338
+
339
+
## Client specific configuration
340
+
341
+
See [Client specific configuration](Client%20specific%20configuration) for more information.
"If true, openvpn-auth-oauth2 will read the CCD directory for additional configuration. This function mimic the client-config-dir directive in OpenVPN.",
0 commit comments