Skip to content
This repository was archived by the owner on Mar 10, 2025. It is now read-only.

SSH to gitpod and local remote machine #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,6 @@ EXPOSE 6080-6090

USER $USER
RUN code --install-extension github.copilot
RUN code --install-extension ms-vscode-remote.remote-ssh

ENTRYPOINT ["/bin/sh", "-c", "set -o errexit; case \"$1\" in sh|bash) set -- \"$@\" ;; *) set -- sway ;; esac; exec \"$@\"", "--"]
10 changes: 10 additions & 0 deletions config/sway/gitpod_ssh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import os
import subprocess

gitpod = os.getenv("GITPOD_SSH_CMD")

if gitpod is not None:
subprocess.run([gitpod], shell=True)

else:
print("Environment variables for Gitpod command not set")
13 changes: 13 additions & 0 deletions config/sway/local_ssh.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import os
import subprocess

port = os.getenv("SSH_PORT")
user = os.getenv("SSH_USER")
ngrok_num = os.getenv("SSH_NGROK_NUM")

if port is not None and user is not None and ngrok_num is not None:
command = 'ssh -p ' + port + ' ' + user + '@' + ngrok_num +'.tcp.ngrok.io'
subprocess.run([command], shell=True)

else:
print("Environment variables for locall ssh are not set")