You would think that with an idea as simple as this, there would already be plenty of implementations. and while there are, each have their own unique problems, be that a buggy and incomplete terminal emulator implementation, convoluted methods of authentication, or just being slow in general.
thus, i'll do it myself, with hterm and catppuccin
this is a very minimal implementation, built to fit my needs and not much more.
- the full power of hterm.js, a fully complete emulator unlike some other inferior ones that i won't mention (cough cough)
- choice between webrtc and socket.io backends
- authentication (see below)
- file transfer
git clone https://github.com/CoolElectronics/tiTTY
cd tiTTY
npm i
nvim .env # edit stuff
npx ts-node main.ts
the following environment variables can be set in .env or as normal
- PORT= - the port the server will listen on
- TTY_SHELL= - the program that the tty will launch. this should usually be set to /bin/bash yes, these are the only options. if you want more fork it
there is no authentication. i didn't want to reinvent the wheel, so this project will assume that there's another method of authentication behind the server itself, be that a reverse proxy, a vpn/proxy/relay, or simply not forwarding the port this runs on.
if you don't have any of the above and the server is publicly accessible, make sure you're ok with anyone on the internet having access to the shell. if you're lazy and don't feel like setting up anything, you can run the server as root and set tty_shell to /bin/login, so at least it's password protected.
- hterm.js
- https://github.com/mshaugh/nerdfont-webfonts
- favicon is the whiskers icon because i didn't feel like making my own