Since I introduced
dashboard in our PaaS system, my colleagues complained a lot about that it was unstable, often disconnected and difficult to transfer files. It is good to know that the dashboard is widely used in our system and developer want it to have more features and stability.
There are two parts to this blog. The former is about usage and the latter is how it works.
uptermd is deployed in a small VPS. It can’t withstand a big storm, so use it wisely.
I’ve extended the
upterm code to support
VSCode Remote SSH. Please feel free to give an issue or pull requests.
bash <(curl -sL http://corvo.fun/scripts/upterm.sh)
Copy URI to the browser:
Open it in the terminal:
When you see this icon, it means the remote connection has been established.
There is a full functional termianl in the VSCode, you can manipulate the host inside it.
VSCode also support port forward, which allows you access the remote port from localhost.
You could roughly assume that this tool has the functionality of openssh-server+frp
Here are two machines, one of them opened a upterm server, the other is the client to connect to the server.
upterm is an alternateive for tmate, upterm做了几个工作:
- Launch a OpenSSH server
- Connect the uptermd, obtain a session id, and print it.
- User will connect the server by session id.
You can refer to progress of upterm.
VSCode supports remote ssh, which is a ssh client that can connect to the remote server.
Upterm already allow us to connect by OpenSSH protocol, it means we can use VSCode over it.
When we use VSCode Remote, it works like this:
ssh -T -D 1234 192.168.101.135 -p 2224 bash
ssh -T 192.168.101.135 -p 2224 bashwill disable pseudo-terminal allocation, only run bash in command
ssh -D 1234 xxxxxmeans there will be a socks5 port in this server, please refer to OpenSSH Port Forwarding
As long as we create an OpenSSH server that allows VSCode connections, we are good to go. You may refer to this gist file.
There are several bottlenecks in Upterm.
- Every time we have a new container, user need to download code-server and uptermd.
- Every time we have a new container, user need to create their own config
- There are too many session ids, and VSCode keep them all
- Currently, VSCode Remote doesn’t support Alpine Linux, so we can’t use it in Alpine linux server
Compared to Gitpod, this project just works, but it doesn’t work well:
- The configuration need to share between multiple containers
- We need OpenID or OAuth for internal use in the enterprise
- Currently, it does not support VSCode web, while Gitpod already supports it.
When I firstly introduced Dashboard to the PaaS System. I’d like to let user use local ssh or VSCode to connect it. I have done a lot of research on this