TNT/README.md
m1ngsama fa348041e5 docs: document comprehensive security fixes
- Add Security section to README.md with configuration examples
- Document all new environment variables (access token, rate limiting, SSH options)
- Add comprehensive CHANGELOG entry for security audit fixes
- Categorize fixes by severity (Critical, High, Medium)
- Include security improvements summary table
- Maintain backward compatibility notes

New environment variables documented:
- TNT_ACCESS_TOKEN: Optional password authentication
- TNT_BIND_ADDR: Configurable bind address
- TNT_SSH_LOG_LEVEL: SSH logging verbosity
- TNT_RATE_LIMIT: Enable/disable rate limiting
- TNT_MAX_CONNECTIONS: Global connection limit
- TNT_MAX_CONN_PER_IP: Per-IP connection limit

Documentation follows Unix-style concise format.
2026-01-22 14:12:55 +08:00

111 lines
1.8 KiB
Markdown

# TNT
Terminal chat server. Vim-style interface. SSH-based.
## Install
```sh
curl -sSL https://raw.githubusercontent.com/m1ngsama/TNT/main/install.sh | sh
```
Or download from [releases](https://github.com/m1ngsama/TNT/releases).
## Run
```sh
tnt # port 2222
tnt -p 3333 # custom port
PORT=3333 tnt # env var
```
Connect: `ssh -p 2222 localhost`
## Security
Configure via environment variables.
### Access Control
```sh
TNT_ACCESS_TOKEN="secret" tnt # require password
TNT_BIND_ADDR=127.0.0.1 tnt # localhost only
```
Without `TNT_ACCESS_TOKEN`, server is open (default).
### Rate Limiting
```sh
TNT_MAX_CONNECTIONS=100 tnt # total limit
TNT_MAX_CONN_PER_IP=10 tnt # per-IP limit
TNT_RATE_LIMIT=0 tnt # disable (testing only)
```
Default: 64 total, 5 per IP, rate limiting enabled.
### SSH Options
```sh
TNT_SSH_LOG_LEVEL=3 tnt # verbose logging (0-4)
```
## Keys
**INSERT** (default)
- `ESC` → NORMAL
- `Enter` → send
- `Backspace` → delete
**NORMAL**
- `i` → INSERT
- `:` → COMMAND
- `j/k` → scroll
- `g/G` → top/bottom
- `?` → help
**COMMAND**
- `:list` → users
- `:help` → commands
- `ESC` → back
## Build
```sh
make # normal
make debug # with symbols
make asan # sanitizer
make check # static analysis
```
Requires: `libssh`
## Deploy
See [DEPLOYMENT.md](DEPLOYMENT.md) for systemd setup.
## Files
```
messages.log chat history
host_key SSH key (auto-gen)
tnt.service systemd unit
```
## Test
```sh
./test_basic.sh # functional
./test_stress.sh 50 # 50 clients
```
## Docs
- `README` - man page style
- `HACKING` - dev guide
- `DEPLOYMENT.md` - production
- `CICD.md` - automation
- `QUICKREF` - cheat sheet
## License
MIT