diff options
author | Kim Hagen <kim@sentrium.io> | 2021-09-03 04:31:36 -0500 |
---|---|---|
committer | Kim Hagen <kim@sentrium.io> | 2021-09-03 04:31:36 -0500 |
commit | cfebb0b01c37e92503aeb88bca42fa18f6927814 (patch) | |
tree | 6b9952f53518432e9d3b9abe8e77435410dc641f | |
parent | 2a27f35ea595a86a37fce093574c015dd7add2d9 (diff) | |
download | vyos-1x-cfebb0b01c37e92503aeb88bca42fa18f6927814.tar.gz vyos-1x-cfebb0b01c37e92503aeb88bca42fa18f6927814.zip |
fix configure error if 2fa is defined but no option is defined
-rw-r--r-- | data/templates/openvpn/server.conf.tmpl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/data/templates/openvpn/server.conf.tmpl b/data/templates/openvpn/server.conf.tmpl index 1348912b3..679c25dd8 100644 --- a/data/templates/openvpn/server.conf.tmpl +++ b/data/templates/openvpn/server.conf.tmpl @@ -127,13 +127,15 @@ push "dhcp-option DNS6 {{ nameserver }}" {% if server.domain_name is defined and server.domain_name is not none %} push "dhcp-option DOMAIN {{ server.domain_name }}" {% endif %} -{% if server['2fa']['totp'] is defined and server['2fa']['totp'] is not none %} +{% if server['2fa'] is defined and server['2fa'] is not none %} +{% if server['2fa']['totp'] is defined and server['2fa']['totp'] is not none %} plugin "/usr/lib/x86_64-linux-gnu/openvpn/plugins/openvpn-otp.so" "otp_secrets=/config/auth/openvpn/{{ ifname }}-otp-secrets otp_slop= {{- server['2fa']['totp']['slop']|default(180) }} totp_t0= {{- server['2fa']['totp']['t0']|default(0) }} totp_step= {{- server['2fa']['totp']['step']|default(30) }} totp_digits= {{- server['2fa']['totp']['digits']|default(6)}} password_is_cr= {%-if server['2fa']['totp']['challenge']|default('enable') == 'enable' %}1{% else %}0{% endif %}" +{% endif %} {% endif %} {% endif %} {% else %} |