cosmos72 / twin

Text mode window environment. A "retro" program for embedded or remote systems, that doubles as X11 terminal and text-mode equivalent of VNC server
Other
654 stars 38 forks source link

Server Architecture Rewrite #37

Open lighth7015 opened 5 years ago

lighth7015 commented 5 years ago

This thread was started to document the discussion, progress, viability, features and capabilities of a twin server rewrite, focusing on portability, maintainability and a modern, extensible core.

Everybody is encouraged to comment on this thread.

lighth7015 commented 5 years ago

One of the things I'd love to see, is a traditional login replacement, with it being able to start up over SSH in a manner very similar to RDP, so you could have like an unprivileged text desktop streamed over a PuTTy session- it would be great to be able to completely rival graphical desktop environments.

cosmos72 commented 5 years ago

Wow, you really want to breathe new life into twin! Did you already try twdm?

lighth7015 commented 5 years ago

I saw that; and ehhhh- honestly the whole thing needs a rewrite. For one, you should be able to mess around in the "root desktop" if you're trying to write an authentication UI.

lighth7015 commented 5 years ago

Also, instead of using a manual socket loop, we should move to something like libevent or libev or libuv for portability between POSIX implementations.

dimitrik-fr commented 5 years ago

Regarding "similar to RDP" (or VNC) access -- you can already do it with twdisplay ! personally I'm leaving TWIN running on remote server, after what then connecting to it via twdisplay only -- no more login required (similar to SSH with id keys), easy to re-connect if VPN was down, works like a charm ! Also, if you have to access your server via SSH gateway -- it's easy to start port forwarding via SSH connection and point it to 7754 port (default TWIN IP port)..

cosmos72 commented 5 years ago

For reference: I am not very fond of adding dependencies to twin, unless there is a very good reason: I want to keep the minimal/lightweight approach. Dependencies of specific modules (X11, X11+xpm, X11+xft) are less problematic, as in the worst case ./configure will disable the unsupported modules.

I agree the architecture would benefit from a refactoring - it's very old and it accumulated layers of cruft/patches and complications through the years. Beware that it's not always simple nor trivial to rewrite it.

Also: in 1992 I intentionally avoided C++ and sticked with ANSI C, but nowadays C++ is probably a better choice, because good & standardized C++ compilers are common and because I had to implement a lot of C tricks to emulate classes and inheritance.

lighth7015 commented 5 years ago

well if we're sticking with C, we should at least use C98, since it's much better supported by compilers thesedays.

lighth7015 commented 5 years ago

@dimitrik-fr And I was referring to being able to connect directly via SSH and having twin come up in-place of /bin/login.

lighth7015 commented 5 years ago

@cosmos72 Honestly, I think in this day and age maintainability and portability is preferred over doing everything yourself; and honestly, libevent isn't THAT big of a dependency; it's not like supporting systemd natively or anything IMO.