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

feat: C daemon #1084

Merged
merged 163 commits into from
Jun 12, 2024
Merged

feat: C daemon #1084

merged 163 commits into from
Jun 12, 2024

Conversation

XavierChanth
Copy link
Member

@XavierChanth XavierChanth commented May 29, 2024

- What I did

  • Feature complete C daemon for an alpha phase:

    • Still some minor, known memory leaks which will be addressed in future PRs
    • Some of these are in the atSDK
  • Missing features:

    • npt_request
    • srv --multi (needed for npt_request)
    • device not showing up in list-devices

- How I did it

- How to verify it

- Description for the changelog
feat: C daemon

- moved 3rdparty/argparse up a level so it could be shared between sshnpd & srv
hey... it's working... cool!
- much easier to not deal with it, and it's not needed for an mvp with sshnpd
doesnt do decrypt correctly...
@XavierChanth XavierChanth changed the title feat [WIP]: C daemon feat: C daemon Jun 12, 2024
@XavierChanth XavierChanth requested review from gkc and cpswan June 12, 2024 15:19
@XavierChanth XavierChanth marked this pull request as ready for review June 12, 2024 15:58
cpswan
cpswan previously approved these changes Jun 12, 2024
@XavierChanth
Copy link
Member Author

Jeremy is doing a manual test, once that is done please merge @JeremyTubongbanua

@XavierChanth
Copy link
Member Author

Once this is merged I will tag c0.1.0

@JeremyTubongbanua
Copy link
Member

JeremyTubongbanua commented Jun 12, 2024

Confirmed working manual test

image

Using v5.3.0 client (@Soccer0) and C Daemon device (@soccer99)

@JeremyTubongbanua JeremyTubongbanua merged commit aadeec9 into trunk Jun 12, 2024
7 checks passed
@JeremyTubongbanua
Copy link
Member

JeremyTubongbanua commented Jun 12, 2024

Some issues I ran into

1. Building C Daemon SSHNPD

Ubuntu installed cmake 3.22 which was not sufficient for our builds, so I had to find a way to install cmake 3.29.

To install cmake 3.29, I used pip by:

sudo apt-get install -y python3-pip
pip install cmake==3.29
pip install -v | grep cmake

# I find `/jeremyvps/.local/lib/python3.10/site-packages/cmake/data/bin` as the bin folder for the cmake binary that pip installed for me

nano ~/.bashrc

# Add line `export PATH="$PATH:/jeremyvps/.local/lib/python3.10/site-packages/cmake/data/bin` to my ~/.bashrc

# Update bash
source ~/.bashrc

cmake --version # Should be 3.29

2. v5.3.0 client-side sshnp key exchange errors

Would run into this error:

v5.3.0 client

./sshnp -f @soccer0 -t @soccer99 -h @rv_eu -i ~/.ssh/id_ed25519 -d vps
2024-06-12 13:38:34.291944 : Sending daemon feature check request
2024-06-12 13:38:34.292038 : Resolving remote username for user session
2024-06-12 13:38:34.714188 : Resolving remote username for tunnel session
2024-06-12 13:38:34.714918 : Fetching host and port from srvd
2024-06-12 13:38:35.814524 : Received host and port from srvd
2024-06-12 13:38:35.814611 : Waiting for daemon feature check response
2024-06-12 13:38:35.814624 : Received daemon feature check response
2024-06-12 13:38:35.816947 : Required daemon features are supported
2024-06-12 13:38:35.949207 : Sending session request to the device daemon
2024-06-12 13:38:36.047653 : Waiting for response from the device daemon
2024-06-12 13:38:36.503629 : Received response from the device daemon
2024-06-12 13:38:36.508431 : Creating connection to socket rendezvous
2024-06-12 13:38:36.633964 : Starting user session
kex_exchange_identification: Connection closed by remote host
Connection closed by 127.0.0.1 port 54167

After a couple of retries, to different rendezvous servers (am, eu, ap), it would work eventually.

Example of it working:

./sshnp -f @soccer0 -t @soccer99 -h @rv_am -i ~/.ssh/id_ed25519 -d vps
2024-06-12 13:43:13.994642 : Sending daemon feature check request
2024-06-12 13:43:13.994709 : Resolving remote username for user session
2024-06-12 13:43:14.404192 : Resolving remote username for tunnel session
2024-06-12 13:43:14.404510 : Fetching host and port from srvd
2024-06-12 13:43:15.780340 : Received host and port from srvd
2024-06-12 13:43:15.780446 : Waiting for daemon feature check response
2024-06-12 13:43:15.780458 : Received daemon feature check response
2024-06-12 13:43:15.784427 : Required daemon features are supported
2024-06-12 13:43:15.855798 : Sending session request to the device daemon
2024-06-12 13:43:15.962725 : Waiting for response from the device daemon
2024-06-12 13:43:16.575239 : Received response from the device daemon
2024-06-12 13:43:16.580149 : Creating connection to socket rendezvous
2024-06-12 13:43:16.706060 : Starting user session
Warning: Permanently added '[localhost]:54308' (ED25519) to the list of known hosts.

@gkc gkc deleted the c_daemon branch October 16, 2024 09: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.

5 participants