Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identity on off cmdline #323

Merged
merged 31 commits into from
Apr 8, 2021
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
75297f1
identity onoff cmd function
mary-dcouto Mar 1, 2021
b99b9bc
identity on off function
mary-dcouto Mar 2, 2021
8265e3c
set loglevel command line option
mary-dcouto Mar 3, 2021
00de956
notify the UI through events channel
mary-dcouto Mar 5, 2021
343a52e
sent notify message to UI and monitor for loglevel
mary-dcouto Mar 8, 2021
d176672
notify ui about identity changes
mary-dcouto Mar 8, 2021
2de56dd
display proper error message
mary-dcouto Mar 9, 2021
6548984
adding feedback option to the cmd line
mary-dcouto Mar 10, 2021
5198f40
updainge the version
mary-dcouto Mar 11, 2021
b25be12
Merge branch 'main' into identity-onOff-cmdline
mary-dcouto Mar 16, 2021
ecdb230
update version
mary-dcouto Mar 16, 2021
74dbf43
fixing build errors after merge
mary-dcouto Mar 19, 2021
e7288b8
Merge branch 'main' into identity-onOff-cmdline
mary-dcouto Mar 26, 2021
e2e6577
revering the formatting changes
mary-dcouto Mar 26, 2021
b083bd4
Merge branch 'main' into identity-onOff-cmdline
mary-dcouto Apr 5, 2021
0f6e179
merge origin/main to identity-onOff-cmdline
dovholuknf Apr 6, 2021
c1d3b3d
one big commit - nothing but go fmt ./...
dovholuknf Apr 6, 2021
0273259
Merge pull request #344 from openziti/identity-onOff-cmdline-fmt
mary-dcouto Apr 7, 2021
6ebc4d1
remove ownIntercept from the list services option
mary-dcouto Apr 7, 2021
3fa72ad
updating version
mary-dcouto Apr 7, 2021
9c4d129
Fix the search for service query
actieve Apr 7, 2021
5a0bc73
fixing code review comments
mary-dcouto Apr 7, 2021
d73d66a
initial stab at chunking nrpt rules
dovholuknf Apr 7, 2021
4b18db7
make sure we add the final chunk of rules to the NRPT. also update th…
dovholuknf Apr 7, 2021
f757977
fix two bugs - first don't add IPs to NRPT. dispatch service updates …
dovholuknf Apr 7, 2021
6847519
Merge remote-tracking branch 'origin/issuefix-346' into issue-349-chu…
dovholuknf Apr 7, 2021
5a46877
output the NRPT policy/rule on feedback
dovholuknf Apr 7, 2021
d9a55ff
update release-notes
dovholuknf Apr 7, 2021
8ec6cb1
fix race condition at startup
dovholuknf Apr 8, 2021
cc3220d
try to fix the off by one issue
dovholuknf Apr 8, 2021
d8cd6c2
Merge pull request #350 from openziti/issue-349-chunk-nrpt-rules
dovholuknf Apr 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions DesktopEdge/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ async private void MainWindow_Loaded(object sender, RoutedEventArgs e) {
serviceClient.OnMetricsEvent += ServiceClient_OnMetricsEvent;
serviceClient.OnServiceEvent += ServiceClient_OnServiceEvent;
serviceClient.OnTunnelStatusEvent += ServiceClient_OnTunnelStatusEvent;
serviceClient.OnLogLevelEvent += ServiceClient_OnLogLevelEvent;
Application.Current.Properties.Add("ServiceClient", serviceClient);

monitorClient = new MonitorClient();
Expand Down Expand Up @@ -516,6 +517,7 @@ private void ServiceClient_OnIdentityEvent(object sender, IdentityEvent e) {
found.Name = zid.Name;
found.ControllerUrl = zid.ControllerUrl;
found.IsEnabled = zid.IsEnabled;
LoadIdentities(true);
return;
}
} else {
Expand Down Expand Up @@ -610,6 +612,20 @@ private void ServiceClient_OnTunnelStatusEvent(object sender, TunnelStatusEvent
});
}

