Skip to content

Include network interface details in debug logs#1471

Merged
cghague merged 3 commits intomasterfrom
1432-include-high-level-network-details-in-the-debug-logs
Jul 3, 2023
Merged

Include network interface details in debug logs#1471
cghague merged 3 commits intomasterfrom
1432-include-high-level-network-details-in-the-debug-logs

Conversation

@cghague
Copy link
Contributor

@cghague cghague commented Jun 28, 2023

Resolves #1432.

This change adds a new section to the debug logs listing all available network interfaces, including popular VPNs, virtual network devices, USB adapters, and so on, and their current active state:

Network interfaces:
  eth0 (down)
  lo0 (unknown)
  wlan0 (up)
  tailscale0 (up)
  wg0 (down)

This addition will be helpful for support purposes, as we can see at a glance whether the user is connecting over something other than the onboard Ethernet.

Why not dump the output of ip or ifconfig?

Users may consider details of their network configuration to be sensitive. This conservative approach provides the most helpful information while ensuring we don't accidentally leak sensitive information.

Why not parse the output of ip or ifconfig?

I opted to use /sys/class/net rather than directly parsing the output of ip or ifconfig. The rationale for this decision is that ifconfig is deprecated, and the output of ip link show is not guaranteed. The /sys/class/net structure should be more resilient.
Review on CodeApprove

@cghague cghague requested a review from mtlynch June 28, 2023 19:56
Copy link
Contributor

@mtlynch mtlynch left a comment

Choose a reason for hiding this comment

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

Automated comment from CodeApprove ➜

⏳ Approval Pending (1 unresolved comments)
Approval will be granted automatically when all comments are resolved

LGTM, thanks!


In: debian-pkg/opt/tinypilot-privileged/scripts/collect-debug-logs:

> Line 116
  readonly INTERFACES="/sys/class/net"

Can we clarify the naming of INTERFACES and interface? I was expecting INTERFACES to be an array and interface to be an item in the array.

Suggest:

  • INTERFACES -> INTERFACES_ROOT
  • interface -> interface_path

👀 @cghague it's your turn please take a look

@cghague cghague enabled auto-merge (squash) July 3, 2023 15:16
Copy link
Contributor Author

@cghague cghague left a comment

Choose a reason for hiding this comment

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

Automated comment from CodeApprove ➜

In: debian-pkg/opt/tinypilot-privileged/scripts/collect-debug-logs:
Resolved

Copy link
Contributor

@mtlynch mtlynch left a comment

Choose a reason for hiding this comment

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

Automated comment from CodeApprove ➜

Approved: I have approved this change on CodeApprove and all of my comments have been resolved.

@cghague cghague merged commit 1058494 into master Jul 3, 2023
@cghague cghague deleted the 1432-include-high-level-network-details-in-the-debug-logs branch July 3, 2023 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include high level network details in the debug logs

2 participants