Giter VIP home page Giter VIP logo

action-upterm's People

Contributors

gableroux avatar lhotari avatar owenthereal avatar telotortium avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

action-upterm's Issues

Upterm action failing with "command not found"

Hey, I'm trying to use the upterm action to debug some test failures, and it appears to be failing. This used to work (as of a month ago or so). I'm not hosting my own upterm server or anything, but the runs are failing like this:

=== YU0HKZGLXX4IWRUUUFRM                                                                                         
Command:                tmux new -s upterm -x 132 -y 43                                                         
Force Command:          tmux attach -t upterm                                                                   
Host:                   ssh://uptermd.upterm.dev:22                                                             
SSH Session:            ssh Yu0hKZGLXx4IWRuuufRM:[email protected]

bash: upterm: command not found

127

Given the lack of configuration options, I'm reasonably sure this isn't something I messed up somehow, unless this type of runner is no longer supported.

Could not connect: `invalid option: window-size`

Any ideas?

Run lhotari/action-upterm@v1
upterm

Auto-generating ~/.ssh/known_hosts by attempting connection to uptermd.upterm.dev
Pseudo-terminal will not be allocated because stdin is not a terminal.

Warning: Permanently added 'uptermd.upterm.dev' (ED25519) to the list of known hosts.

Connection closed by xxx.yyy.zzz.aa port 22

Adding actor "pvonmoradi" to allowed users.
Fetching SSH keys registered with GitHub profiles: pvonmoradi
Fetched 1 ssh public keys
Creating a new session. Connecting to upterm server ssh://uptermd.upterm.dev:22
invalid option: window-size

invalid option: window-size

Error: 1

Here is the relavant parts from my yml file:

      - name: Setup upterm session
        uses: lhotari/action-upterm@v1
        with:
          ## limits ssh access and adds the ssh public key for the user which
          #triggered the workflow
          limit-access-to-actor: true
            ## limits ssh access and adds the ssh public keys of the listed
            #GitHub users
          limit-access-to-users: pvonmoradi

Getting error: `[email protected]: Permission denied (publickey).`

I followed the instructions with a simple setup:

- name: Setup upterm session
        uses: lhotari/action-upterm@v1

but when trying to connect using:

ssh XhMfjw1FxKdix4uQGdWd:[email protected]

I get the following error:

XhMfjw1FxKdix4uQGdWd:[email protected]: Permission denied (publickey).

I didn't use any authorisation options so I expected it would work just like that - but it doesn't.

I found this Upterm issue that could be related: owenthereal/upterm#93

Github ssh connection issues

Hey,

I'm not sure if the docs are unclear or something is wrong, but I couldn't use either limit-access-to-actor together with limit-access-to-users or limit-access-to-actor by itself (introduced in #8).

The ssh command I used was:

ssh -i ~/.ssh/gh_current_key b9mSRLZzh0Br3aVNmSNE:[email protected]
b9mSRLZzh0Br3aVNmSNE:[email protected]: Permission denied (publickey).

I also tried stripping the password string, as the connection string instruction in the docs is a little ambiguous.

ssh -i ~/.ssh/gh_current_key [email protected] 
Connection closed by 157.230.199.75 port 22

To sanity check I tried doing an ssh connection test to github, which worked fine:

ssh -T -i ~/.ssh/gh_current_key [email protected] 
Warning: remote port forwarding failed for listen port 2222
Hi Folcon! You've successfully authenticated, but GitHub does not provide shell access.

Not sure what the problem is or if this is an upstream issue...

Documentation is unclear when action is initiated on [push]

The documentation talks about using the checks tab in a pull-request to determine how to access the runner via this action. However it does not explain how to do this when there is no pull-request. Can the README.md be updated to handle this case?

Support other Linux besides Debian

Currently it does not seem to work with my non-Debian Linux. I believe my runner is a RHEL or CentOS, I can't be really sure, but either way I run into this error:

image

Or am I doing something wrong?

This is the action step:

      - name: Debug
        uses: lhotari/action-upterm@v1

Add option to kill tmux session if not connected to within a certain time period

Use case: I've set up my workflow to automatically run the upterm action if the job fails. This works really well, except for one thing - it causes the action not to complete for hours if there's a failure, because the upterm server just waits there. I could set timeout-minutes on the entire step, but that will kill the terminal even if a user connects to it. Instead, I'd like it if there were a timeout-minutes field specific to this action that terminates the action if no one SSH's to the server within that number of minutes, but keeps the terminal open if someone connects.

Feature Request: Ability to "lock" upterm session via GitHub secret

This is a really next github action! Thanks! It def saved my butt :)

Anyhow, wondering if there's a way to make the session password-protected in some way, so that it's not accessible (complete with any secrets present in session) from anyone following the CI run logs.

Thanks for considering!

Support for Windows through WSL

