Commit graph

56 commits

Author SHA1 Message Date
d7531f9305 Show unread count in private inbox 2026-05-29 18:06:45 +08:00
845657e3c2 Allow clearing private message inbox 2026-05-29 18:04:34 +08:00
2fca031362 Mark unread private messages in inbox 2026-05-29 18:01:05 +08:00
1f8fb7acf4 Add private message reply command 2026-05-29 17:40:09 +08:00
5ae02054ee Improve terminal UX and private message flow 2026-05-29 17:05:22 +08:00
b6f92968d0 Add multiplatform CI governance gates 2026-05-28 14:48:36 +08:00
0da5f51e2e Split release and package publish gates 2026-05-28 11:29:25 +08:00
fe7419709e Polish interactive help lifecycle 2026-05-28 11:19:25 +08:00
fab8b315a5 Split tntctl local text catalog 2026-05-28 09:40:55 +08:00
f0499c32f6 Tighten CLI option diagnostics 2026-05-28 08:59:54 +08:00
1c451b7722 Add offline message log recovery modes 2026-05-27 10:26:50 +08:00
5240756f96 Harden message log maintenance tooling 2026-05-27 09:58:56 +08:00
8b55a3d9ab Add persisted message dump command 2026-05-27 09:37:51 +08:00
7b5a683557 Document message log v1 contract 2026-05-27 09:21:59 +08:00
13b671cc9f Add slow-client backpressure regression 2026-05-26 14:20:07 +08:00
e603a55cb3 Polish live inbox command output 2026-05-26 12:22:33 +08:00
d3002dbfde Deepen TUI lifecycle and runtime readiness 2026-05-26 11:15:55 +08:00
33e2dc4f13 Build public release readiness foundation 2026-05-26 09:42:14 +08:00
f2942e9c9e commands: centralize usage validation in catalog 2026-05-24 15:00:41 +08:00
1391ddca07 docs: use neutral host examples 2026-05-24 13:15:10 +08:00
bfaafb4b35 exec: centralize command matching in catalog 2026-05-24 13:12:47 +08:00
e911a2d469 exec: extract help text into catalog 2026-05-24 12:41:05 +08:00
00fc944da8 ux: standardize private message terminology 2026-05-24 12:30:08 +08:00
8fbd789dfb i18n: split text catalog from language parsing 2026-05-24 12:18:21 +08:00
57bf3cfc67 commands: centralize interactive command catalog 2026-05-24 11:25:46 +08:00
a693d281f8 ux: collapse help surface around manual 2026-05-24 10:17:25 +08:00
998da4288f test: stabilize stress test runner 2026-05-24 08:42:39 +08:00
fa16beb7a6 test: stabilize anonymous access checks 2026-05-23 23:30:43 +08:00
cd170d3245 docs: refresh module quick reference 2026-05-23 22:12:22 +08:00
f39f07b205 ci: add local ci-test target 2026-05-23 22:10:28 +08:00
095491927a test: cover connection limit regressions 2026-05-23 21:38:27 +08:00
6d5c77b850 ci: make integration tests strict 2026-05-23 21:26:19 +08:00
2e69283e5c i18n: add session language command 2026-05-23 18:10:54 +08:00
0c27976763 i18n: select interactive language from locale 2026-05-23 18:06:39 +08:00
2490262332 install: verify release binary checksums 2026-05-21 12:58:24 +08:00
a4748cd902 release: add local preflight checks 2026-05-21 12:51:10 +08:00
67d21ad0e9 tui: improve history browsing and support guide 2026-05-21 11:57:59 +08:00
70718482f3 docs: troubleshooting section for "Connection closed by remote host" (UX-10)
The original UX-10 was "give the client a readable reason on
disconnect" — turns out the libssh server API doesn't let us send
SSH_MSG_USERAUTH_BANNER, ssh_set_banner is GET-only on the linked
versions (0.9.6 on oss, 0.10.6 on ali), and pre-auth rejections
(max_connections / ratelimit / firewall) happen before any SSH
exchange the client could parse.