private void ServiceClient_OnLogLevelEvent(object sender, LogLevelEvent e) {
if (e.LogLevel != null) {
SetLogLevel_monitor(e.LogLevel);
this.Dispatcher.Invoke(() => {
this.MainMenu.LogLevel = e.LogLevel;
Ziti.Desktop.Edge.Utils.UIUtils.SetLogLevel(e.LogLevel);
});
}
}

async private void SetLogLevel_monitor(string loglevel) {
await monitorClient.SetLogLevelAsync(loglevel);
}

private void IdentityForgotten(ZitiIdentity forgotten) {
ZitiIdentity idToRemove = null;
foreach (var id in identities) {
Expand Down
6 changes: 6 additions & 0 deletions ZitiDesktopEdge.Client/DataStructures/DataStructures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,12 @@ public class IdentityEvent : ActionEvent
{
public Identity Id { get; set; }
}

public class LogLevelEvent : ActionEvent
{
public string LogLevel { get; set; }
}


public class MonitorServiceStatusEvent : SvcResponse {
public string Status { get; set; }
Expand Down
13 changes: 13 additions & 0 deletions ZitiDesktopEdge.Client/ServiceClient/DataClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class DataClient : AbstractClient {
public event EventHandler<List<Identity>> OnMetricsEvent;
public event EventHandler<IdentityEvent> OnIdentityEvent;
public event EventHandler<ServiceEvent> OnServiceEvent;
public event EventHandler<LogLevelEvent> OnLogLevelEvent;

protected override void ShutdownEvent(StatusEvent e) {
Logger.Debug("Clean shutdown detected from ziti");
Expand All @@ -55,6 +56,11 @@ protected virtual void IdentityEvent(IdentityEvent e) {
protected virtual void ServiceEvent(ServiceEvent e) {
OnServiceEvent?.Invoke(this, e);
}

protected virtual void LogLevelEvent(LogLevelEvent e) {
OnLogLevelEvent?.Invoke(this, e);
}


protected override void ClientConnected(object e) {
base.ClientConnected(e);
Expand Down Expand Up @@ -235,6 +241,13 @@ protected override void ProcessLine(string line) {
ServiceEvent(svc);
}
break;
case "logLevel":
LogLevelEvent ll = serializer.Deserialize<LogLevelEvent>(jsonReader);

if (ll != null) {
LogLevelEvent(ll);
}
break;
case "shutdown":
Logger.Debug("shutdown message received");
var se = new StatusEvent();
Expand Down
14 changes: 14 additions & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Release 1.8.3

## What's New
* [#322](https://github.com/openziti/desktop-edge-win/issues/322) Ability to toggle identity, set loglevel and generate feedback zip file from cmd line

## Other changes:
* none

## Bugs fixed:
* none

## Dependency Updates
* none

# Release 1.8.2

## What's New
Expand Down
133 changes: 0 additions & 133 deletions service/ziti-tunnel/cli/cmdlineClientFunctions.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ var GET_STATUS = dto.CommandMsg{
Function: "Status",
}

var ONOFF_IDENTITY = dto.CommandMsg{
Function: "IdentityOnOff",
}

var SET_LOGLEVEL = dto.CommandMsg{
Function: "SetLogLevel",
}

var NOTIFY_LOGLEVEL_UI_MONITOR = dto.CommandMsg{
Function: "NotifyLogLevelUIAndUpdateService",
}

var NOTIFY_IDENTITY_UI = dto.CommandMsg{
Function: "NotifyIdentityUI",
}

var monitorIpcPipe = `\\.\pipe\OpenZiti\ziti-monitor\ipc`

var templateIdentity = `{{printf "%40s" "Name"}} | {{printf "%41s" "FingerPrint"}} | {{printf "%6s" "Active"}} | {{printf "%30s" "Config"}} | {{"Status"}}
{{range .}}{{printf "%40s" .Name}} | {{printf "%41s" .FingerPrint}} | {{printf "%6t" .Active}} | {{printf "%30s" .Config}} | {{.Status}}
{{end}}`
Expand Down
Loading