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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ssh server functionality #150

Merged
merged 5 commits into from
Apr 13, 2022
Merged

Add ssh server functionality #150

merged 5 commits into from
Apr 13, 2022

Conversation

ivantsepp
Copy link
Contributor

This adds a -server flag which will spin up an ssh server that executes the slides bubbletea application upon each ssh session.

馃憢 hey apologies for the delay in this PR but here's what I have so far just as a first step in getting ssh functionality! It's very bare bones but intentional because I'm not sure how y'all wanted this functionality to look like.

  • I saw this recent wish commit charmbracelet/wish@3a1ac79 and figured we probably want this middleware style so we can eventually send messages to the bubbletea program.
  • Uses -server flag since I wasn't sure how you wanted the cli to look like. Should we do something similar to Networked play over ssh聽gambit#3 where it uses coral to split the cli into subcommands? (ex. slides serve file.md -port 2222 ...)
  • I added a server struct similar to the PR for gambit as I imagine we'll extend this later on.
  • I didn't attempt to code up how you can have "viewers" - I think there are so many options/ideas and I'm not sure I can handle that part of the coding with my current golang skills 馃槅

One idea for the ssh functionality is to either require a password (slides serve file.md -password [...] -port 2222 ...) or if it's not given, print out a random password. Then when an ssh session connects with the right password, that session will get presenter rights. Other ssh sessions will automatically be viewers. Thoughts?

This adds a `-server` flag which will spin up an ssh server that
executes the slides bubbletea application upon each ssh session.
@maaslalani
Copy link
Owner

maaslalani commented Apr 10, 2022

Hey! This looks super awesome! I'll test it out soon.

Thank you so much for this PR, can't wait to have ssh functionality in slides 馃帀

@maaslalani
Copy link
Owner

Hey, so I think that -server shouldn't be a flag but rather we should have slides serve as the entry point and also be able to pass in the slides through stdin like

# this
slides serve file.md

# or
cat file.md | slides serve

# or 
curl https://raw.githubusercontent.com/maaslalani/slides/main/examples/slides.md | slides serve

so that people don't need to have the slides available on the machine they are hosting the server on.

@ivantsepp
Copy link
Contributor Author

ivantsepp commented Apr 12, 2022

thanks for taking a look and I totally agree! I followed the gambit PR and added a serve subcommand via the coral/cobra library

Copy link
Owner

@maaslalani maaslalani left a comment

Choose a reason for hiding this comment

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

Absolutely fantastic work! Thanks so much @ivantsepp

@maaslalani maaslalani merged commit 93c0f89 into maaslalani:main Apr 13, 2022
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.

None yet

2 participants