It would be amazing, if your action could also support WSL in Windows.
I'm the creator of https://github.com/Vampire/setup-wsl and right now need to investigate some strange behavior within the WSL distribution on the Windows runner.
It would have been very nice if this action could have been used for that.

Scroll-up in terminal

Thanks for this action, huge fan, have used a number of times when debugging workflows.

Stupid question: Once connected, the upterm screen appears locked to the current line count - is there some way to scroll-up or see line history when a command produces multiple screens of output?

Now that I'm typing this i guess I could pipe the output to more.

Issue while using custom server

This action is failing to launch the upterm host, when using my custom uptermd server.
My custom server itself is working (both with ssh and ws protocols) when I try to connect from my terminal.

This is the failed action log (for my last ws attempt; using ssh results in a similar log):

2022-05-28T15:41:27.1593300Z Secret source: Actions
2022-05-28T15:41:27.1594079Z Prepare workflow directory
2022-05-28T15:41:27.2941208Z Prepare all required actions
2022-05-28T15:41:27.3150184Z Getting action download info
2022-05-28T15:41:27.5609560Z Download action repository 'lhotari/action-upterm@v1' (SHA:d23c2722bdab893785c9fbeae314cbf080645bd7)
2022-05-28T15:41:28.4010066Z ##[group]Run lhotari/action-upterm@v1
2022-05-28T15:41:28.4010419Z with:
2022-05-28T15:41:28.4010662Z   limit-access-to-actor: true
2022-05-28T15:41:28.4010938Z   limit-access-to-users: CarloDePieri
2022-05-28T15:41:28.4011343Z   upterm-server: ws://***:80
2022-05-28T15:41:28.4011728Z   GITHUB_TOKEN: ***
2022-05-28T15:41:28.4011947Z env:
2022-05-28T15:41:28.4012131Z   is_cron: false
2022-05-28T15:41:28.4012338Z ##[endgroup]
2022-05-28T15:41:29.0131355Z upterm
2022-05-28T15:41:29.0131993Z 
2022-05-28T15:41:29.3917240Z Auto-generating ~/.ssh/known_hosts by attempting connection to uptermd.upterm.dev
2022-05-28T15:41:29.6491930Z Pseudo-terminal will not be allocated because stdin is not a terminal.
2022-05-28T15:41:29.6492275Z 
2022-05-28T15:41:29.7888068Z Warning: Permanently added 'uptermd.upterm.dev' (ED25519) to the list of known hosts.
2022-05-28T15:41:29.7888373Z 
2022-05-28T15:41:29.8048808Z Connection closed by *** port 22
2022-05-28T15:41:29.8049254Z 
2022-05-28T15:41:29.8109578Z Adding actor "CarloDePieri" to allowed users.
2022-05-28T15:41:29.8123618Z Fetching SSH keys registered with GitHub profiles: CarloDePieri
2022-05-28T15:41:30.0561924Z Fetched 3 ssh public keys
2022-05-28T15:41:30.0562557Z Creating a new session. Connecting to upterm server ws://***:80
2022-05-28T15:41:32.2601272Z Created new session successfully
2022-05-28T15:41:33.2618623Z Entering main loop
2022-05-28T15:41:33.2735134Z Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory"
2022-05-28T15:41:33.2735882Z 
2022-05-28T15:41:33.2736901Z Usage:
2022-05-28T15:41:33.2737397Z   upterm session current [flags]
2022-05-28T15:41:33.2737782Z 
2022-05-28T15:41:33.2827031Z Aliases:
2022-05-28T15:41:33.2827320Z   current, c
2022-05-28T15:41:33.2827468Z 
2022-05-28T15:41:33.2827548Z 1
2022-05-28T15:41:33.2829383Z Examples:
2022-05-28T15:41:33.2829691Z   # Display the current session defined in $UPTERM_ADMIN_SOCKET
2022-05-28T15:41:33.2831313Z   upterm session current
2022-05-28T15:41:33.2831980Z   # Display the current session with a custom path
2022-05-28T15:41:33.2833909Z   upterm session current --admin-socket ADMIN_SOCKET_PATH
2022-05-28T15:41:33.2834122Z 
2022-05-28T15:41:33.2834219Z Flags:
2022-05-28T15:41:33.2835429Z       --admin-socket string   admin unix domain socket (required)
2022-05-28T15:41:33.2835824Z   -h, --help                  help for current
2022-05-28T15:41:33.2837029Z 
2022-05-28T15:41:33.2837849Z time="2022-05-28T15:41:33Z" level=fatal msg="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory\""
2022-05-28T15:41:33.2838210Z 
2022-05-28T15:41:33.3168761Z Cleaning up orphan processes
2022-05-28T15:41:33.3590362Z Terminate orphan process: pid (1695) (tmux: server)
2022-05-28T15:41:33.3659997Z Terminate orphan process: pid (1696) (upterm)

