From 126e077b014c35f2e37b0e641c5e6f419e9db682 Mon Sep 17 00:00:00 2001 From: bnhf <41088895+bnhf@users.noreply.github.com> Date: Thu, 8 Dec 2022 07:49:57 -0700 Subject: [PATCH 1/2] Make DNS fields optional --- conf/openvpn-server-config.tpl | 4 ++-- models/models.go | 4 ++-- views/ovconfig.html | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/conf/openvpn-server-config.tpl b/conf/openvpn-server-config.tpl index e7f27de..9b80269 100644 --- a/conf/openvpn-server-config.tpl +++ b/conf/openvpn-server-config.tpl @@ -12,8 +12,8 @@ ecdh-curve prime256v1 topology subnet {{ .Server }} ifconfig-pool-persist {{ .IfconfigPoolPersist }} -push "dhcp-option DNS {{ .DNSServerOne }}" -push "dhcp-option DNS {{ .DNSServerTwo }}" +{{ .DNSServerOne }}" +{{ .DNSServerTwo }}" keepalive {{ .Keepalive }} remote-cert-tls client diff --git a/models/models.go b/models/models.go index 2b69ebe..214ba7e 100644 --- a/models/models.go +++ b/models/models.go @@ -99,8 +99,8 @@ func createDefaultOVConfig() { Dev: "tap0", Port: 1194, Proto: "udp", - DNSServerOne: "8.8.8.8", - DNSServerTwo: "8.8.4.4", + DNSServerOne: "# push \"dhcp-option DNS 8.8.8.8\"", + DNSServerTwo: "# push \"dhcp-option DNS 8.8.4.4\"", Cipher: "AES-256-GCM", Auth: "SHA256", Dh: "none", diff --git a/views/ovconfig.html b/views/ovconfig.html index 6d0b13c..9dc2fb7 100644 --- a/views/ovconfig.html +++ b/views/ovconfig.html @@ -42,17 +42,17 @@

Edit configuration

- + - Enter the first DNS server + Uncomment if you want to push a DNS server to the client -- primarily for TAP clients (can be used for comments or left empty as well)
- + - Enter the second DNS server + Uncomment if you want to push a DNS server to the client -- primarily for TAP clients (can be used for somments or left empty as well)
From b2df6d474b5090dce2297440f774f7df803eeba9 Mon Sep 17 00:00:00 2001 From: bnhf <41088895+bnhf@users.noreply.github.com> Date: Thu, 8 Dec 2022 08:02:49 -0700 Subject: [PATCH 2/2] Update ovconfig.html --- views/ovconfig.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/ovconfig.html b/views/ovconfig.html index 9dc2fb7..2af0b16 100644 --- a/views/ovconfig.html +++ b/views/ovconfig.html @@ -52,7 +52,7 @@

Edit configuration

- Uncomment if you want to push a DNS server to the client -- primarily for TAP clients (can be used for somments or left empty as well) + Uncomment if you want to push a DNS server to the client -- primarily for TAP clients (can be used for comments or left empty as well)