The realistic improvement is documentation: README now has a
troubleshooting table mapping the generic close to the actual cause
and how to verify (journalctl) + fix.  Also documents the idle
timeout disconnect for completeness.

Server-side stderr already prints rejection reason with the
offending IP, so journalctl gives the admin enough to debug.
2026-05-17 14:24:35 +08:00
d9382882d1 chore: bug fixes and code cleanup
Fixes:
- message_load() now holds g_message_file_lock for the read, so :last [N]
  can no longer observe a half-written line while message_save() is
  flushing.
- constant_time_strcmp() accumulates the length difference in size_t.
  The old code truncated to unsigned char, which collapsed pairs whose
  lengths differed by a multiple of 256 down to 0 and lost the signal.

Refactor:
- buffer_appendf() / buffer_append_bytes() moved to common.c; the two
  identical copies in ssh_server.c and tui.c have been removed.

Docs / cleanup:
- README clarifies that exec 'post' uses the SSH login name as the
  author and that anonymous mode performs no identity check.
- Removed TODO.md (both items completed) and docs/README.old.
- Trimmed the auto-generated 2025 entry block from docs/CHANGELOG.md
  and added a 2026-05-16 entry summarising this change.
2026-05-16 22:44:41 +08:00
eead27544c docs: update all docs for :last, :search, :mute-joins and MOTD
Some checks failed
CI / build-and-test (macos-latest) (push) Has been cancelled
CI / build-and-test (ubuntu-latest) (push) Has been cancelled
Deploy / test (push) Has been cancelled
Deploy / deploy (push) Has been cancelled
- README: add new commands to COMMAND mode table, MOTD section,
  update Known Limitations (100-msg limit now softened by :last/:search)
- tnt.1: add :last/:search/:mute-joins to man page command table,
  add motd.txt to FILES section
- CHANGELOG: add 2026-04-23 entry
- QUICKREF: rewrite command section, add new commands, add motd.txt to files
- ROADMAP: mark Stage 4 :last/:search/:mute-joins items as completed
- DEPLOYMENT: add MOTD setup section
2026-04-23 12:38:04 +08:00
bb77c77b8f feat: add @mention notifications, idle timeout, and online duration
- @mention: typing @username in a message sends bell char to that user
  and highlights the message content in bold yellow for them
- Idle timeout: disconnect inactive clients after TNT_IDLE_TIMEOUT
  seconds (default 1800 = 30min, 0 to disable)
- :list now shows connection duration per user (e.g. "alice (12m)")
- Document all three features in help text, manpage, and README

Closes #46
2026-04-19 23:12:45 +08:00
b07348c6e1 docs: update all user-facing help text and documentation
- Add /me action command to all help surfaces (EN/ZH help screen,
  :help output, exec help, manpage, README)
- Add Ctrl+D/U/F/B page scrolling keys to help text (were only in manpage)
- Add :q/:quit/:exit disconnect command to help text
- Update README COMMAND mode section with all current commands
  (:nick, :msg, :w were missing)
- Remove redundant COMMAND MODE KEYS section from help text
  (merged into AVAILABLE COMMANDS for clarity)
- Compact help screen layout (j/k on one line, g/G on one line)
2026-04-19 22:08:59 +08:00
49674b75e8 docs: add project roadmap
Some checks failed
CI / build-and-test (macos-latest) (push) Has been cancelled
CI / build-and-test (ubuntu-latest) (push) Has been cancelled
Deploy / test (push) Has been cancelled
Deploy / deploy (push) Has been cancelled
2026-03-10 19:45:51 +08:00
cb106de31b fix: separate per-ip concurrency from connection rate 2026-03-10 19:08:28 +08:00
e473b26e0d refactor: stabilize SSH runtime and add exec interface 2026-03-10 18:52:20 +08:00
da8b77d625 docs: reorganize documentation structure
- Move all documentation to docs/ directory for better organization
- Rewrite README.md following Linux kernel style (English only)
- Rename HACKING -> CONTRIBUTING.md
- Rename QUICKREF -> QUICKREF.md
- Rename README -> README.old
- Add comprehensive Development-Guide.md for contributors

Documentation structure:
- README.md: Project overview and quick start
- docs/Development-Guide.md: Complete developer manual
- docs/CONTRIBUTING.md: Contribution guidelines
- docs/DEPLOYMENT.md: Production deployment guide
- docs/SECURITY_QUICKREF.md: Security config reference
- docs/QUICKREF.md: Command cheat sheet

This aligns with Linux kernel documentation practices:
simple, organized, and accessible.
2026-02-07 23:31:53 +08:00
07fd7b1513
refactor: optimize rendering, log loading, and migrate to libssh callback API (#9)
This PR addresses critical performance bottlenecks, improves UX, and eliminates technical debt.

### Key Changes

**1. Performance Optimization:**
- **Startup**: Rewrote `message_load` to scan `messages.log` backwards from the end
  - Complexity reduced from O(FileSize) to O(MaxMessages)
  - Large log file startup: seconds → milliseconds
- **Rendering**: Optimized TUI rendering to use line clearing (`\033[K`) instead of full-screen clearing (`\033[2J`)
  - Eliminated visual flicker

**2. libssh API Migration:**
- Replaced deprecated message-based API with callback-based server implementation
- Removed `#pragma GCC diagnostic ignored "-Wdeprecated-declarations"`
- Ensures future libssh compatibility

**3. User Experience (Vim Mode):**
- Added `Ctrl+W` (Delete Word) and `Ctrl+U` (Delete Line) in Insert/Command modes
- Modified `Ctrl+C` behavior to safely switch modes instead of terminating connection
- Added support for `\n` as Enter key (fixing piped input issues)

**4. Project Structure:**
- Moved all test scripts to `tests/` directory
- Added `make test` target
- Updated CI/CD to run comprehensive test suite

### Verification
-  All tests passing (17/17)
-  CI passing on Ubuntu and macOS
-  AddressSanitizer clean
-  Valgrind clean (no memory leaks)
-  Zero compilation warnings

### Code Quality
**Rating:** 🟢 Good Taste
- Algorithm-driven optimization (not hacks)
- Simplified architecture (callback-based API)
- Zero breaking changes (all tests pass)
2026-02-07 23:17:55 +08:00
5f8b8fd843 feat: enhance anonymous access and long-term stability
Improvements for low-barrier anonymous access:
- Enhanced welcome message to clarify anonymous access
- Added EASY_SETUP.md guide in Chinese and English
- Updated README with anonymous access notes

Long-term stability enhancements:
- Improved systemd service with auto-restart and resource limits
- Added log rotation script (scripts/logrotate.sh)
- Added health check script (scripts/healthcheck.sh)
- Added cron setup script for automated maintenance
- Added anonymous access test suite

Testing:
- All security features verified (10/10 passed)
- Anonymous access tests passed (2/2)
- Health check verified

This ensures:
- Zero-barrier SSH access (any username, any password)
- Stable long-term operation with auto-restart
- Automated log management
- Continuous health monitoring
2026-01-22 15:06:54 +08:00
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
abe477f713 Rewrite README in classic Unix style
- README: BSD man page format (NAME/SYNOPSIS/OPTIONS/etc)
- README.md: Minimal markdown (82 lines vs 200+)

Philosophy: Dense information, no fluff, reference style.
Inspired by original Unix manuals and BSD docs.

Changes:
- Removed emojis and badges
- Condensed verbose sections
- Clear command examples
- Direct references to detailed docs
2025-12-02 12:57:18 +08:00