haliphax / xthulu

Python asyncio community server (HTTPS, SCP, SFTP, SSH) with a modern terminal interface

Home Page:https://haliphax.github.io/xthulu/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

xthulu

xthulu ("ch-THOO-loo") Python asyncio community server

Header image

Build Checks Tests Coverage

While xthulu is intended to be a community server with multiple avenues of interaction (e.g. terminal, browser, REST API), its primary focus is to provide a modern SSH terminal interface which pays homage to the bulletin boards of the 1990s. Rather than leaning entirely into DOS-era nostalgia, modern character sets (UTF-8) and terminal capabilities are taken advantage of.

Progress

Terminal server checklist

Terminal server

  • SSH server (AsyncSSH)
    • Password authentication
    • Guest (no-auth) users
    • Key authentication
  • PROXY v1 support
  • SCP subsystem
  • SFTP subsystem
  • Composite userland script stack
    • Goto
    • Gosub
    • Exception handling
  • Terminal library (rich)
    • Adapt for SSH session usage
  • UI components (textual)
    • Adapt for SSH session usage
    • File browser
    • Message interface
  • Door games
    • Subprocess redirect for terminal apps
    • Dropfile generators
      • DOOR.SYS
      • DORINFOx.DEF
Miscellaneous checklist

Miscellaneous

  • Container proxy (Traefik)
  • HTTP server (uvicorn)
    • Basic authentication
    • Web framework (FastAPI)
      • Composite userland
    • Static files
  • IPC
    • Session events queue
    • Methods for manipulating queue (querying specific events, etc.)
    • Can target other sessions and send them events (gosub/goto, chat requests, IM, etc.)
    • Server events queue (IPC coordination, etc.)
    • Locks (IPC semaphore)
    • Global IPC (CLI, web, etc.) via Redis PubSub
  • Data layer
    • PostgreSQL for data
    • Asynchronous ORM (GINO)
    • User model
    • Message bases
    • Simple pickle table for miscellaneous data storage?

Setup

Build the docker images

# in the docker/ directory
docker compose build

Create a configuration file and generate host keys

# in the data/ directory
cp config.example.toml config.toml
ssh-keygen -f ssh_host_key -t rsa -b 4096  # do not use a passphrase

Create and seed the database

Note the use of the cli and user service containers, which are only spun up for command line tasks. The cli container is for the server, while the user container is for the userland implementation.

# in the docker/ directory
docker compose run --rm cli db create
docker compose run --rm cli db init
docker compose run --rm user db create

Build the static web assets

# in the project root
etc/build-web.sh

Start the services

# in the docker/ directory
docker compose up -d

Connect

Connect to the terminal server

There is a guest account which demonstrates the ability for some accounts to bypass authentication.

ssh guest@localhost

There is also a user account with a password for testing password authentication.

ssh user@localhost  # password is also "user"

Connect to the web server

For the time being, the web server only demonstrates simple interoperability between the REST API and static pages. It is available at https://localhost.

⚠️ Traefik will be using an untrusted certificate, and you will likely be presented with a warning.

The same credentials may be used here; for the guest account, any password (or a blank password) will work.

About

Python asyncio community server (HTTPS, SCP, SFTP, SSH) with a modern terminal interface

https://haliphax.github.io/xthulu/

License:MIT License


Languages

Language:Python 95.8%Language:Shell 1.7%Language:TypeScript 1.1%Language:Dockerfile 0.6%Language:HTML 0.5%Language:CSS 0.3%