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

add ssh command #598

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

add ssh command #598

wants to merge 1 commit into from

Conversation

20k-ultra
Copy link

@20k-ultra 20k-ultra commented Feb 22, 2025

This adds a railway ssh command that creates a websocket connect to a relay server that will provide SSH capabilities to deployment instances.

<project-name> and <service-name> are required and deployment instance id is not because they are the minimum data required to find a deployment instance. --deployment-instance is only necessary if you have multiple replicas.

$ railway ssh --help
Connect to a service via SSH

Usage: railway ssh [OPTIONS] <project-name> <service-name>

Arguments:
  <project-name>  Project to connect to
  <service-name>  Service to connect to

Options:
      --deployment-instance <deployment-instance-id>  Deployment instance ID to connect to
      --json                                          Output in JSON format
  -h, --help                                          Print help
  -V, --version                                       Print version

$ railway ssh my-website http-service --deployment-instance 6432af2a-1e53-4865-842d-70b553ae7cd5
  Connecting to service...
root@07e29b7e760a:/app# exit
exit

@20k-ultra 20k-ultra marked this pull request as draft February 22, 2025 02:29
)
.await?;

if !std::io::stdout().is_terminal() {
Copy link
Author

Choose a reason for hiding this comment

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

move this before making ws connection

.tick_chars(TICK_STRING)
.template("{spinner:.green} {msg}")?,
)
.with_message("Connecting to service...");
Copy link
Author

Choose a reason for hiding this comment

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

make this message go away after connection

);
}
eprintln!(
"Connection attempt {} failed: {}. Retrying in {} seconds...",
Copy link
Author

Choose a reason for hiding this comment

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

make sure these logs go away after connection

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