merge origin/main and bump tsdk

This commit is contained in:
dovholuknf
2021-02-23 19:01:52 -05:00
14 changed files with 279 additions and 47 deletions
+3 -3
View File
@@ -50,6 +50,6 @@ using System.Windows;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.7.6.0")]
[assembly: AssemblyVersion("1.7.6.0")]
[assembly: AssemblyFileVersion("1.7.6.0")]
// [assembly: AssemblyVersion("1.7.8.0")]
[assembly: AssemblyVersion("1.7.8.0")]
[assembly: AssemblyFileVersion("1.7.8.0")]
+8 -2
View File
@@ -22,10 +22,10 @@
<ROW Property="CTRLS" Value="2"/>
<ROW Property="Manufacturer" Value="NetFoundry, Inc."/>
<ROW Property="MsiLogging" MultiBuildValue="AnyCPU_Release:vp"/>
<ROW Property="ProductCode" Value="1033:{B2CCD650-A02F-469E-A7A4-B816679F3128} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{CBC8B589-1E39-42E2-8AAC-8EECC679D7CA} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Ziti Desktop Edge"/>
<ROW Property="ProductVersion" Value="1.7.6" Type="32"/>
<ROW Property="ProductVersion" Value="1.7.8" Type="32"/>
<ROW Property="REBOOT" MultiBuildValue="AnyCPU_Release:Suppress"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
<ROW Property="UpgradeCode" Value="{CB7E173A-663D-4A23-BB22-D1E8D885C2F3}"/>
@@ -50,10 +50,12 @@
<ROW Component="AI_ExePath" ComponentId="{F9B15650-F37D-424A-B159-B54B9F36EC2C}" Directory_="APPDIR" Attributes="260" KeyPath="AI_ExePath"/>
<ROW Component="APPDIR" ComponentId="{B3881A25-6890-4920-9F69-CACA0C9ABA63}" Directory_="APPDIR" Attributes="0"/>
<ROW Component="App.config" ComponentId="{27FAD46C-8379-4680-8506-4BCBA5A012E8}" Directory_="APPDIR" Attributes="0" KeyPath="ZitiDesktopEdge.exe.config" Type="0"/>
<ROW Component="DnsClient.dll" ComponentId="{8C789D0B-0EB7-4172-ADB8-11D52C22488C}" Directory_="APPDIR" Attributes="0" KeyPath="DnsClient.dll"/>
<ROW Component="NLog.dll" ComponentId="{384D38B5-A4A0-4BC6-886A-82153E2687ED}" Directory_="APPDIR" Attributes="0" KeyPath="NLog.dll"/>
<ROW Component="Newtonsoft.Json.dll" ComponentId="{5D7B59CE-A1B5-4EE9-842E-0206408F8674}" Directory_="APPDIR" Attributes="0" KeyPath="Newtonsoft.Json.dll"/>
<ROW Component="ProductInformation" ComponentId="{4FC3A7CB-D334-466A-A919-E6A237EF4443}" Directory_="APPDIR" Attributes="260" KeyPath="Version"/>
<ROW Component="SHORTCUTDIR" ComponentId="{3A88A759-A3FE-443F-A6D9-0D97BA424B2E}" Directory_="SHORTCUTDIR" Attributes="0"/>
<ROW Component="System.Buffers.dll" ComponentId="{337A28A5-0EA0-420C-8CC3-84FBC3EF7BE2}" Directory_="APPDIR" Attributes="0" KeyPath="System.Buffers.dll"/>
<ROW Component="WpfMouseWheelLib.dll" ComponentId="{8CFD4E8C-7E6E-4797-A38A-02B7794BFF5F}" Directory_="APPDIR" Attributes="0" KeyPath="WpfMouseWheelLib.dll"/>
<ROW Component="ZitiDesktopEdge.Client.dll" ComponentId="{7834CBFB-BA9A-4337-9603-507C71135B01}" Directory_="APPDIR" Attributes="0" KeyPath="ZitiDesktopEdge.Client.dll"/>
<ROW Component="ZitiDesktopEdge.exe" ComponentId="{FDDCF14B-4FAF-469F-810E-0877A0DD5F3B}" Directory_="APPDIR" Attributes="0" KeyPath="ZitiDesktopEdge.exe"/>
@@ -87,6 +89,8 @@
<ROW File="ZitiDesktopEdgelog.config" Component_="App.config" FileName="ZITIDE~2.CON|ZitiDesktopEdge-log.config" Attributes="0" SourcePath="..\DesktopEdge\bin\Release\ZitiDesktopEdge-log.config" SelfReg="false"/>
<ROW File="wintun.dll" Component_="wintun.dll" FileName="wintun.dll" Attributes="0" SourcePath="..\service\wintun.dll" SelfReg="false"/>
<ROW File="WpfMouseWheelLib.dll" Component_="WpfMouseWheelLib.dll" FileName="WPFMOU~1.DLL|WpfMouseWheelLib.dll" Attributes="0" SourcePath="..\DesktopEdge\bin\Release\WpfMouseWheelLib.dll" SelfReg="false"/>
<ROW File="DnsClient.dll" Component_="DnsClient.dll" FileName="DNSCLI~1.DLL|DnsClient.dll" Attributes="0" SourcePath="..\ZitiUpdateService\bin\Release\DnsClient.dll" SelfReg="false"/>
<ROW File="System.Buffers.dll" Component_="System.Buffers.dll" FileName="SYSTEM~1.DLL|System.Buffers.dll" Attributes="0" SourcePath="..\ZitiUpdateService\bin\Release\System.Buffers.dll" SelfReg="false"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.AiPersistentDataComponent">
<ROW PersistentRow="ZitiUpdateServicelog.config" Type="0" Condition="OLDPRODUCTS"/>
@@ -248,6 +252,8 @@
<ROW Feature_="MainFeature" Component_="NLog.dll"/>
<ROW Feature_="MainFeature" Component_="wintun.dll"/>
<ROW Feature_="MainFeature" Component_="WpfMouseWheelLib.dll"/>
<ROW Feature_="MainFeature" Component_="DnsClient.dll"/>
<ROW Feature_="MainFeature" Component_="System.Buffers.dll"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiIconsComponent">
<ROW Name="ziti.exe" SourcePath="ziti.ico" Index="0"/>
@@ -227,12 +227,12 @@ namespace ZitiDesktopEdge.ServiceClient {
return respAsString;
} catch (IOException ioe) {
//almost certainly a problem with the pipe
Logger.Debug("io error in read: " + ioe.Message);
Logger.Error(ioe, "io error in read: " + ioe.Message);
ClientDisconnected(null);
throw ioe;
} catch (Exception ee) {
//almost certainly a problem with the pipe
Logger.Debug("unexpected error in read: " + ee.Message);
Logger.Error(ee, "unexpected error in read: " + ee.Message);
ClientDisconnected(null);
throw ee;
}
+3 -3
View File
@@ -30,6 +30,6 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.7.6.0")]
[assembly: AssemblyVersion("1.7.6.0")]
[assembly: AssemblyFileVersion("1.7.6.0")]
// [assembly: AssemblyVersion("1.7.8.0")]
[assembly: AssemblyVersion("1.7.8.0")]
[assembly: AssemblyFileVersion("1.7.8.0")]
+74 -3
View File
@@ -17,6 +17,8 @@ using ZitiDesktopEdge.Utility;
using NLog;
using Newtonsoft.Json;
using DnsClient;
using System.Net;
namespace ZitiUpdateService {
public partial class UpdateService : ServiceBase {
@@ -55,6 +57,9 @@ namespace ZitiUpdateService {
Task eventServer = null;
checkers.UpdateCheck check = null;
private Timer dnsProbeTimer = new Timer();
private IPAddress dnsIpAddress = null;
public UpdateService() {
InitializeComponent();
@@ -355,6 +360,9 @@ namespace ZitiUpdateService {
AccessUtils.GrantAccessToFile(Path.Combine(exeLocation, "ZitiDesktopEdge.exe.config")); //allow anyone to change the config file
AccessUtils.GrantAccessToFile(Path.Combine(exeLocation, "ZitiDesktopEdge-log.config")); //allow anyone to change the log file config
dnsProbeTimer.Elapsed += DnsProbe_Elapsed;
dnsProbeTimer.Interval = dnsProbeIntervalInSeconds * 1000;
Logger.Info("starting ipc server");
ipcServer = svr.startIpcServerAsync(onIpcClientAsync);
Logger.Info("starting events server");
@@ -371,7 +379,58 @@ namespace ZitiUpdateService {
base.OnStart(args);
}
async private Task onEventsClientAsync(StreamWriter writer) {
IPAddress lh = IPAddress.Parse("127.0.0.1"); //expected result
int dnsProbeFailCount = 0;
int dnsProbeIntervalInSeconds = 15;
bool dnsProbeStarted = false;
private void DnsProbe_Elapsed(object sender, ElapsedEventArgs e) {
if (dnsProbeStarted) return; //skip out if it's already going...
dnsProbeStarted = true;
Logger.Trace("dns probe started");
try {
if (dnsIpAddress != null) {
DnsQuestion q = new DnsQuestion("dew-dns-probe.openziti.org", QueryType.A);
var dnsEp = new IPEndPoint(dnsIpAddress, 53);
var dnsProbe = new LookupClient(dnsEp);
foreach (DnsClient.Protocol.ARecord arec in dnsProbe.Query(q).AllRecords) {
if (arec.Address.Equals(lh)) {
dnsProbeFailCount = 0;
Logger.Debug("dns probe success");
} else {
dnsProbeFailCount++;
logDnsProbeFailure(null);
}
}
}
} catch(Exception dnse) {
//don't really care but it probably means a timeout happened. but might as well log a trace error anyway...
//it's expected that this is due to the service shutting down...
dnsProbeFailCount++;
logDnsProbeFailure(dnse);
}
dnsProbeStarted = false;
}
private void logDnsProbeFailure(Exception e) {
bool logit = false;
if (dnsProbeFailCount <= 4) {
logit = true;
} else {
//else log it every 5 minutes...
logit = dnsProbeFailCount % (5 * 60 / dnsProbeIntervalInSeconds) == 0;
}
if (logit) {
if (e != null) {
Logger.Warn(e, "dns probe failed due to error. This has happened {0} times", dnsProbeFailCount);
} else {
Logger.Warn("dns probe failed. This has happened {0} times", dnsProbeFailCount);
}
}
}
async private Task onEventsClientAsync(StreamWriter writer) {
Logger.Info("a new events client was connected");
//reset to release stream
//initial status when connecting the event stream
@@ -711,18 +770,30 @@ namespace ZitiUpdateService {
EventRegistry.SendEventToConsumers(status);
}
private static void Svc_OnTunnelStatusEvent(object sender, TunnelStatusEvent e) {
private void Svc_OnTunnelStatusEvent(object sender, TunnelStatusEvent e) {
string dns = e?.Status?.IpInfo?.DNS;
string version = e?.Status?.ServiceVersion.Version;
string op = e?.Op;
Logger.Info($"Operation {op}. running dns: {dns} at version {version}");
try {
dnsIpAddress = IPAddress.Parse(dns);
} catch {
//ignore it
}
}
private static void Svc_OnClientConnected(object sender, object e) {
private void Svc_OnClientConnected(object sender, object e) {
Logger.Info("successfully connected to service");
if (!dnsProbeTimer.Enabled) {
dnsProbeTimer.Enabled = true;
dnsProbeTimer.Start();
Logger.Info("DNS Probe enabled");
}
}
private void Svc_OnClientDisconnected(object sender, object e) {
//dnsProbeTimer.Stop();
DataClient svc = (DataClient)sender;
if (svc.CleanShutdown) {
//then this is fine and expected - the service is shutting down
@@ -76,6 +76,9 @@
<OutputPath>bin\Releases\</OutputPath>
</PropertyGroup>
<ItemGroup>
<Reference Include="DnsClient, Version=1.3.2.0, Culture=neutral, PublicKeyToken=4574bb5573c51424, processorArchitecture=MSIL">
<HintPath>..\packages\DnsClient.1.3.2\lib\net471\DnsClient.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
@@ -83,6 +86,9 @@
<HintPath>..\packages\NLog.4.7.6\lib\net45\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
@@ -15,7 +15,6 @@ namespace ZitiUpdateService.checkers {
string url;
string downloadUrl = null;
string downloadFileName = null;
string currentResponse = null;
Version nextVersion = null;
public GithubCheck(string url) {
+2
View File
@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DnsClient" version="1.3.2" targetFramework="net48" />
<package id="Microsoft.PowerShell.5.ReferenceAssemblies" version="1.1.0" targetFramework="net48" />
<package id="Newtonsoft.Json" version="12.0.3" targetFramework="net48" />
<package id="NLog" version="4.7.6" targetFramework="net48" />
<package id="System.Buffers" version="4.4.0" targetFramework="net48" />
</packages>
+32
View File
@@ -1,3 +1,34 @@
# Release 1.7.9
## What's New
* nothing
## Other changes:
* none
## Bugs fixed:
* [#310](https://github.com/openziti/desktop-edge-win/pull/310) Restore identities moved by Windows after Windows system update
## Dependency Updates
* Tunneler SDK to v0.8.21/CSDK 0.20.13
# Release 1.7.8
## What's New
* a new DNS probe record was added to the DNS server to allow DNS-related testing
* ziti-monitor service now probes the DNS server for diagnostic reasons
* added code to check upgrade status - only useful when the ziti-monitor service is not running
## Other changes:
* minor logging updates
## Bugs fixed:
* fixed an issue with hosting connections after channel failure [CSDK #233](https://github.com/openziti/ziti-sdk-c/pull/233)
* fixed a UI issue when no identites existed
## Dependency Updates
* Tunneler SDK to v0.8.17/CSDK 0.20.12
# Release 1.7.7
## What's New
@@ -11,6 +42,7 @@
## Dependency Updates
* Tunneler SDK to v0.8.15
# Release 1.7.6
## What's New
+9
View File
@@ -274,6 +274,15 @@ func DnsInit(tun api.DesktopEdgeIface, ip string, maskBits int) {
dnsMgrPrivate.serviceMap = make(map[string]*ctxService)
//DNS.ipMap = make(map[uint32]string)
dnsMgrPrivate.hostnameMap = make(map[string]*ctxIp)
//register the test dns entry:
dnsMgrPrivate.hostnameMap[normalizeDnsName("dew-dns-probe.openziti.org")] = &ctxIp{
//ctx: nil,
ip: net.ParseIP("127.0.0.1"),
//network: "",
dnsEnabled: true,
refCount: 0,
}
dnsip = net.ParseIP(ip).To4()
mask := net.CIDRMask(maskBits, 32)
dnsMgrPrivate.cidr = binary.BigEndian.Uint32(dnsip) & binary.BigEndian.Uint32(mask)
@@ -0,0 +1,101 @@
package service
import (
"errors"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/config"
)
// After System update, the identity files are not getting copied to the config path
// So we are adding a function to scan for identities in the backtup location
func scanForIdentitiesPostWindowsUpdate() error {
srcBackUpPaths := [2]string{"Windows.~BT\\Windows\\System32\\config\\systemprofile\\AppData\\Roaming\\NetFoundry",
"Windows.old\\Windows\\System32\\config\\systemprofile\\AppData\\Roaming\\NetFoundry"}
systemDrivePath := os.Getenv("SystemDrive")
if systemDrivePath == "" {
return nil
}
for _, srcPath := range srcBackUpPaths {
sourcePath := filepath.Join(systemDrivePath, string(os.PathSeparator), srcPath)
_, err := os.Stat(sourcePath)
if err != nil {
log.Debugf("Folder %s does not exist", sourcePath)
continue
}
err = searchAndCopyFilesFromBackup(sourcePath)
if err != nil {
log.Debugf("Copy files from %s failed, %v", sourcePath, err)
}
}
return nil
}
func searchAndCopyFilesFromBackup(srcPath string) error {
err := filepath.Walk(srcPath, copyFilesFromBackUp)
if err != nil {
return err
}
return nil
}
func copyFilesFromBackUp(path string, f os.FileInfo, err error) error {
if !f.IsDir() {
log.Infof("Found: %s", path)
destinationFile := filepath.Join(config.Path(), string(os.PathSeparator), f.Name())
//check if the file is present in the destination folder
_, err := os.Stat(destinationFile)
if err == nil && !strings.Contains(f.Name(), ConfigFileName) {
log.Debugf("File %s is already present in the config path and it is not %s, So not transfering", f.Name(), ConfigFileName)
deleteFile(path)
return nil
}
_, err = copy(path, destinationFile)
if err != nil {
log.Errorf("Error occurred while copying the Windows backup folder %s --> %s %v", f.Name(), destinationFile, err)
return nil
} else {
log.Infof("Found backup file at %s. Restored this file to %s", path, destinationFile)
deleteFile(path)
}
}
return nil
}
func deleteFile(path string) {
log.Infof("Removing file %s", path)
err := os.Remove(path)
if err != nil {
log.Errorf("Error occured while removing the file %s, %v", path, err)
} else {
log.Infof("Removed file %s", path)
}
}
func copy(src, dst string) (int64, error) {
sourceFileStat, err := os.Stat(src)
if err != nil {
return 0, err
}
if !sourceFileStat.Mode().IsRegular() {
return 0, errors.New(fmt.Sprintf("%s is not a regular file", src))
}
source, err := os.Open(src)
if err != nil {
return 0, err
}
defer source.Close()
destination, err := os.Create(dst)
if err != nil {
return 0, err
}
defer destination.Close()
nBytes, err := io.Copy(destination, source)
return nBytes, err
}
+14 -10
View File
@@ -18,12 +18,14 @@
package service
import (
"sync"
"time"
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/dto"
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/util/logging"
"golang.org/x/sys/windows/svc"
"sync"
"time"
)
var Version dto.ServiceVersion
var pipeBase = `\\.\pipe\OpenZiti\ziti\`
@@ -42,7 +44,7 @@ var Debug bool
var TunStarted time.Time
var log = logging.Logger()
var events = newTopic(32)
var events = newTopic(32)
const (
API_VERSION = 1
@@ -60,13 +62,13 @@ const (
cmdsAccepted = svc.AcceptStop | svc.AcceptShutdown | svc.AcceptPauseAndContinue
InformationEvent = 0 //1
ContinueEvent = 0 //2
PauseEvent = 0 //3
InstallEvent = 0 //4
ContinueEvent = 0 //2
PauseEvent = 0 //3
InstallEvent = 0 //4
InterrogateEvent = 0 //5
StopEvent = 0 //6
ShutdownEvent = 0 //7
ErrorEvent = 0 //1000
StopEvent = 0 //6
ShutdownEvent = 0 //7
ErrorEvent = 0 //1000
// This is the name you will use for the NET START command
SvcStartName = "ziti"
@@ -88,7 +90,9 @@ const (
LocalService = "(A;;FA;;;LS)"
NF_GROUP_NAME = "NetFoundry Tunneler Users"
TunName = "ZitiTUN"
TunName = "ZitiTUN"
STATUS_ENROLLED = "enrolled"
ConfigFileName = "config.json"
)
+24 -22
View File
@@ -21,6 +21,14 @@ import (
"bufio"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"path"
"strings"
"time"
"github.com/openziti/desktop-edge-win/service/cziti"
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/config"
"github.com/openziti/desktop-edge-win/service/ziti-tunnel/constants"
@@ -29,13 +37,6 @@ import (
"golang.org/x/sys/windows/registry"
"golang.zx2c4.com/wireguard/tun"
"golang.zx2c4.com/wireguard/windows/tunnel/winipcfg"
"io"
"io/ioutil"
"net"
"os"
"path"
"strings"
"time"
)
type RuntimeState struct {
@@ -58,7 +59,7 @@ func (t *RuntimeState) SaveState() {
_ = os.MkdirAll(config.Path(), 0644)
log.Debugf("backing up config")
backup,err := backupConfig()
backup, err := backupConfig()
if err != nil {
log.Warnf("could not backup config file! %v", err)
} else {
@@ -141,16 +142,16 @@ func (t *RuntimeState) ToStatus(onlyInitialized bool) dto.TunnelStatus {
func (t *RuntimeState) ToMetrics() dto.TunnelStatus {
clean := dto.TunnelStatus{
Identities: make([]*dto.Identity, len(t.ids)),
Identities: make([]*dto.Identity, len(t.ids)),
}
i := 0
for _, id := range t.ids {
AddMetrics(id)
clean.Identities[i] = &dto.Identity{
Name: id.Name,
FingerPrint: id.FingerPrint,
Metrics: id.Metrics,
Name: id.Name,
FingerPrint: id.FingerPrint,
Metrics: id.Metrics,
}
i++
}
@@ -160,7 +161,7 @@ func (t *RuntimeState) ToMetrics() dto.TunnelStatus {
func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int) (net.IP, *tun.Device, error) {
log.Infof("creating TUN device: %s", TunName)
tunDevice, err := tun.CreateTUN(TunName, 64*1024 - 1)
tunDevice, err := tun.CreateTUN(TunName, 64*1024-1)
if err == nil {
t.tun = &tunDevice
tunName, err2 := tunDevice.Name()
@@ -201,7 +202,7 @@ func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int) (net.IP, *tun.Device
return nil, nil, fmt.Errorf("failed to set IP address to %v: (%v)", ip, err)
}
dnsServers := []net.IP{ ip }
dnsServers := []net.IP{ip}
log.Infof("adding DNS servers to TUN: %s", dnsServers)
err = luid.AddDNS(dnsServers)
@@ -217,7 +218,7 @@ func (t *RuntimeState) CreateTun(ipv4 string, ipv4mask int) (net.IP, *tun.Device
log.Infof("TUN dns servers set to: %s", dns)
log.Infof("setting routes for cidr: %s. Next Hop: %s", ipnet.String(), ipnet.IP.String())
err = luid.SetRoutes([]*winipcfg.RouteData{{ Destination: *ipnet, NextHop: ipnet.IP, Metric: 0}})
err = luid.SetRoutes([]*winipcfg.RouteData{{Destination: *ipnet, NextHop: ipnet.IP, Metric: 0}})
if err != nil {
return nil, nil, fmt.Errorf("failed to SetRoutes: (%v)", err)
}
@@ -233,7 +234,7 @@ func (t *RuntimeState) LoadIdentity(id *Id, refreshInterval int) {
}
_, err := os.Stat(id.Path())
if err != nil{
if err != nil {
if os.IsNotExist(err) {
//file does not exist. TODO remove this from the list
} else {
@@ -244,7 +245,7 @@ func (t *RuntimeState) LoadIdentity(id *Id, refreshInterval int) {
log.Infof("loading identity %s[%s]", id.Name, id.FingerPrint)
sc := func(status int){
sc := func(status int) {
log.Infof("status change! %d", status)
id.ControllerVersion = id.CId.Version
@@ -267,7 +268,7 @@ func (t *RuntimeState) LoadIdentity(id *Id, refreshInterval int) {
events.broadcast <- dto.IdentityEvent{
ActionEvent: IDENTITY_ADDED,
Id: id.Identity,
Id: id.Identity,
}
log.Infof("connecting identity completed: %s[%s]", id.Name, id.FingerPrint)
}
@@ -278,6 +279,7 @@ func (t *RuntimeState) LoadIdentity(id *Id, refreshInterval int) {
}
func (t *RuntimeState) LoadConfig() {
scanForIdentitiesPostWindowsUpdate()
err := readConfig(t, config.File())
if err != nil {
err = readConfig(t, config.BackupFile())
@@ -319,7 +321,7 @@ func (t *RuntimeState) scanForOrphanedIdentities(folder string) {
fingerprint := strings.Split(f.Name(), ".")[0]
var found *dto.Identity
for _, sid := range t.state.Identities {
if sid.FingerPrint == fingerprint{
if sid.FingerPrint == fingerprint {
found = sid
break
}
@@ -387,11 +389,11 @@ func readConfig(t *RuntimeState, filename string) error {
return nil
}
func (t *RuntimeState) UpdateIpv4Mask(ipv4mask int){
func (t *RuntimeState) UpdateIpv4Mask(ipv4mask int) {
rts.state.TunIpv4Mask = ipv4mask
rts.SaveState()
}
func (t *RuntimeState) UpdateIpv4(ipv4 string){
func (t *RuntimeState) UpdateIpv4(ipv4 string) {
rts.state.TunIpv4 = ipv4
rts.SaveState()
}
@@ -447,7 +449,7 @@ func (t *RuntimeState) Close() {
t.RemoveZitiTun()
}
func(t *RuntimeState) RemoveZitiTun() {
func (t *RuntimeState) RemoveZitiTun() {
log.Infof("Removing existing interface: %s", TunName)
wt, err := tun.WintunPool.OpenAdapter(TunName)
if err == nil {
+1 -1
View File
@@ -1 +1 @@
1.7.7
1.7.9