Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ body:
attributes:
label: Version
description: Run `tnt --version`, or provide the commit hash.
placeholder: "tnt 1.0.1"
placeholder: "tnt 1.1.0"
validations:
required: true
- type: dropdown
Expand Down
93 changes: 93 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
PROJECT METADATA
S: Maintained
F: .github/**
F: .gitignore
F: LICENSE
F: MAINTAINERS
F: demos/**
F: include/.gitkeep
F: scripts/check_maintainers.sh
F: scripts/get_maintainer.sh
F: src/.gitkeep

TNT CORE
S: Maintained
F: Makefile
F: install.sh
F: tnt.service
F: include/*.h
F: src/*.c
F: include/common.h
F: include/config_defaults.h
F: src/main.c
F: src/common.c
F: src/config_defaults.c

SSH SERVER AND EXEC INTERFACE
S: Maintained
F: include/bootstrap.h
F: include/ssh_server.h
F: include/exec*.h
F: include/tntctl_text.h
F: src/bootstrap.c
F: src/ssh_server.c
F: src/exec*.c
F: src/tntctl*.c
F: tests/test_exec_mode.sh
F: tests/test_tntctl_cli.sh

INTERACTIVE TUI
S: Maintained
F: include/input*.h
F: include/tui*.h
F: include/history_view.h
F: src/input*.c
F: src/tui*.c
F: src/history_view.c
F: tests/test_interactive_input.sh
F: tests/test_user_lifecycle.sh

MESSAGE STORAGE
S: Maintained
F: include/message*.h
F: src/message*.c
F: scripts/logrotate.sh
F: tests/test_message_log_tool.sh
F: tests/test_logrotate.sh
F: docs/MESSAGE_LOG.md

MODULE CORE INTERFACE
S: Maintained
F: include/module_*.h
F: src/module_*.c
F: scripts/module_check.sh
F: scripts/install_wizard.sh
F: tests/test_module_*.sh
F: tests/test_install_wizard.sh
F: docs/MODULE_PROTOCOL.md
F: docs/INSTALL_LIFECYCLE.md

PACKAGING AND RELEASE
S: Maintained
F: packaging/**
F: scripts/healthcheck.sh
F: scripts/package_*.sh
F: scripts/check_release_ref.sh
F: scripts/release_check.sh
F: scripts/setup_cron.sh
F: tests/test_release_artifact_gate.sh
F: tests/test_source_archive.sh
F: docs/DEPLOYMENT.md
F: docs/CICD.md

TESTING
S: Maintained
F: tests/**

DOCUMENTATION
S: Maintained
F: README.md
F: SECURITY.md
F: docs/**
F: tnt.1
F: tntctl.1
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ script-test: all
@echo "Running script tests..."
@cd tests && ./test_cli_options.sh
@cd tests && ./test_docs_help_surface.sh
@cd tests && ./test_get_maintainer.sh
@cd tests && ./test_check_maintainers.sh
@cd tests && ./test_module_check.sh
@cd tests && ./test_install_wizard.sh
@cd tests && ./test_logrotate.sh
@cd tests && ./test_message_log_tool.sh
@cd tests && ./test_source_archive.sh
Expand Down
60 changes: 53 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,20 @@ A minimalist terminal chat server with Vim-style interface over SSH.

### Installation

**One-liner:**
**Pinned release installer:**
```sh
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/v1.1.0/install.sh | VERSION=v1.1.0 sh
```
The installer verifies downloaded release binaries against `checksums.txt`
before installing them. Older releases may provide only `tnt`; newer releases
also install `tntctl`.

For convenience during testing, the moving `main` installer is also available:

```sh
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
```

**From source:**
```sh
git clone https://github.com/m1ngsama/TNT.git
Expand All @@ -36,6 +42,18 @@ sudo make install
**Binary releases:**
https://github.com/m1ngsama/TNT/releases

**Interactive setup guide:**

After installing the binary, operators can generate a reviewable environment
file and choose a module profile with the terminal setup wizard:

```sh
scripts/install_wizard.sh --output tnt.env
```

The wizard does not restart services or install modules. Review the generated
file, then install it manually as your systemd environment file.

### Running

```sh
Expand Down Expand Up @@ -422,6 +440,33 @@ replace placeholder checksums, and run:
SOURCE_TARBALL=dist/tnt-chat-vX.Y.Z-source.tar.gz make package-publish-check
```

## Module Development

TNT modules are external processes that speak the `tnt.module.v1` JSON Lines
protocol over stdin/stdout. TNT core stays minimal, Unix-like, text-first, and
reliable; modules are the optional layer for richer modern-terminal interaction,
visual presentation, workflow automation, and future community features.

The core server owns the protocol contract and the runtime supervisor;
community module examples and module packages live in the public companion
repository:

https://github.com/m1ngsama/tnt-modules

Before enabling a third-party module, check its manifest and handshake:

```sh
scripts/module_check.sh /path/to/module
```

Enable reviewed modules explicitly:

```sh
TNT_MODULE_PATHS=/opt/tnt-modules/echo-module:/opt/tnt-modules/other-module tnt
```

Unset `TNT_MODULE_PATHS` and restart TNT to return to the plain core server.

## Files

```
Expand All @@ -432,11 +477,11 @@ tnt.service - systemd service unit
```

The persisted chat-history format is documented in
[docs/MESSAGE_LOG.md](docs/MESSAGE_LOG.md). Experimental community modules
should follow the external-process protocol in
[docs/MODULE_PROTOCOL.md](docs/MODULE_PROTOCOL.md). Module-generated content
must always include a plain-text fallback so TNT can keep working on basic
terminal clients and preserve the stable `messages.log` v1 history contract.
[docs/MESSAGE_LOG.md](docs/MESSAGE_LOG.md). The core module protocol is
documented in [docs/MODULE_PROTOCOL.md](docs/MODULE_PROTOCOL.md).
Module-generated content must always include a plain-text fallback so TNT can
keep working on basic terminal clients and preserve the stable `messages.log`
v1 history contract.

### MOTD (Message of the Day)

Expand All @@ -457,6 +502,7 @@ Delete `motd.txt` to disable the MOTD.
- [Development Guide](https://github.com/m1ngsama/TNT/wiki/Development-Guide) - Complete development manual
- [Quick Setup](docs/EASY_SETUP.md) - 5-minute deployment guide
- [Roadmap](docs/ROADMAP.md) - Long-term Unix/GNU direction and next stages
- [Installation Lifecycle](docs/INSTALL_LIFECYCLE.md) - Setup wizard, module selection, and rollback model
- [Interface Contract](docs/INTERFACE.md) - Scriptable commands, exit statuses, and JSON fields
- [Module Protocol](docs/MODULE_PROTOCOL.md) - External-process module contract
- [Security Reference](docs/SECURITY_QUICKREF.md) - Security config quick reference
Expand Down
22 changes: 22 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@

## Unreleased

## 1.1.0 - 2026-06-16

### Added
- Added `scripts/module_check.sh` for validating third-party module manifests,
entrypoints, protocol handshakes, permissions, events, and TNT minimum
version compatibility before deployment.
- Added `scripts/install_wizard.sh`, a non-mutating installer guide that writes
reviewable environment files for core-only, all-compatible, selected, and
manually supplied module deployments.
- Added `MAINTAINERS` plus maintainer lookup and coverage checks, giving the
core runtime, module interface, packaging, tests, and documentation explicit
ownership patterns.
- Added regression tests for module manifest compatibility, install wizard
selection behavior, maintainer lookup, and maintainer coverage.
- Added a release tag/version guard used by the GitHub release workflow, so a
`vX.Y.Z` tag must match `TNT_VERSION` before release assets are built.
- Added `make package-publish-check` for verifying Arch/Homebrew source
Expand Down Expand Up @@ -51,6 +64,15 @@
and server survival stay responsive.

### Changed
- Module names are now restricted to lowercase ASCII letters, digits, and
hyphens, with a length cap that keeps generated `module:<name>` senders
within the public message username limit.
- The module runtime now disables modules that flood a single event with too
many responses or repeatedly emit invalid response records, keeping bad
downstream modules isolated from the core server.
- Module documentation now treats the public companion module repository as
downstream of the TNT core protocol and keeps TNT's core Unix surface
minimal, text-first, and robust.
- INSERT-mode chrome now only advertises message sending and `Esc` to NORMAL;
`? keys` appears only in NORMAL mode, matching where help keys work.
- Dismissing MOTD now returns first-time users to INSERT mode, and `Ctrl+C`
Expand Down
14 changes: 14 additions & 0 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,20 @@ utf8.c → UTF-8 string handling
4. Put shared localized strings in `src/i18n_text.c`.
5. Add or update the narrowest unit/integration test for the behavior.

## Adding Modules

TNT core owns the module protocol, runtime supervisor, and compatibility tests.
Community modules and module examples live in the companion repository:

```text
https://github.com/m1ngsama/tnt-modules
```

For core protocol or runtime changes, update `docs/MODULE_PROTOCOL.md`, add or
update tests in this repository, and keep `scripts/module_check.sh` aligned with
the manifest and handshake rules. For new module implementations, contribute to
the companion module repository instead of adding them to TNT core.

## Debugging Tips

```sh
Expand Down
30 changes: 23 additions & 7 deletions docs/DEPLOYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

## Quick Install

One-line install (latest release):
Pinned release install:
```bash
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/v1.1.0/install.sh | VERSION=v1.1.0 sh
```

Specific version:
Moving latest-release installer, convenient for test deployments:
```bash
VERSION=vX.Y.Z curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
```

## Manual Install
Expand Down Expand Up @@ -82,6 +82,20 @@ sudo systemctl restart tnt
The service uses `StateDirectory=tnt`, so systemd creates `/var/lib/tnt` automatically.
Use `TNT_STATE_DIR` or `tnt -d DIR` when running outside systemd to avoid depending on the current working directory.

To generate a reviewable environment file with an interactive terminal setup
wizard:

```bash
scripts/install_wizard.sh --output tnt.env
sudo install -m 600 tnt.env /etc/default/tnt
sudo systemctl restart tnt
```

The wizard can choose a core-only deployment, scan a module root, select
individual modules, or validate a manually entered module path list. It never
downloads modules, edits systemd units, or restarts TNT by itself. See
`docs/INSTALL_LIFECYCLE.md` for the full operator lifecycle.

Recommended interpretation:

- `TNT_MAX_CONNECTIONS`: global connection ceiling
Expand Down Expand Up @@ -109,7 +123,9 @@ For that profile:
- Prefer plain-text fallbacks for every module-created message, even when the
module also targets richer terminal renderers.
- Before promoting a module, test its manifest and JSONL handshake against the
protocol in `docs/MODULE_PROTOCOL.md`.
protocol in `docs/MODULE_PROTOCOL.md` with `scripts/module_check.sh`.
- Develop and publish community modules in the public companion repository:
`https://github.com/m1ngsama/tnt-modules`.

Enable modules explicitly with `TNT_MODULE_PATHS`, using a colon-separated
list of module directories:
Expand Down Expand Up @@ -183,8 +199,8 @@ sudo firewall-cmd --reload
# Stop service
sudo systemctl stop tnt

# Re-run install script
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
# Re-run the pinned installer for the version you want
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/v1.1.0/install.sh | VERSION=v1.1.0 sh

# Start service
sudo systemctl start tnt
Expand Down
47 changes: 47 additions & 0 deletions docs/INSTALL_LIFECYCLE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Installation Lifecycle

TNT core is the small Unix tool: text-first, compatible, and reliable. Modules
are downstream enhancements for modern terminal UX, visuals, automation, and
community features. Module failure must not take TNT down.

## Flow

1. Install `tnt` and `tntctl`.
2. Choose a profile: `core`, `select`, `all`, or `manual`.
3. Validate modules with `scripts/module_check.sh`.
4. Generate an env file with `scripts/install_wizard.sh`.
5. Review, install, restart, smoke-test.
6. Roll back by removing `TNT_MODULE_PATHS` and restarting.

## Commands

Generate a reviewable env file:

```sh
scripts/install_wizard.sh --output tnt.env
```

Preview all modules under a root:

```sh
scripts/install_wizard.sh --print-modules --module-root /opt/tnt-modules
```

Generate an all-valid-modules env file:

```sh
TNT_SETUP_PROFILE=all \
TNT_SETUP_MODULE_ROOT=/opt/tnt-modules \
scripts/install_wizard.sh --non-interactive --output tnt.env
```

Activate manually:

```sh
sudo install -m 600 tnt.env /etc/default/tnt
sudo systemctl restart tnt
ssh -p 2222 localhost health
```

The wizard never installs binaries, downloads modules, edits systemd units, or
restarts services. It only makes choices visible and emits config.
Loading
Loading