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

chore(gui-client/linux): export all logs, not just app logs #4830

Merged
merged 18 commits into from
May 3, 2024

Conversation

ReactorScram
Copy link
Collaborator

@ReactorScram ReactorScram commented Apr 30, 2024

17ac1eb looks good on both Linux and Windows

Before merging

Edit tasklist title
Beta Give feedback Tasklist Before merging, more options

Delete tasklist

Delete tasklist block?
Are you sure? All relationships in this tasklist will be removed.
  1. Allow GUI to delete IPC service logs
    Options
  2. Test Linux
    Options
  3. Test Windows
    Options

@ReactorScram ReactorScram added the area/tauri_client The Windows and Linux Tauri GUI clients label Apr 30, 2024
@ReactorScram ReactorScram added this to the 05/24 milestone Apr 30, 2024
@ReactorScram ReactorScram self-assigned this Apr 30, 2024
Copy link

vercel bot commented Apr 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
firezone ⬜️ Ignored (Inspect) Visit Preview May 3, 2024 5:35pm

@github-actions github-actions bot added the kind/chore Issues related to repository cleanup or maintenance label Apr 30, 2024
Copy link

github-actions bot commented Apr 30, 2024

Terraform Cloud Plan Output

Plan: 15 to add, 15 to change, 15 to destroy.

Terraform Cloud Plan

Copy link

github-actions bot commented Apr 30, 2024

Performance Test Results

TCP

Test Name Received/s Sent/s Retransmits
direct-tcp-client2server 242.3 MiB (+1%) 244.9 MiB (+1%) 375 (+67%)
direct-tcp-server2client 239.5 MiB (-2%) 240.8 MiB (-2%) 18 (-85%)
relayed-tcp-client2server 240.4 MiB (+8%) 241.1 MiB (+8%) 276 (-13%)
relayed-tcp-server2client 239.8 MiB (+0%) 240.5 MiB (+0%) 458 (-13%)

UDP

Test Name Total/s Jitter Lost
direct-udp-client2server 500.0 MiB (+0%) 0.03ms (-2%) 42.78% (+9%)
direct-udp-server2client 500.0 MiB (+0%) 0.01ms (+51%) 21.84% (-3%)
relayed-udp-client2server 500.0 MiB (-0%) 0.07ms (+100%) 55.20% (+0%)
relayed-udp-server2client 499.8 MiB (-0%) 0.01ms (-61%) 43.51% (+31%)

@ReactorScram ReactorScram changed the base branch from main to chore/log-permissions April 30, 2024 16:26
Comment on lines 10 to 11
# Allow users in `firezone` group to delete log files
LogsDirectoryMode=775
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow users in firezone write bogus log files. I think the threat from that is small, and the only alternative I had in mind is issuing a "ClearLogs" command to the IPC service and waiting for a response, which would add a lot of complexity to both the IPC protocol and the log clearing code.

So we could do that later if we really need.

But since the GUI decides what goes into the zip file in the end, it may not even matter if it can modify the original logs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we don't only use those for the zip right? also for streaming them upstream

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, if we re-enable log uploading.

Depending how tight we want the security sandbox, I was thinking the tunnel process shouldn't be allowed to read the user's files, so it would be safer to let the user read the tunnel's files.


#[cfg(not(debug_assertions))]
/// Does nothing in release mode
pub async fn fault_msleep(&self, _millis: u64) {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fault injection tests weren't used anywhere. I really like the idea but the code is simpler without them. If anyone has a slow hard disk and runs into issues with that, we can deal with it then.

Comment on lines +368 to +371
ctlr_tx
.send(ControllerRequest::ClearLogs)
.await
.context("Failed to send ClearLogs request")?;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The results are not checked anywhere, but the code is exercised.

Ok(())
}

/// Pops up the "Save File" dialog
pub(crate) fn export_logs_inner(ctlr_tx: CtlrTx) -> Result<()> {
let now = chrono::Local::now();
let datetime_string = now.format("%Y_%m_%d-%H-%M");
let stem = PathBuf::from(format!("connlib-{datetime_string}"));
let stem = PathBuf::from(format!("firezone_logs_{datetime_string}"));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the default zip name to match the macOS Client.

I could also make it default to the Documents folder if that's worth it for UX.

@@ -154,7 +154,7 @@ async function clearLogs() {
console.error(e);
})
.finally(() => {
logCountOutput.innerText = "0 files, 0 MB";
countLogs();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the permissions are wrong, the GUI may fail to clear all the logs, but it won't show an error because there's no error handling in this part of the code. In that case, I want the display to be accurate.

@ReactorScram ReactorScram marked this pull request as ready for review April 30, 2024 18:30
Base automatically changed from chore/log-permissions to main May 1, 2024 15:21
Comment on lines 10 to 11
# Allow users in `firezone` group to delete log files
LogsDirectoryMode=775
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but we don't only use those for the zip right? also for streaming them upstream

@ReactorScram ReactorScram added this pull request to the merge queue May 3, 2024
Merged via the queue into main with commit 2f235eb May 3, 2024
136 checks passed
@ReactorScram ReactorScram deleted the chore/linux-zip-all-logs branch May 3, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tauri_client The Windows and Linux Tauri GUI clients kind/chore Issues related to repository cleanup or maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants