GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - jshsakura/oc-terminal-list: Self-hosted web terminal β€” persistent tmux sessions, Monaco editor, SSH management, voice input, Passkey/WebAuthn. Docker or systemd. MIT License.

BranchesTags
Open more actions menu

Latest commit

 

History

1,105 Commits
1,105 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
backend
backend
 
 
codex-statusline-compact
codex-statusline-compact
 
 
deploy
deploy
 
 
docs
docs
 
 
frontend
frontend
 
 
secrets
secrets
 
 
shared
shared
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
AGENTS.md
AGENTS.md
 
 
AGENT_LAYER_PLAN.md
AGENT_LAYER_PLAN.md
 
 
CLAUDE.md
CLAUDE.md
 
 
DESIGN.md
DESIGN.md
 
 
Dockerfile
Dockerfile
 
 
README.ko.md
README.ko.md
 
 
README.md
README.md
 
 
compose.host.yml
compose.host.yml
 
 
compose.yml
compose.yml
 
 
run.py
run.py
 
 
seg-compare.png
seg-compare.png
 
 
seg-variants.png
seg-variants.png
 
 

Repository files navigation

Terminal List

🌐 English | πŸ‡°πŸ‡· ν•œκ΅­μ–΄ | 🐳 GHCR Container | πŸ–₯️ Host-native recommended

GHCR Publish GHCR Image License: MIT

Fast, self-hosted web terminal for persistent tmux sessions, file browsing, SSH host management, and mobile-friendly server access.

β–Ά Live Demo β€” scripted playback with sample hosts, no install, no signup, no real shell. See the project site for the full pitch and screenshots.

Docker is supported for quick isolated deployment. Host-native install is recommended when you want the app to control the real host shell, host tmux, SSH tools, and local workspace directly.

# Paste this into any AI coding assistant for guided setup
Install Terminal List from this repository and choose the best mode for my server:
https://github.com/jshsakura/oc-terminal-list

Prefer host-native systemd for full host integration.
Use GHCR Docker only if I want an isolated container terminal.

Table of Contents

  • What it is
  • Screenshots
  • Features
  • Install modes
  • Quick Start: Docker / GHCR
  • Recommended: Host-native systemd
  • Data model: Docker vs host-native
  • Configuration
  • First login and 2FA
  • Using the app
  • Operations
  • Security model
  • Reverse proxy / HTTPS
  • Developer setup
  • Project structure
  • Troubleshooting
  • Roadmap
  • License

What it is

Terminal List is a browser-based terminal workspace for machines you own.

It combines:

  • a web terminal backed by persistent host tmux sessions
  • split panes with broadcast typing and per-pane opt-out
  • a VS Code-style file browser and editor scoped to a workspace directory
  • SSH host/key management
  • single-admin login with optional TOTP 2FA and passkey (WebAuthn)
  • voice input for hands-free command entry
  • a responsive UI that works on desktop, tablet, and mobile

It is useful when you want a lightweight terminal dashboard that feels faster and more direct than notebook-style remote shells.


Screenshots

Split panes and Broadcast

Split a tab into as many panes as you need. Turn on Broadcast and every keystroke is mirrored to the other panes in the tab β€” each pane gets an amber border and a badge. Press the badge's βœ• to drop just that pane out of the broadcast (it then neither receives nor sends).

Split panes with Broadcast on, one pane excluded

Quick Input, targeted across tabs

Compose a command once, then pick exactly which terminals receive it. Panes are grouped by tab; tap a tab heading to select all of its panes at once. With nothing selected, the command goes to the focused pane.

Send-to picker with panes grouped by tab

Home dashboard

Home dashboard with connections, running sessions, and usage

Mobile

Splits collapse into sub-tabs, and a key toolbar supplies Esc, Tab, Ctrl+C, arrows, and paste. On iPhone/iPad, Hangul composition is previewed at the cursor and only committed text is sent, allowing direct terminal input. Quick Input remains available for longer messages.

Mobile view with sub-tabs and key toolbar Quick Input on mobile


Features

Area Capability
Terminal xterm.js terminal UI, persistent tmux sessions, reconnect-friendly WebSocket bridge, predictive echo (mosh-style local echo), restart a session in place (fresh shell, same cwd)
Panes Split right/down, 2Γ—2 grid, drag to resize, equalize (every pane gets equal area, even in nested splits), drag a pane out into its own tab
Broadcast Mirror your typing to every pane in the tab; exclude individual panes on the fly
Quick Input Compose a command and send it to any set of panes, grouped by tab; voice dictation (Web Speech API); per-terminal history with infinite scroll
Sessions SQLite-backed session metadata and restoration
Files Workspace-scoped file browser, Monaco editor, content search (ripgrep), upload into the selected folder, create/move/delete
Git Per-pane change list and branch indicator for the pane's repository
Snippets Saved commands, opened with Ctrl+Shift+S and run in the focused pane
SSH Host and key management with encrypted secret storage
Auth Initial admin setup, JWT sessions, optional TOTP 2FA, one-time backup codes, passkey (WebAuthn)
Vault SSH passwords, private-key passphrases, and OTP secrets encrypted with data/.vault-key
UI 59 themes, per-pane theme override, language switch (EN/KO), mobile sub-tabs and key toolbar, responsive layout
Performance Gzip/Brotli, long-lived static asset cache, lazy loaded frontend chunks, Monaco idle prefetch, WebSocket batching, WebGL renderer
Deployment GHCR Docker image, Compose example, systemd host-native service

Installing tools on your machines

Every host card (and this server's own card) has a πŸ“¦ button: pick a machine, see what is installed, and install what you want. tmux and itl ship as the built-in entries; anything else you add yourself β€” the app does not decide what belongs on your machines.

Installing does not run behind your back. It opens a terminal on that machine, types the command, and leaves the Enter to you β€” so sudo prompts, progress output and Ctrl-C all behave the way they do in any other terminal, and the feature grants no privilege you did not already have.

The probe that reports "installed" must not run the tool β€” command -v tmux, never tmux -V-style invocations of tools that may open a TUI. A program that starts a TUI on an unknown flag would hang a probe that has no tty.


Install modes

Mode Best for Terminal runs in Data lives in Recommendation
Host-native / systemd Real server control, host shell, host tmux, direct workspace access The host Host paths from .env Recommended
Docker / GHCR Quick trial, isolated deployment, simple rollback The container Mounted ./data and ./workspace Supported
Local dev Hacking on backend/frontend Your dev shell Local paths Developers

Why host-native is the primary mode: this project is a terminal tool. Container isolation is great for packaging, but it also means the shell, filesystem, SSH agent, and tmux server are container-scoped unless you intentionally mount and wire host resources.


Sending commands between terminal tabs

Run itl doctor to check your current pane and socket access, then use addresses from itl list.

itl whoami
itl list
itl send 2.1 'Please handle this task'
itl send 2.1 'Type only' --no-enter
itl read 2.1 --lines 20

Discovery defaults to the current tmux server; outside tmux it scans this user's sockets. Use itl list --all for all servers or itl --socket /absolute/socket/path list for one explicit server. A deleted or stale sender fails immediately with tmux_context_stale: reopen the terminal in the app and run from a fresh shell. Actual permission denial is reported separately as tmux_socket_denied. itl sandbox-config prints socket permission settings without changing permissions automatically.

Cross-host app delivery uses the backend and waits up to 70 seconds by default. delivery=enter-sent confirms input and Enter; typed confirms input only. With --wait 0, queued means pending delivery. Exit code 4 and unknown require itl receipt <request ID> in the original sender pane. Do not resend automatically when delivery is unknown.

Quick Start: Docker / GHCR

Docker is the fastest way to try the app.

Default port: 38822. It avoids common development ports like 3000, 5173, 8000, 8080, and 8888. Change it freely with APP_PORT.

Option A: use the checked-in compose.yml

git clone https://github.com/jshsakura/oc-terminal-list.git
cd oc-terminal-list

docker compose up -d
docker compose logs -f backend

Open:

http://localhost:38822

Use a different port:

# One-off
APP_PORT=9000 docker compose up -d

# Persistent for this checkout
echo "APP_PORT=9000" >> .env
docker compose up -d

Option B: create a minimal Compose file

mkdir oc-terminal-list && cd oc-terminal-list

cat > compose.yml <<'EOF'
services:
  backend:
    image: ghcr.io/jshsakura/oc-terminal-list:latest
    container_name: oc-terminal-list
    ports:
      - "${APP_PORT:-38822}:${APP_PORT:-38822}"
    environment:
      - HOST=0.0.0.0
      - APP_PORT=${APP_PORT:-38822}
      - DB_PATH=/app/data/iterminallist.db
      - WORKSPACE_ROOT=/workspace
    volumes:
      - ./data:/app/data
      - ./workspace:/workspace
    restart: unless-stopped
EOF

docker compose up -d

Docker behavior

  • Web service listens on ${APP_PORT:-38822}.
  • The terminal shell is inside the container.
  • App data is mounted from ./data to /app/data.
  • Editable workspace files are mounted from ./workspace to /workspace.
  • JWT signing key is generated at data/.jwt-secret; browser sessions use an HttpOnly cookie.
  • Vault encryption key is generated as /app/data/.vault-key.

Recommended: Host-native systemd

Use this when Terminal List should operate on the actual host environment.

Prerequisites

  • Linux host
  • Python 3.12 recommended
  • Node.js 20 recommended for frontend build
  • tmux
  • sqlite3 CLI recommended for backup operations
  • bash or your preferred host shell

Install OS packages on Debian/Ubuntu-like systems:

sudo apt-get update
sudo apt-get install -y python3 python3-venv nodejs npm tmux sqlite3

Install

git clone https://github.com/jshsakura/oc-terminal-list.git
cd oc-terminal-list

cp .env.example .env

Edit .env for your host:

# Example host-native values
APP_PORT=38822
HOST=0.0.0.0
DB_PATH=/var/lib/iterminallist/iterminallist.db
VAULT_KEY_PATH=/var/lib/iterminallist/.vault-key
WORKSPACE_ROOT=/srv/iterminallist/workspace
TMUX_SOCKET_NAME=iterminallist-app
LOG_LEVEL=INFO

Create host-owned runtime directories:

sudo mkdir -p /var/lib/iterminallist /srv/iterminallist/workspace
sudo chown -R "$USER:$USER" /var/lib/iterminallist /srv/iterminallist/workspace

Install dependencies and build the frontend:

python3 -m venv .venv
.venv/bin/pip install -r backend/requirements.txt

cd frontend
npm install
npm run build
cd ..

Register the service:

# IMPORTANT: review deploy/iterminallist.service first.
# It contains host-specific User, Group, WorkingDirectory, EnvironmentFile, and ExecStart paths.
sudo cp deploy/iterminallist.service /etc/systemd/system/iterminallist.service
sudo systemctl daemon-reload
sudo systemctl enable --now iterminallist.service

Check status:

systemctl status iterminallist.service
journalctl -u iterminallist.service -f

Open:

http://localhost:38822

Full host operations guide: deploy/README.md


Data model: Docker vs host-native

Keep Docker and host-native data separate unless you are intentionally migrating.

Mode DB Vault key Workspace
Docker ./data/iterminallist.db mounted as /app/data/iterminallist.db ./data/.vault-key mounted as /app/data/.vault-key ./workspace mounted as /workspace
Host-native DB_PATH in .env VAULT_KEY_PATH in .env (or repo data/.vault-key default) WORKSPACE_ROOT in .env

Rules:

  1. Back up iterminallist.db and .vault-key together.
  2. Losing .vault-key makes encrypted SSH passwords, private-key passphrases, and OTP secrets unrecoverable.
  3. Do not casually point Docker and systemd at the same data/ directory. File ownership and vault-key mismatch can break secrets.
  4. For migration, stop the app first, copy both DB and .vault-key, then restart in the target mode.

Configuration

Core environment variables:

Variable Default / example Description
HOST 0.0.0.0 Bind address for FastAPI / uvicorn
APP_PORT 38822 Web service port
DB_PATH /var/lib/iterminallist/iterminallist.db or /app/data/iterminallist.db SQLite database path
VAULT_KEY_PATH /var/lib/iterminallist/.vault-key or /app/data/.vault-key Fernet master key path for encrypted secrets
WORKSPACE_ROOT /srv/iterminallist/workspace or /workspace Root directory exposed in the file browser
TMUX_SOCKET_NAME iterminallist-app Dedicated tmux -L socket namespace
TMUX_HISTORY_LIMIT 100000 tmux scrollback/history limit
LOG_LEVEL INFO Python logging level
RELOAD false for production Uvicorn reload flag
TRUST_PROXY_HEADERS 0 Trust X-Forwarded-* headers only when behind a trusted reverse proxy
CF_ACCESS_TEAM_DOMAIN (empty) Cloudflare Access team host, e.g. example.cloudflareaccess.com; set together with CF_ACCESS_AUD
CF_ACCESS_AUD (empty) Access application's audience tag; enables externally verified authentication with the team host
CF_ACCESS_ALLOWED_EMAILS (empty) Optional comma-separated signed email allowlist
ENABLE_CSP 1 Send the default Content-Security-Policy header

Security keys:

  • Do not put JWT signing keys in .env.
  • JWT signing key is generated and stored at data/.jwt-secret by default, or JWT_SECRET_PATH if set.
  • Vault master key is stored at VAULT_KEY_PATH if set; otherwise the app default is data/.vault-key under the project root. It must be backed up with the DB.
  • JWT rotation command is available for host-native installs:
.venv/bin/python backend/rotate_jwt.py --confirm
sudo systemctl restart iterminallist.service

First login and 2FA

  1. Open http://localhost:38822 or your configured domain.
  2. The initial setup screen appears when no admin exists.
  3. Create the admin account:
    • username: at least 3 characters
    • password: at least 8 characters; 12+ recommended
  4. Log in.
  5. Optional but recommended: enable TOTP 2FA in Settings β†’ 2-step authentication.

2FA flow:

  1. Click Enable 2FA.
  2. Scan the QR code with Google Authenticator, Microsoft Authenticator, 1Password, Bitwarden, or any RFC 6238-compatible app.
  3. Enter the 6-digit code.
  4. Store the 10 one-time backup codes safely. They are not shown again.

Using the app

Terminal

  • Open a terminal from the Home dashboard ("This machine") or from any registered SSH host.
  • Reconnect after browser refresh; the backend reattaches to persistent tmux sessions.
  • Rename a tab from its β‹― menu; close a tab to end the sessions inside it.
  • Use the mobile toolbar keys for Esc, Tab, Ctrl+C, arrows, and paste on touch devices.
  • Right-click opens this app's menu (copy, paste, send file). Shift+right-click goes to the program inside the pane instead, so mouse-aware TUIs such as herdr show their own menu. Inside tmux it is forwarded only when that program has mouse reporting on. On touch devices a long press opens this app's menu. Firefox always shows its own menu on Shift+right-click, and a page cannot block it.
  • Reload terminal (pane … menu) remounts the view and re-attaches to the same shell β€” its PATH, shell hash, and running processes are untouched.
  • Restart session (pane … menu) kills the tmux session and opens a fresh shell at the same directory. Use it when a just-installed binary isn't on PATH yet. Everything running inside dies, so it asks for confirmation first.

Splits and Broadcast

  • Split a pane right (Ctrl+\) or down (Ctrl+Shift+\), or pick a 2Γ—2 grid from the tab menu.
  • Drag the divider to resize. Equalize panes (grid icon in the tab bar) restores equal area to every pane β€” including nested splits, where a naive "half each" would leave inner panes at half size.
  • Broadcast (antenna icon) mirrors your typing to every pane in the tab. Broadcasting panes get an amber border and a badge; press the badge's βœ• to exclude one pane, + to bring it back.
  • An excluded pane neither receives broadcast input nor sends its own, so a stray keystroke there cannot leak into the others.
  • Turning Broadcast off clears the exclusions, so it always starts with everyone included.

Quick Input, voice, and targeting

  • Open Quick Input from the tab bar (keyboard icon), the mobile toolbar, or Ctrl+Shift+Enter.
  • Compose longer commands and send them once. iPhone/iPad also supports direct Hangul input in the terminal (screen-reader mode keeps xterm's native input handling).
  • Type directly or tap the mic to dictate via the Web Speech API.
  • Press the crosshair button to choose which terminals receive the command. Panes from every open tab are listed, grouped by tab β€” tap a tab heading to select all of its panes. With nothing selected, the command goes to the focused pane.
  • The Command History panel (eye icon) shows per-terminal history with infinite scroll. Click an entry to insert it at the cursor.

File browser

  • Browse under WORKSPACE_ROOT only.
  • Open and edit files in the built-in Monaco editor; search file contents with ripgrep.
  • Create, move, rename, and delete workspace entries.
  • Upload lands in the folder you have selected. With nothing selected it falls back to the folder you have navigated into, then to the folder of the file open in the editor.
  • Open a terminal in a selected folder.

Passkey / WebAuthn

  • In Settings β†’ Security, register a passkey (Face ID, Touch ID, hardware key).
  • On subsequent logins, use the passkey instead of a password.
  • TOTP 2FA and password login remain available as fallbacks.

Settings

  • Theme selection: 59 themes (Catppuccin, Tokyo Night, Dracula, Gruvbox, Nord, RosΓ© Pine, Solarized, GitHub, …), overridable per pane.
  • Text contrast: brighten low-contrast palettes for legibility, or show the theme colors as-is.
  • Language: Korean / English.
  • Font size and family, separately for desktop and mobile.
  • Terminal auto-scroll behavior, smooth scroll, scroll sensitivity.
  • General β†’ Scroll β†’ Show terminal scrollbar: an optional feature that is off by default. Enable it to drag through earlier output on the right and return to the bottom for live output. Supports local and remote tmux history.
  • General β†’ Scroll β†’ Show input while scrolling: directly below the scrollbar option, off by default. Pins the question belonging to the answer at the viewport top; hidden at the bottom. Finds recognized prompt markers (β€Ί, ❯) in terminal history without depending on a specific agent product or scrollbar visibility. Click the question card to jump to its original position. The expand/collapse button works independently. Retained tmux history works after page reload; sections without a recognized or retained question have no preview. Without tmux, matching Recent commands entries supply the original input text. The preview never records raw terminal keystrokes; only commands explicitly sent through the app can enter Recent commands. Command timestamps never substitute for missing answer positions. The Recent commands button remains available for reinserting earlier input.
  • Predictive echo (mosh-style local echo), auto-disabled in editors and password prompts.
  • TOTP 2FA, backup-code management, and passkey registration.

Keyboard shortcuts

Shortcut Action
Ctrl+Shift+Enter Quick Input
Ctrl+Shift+P Command palette
Ctrl+Shift+S Snippet palette
Ctrl+P Quick open files
Ctrl+T New tab
Ctrl+W Close tab (passed to the shell while the terminal is focused)
Ctrl+1 … Ctrl+9 Switch to tab N
Ctrl+\ Split right
Ctrl+Shift+\ Split down
Ctrl+, Settings
Ctrl+Shift+F Find in terminal

On macOS, use Cmd in place of Ctrl.


Operations

Service commands

sudo systemctl restart iterminallist.service
sudo systemctl stop iterminallist.service
sudo systemctl start iterminallist.service
journalctl -u iterminallist.service -f

Mobile view mode

Mobile terminals start in View mode: tapping the screen does not open the keyboard. Explicitly opening Quick Input or pressing a quick bar key returns from history before enabling input. Tap links to open them; hold and drag (or drag horizontally) to select text. The long-press menu places Copy selection directly below Copy all. Paste sends clipboard text to the terminal; Paste into Quick Input appends it to the draft without sending. Scroll to Bottom and View as text are also in this menu.

Mobile quick bar sets and key combinations

Tap the icon immediately left of Quick Input to open the set picker. It defaults to a keyboard; choose a set's icon in Quick bar settings. The picker button shows only an icon, and the last selection is saved automatically. The downward arrow icon at the end of the basic key set scrolls the terminal to the bottom. Set 1 includes Ctrl, Alt and Shift toggles. Combine toggles, then press an arrow, Tab or another key; the bar sends the combination and clears the toggles. Start with set 1: Basic keys and set 2: Claude Β· Codex. Set 2 includes Shift+Left/Right, Shift+Tab, Ctrl+J, Esc, Ctrl+C/T/O/R/G, and Alt+P/T. Actions depend on the CLI and its keymap: Claude shortcuts, Codex controls, Codex editor shortcut. Navigation/editing, Ctrl, Alt, F1–F12, tmux, common commands, and special key sets can be added from presets when needed. Your existing custom bar becomes set 1. Choose Quick bar settings at the bottom of the set picker to open the mobile editor, where you can add/delete sets and edit names, button text, icons, and key order.

On mobile, Quick Input leaves the bar outside the modal at the bottom of the visible screen, above the keyboard. Use the arrow immediately left of Close to toggle recent commands. The button remains available in both text and key combination modes; an open list stays above the input area after picking an entry or switching modes. Switch between text and key combination input using the compact header buttons. Choose Ctrl/Alt/Shift, then tap a letter, number or arrow on the screen keyboard. The preview shows familiar labels such as Shift + ←. Selection never sends; use the paper-plane Send button in the footer. Choose navigation and F1–F12 keys under Special keys, or open Type a key when you need direct input. Direct input accepts a whole combination such as Ctrl+C or Ctrl+Shift+←, or records the actual shortcut you press. Open Register key combination from quick bar settings for a separate modal. Select common special keys, navigation keys or F1–F12, or type a character, then add it to the current set. Hold and drag quick bar keys to reorder them. Dropping saves the order in the current set. To keep a key in view, set its Position to Pin left or Pin right in quick bar settings. Pinned keys stay at that end of the bar while the rest scroll. Quick Input is always pinned first on the left. Context-menu Paste pastes directly into the terminal; Paste into Quick Input fills the draft without sending it. No escape codes need to be entered manually.

Resetting the administrator password

If you forget the administrator password, reset it from an interactive server terminal. The old password is not required. Enter a new password of at least 8 characters twice; both entries are hidden. Registered passkeys and TOTP 2FA remain enabled.

Docker / GHCR

docker compose exec app python /app/backend/reset_admin_password.py --confirm
docker compose restart app

Host-native systemd (from the repository root)

.venv/bin/python backend/reset_admin_password.py --confirm
sudo systemctl restart iterminallist.service

Existing web login sessions are revoked. Restart the backend to close existing authenticated connections, then sign in with the new password or a registered passkey. Run without --confirm to preview the target account without changing it. Use --database /path/to/app.db to select a different database. See the operations guide for host maintenance details.

Updating

Docker / GHCR

docker compose pull
docker compose up -d

Host-native systemd

There is no update script in this repository. Run the three steps in this order:

git pull

# 1. Frontend β€” only when frontend/ changed
cd frontend && npm ci && npm run build && cd ..

# 2. Python dependencies β€” only when backend/requirements.txt changed
.venv/bin/pip install -r backend/requirements.txt

# 3. Restart β€” only when backend/ or the unit file changed
sudo systemctl restart iterminallist.service

Order matters: build the frontend before restarting. The backend serves backend/static as-is, so restarting first just reloads the old bundle.

Your tmux sessions survive the restart (KillMode=process in the unit file). Open browser tabs reconnect on their own; they may show "reconnecting" for a few seconds.

⚠️ A frontend rebuild deletes the previous hash-named chunks (emptyOutDir: true). A browser tab that was already open is running the old bundle and will reload itself when it needs a chunk that no longer exists. If people are actively using the app, batch your updates instead of deploying repeatedly.

Docker commands

docker compose ps
docker compose logs -f backend
docker compose restart backend
docker compose pull
docker compose up -d

Backup

Host-native example:

DEST=/backup/iterminallist-$(date +%Y%m%d-%H%M)
mkdir -p "$DEST"

sqlite3 /var/lib/iterminallist/iterminallist.db ".backup $DEST/iterminallist.db" 2>/dev/null \
  || cp /var/lib/iterminallist/iterminallist.db "$DEST/iterminallist.db"

cp /var/lib/iterminallist/.vault-key "$DEST/.vault-key"
chmod 600 "$DEST/.vault-key"

Docker example:

DEST=./backup/iterminallist-$(date +%Y%m%d-%H%M)
mkdir -p "$DEST"

sqlite3 ./data/iterminallist.db ".backup $DEST/iterminallist.db" 2>/dev/null \
  || cp ./data/iterminallist.db "$DEST/iterminallist.db"

cp ./data/.vault-key "$DEST/.vault-key"
chmod 600 "$DEST/.vault-key"

Restore

Host-native:

sudo systemctl stop iterminallist.service
cp /backup/iterminallist-YYYYMMDD-HHMM/iterminallist.db /var/lib/iterminallist/iterminallist.db
cp /backup/iterminallist-YYYYMMDD-HHMM/.vault-key /var/lib/iterminallist/.vault-key
chmod 600 /var/lib/iterminallist/.vault-key
sudo systemctl start iterminallist.service

Docker:

docker compose down
cp ./backup/iterminallist-YYYYMMDD-HHMM/iterminallist.db ./data/iterminallist.db
cp ./backup/iterminallist-YYYYMMDD-HHMM/.vault-key ./data/.vault-key
chmod 600 ./data/.vault-key
docker compose up -d

Security model

Control Behavior
Admin auth Single-admin setup flow, password hashing with bcrypt/passlib
Session auth JWT access token in an HttpOnly cookie; signing key generated at data/.jwt-secret
2FA TOTP with one-time backup codes
Secret storage Fernet-encrypted vault values using data/.vault-key
File access Server validates paths and confines file operations to WORKSPACE_ROOT
API access Auth-protected API endpoints

Recommendations:

  1. Enable TOTP 2FA.
  2. Put the app behind HTTPS for anything beyond local-only use.
  3. Keep APP_PORT firewalled if using a reverse proxy.
  4. Back up DB and .vault-key together.
  5. Do not commit .env, data/, DB files, or .vault-key.

Reverse proxy / HTTPS

Example Nginx configuration:

server {
    listen 80;
    server_name terminal.example.com;

    location / {
        proxy_pass http://127.0.0.1:38822;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /ws/ {
        proxy_pass http://127.0.0.1:38822;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "Upgrade";
        proxy_set_header Host $host;
        proxy_read_timeout 3600s;
        proxy_send_timeout 3600s;
    }
}

Enable HTTPS with Certbot:

sudo apt-get install -y certbot python3-certbot-nginx
sudo certbot --nginx -d terminal.example.com
sudo certbot renew --dry-run

Developer setup

Run both backend and frontend

python run.py

Options:

python run.py --backend
python run.py --frontend
python run.py --no-restart

Manual backend

cd backend
pip install -r requirements.txt
DB_PATH=../data/iterminallist.db APP_PORT=8000 python3 main.py

Manual frontend

cd frontend
npm install
npm run dev

Vite dev server defaults to 5173 and proxies /api and /ws to localhost:8000 unless VITE_BACKEND_HOST / VITE_BACKEND_PORT are set.

Tests and build

# Frontend tests
cd frontend
npx vitest run

# Frontend production build -> backend/static
npm run build

# Backend tests
cd ../backend
pytest

Docker image build

docker build -t ghcr.io/jshsakura/oc-terminal-list:latest .
docker compose config --quiet
docker compose up -d

GHCR publishing

The workflow at .github/workflows/ghcr-publish.yml publishes to:

ghcr.io/jshsakura/oc-terminal-list

Triggers:

  • push to main or master
  • tags matching v*.*.*
  • manual workflow_dispatch

Generated tags include latest for the default branch, semantic version tags for releases, and sha-* tags.


Project structure

oc-terminal-list/
β”œβ”€β”€ backend/                    # FastAPI backend
β”‚   β”œβ”€β”€ main.py                 # API, WebSocket bridge, static serving
β”‚   β”œβ”€β”€ auth_manager.py         # Admin auth, JWT, 2FA flow
β”‚   β”œβ”€β”€ sqlite_storage.py       # SQLite persistence
β”‚   β”œβ”€β”€ tmux_manager.py         # tmux session management
β”‚   β”œβ”€β”€ vault.py                # encrypted secret storage
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── tests/
β”œβ”€β”€ frontend/                   # React + Vite frontend
β”‚   β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js          # builds into backend/static
β”œβ”€β”€ deploy/
β”‚   β”œβ”€β”€ README.md               # host-native operations guide
β”‚   └── iterminallist.service   # systemd unit template/example
β”œβ”€β”€ compose.yml                 # GHCR Compose example
β”œβ”€β”€ Dockerfile                  # multi-stage frontend + backend image
β”œβ”€β”€ .dockerignore
β”œβ”€β”€ .env.example
β”œβ”€β”€ run.py                      # development supervisor
└── README.md

Troubleshooting

Port already in use

Docker:

APP_PORT=9000 docker compose up -d

Persist it:

echo "APP_PORT=9000" >> .env
docker compose up -d

Host-native:

# edit .env
APP_PORT=9000

sudo systemctl restart iterminallist.service

Docker container does not start

docker compose ps
docker compose logs backend
docker compose config

systemd service fails

journalctl -u iterminallist.service -n 100 --no-pager
systemctl status iterminallist.service

Common causes:

  • deploy/iterminallist.service still contains the wrong User, Group, or path.
  • .env points DB_PATH or WORKSPACE_ROOT to a directory the service user cannot write.
  • tmux is missing.
  • frontend was not built into backend/static.

Login succeeds but immediately logs out

JWT signing key may have rotated. Sign in again; the server will clear/reissue the session cookie.

Vault decrypt errors

The DB and .vault-key do not match. Restore both from the same backup set, or re-register affected SSH/host secrets.

Reset Docker data

docker compose down
rm -rf ./data ./workspace
mkdir -p ./data ./workspace
docker compose up -d

Roadmap

  • install.sh guided host-native installer
  • PyPI / pipx packaging after CLI and static asset layout are cleaned up
  • multi-user support
  • session sharing
  • terminal recording/replay
  • plugin system
  • native mobile companion apps

Related docs

  • deploy/README.md β€” systemd operations, JWT rotation, vault key handling, backup/restore
  • GHCR package
  • GitHub Issues

License

MIT License.


Cloudflare Access authentication (optional)

Set CF_ACCESS_TEAM_DOMAIN and CF_ACCESS_AUD to use Access as the only login layer. Every HTTP request (including static assets and /api/health) and WebSocket handshake requires a valid Access JWT. The app verifies RS256 signatures against the configured team's /cdn-cgi/access/certs, exact issuer/audience and expiry. Signing keys are cached for five minutes; an unknown key ID triggers a refresh, with a short cooldown against repeated unknown-key traffic. A present invalid assertion header never falls back to a cookie or local app token. CF_ACCESS_ALLOWED_EMAILS restricts verified email claims when set.

All allowed identities act as this instance's existing administrator. A fresh data volume uses the logical owner admin without creating a local password account. Local setup, password, OTP and passkey authentication/management endpoints are disabled; logout goes through /cdn-cgi/access/logout. Existing local authentication is unchanged when both settings are empty. Partial configuration fails closed. This mode does not provide multi-user isolation.

The shipped container healthcheck uses a local TCP liveness probe in Access mode so no unauthenticated HTTP exception is needed. Without Access it checks /api/health as before. Do not expose the container's port beyond the intended ingress. Existing TRUST_PROXY_HEADERS and origin restrictions still apply independently.

About

Self-hosted web terminal β€” persistent tmux sessions, Monaco editor, SSH management, voice input, Passkey/WebAuthn. Docker or systemd. MIT License.

jshsakura.github.io/oc-terminal-list/

Topics

dockerfastapireactself-hostedsshterminaltmuxwebauthnxterm

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.