diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2020-11-17 11:09:35 +0100 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2020-11-17 11:09:35 +0100 |
| commit | 6d95d36bb37e73e65f7b4950993dc3e42d447a5c (patch) | |
| tree | ee2d4b9f0de9cd08615c396f7157baa603e9194e /gui/src/main | |
| parent | 765f777dd4399b334fe6641e5d427d379826501a (diff) | |
| parent | 6332e991b2bfaf334df03d93d5bd20df06ae699f (diff) | |
| download | mullvadvpn-6d95d36bb37e73e65f7b4950993dc3e42d447a5c.tar.xz mullvadvpn-6d95d36bb37e73e65f7b4950993dc3e42d447a5c.zip | |
Merge branch 'custom-dns-ui'
Diffstat (limited to 'gui/src/main')
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 13 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index 130651c200..c7f4ce8608 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -48,6 +48,7 @@ import { ProxySettings, VoucherResponse, TunnelProtocol, + IDnsOptions, } from '../shared/daemon-rpc-types'; import * as managementInterface from './management_interface/management_interface_grpc_pb'; @@ -452,6 +453,14 @@ export class DaemonRpc { }; } + public async setDnsOptions(dns: IDnsOptions): Promise<void> { + const dnsOptions = new grpcTypes.DnsOptions(); + dnsOptions.setCustom(dns.custom); + dnsOptions.setAddressesList(dns.addresses); + + await this.call<grpcTypes.DnsOptions, Empty>(this.client.setDnsOptions, dnsOptions); + } + public async verifyWireguardKey(): Promise<boolean> { const response = await this.callEmpty<BoolValue>(this.client.verifyWireguardKey); return response.getValue(); @@ -1029,6 +1038,10 @@ function convertFromTunnelOptions(tunnelOptions: grpcTypes.TunnelOptions.AsObjec generic: { enableIpv6: tunnelOptions.generic!.enableIpv6, }, + dns: { + custom: tunnelOptions.dnsOptions?.custom ?? false, + addresses: tunnelOptions.dnsOptions?.addressesList ?? [], + }, }; } diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 514fa4b4e8..d780e8e128 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -15,6 +15,7 @@ import { DaemonEvent, IAccountData, IAppVersionInfo, + IDnsOptions, ILocation, IRelayList, ISettings, @@ -137,6 +138,10 @@ class ApplicationMain { wireguard: { mtu: undefined, }, + dns: { + custom: false, + addresses: [], + }, }, }; private guiSettings = new GuiSettings(); @@ -984,6 +989,9 @@ class ApplicationMain { IpcMainEventChannel.settings.handleUpdateBridgeSettings((bridgeSettings: BridgeSettings) => { return this.daemonRpc.setBridgeSettings(bridgeSettings); }); + IpcMainEventChannel.settings.handleDnsOptions((dns: IDnsOptions) => { + return this.daemonRpc.setDnsOptions(dns); + }); IpcMainEventChannel.autoStart.handleSet((autoStart: boolean) => { return this.setAutoStart(autoStart); }); |
