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

VNC instance access #465

Closed
alessandroargentieri opened this issue Sep 12, 2024 · 15 comments · Fixed by #472
Closed

VNC instance access #465

alessandroargentieri opened this issue Sep 12, 2024 · 15 comments · Fixed by #472

Comments

@alessandroargentieri
Copy link
Member

Given that the api:

PUT /v2/instances/{uuid}/vnc

Returns the body:

{"uri":"https://..."}

Design and develop the client solution to call this api and be redirect to the default browser new tab towards the specified "uri" parameter.

Suggestion proposed:
civo instance vnc INSTANCE-ID/NAME

@uzaxirr
Copy link
Member

uzaxirr commented Sep 24, 2024

Corresponding civo-go ticket: civo/civogo#211

@dipu989
Copy link
Contributor

dipu989 commented Sep 24, 2024

This looks fun ⭐
I will pick this up 💯

Here’s my initial understanding of the high-level requirements (thinking out loud and listing what comes to mind):

CLI Command:
We need to expose a new CLI command civo instance vnc INSTANCE-ID/NAME that accepts either the instance ID or name.

API Exposure (SDK):
We'll add an API call in the civogo SDK: PUT /v2/instances/{uuid}/vnc. This should interact with Civo's backend and return the response to the CLI/client when cli runs the above mentioned command.

URL Redirection:
Once the response is returned, it includes a field url (the VNC URL). We’ll need to automatically open this URL in the default web browser, taking into account different platforms (Mac, Windows, etc.).

Additional Considerations:
Timeout Handling:
After redirecting, the terminal should wait for a set duration before timing out, allowing the user to issue further commands after the timeout.

Let me know if that's the correct expectation of the overall feature?

Also, a follow-up question:
Accessing VNC might require the device to be connected to a VPN or sometimes use SSH. Should we consider these scenarios as well?

Let me know your thoughts!

@uzaxirr @alessandroargentieri @DMajrekar

@alessandroargentieri
Copy link
Member Author

What you say is correct.
No VPN or SSH, that URL brings tona validation layer via the civo OpenID Connect Provider.

The functionality is being released during these days, so it may be not immediately available in the next hours in every region.

@dipu989
Copy link
Contributor

dipu989 commented Sep 24, 2024

Got it! Since VPN or SSH restrictions won’t apply, I’ll proceed without those considerations in the design.
I’ll move forward with the implementation. Appreciate the quick feedback!

@dipu989
Copy link
Contributor

dipu989 commented Sep 24, 2024

@alessandroargentieri Quick doubt,
Was this API (/v2/instances/%s/console) built to serve the same purpose?

I can see this the instance_console command in the cli already but I guess it's deprecated now?
Was it also serving the vnc console uri?
I tried calling the GET Api on /v2/instances/%s/console, but gives 404. I guess that's for different use case then?

Just want to understand the full context and difference between these two.

@uzaxirr
Copy link
Member

uzaxirr commented Sep 25, 2024

hey @dipu989 thank you for elaborating, this feature is still not available to general public. Thus there would be no way you can test it out. So i will be picking this up

@uzaxirr uzaxirr self-assigned this Sep 25, 2024
@dipu989
Copy link
Contributor

dipu989 commented Sep 25, 2024

@uzaxirr No worries. That should be fine.
I thought it was available to be picked up by the contributors.

@alessandroargentieri
Copy link
Member Author

@uzaxirr this IS for the public

@uzaxirr
Copy link
Member

uzaxirr commented Sep 25, 2024

@uzaxirr this IS for the public

but as of now it is only available in a single region which general public do not have access to.

@alessandroargentieri
Copy link
Member Author

alessandroargentieri commented Sep 25, 2024

Today it will be publicly available @uzaxirr.
The only thing, @dipu989 is that we have an ETA (end of this week) with a customer to present it.
So if you can work on it quickly enough, I think it's nice to be helped by propositive contributors like you

@dipu989
Copy link
Contributor

dipu989 commented Sep 25, 2024

@alessandroargentieri @uzaxirr I can work on this and try to raise PR ASAP if that works for you guys?
Let me know if you guys still think it should be picked by someone from the team as it's a customer request.
I can raise PR in a day or two.

@alessandroargentieri
Copy link
Member Author

@dipu989 I've reached out internally and we decided to foster as much as possible the open source culture and favor external contribution over ETAs. This frees up @uzaxirr concern and allows you work on this task. Thank you so much and for any further questions about the task just ask!

@dipu989
Copy link
Contributor

dipu989 commented Sep 25, 2024

@alessandroargentieri @uzaxirr Thank you so much for this!
I will pick this up 🚀
Sure, will ask questions right away as I come across during implementation.

@kaihoffman
Copy link
Member

@alessandroargentieri Quick doubt, Was this API (/v2/instances/%s/console) built to serve the same purpose?

I can see this the instance_console command in the cli already but I guess it's deprecated now? Was it also serving the vnc console uri? I tried calling the GET Api on /v2/instances/%s/console, but gives 404. I guess that's for different use case then?

Just want to understand the full context and difference between these two.

This is absolutely correct. There was a separate "console" on a previous iteration of the Civo back-end that used a different architecture. In an ideal world I guess I would love to see "console" and "vnc" as aliases of each other. Thoughts @alessandroargentieri @fernando-villalba @uzaxirr ?

@alessandroargentieri
Copy link
Member Author

@uzaxirr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants