Files
ssh-portfolio/README.md
T

2.1 KiB

SSH Portfolio

A public, anonymous Node.js SSH server that turns a terminal into a customizable portfolio. Visitors connect with:

ssh -p 2222 localhost

Quick start

npm install
npm start

The first run creates data/config.json from config.example.json. Edit persona, pages, colors, ports, and admin keys, then use reload as an admin or restart the server. Pages are content-only; actions are registered in src/commands.js, so adding a command does not require changing the SSH transport.

Authentication model

Anonymous none authentication is intentionally accepted for visitors. Add one or more base64 public-key blobs to adminPublicKeys to enable administrator mode; key authentication is optional and never required. Admins get reload, theme, and announce commands.

Because this is an intentionally open service, run it in a container or restricted account, use a dedicated port, and do not expose private data through configured pages.

Owner notifications

Run npm run notify on the owner machine (or use NOTIFICATION_PORT) to receive chat and announcement notifications over a localhost-only socket. The protocol is newline-delimited JSON, so it is straightforward to replace with a desktop/mobile notification client. For a separate owner machine, forward the port with ssh -N -L 7777:127.0.0.1:7777 <server>.

Extending

Pages and commands are source modules:

  • src/pages/home.js, about.js, projects.js, and links.js are the premade editable pages.
  • src/pages/index.js is the page registry. Add an import and registry entry when creating a new page; its filename becomes the SSH command.
  • src/commands/ contains the premade command modules (chat, contact, announce, and so on).
  • src/commands.js is the command registry. Add an import there to expose a new command.

Each page exports name, title, and render({ config, ctx, api }). The renderer returns terminal text, so you can build extensive custom pages while inheriting the shared header, theme, and prompt. Pong is intentionally left as the next module: it can use the same session registry and owner-online check.