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

refactor: TunshellSession ~> TunshellClient #273

Merged
merged 1 commit into from
Aug 23, 2023
Merged

Conversation

de-sh
Copy link
Contributor

@de-sh de-sh commented Aug 23, 2023

Closes #

Changes

  • Rename TunshellSession to TunshellClient
  • Create an error type
  • Remove unused _config and echo_stdout
  • Refactor code to improve readabilitiy

Why?

For maintainability

Trials Performed

Start a tunshell session from stage:

  2023-08-23T03:55:35.200529Z  INFO uplink::base::mqtt: Action = Action { device_id: None, action_id: "1457", kind: "process", name: "launch_shell", payload: "{\"encryption\":\"JKyD8e86uifeBdJdf6ZuLM\",\"relay\":\"eu.relay.tunshell.com\",\"session\":\"PyqjSk1RBHKax2Soh6OXPG\"}" }

  2023-08-23T03:55:35.200776Z  INFO uplink::base::bridge: Received action: Action { device_id: None, action_id: "1457", kind: "process", name: "launch_shell", payload: "{\"encryption\":\"JKyD8e86uifeBdJdf6ZuLM\",\"relay\":\"eu.relay.tunshell.com\",\"session\":\"PyqjSk1RBHKax2Soh6OXPG\"}" }

  2023-08-23T03:55:35.200918Z  INFO uplink::base::bridge: Action response = ActionResponse { action_id: "1457", device_id: None, sequence: 0, timestamp: 1692762935200, state: "Received", progress: 0, errors: [], done_response: None }

  2023-08-23T03:55:35.201006Z DEBUG uplink::base::bridge::stream: Sequence number anomaly! [0, 0

  2023-08-23T03:55:35.201043Z TRACE uplink::base::bridge::stream: Flushing stream name: action_status, topic: /tenants/demo/devices/1001/action/status

  2023-08-23T03:55:35.201217Z  INFO uplink::base::bridge: Action response = ActionResponse { action_id: "1457", device_id: None, sequence: 0, timestamp: 1692762935201, state: "ShellSpawned", progress: 90, errors: [], done_response: None }

  2023-08-23T03:55:35.201201Z TRACE uplink::base::serializer: Data received on stream: action_status; message count = 1; batching latency = 0

  2023-08-23T03:55:35.201279Z DEBUG uplink::base::bridge::stream: Sequence number anomaly! [0, 0

  2023-08-23T03:55:35.201317Z TRACE uplink::base::bridge::stream: Flushing stream name: action_status, topic: /tenants/demo/devices/1001/action/status

  2023-08-23T03:55:35.201331Z DEBUG uplink::base::serializer: publishing on /tenants/demo/devices/1001/action/status with size = 105

  2023-08-23T03:55:35.201394Z TRACE uplink::base::serializer: Data received on stream: action_status; message count = 1; batching latency = 0

  2023-08-23T03:55:35.201421Z DEBUG uplink::base::serializer: publishing on /tenants/demo/devices/1001/action/status with size = 110

  2023-08-23T03:55:35.201551Z DEBUG uplink::base::mqtt: Outgoing = Publish(5)

Connecting to relay server...
  2023-08-23T03:55:35.201643Z DEBUG uplink::base::mqtt: Outgoing = Publish(6)

  2023-08-23T03:55:35.321139Z DEBUG uplink::base::mqtt: Incoming = PubAck(PubAck { pkid: 5 })

  2023-08-23T03:55:35.321175Z DEBUG uplink::base::mqtt: Incoming = PubAck(PubAck { pkid: 6 })

Waiting for peer to join...

image

@de-sh de-sh merged commit a586c1d into main Aug 23, 2023
2 checks passed
@de-sh de-sh deleted the tunshell-refactor branch August 23, 2023 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant