Skip to content

Commit

Permalink
feat(auth_gen_token): support for auth-gen-token
Browse files Browse the repository at this point in the history
Server config can now have auth-gen-token, which is kinda required for OTP
authentications.
  • Loading branch information
Adrien "ze" Urban committed Sep 6, 2019
1 parent a743093 commit 333edd7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openvpn/files/server.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ management {{ config.management }}
auth-user-pass-verify {{ config.auth_user_pass_verify }}
{%- endif %}

{#- `false is number` and `true is number` both also return true... #}
{%- if config.auth_gen_token is defined
and (config.auth_gen_token|int is sameas (config.auth_gen_token)
or config.auth_gen_token is sameas true) %}
auth-gen-token{% if config.auth_gen_token is not sameas true %} {{ config.auth_gen_token|int }}{% endif %}
{%- endif %}

{%- if config.setenv is defined %}
{%- for setenv in config.setenv %}
setenv {{ setenv }}
Expand Down
3 changes: 3 additions & 0 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ openvpn:
verb: 3
mute: 20
management: 'tunnel 7505'
auth_gen_token: true
# or, a lifetime in seconds:
# auth_gen_token: 604800
myserver3:
daemon:
port: 443
Expand Down

0 comments on commit 333edd7

Please sign in to comment.