And this is the server log:

root@myserver:~/upterm/build# ./uptermd --ws-addr 0.0.0.0:80
INFO[0000] starting server                               app=uptermd network=mem network-opt="[]" node-addr="127.0.0.1:2222" ssh-addr="127.0.0.1:2222" ws-addr="[::]:80"
INFO[0250] dialing sshproxy sshd                         app=uptermd com=ws-sshproxy-dialer host=runner network=mem network-opt="[]" node-addr="127.0.0.1:2222" ssh-addr="127.0.0.1:2222" sshproxy-addr="127.0.0.1:2222" ws-addr="[::]:80"
ERRO[0253] error piping                                  app=uptermd com=ws-proxy error="readfrom tcp 127.0.0.1:56024->127.0.0.1:2222: websocket: close 1006 (abnormal closure): unexpected EOF" network=mem network-opt="[]" node-addr="127.0.0.1:2222" ssh-addr="127.0.0.1:2222" ws-addr="[::]:80"

And this is the action config:

      - name: Setup upterm session
        uses: lhotari/action-upterm@v1
        with:
          limit-access-to-actor: true
          limit-access-to-users: CarloDePieri
          upterm-server: ws://${{ secrets.UPTERM_SERVER }}:80

The action does work when using the default upterm server.

EDIT: taking a quick look at the code I see that from here

await execShellCommand("ssh -i ~/.ssh/id_ed25519 uptermd.upterm.dev")
it tries to connect to the default server to save in the know_host file the server key... should it do the same for a custom ssh server when connecting with ssh?

macOS host: session dies as soon as I connect (transport: Error while dialing dial unix /Users/runner/.upterm/xxxxxxxxxxx.sock: connect: connection refused")

Hi!

Thanks for this action. I'm trying it out for the first time on macos-10.15 GHA runners, and as soon as I ssh from my machine, the upterm session seems to die. Locally I simply get:

$ ssh szq1wc1331uu9SXcR9DY:[email protected]
Connection closed by 157.230.199.75 port 22

and in the GitHub Actions log (example: https://github.com/phil-blain/github-actions-debug/runs/5293251543?check_suite_focus=true#step:3:96)

Creating a new session. Connecting to upterm server ssh://uptermd.upterm.dev:22
Created new session successfully
Entering main loop
=== SZQ1WC1331UU9SXCR9DY                                                                 
Command:                tmux new -s upterm -x 132 -y 43                                 

Force Command:          tmux attach -t upterm                                           
Host:                   ssh://uptermd.upterm.dev:22                                     
SSH Session:            ssh szq1wc1331uu9SXcR9DY:[email protected]

=== SZQ1WC1331UU9SXCR9DY                                                                 
Command:                tmux new -s upterm -x 132 -y 43                                 
Force Command:          tmux attach -t upterm                                           
Host:                   ssh://uptermd.upterm.dev:22                                     
SSH Session:            ssh szq1wc1331uu9SXcR9DY:[email protected]

Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /Users/runner/.upterm/szq1wc1331uu9SXcR9DY.sock: connect: connection refused"

Usage:
  upterm session current [flags]

Aliases:
  current, c

Examples:
  # Display the current session defined in $UPTERM_ADMIN_SOCKET
  upterm session current
  # Display the current session with a custom path
1
  upterm session current --admin-socket ADMIN_SOCKET_PATH

Flags:
      --admin-socket string   admin unix domain socket (required)
  -h, --help                  help for current

time="2022-02-22T18:52:18Z" level=fatal msg="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /Users/runner/.upterm/szq1wc1331uu9SXcR9DY.sock: connect: connection refused\""

Error when using action-upterm, Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory"

Error when using lhotari/action-upterm, was working yesterday, not sure what went wrong.

Run lhotari/action-upterm@v1
upterm

Auto-generating ~/.ssh/known_hosts by attempting connection to uptermd.upterm.dev
Pseudo-terminal will not be allocated because stdin is not a terminal.

ssh: connect to host uptermd.upterm.dev port 22: Network is unreachable

Creating a new session. Connecting to upterm server ssh://uptermd.upterm.dev:22
Created new session successfully
Entering main loop
Error: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory"

Usage:
  upterm session current [flags]

Aliases:
  current, c

Examples:
  # Display the current session defined in $UPTERM_ADMIN_SOCKET
  upterm session current
  # Display the current session with a custom path
  upterm session current --admin-socket ADMIN_SOCKET_PATH

Flags:
      --admin-socket string   admin unix domain socket (required)
  -h, --help                  help for current

time="[20](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:21)[22](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:23)-09-15T[23](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:24):[20](https://github.com/quiltt/quiltt/actions/runs/3064324589/jobs/4947319032#step:6:21):01Z" level=fatal msg="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /home/runner/.upterm/*.sock: connect: no such file or directory\""

1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.