• HTMLterm

    From freet@freet@aussies.space (The Free Thinker) to tilde.projects on Sun Aug 16 04:13:47 2020
    I'm just wondering if anyone knows of an existing project like what
    I'm thinking of.

    There are a whole bunch of web-based terminal programs, some of which
    implement an SSH client in the browser, others use their own system
    for communication via something like Web... err... well that
    Web[letter] thing that I've forgotten the name of.

    Anyway I'm of the opinion that client-side scripting is the work
    of the devil, and also part of my thinking is to enable some sort
    of shell access to a Tilde from systems where SSH clients aren't
    as available as web browsers (eg. Windows CE), but those web browsers
    probably aren't suitably Javascript compatible.

    I'd like to write a simple Bash CGI script that executes commands
    entered in a plain HTML form, and displays the terminal output. In
    theory it's dead simple, but I'd like to be able to update the
    display before the command has completed, and add few other features
    that would probably pad the project out to a full day's work. Yet it
    might be years until I feel I can devote a day to something like
    this, so I wonder if such a HTML terminal script already exists that
    I could modify to suit.

    Obviously for security access over the internet would have to be
    using HTTPS and access to the page would be password restricted.

    --

    - The Free Thinker | gopher://aussies.space/1/%7efreet/
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From Dacav Doe@dacav@tilde.institute to tilde.projects on Mon Aug 17 07:53:42 2020
    On 2020-08-16, The Free Thinker <freet@aussies.space> wrote:
    There are a whole bunch of web-based terminal programs, some of which implement an SSH client in the browser, others use their own system
    for communication via something like Web... err... well that
    Web[letter] thing that I've forgotten the name of.

    ???
    I don't quite follow :)

    Anyway I'm of the opinion that client-side scripting is the work
    of the devil, and also part of my thinking is to enable some sort
    of shell access to a Tilde from systems where SSH clients aren't
    as available as web browsers (eg. Windows CE), but those web browsers probably aren't suitably Javascript compatible.

    Even Windows has a ssh client nowadays.

    Or do you mean really old stuff? As you put it too, if it's really
    old it will not handle Javascrot anyway. Or anything given
    for granted nowadays.

    Would it make sense to attempt the back-porting of a lightweight SSH
    client instead?

    I'd like to write a simple Bash CGI script that executes commands
    entered in a plain HTML form, and displays the terminal output.

    During the late 90's there were sites providing you with a working
    real-time chat environment. I have no idea what that was made
    of (I'm not sure if Javascrap was already a thing back then).

    In theory it's dead simple, but I'd like to be able to update the display before the command has completed,

    In the end completion is something you get when you press TAB (or ^d, or whatever you like), so perhaps you don't need anything automatic?
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From @lkosov@tilde.town to tilde.projects on Mon Aug 17 16:14:12 2020
    The Free Thinker <freet@aussies.space> wrote:

    I'd like to write a simple Bash CGI script that executes commands
    entered in a plain HTML form, and displays the terminal output. In
    theory it's dead simple, but I'd like to be able to update the
    display before the command has completed, and add few other features

    I'm a sysadmin, I just make servers work, I don't code, but Webmin has had a web-based terminal of sorts since the days when Sparcs roamed the earth. I dunno how they do it or any of the technical mumbo-jumbo, but it's saved my bacon...once or twice. :)

    --

    Inanities: gopher://tilde.town:70/1/~lkosov/ (with netmail address & GPG key) He/him/them/they/whatever. If in doubt, assume the above post contains sarcasm --- Synchronet 3.18b-Linux NewsLink 1.113
  • From freet@freet@aussies.space (The Free Thinker) to tilde.projects on Tue Aug 18 23:59:59 2020
    Dacav Doe <dacav@tilde.institute> wrote:
    On 2020-08-16, The Free Thinker <freet@aussies.space> wrote:
    There are a whole bunch of web-based terminal programs, some of which
    implement an SSH client in the browser, others use their own system
    for communication via something like Web... err... well that
    Web[letter] thing that I've forgotten the name of.

    ???
    I don't quite follow :)

    WebRTC it what I eventually remembered I was thinking of, so I could
    again find this example:
    https://github.com/maxmcd/webtty

    Here's an older example:
    http://phpterm.sourceforge.net/

    The browser SSH client ones are out there too, from memory.

    Anyway I'm of the opinion that client-side scripting is the work
    of the devil, and also part of my thinking is to enable some sort
    of shell access to a Tilde from systems where SSH clients aren't
    as available as web browsers (eg. Windows CE), but those web browsers
    probably aren't suitably Javascript compatible.

    Even Windows has a ssh client nowadays.

    Not on Windows CE, or at least any version I'm familiar with.

    Or do you mean really old stuff? As you put it too, if it's really
    old it will not handle Javascrot anyway. Or anything given
    for granted nowadays.
    Would it make sense to attempt the back-porting of a lightweight SSH
    client instead?

    I want to use plain HTML4 over HTTP/HTTPS on the client side.
    Preferably a Bash script for the CGI program run by the web server.

    OK, here are use cases that come to mind (I was trying to be breif
    before by just mentioning one), not all of which apply to me:

    * Remote terminal access from systems like feature phones or smart
    phones that aren't Apple/Android, so have web browser "apps" but
    no SSH client. Or the SSH clients available are old and won't
    connect to modern SSH servers because they don't support the new
    cyphers.
    - Porting SSH clients from other systems would be too
    hard/impossible.

    * I'd like to connect to my router from some old systems that don't
    support modern encryption. It's on my LAN, which isn't being spied
    on, so I don't need SSH. But OpenWRT doesn't have a telnetd package
    and compiling for it is very complicated. It does have some web
    servers available though, so it would be good to be able to use
    HTTP instead.

    * Some people's ISPs block common SSH ports.

    * Cheaper web hosting services generally don't allow shell access.

    I'd like to write a simple Bash CGI script that executes commands
    entered in a plain HTML form, and displays the terminal output.

    During the late 90's there were sites providing you with a working
    real-time chat environment. I have no idea what that was made
    of (I'm not sure if Javascrap was already a thing back then).

    I'm not really after a real-time sort of thing. The linked projects
    provide an exact replica of a terminal, but I'm not aiming for that
    because I want the page to be plain HTML.

    If I find the time I'll wite my simple version of the script as an
    example, but basically the page's HTML would look something like
    something like:

    <html>
    <body>
    <pre>
    [stdout from commands run so far]
    </pre>

    <form method=POST action="/cgi-bin/htmlterm.sh">
    <p>$ <input type=text name=CMD>
    <input type=submit value="Enter">
    </form>
    </body>
    </html>

    Easily done by piping the command output to a file and reading that
    in a bash script that generates the HTML around it after executing.
    The command being specified in the CMD input field.

    BUT complications are:

    * I don't want to have to wait for the command to complete before the
    page is loaded. I need to look into how page loads can be
    asynchonous to commmand completion.

    * I need to have "cd" work, so it needs a concept of PWD (another
    form field perhaps?

    * Obviously need to replace any HTML special characters with
    character entities (there are already shell scripts for that I'm
    sure).

    * Ideally replicate text colouring with html <font color=> tags
    (maybe I already saw a script that did that?...).

    * How to kill a run-away process? Need to run "ps" and format the
    processes on the page with check-boxes that allow you to TERM
    or KILL them.

    * Really want the terminal in a vertically scrollable window within
    the page. Use a pre-filled textarea box? Multiple frames? Both, so
    that browsers without frame support are supported?

    So by the time I've worked out all of that I've spent a day, well
    maybe a week, researching obscure intricacies of the shell
    environment and getting everything working reliably. As it is that
    puts it in my "maybe one day" box.

    But given that there are various other web terminal programs
    available that require Javascript and modern browsers (so I don't
    like them, plus that PHPterm wouldn't run for me anyway), I figured
    there could easily be one already written as a shell script
    generating plain HTML.

    However such scripts are hard to find on the web. I've very often
    stumbled upon things that I'd searched extremely hard for in the
    past. So I thought I'd ask. Even if an existing script doesn't have
    all of the features I'm after, it may have already delt with some of
    the "intricacies" which saves the lion's share of the time and energy
    required to make my own.

    In theory it's dead simple, but I'd like to be able to update the display
    before the command has completed,

    In the end completion is something you get when you press TAB (or ^d, or whatever you like), so perhaps you don't need anything automatic?

    Things like tab completion would be out of course. As would anything
    using ncurses. It would only suit individual commands, and maybe
    line-based interactive programs with some more tricks (echo to a
    /dev/tty ?).

    By completed, I meant after execution of the processes started by the
    previous command was completed.

    --

    - The Free Thinker | gopher://aussies.space/1/%7efreet/
    --- Synchronet 3.18b-Linux NewsLink 1.113
  • From freet@freet@aussies.space (The Free Thinker) to tilde.projects on Wed Aug 19 00:10:48 2020
    lkosov <lkosov@tilde.town> wrote:
    The Free Thinker <freet@aussies.space> wrote:

    I'd like to write a simple Bash CGI script that executes commands
    entered in a plain HTML form, and displays the terminal output. In
    theory it's dead simple, but I'd like to be able to update the
    display before the command has completed, and add few other features

    I'm a sysadmin, I just make servers work, I don't code, but Webmin has had a web-based terminal of sorts since the days when Sparcs roamed the earth. I dunno how they do it or any of the technical mumbo-jumbo, but it's saved my bacon...once or twice. :)

    Thanks, a quick look into it suggests that it uses Shell In A Box,
    which I had found before in searches, but disregarded because it
    needs Javascript.
    https://github.com/shellinabox/shellinabox

    I'm looking for something like that, but implemented with server-side
    scripting only, and happy to accept all of the inevitable limitations
    that comes with that (obviously it would only really be a "pretend"
    terminal, based around a HTML form).

    --

    - The Free Thinker | gopher://aussies.space/1/%7efreet/
    --- Synchronet 3.18b-Linux NewsLink 1.113