Skip to content

Commit

Permalink
Merge pull request #13 from bnhf/develop-2
Browse files Browse the repository at this point in the history
Make DNS server fields optional and flexible
  • Loading branch information
bnhf authored Dec 8, 2022
2 parents 8f45fd7 + b2df6d4 commit 60e721d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions conf/openvpn-server-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions views/ovconfig.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,17 @@ <h3 class="box-title">Edit configuration</h3>
</div>

<div class="form-group">
<label for="name">DNSServerOne</label>
<label for="name">DNS Server #1 (optional)</label>
<input type="text" class="form-control" name="DNSServerOne" id="DNSServerOne" placeholder="Enter the first DNS server"
value="{{ .Settings.DNSServerOne }}">
<span class="help-block">Enter the first DNS server</span>
<span class="help-block">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)</span>
</div>

<div class="form-group">
<label for="name">DNSServerTwo</label>
<label for="name">DNS Server #2 (optional)</label>
<input type="text" class="form-control" name="DNSServerTwo" id="DNSServerTwo" placeholder="Enter the second DNS server"
value="{{ .Settings.DNSServerTwo }}">
<span class="help-block">Enter the second DNS server</span>
<span class="help-block">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)</span>
</div>

<div class="form-group">
Expand Down

0 comments on commit 60e721d

Please sign in to comment.